./psadmin modify-dp -u amadmin -f ps_password -P JSPTabContainer/bookmark2 -d cn=hr_role,o=Developersample,dc=country,dc=sun,dc=com" -p myPortal1 -m modify.xml
In the above example, the value of the channel, bookmark2, under the container, JSPTabContainer, is changed by the modify-dp subcommand. The data is supplied to the modify-dp command either from one or more input files or from a standard input in the form of an XML fragment that follows the command. The modify.xml file contains the following:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE DisplayProfile SYSTEM "jar://resources/psdp.dtd"> <Properties> <String name="title" value="My Bookmarks"/> <String name="refreshTime" value="600"/> <Collection name="targets"> <String value="Sun home page|http://www.sun.com"/> <String value="Everything you want to know about Portal ...|http://www.iplanet.com/products/iplanet_portal/home_portal.html"/> <String value="iPlanet home page|http://www.iplanet.com"/> </Collection> </Properties> |
The semantics of the modify sub command vary based on the type of the display profile being modified. When combine option is specified, the new properties are combined with the existing display profile object, rather than replacing them.
Different variations of modify sub command are provided below:
Display Profile: An entire display profile can be changed to a new object value specified by a file. If the combine option is specified, every display profile object in the display profile document is combined.
Channel or Container: A channel or a container can be changed to the new object value. When modifying a channel or container, if the parent option is specified, the specified parent container is searched for a channel or container that matches the name of the new display profile object. If the parent option is absent, the root display profile object is assumed to parent container. So, root is searched for a channel or container that matches the name of the new display profile object.
Properties: A display profile objects properties can be changed to the new value. The parent option is required to modify a display profile objects properties. A display profile node (either channel or container) or display profile provider object that matches the specified name is searched for under the specified parent. If found, the objects properties object is replaced by the new display profile object. When the combine option is specified, the existing properties are combined with the new display profile object.
Available or Selected: The Available or Selected list in a container can be replaced with the new display profile object. The parent option is required to modify display profile objects of this type. A display profile container that matches the parent name is searched for. Then the Selected or Available object is replaced by the new display profile object. When the combine option is specified, the existing Selected or Available object is combined with the new display profile object.
String, Boolean, Integer, Collection, or Locale: A String, Boolean, Integer, Collection, or Locale property in a display profile object can be replaced by new display profile object property.
Provider: An existing display profile Provider object can be replaced with the display profile provider of the same name. A display profile provider object that matches the name of the new display profile provider object is searched for under the root display profile node. If present, the new display profile provider object is inserted under the root display profile object, replacing the existing display profile provider of the same name. Since providers can only exist under the root node (the root node is an implicit container), the parent option must not be specified.
Using the list-dp subcommand, you can view the way the bookmark2 channel is changed:./psadmin list-dp -u amadmin -f ps_password -p myPortal1 -d "cn=hr_role,o=Developersample,dc=country,dc=sun,dc=com" -n "JSPTabContainer/bookmark2"
The result is displayed below:
<Channel name="bookmark3" provider="BookmarkProvider"> <Properties> <String name="title" value="My Bookmarks"/> <String name="refreshTime" value="600"/> <Collection name="targets"> <String value="Sun home page|http://www.sun.com"/> <String value="Everything you want to know about Portal ...| http://www.iplanet.com/products/iplanet_portal/home_portal.html"/> <String value="iPlanet home page|http://www.iplanet.com"/> </Collection> </Properties> </Channel> |
If you need to remove a property, <String value="Everything you want to know about Portal ...| http://www.iplanet.com/products/iplanet_portal/home_portal.html"/> from bookmark3 explained in Example1, you can use the modify command.
Create a modify file as follows.
<Channel name="bookmark3" provider="BookmarkProvider"> <Properties> <String name="title" value="My Bookmarks"/> <String name="refreshTime" value="600"/> <Collection name="targets"> <String value="Sun home page|http://www.sun.com"/> <String value="iPlanet home page|http://www.iplanet.com"/> </Collection> </Properties> </Channel> |
Now run the following command:
./psadmin modify-dp -u amadmin -f ps_password -P JSPTabContainer/bookmark2 -d cn=hr_role,o=Developersample,dc=country,dc=sun,dc=com" -p myPortal1 modify.xml
In this example, you are replacing the entire properties section.