When you use portal scripting interface unlike the XMLAccess tool, WebSphere Portal is accessed with user identity, not as a "super administrator".
You can use the Portal Scripting interface in two different modes
- Interaction mode: Use the interactive mode if you want to interact directly and dynamically with the portal to perform simple administrative tasks that should only be executed once. For example, the administrator wants to modify the permissions of a page for a certain principal, or the administrator wants to add a portlet to a page. Use the interactive mode if you do not intend to repeat the operation. Use these steps to use portal scripting in interactive modes
- Execute wpscript.sh -port port_number -user admin_userid -password admin_password command. This should open a wsadmin command console
- Login into portal using $Portal login wpsadmin wpsadmin command
- Execute whatevery wpsadmin commands you want to execute
- After you have completed all tasks by the portal scripting interface, close and exit the script processor. All changes that you committed are applied to the portal configuration.
- Scripting mode: Use the script mode to apply predefined changes to the configuration of a portal. The wpscript tool executes a JACL script that contains the administrative operations. The scripting client inherits the JACL processor from wsadmin, so an administrator can exploit the JACL scripting language, in order to write re-usable, extendable administration scripts. This mode is typically preferred if reproducible administration tasks are created: For example, the administrator can write a JACL script that produces a complete page subtree, and adds individual page layouts and portlets on each page. Follow these steps to use scripting mode
- Create a JACL script file containing the administrative commands for the changes that you would like to make
- Execute this command wpscript.sh -port port_number -f script_file_name.jacl
- Check the output from the script processor to ensure that no errors occurred during the execution of the script.