Portal, Express Beta Version 6.1
Operating systems: i5/OS, Linux,Windows |
You can use the site management extension bean of the Portal Scripting Interface to publish, promote, or demote portal content.
The portal content can consist of content nodes, labels, pages or partial hierarchies, compositions, or links to both internal and external URLs.
Example scenario: A sales company has a test portal and a production portal. The administrator creates a page for a special sale on the test portal. When the approving parties are happy with that page, the administrator publishes the page by moving it from the test or source portal to the production or target portal. By personalization rules, only the administrator can view the page. For the start day of the sale, the administrator promotes the page on the production portal. This makes the page visible to portal users with the appropriate access permissions. When the sale period is over, the administrator demotes the page on the production portal. Users can then no longer view the page.
For more details about site management and publishing portal pages refer to Managing your site. Before using the portal scripting interface to manage your site, review this documentation.
The methods listed in the following are available for site management. You can use them to publish, promote, or demote a page. All commands start with $Publish .Notes:
$Publish publishPage source_server userid password target_server userid password page_uniquename parent_uniquename sibling_uniquename server_uniquename include_children [true|false] stop_on_error [true|false]
$Publish publishPage http://reclab100.rtp.raleigh.ibm.com:10038/wps/mycontenthandler wpsadmin wpsadmin http://reclab101.rtp.raleigh.ibm.com:10038/wps/mycontenthandler wpsadmin wpsadmin testPage ibm.portal.Home null null true trueFor a full code example refer to Example JACL scripts for site management.
Parameter example | Description |
---|---|
http://reclab100.rtp.raleigh.ibm.com:10038/wps/mycontenthandler wpsadmin wpsadmin | Replace this example source server URL, user ID, and password with the appropriate values for your environment. |
http://reclab101.rtp.raleigh.ibm.com:10038/wps/mycontenthandler wpsadmin wpsadmin | Replace this example target server URL, user ID, and password with the appropriate values for your environment. |
testPage | Replace this example page unique name with the object ID of your page. |
ibm.portal.Home | Replace this example parent page unique name with the object ID of the parent page in your portal hierarchy. |
null | Provide the unique name of a sibling page, or specify null. The published page will be inserted before that page in the sequence of sibling pages. If you want your page to be inserted as the last sibling page, specify the string null. |
null | To add the unique name of the target server to the published page metadata, enter the server unique name, or specify null. If a server name is provided, the published page will be updated to include this string in the page metadata. The Resource Manger portlet can use this server identifier to automatically republish the page to the same server on subsequent publish attempts via the portlet. If you do not want the page metadata to be updated, specify the string null as the value. |
true | This parameter determines whether children of the page will be published along with the page. Specify true or false. |
true | This parameter determines whether to stop the publish process on the first error. Specify true or false. |
$Publish promotePage targetserver userid password pageuniquename integer_value include_children [true|false] stop_on_error [true|false]
$Publish promotePage http://reclabl101.rtp.raleigh.ibm.com:10038/wps/mycontenthandler wpsadmin wpsadmin com.ibm.portal.published_testPage 0 true trueFor a full code example refer to Example JACL scripts for site management.
Parameter example | Description |
---|---|
http://reclab101.rtp.raleigh.ibm.com:10038/wps/mycontenthandler wpsadmin wpsadmin | Replace this example target server URL, user ID, and password with the appropriate values for your environment. |
com.ibm.portal.published_testPage | Replace this example page unique name with the object ID of your page. |
0 | Specify an integer value after the page name to determine
how you want the pages and hierarchy to be published. When you run the scripting
command, the process compares the subtree hierarchy of the page that you are
promoting on the source and target portals and then adds, replaces, or deletes
nodes and customized preferences according to the specified integer value
as follows:
|
true | This parameter determines whether children of the page will be published along with the page. Specify true or false. |
true | This parameter determines whether to stop the publish process on the first error. Specify true or false. |
$Publish demotePage targetserver userid password pageuniquename include_children [true|false] stop_on_error [true|false]
$Publish demotePage http://reclab101.rtp.raleigh.ibm.com:10038/wps/mycontenthandler wpsadmin wpsadmin testPage true trueFor a full code example refer to Example JACL scripts for site management.
Parameter example | Description |
---|---|
http://reclab101.rtp.raleigh.ibm.com:10038/wps/mycontenthandler wpsadmin wpsadmin | Replace this example target server URL, user ID, and password with the appropriate values for your environment. |
testPage | Replace this example page unique name with the object ID of your page. |
true | This parameter determines whether children of the page will be published along with the page. Specify true or false. |
true | This parameter determines whether to stop the publish process on the first error. Specify true or false. |
# Scripting bean example: create a simple page (multi-column Layout) # # Procedure: create a multi-column page below the page that is currently # selected, and place the given portlets into the layout. # # parameters: # name The name of the page # portlet_names A list of portlet names. # returns: # oid The id of the page that has been created proc create_multi_col_page { name uniqueName portlet_names } { global Content Layout Portlet set thePage [$Content create page $name html] $Content select $the Page $Content set uniquename $uniqueName set lyt0 [$Layout create container horizontal select] foreach pn $portlet_names { set pid [$Portlet find portlet cn $pn] $Layout create control $pid } return $thePage } # main code starts here # set User ID/ pwd for portal Login command # Hint: User ID and passwords should normally not be placed inside a # configuration script; better use property files or command line arguments set user portaladmin set pwd adminpwd $Portal login $user $pwd # determine and select the parent of the page to be created. # In this example, This is the "Home" label. $Content select [$Content find all uniquename "ibm.portal.Home"] # Invoke the page creation procedure. The label of the page is "My test page", # portlets to be added are the workd clock portlet, and the welcome portlet. set newbie [create_multi_col_page "A Page" "aPage" { "World_Clock" "Welcome_to_WebSphere_Portal" } ] puts "ok, we are done."This example is based on the testme.jacl example for creating a page under Script mode. The additions that are required for later publishing are highlighted. JACL code example for publishing the page:
# Scripting bean example: publish a page with the uniquename of "aPage" # main code starts here # set User ID/ pwd for portal Login command # Hint: User ID and passwords should normally not be placed inside a # configuration script; better use property files or command line arguments set user portaladmin set pwd adminpwd set sourceServer http://sourceServer:sourceport/wps/mycontenthandler set sourceUser sourceUser set sourcePwd sourcePwd set targetServer http://targetServer:sourceport/wps/mycontenthandler set targetUser targetUser set targetPwd targetPwd set uniqueName "aPage" set parentPage parentPage set siblingPage siblingPage set targetServer MyTargetServerUn $Portal login $user $pwd # Publish a page $Publish publishPage $sourceServer $sourceUser $sourcePwd $targetServer $targetUser $targetPwd $uniqueName $parentPage $siblingPage $targetServer true true puts "ok, we are done."JACL code example for promoting the page:
# Scripting bean example: promote a page with the uniquename of # "com.ibm.portal.published_aPage" # main code starts here # set User ID/ pwd for portal Login command # Hint: User ID and passwords should normally not be placed inside a # configuration script; better use property files or command line arguments set user portaladmin set pwd adminpwd set server http://server:port/wps/mycontenthandler set sUser sUser set sPwd sPwd set promoteOption 0 set uniqueName "com.ibm.portal.published_aPage" $Portal login $user $pwd # Promote a page $Publish promotePage $server $sUser $sPwd $uniqueName $promoteOption true true puts "ok, we are done."JACL code example for demoting the page:
# Scripting bean example: demote a page with the uniquename of "aPage" # main code starts here # set User ID/ pwd for portal Login command # Hint: User ID and passwords should normally not be placed inside a # configuration script; better use property files or command line arguments set user portaladmin set pwd adminpwd set server http://server:port/wps/mycontenthandler set sUser sUser set sPwd sPwd set uniqueName "aPage" $Portal login $user $pwd # Demote a page $Publish demotePage $server $sUser $sPwd $uniqueName true true puts "ok, we are done."Parent topic: Managing your site Related tasks