Publish and deleting personalization rules using a script
You can use a WebSphere Portal Personalization provided script, pznload, to export, publish, and delete Personalization rules on local or remote servers. You can script the delivery of rules and campaigns from staging to production, or the offline publishing between disconnected systems (such as when production servers are secured behind a firewall). You can use this function to quickly revert production servers to an earlier state.
Publish via the command-line is a two step process. First, you export the personalization rules you want to transfer from the authoring environment to a remote system. After exporting and saving the required objects, you use the pznload script to send this data to the appropriate server.
After a publish is started, you see status messages in the command console.
- You can export the personalization rules on the site or you can run the pzload command. Select one of the following methods to export personalization objects from the site:
- Click More Actions -> Export in the Personalization Navigator. You are prompted for a location to save a nodes file. This file contains an XML representation of all the currently selected personalization objects. You can export entire folders.
Figure 1. Exporting a folder to the file system
- Open a command prompt and run the following command, where out designates the location of the exported data on local system and targetPath is the object (and children) that will be exported:
pznload --export --out filename --serverUrl url --targetPath path--targetWorkspace workspace --username username --password password
- Use pznload to send this data to the appropriate server. The pznload script is located in... $PORTAL_HOME/pzn/prereq.pzn/publish/
- pznload.bat --serverUrl url --targetPath path--targetWorkspace workspace --username username --password password
- pznload.sh --serverUrl url --targetPath path --targetWorkspace workspace --username username --password password
This program accepts a number of command line options and a set of nodes files to publish. Invoke pznload with the --help option to see a list of all options. The most important arguments are described below:
serverUrlThe URL of the remote publish servlet. If you do not specify a value the program will attempt to connect to a WebSphere Portal server running on the local machine.
targetWorkspaceThe name of the workspace to publish to. The default workspace name on all IBM Content Manager run time edition installations is RULESWORKSPACE.
targetPathThe location in the target workspace which will be the parent for the published nodes. The target path must exist prior to publishing. Example: If the Export function was used on the folder /Projects/HR website, then the target path should be specified as /Projects so that the published resources are once again located in /Projects/HR website.
usernameA valid user on the target system with sufficient access rights.
passwordThe password for the user
- To delete objects, run the following command where TargetPath is the object (and all associated children) that will be deleted.
pznload --delete --targetPath path -serverUrl url --targetPath path --targetWorkspace workspace --username username --password password
Parent
Personalization rules