Configure profile types for widget layout
To configure widget layout, you can add a profile type containing the widget layout configuration to Profiles in the widgets-config.xml file.
Before starting
To edit configuration files, use the wsadmin client. See Starting the wsadmin client for information about how to start the wsadmin command-line tool.
Procedure
To add a new profile type for widget layout, perform the following steps.
- From the dmgr host:
cd $DMGR_PROFILE/bin
./wsadmin.sh -jython
execfile("profilesAdmin.py")If prompted to specify a service to connect to, type 1 to pick the first node in the list. Most commands can run on any node. If the command writes or reads information to or from a file using a local file path, pick the node where the file is stored.
Check out the widget configuration file:
ProfilesConfigService.checkOutWidgetConfig("<working_directory>", "<cell_name>")
where:
- <working_directory> is the temporary working directory to which the configuration XML and XSD files will be copied. The files are kept in this working directory while you make changes to them.
- <cell_name> is the name of the WAS cell hosting the Profiles application. This argument is required.
For example:
ProfilesConfigService.checkOutWidgetConfig("/wsadminoutput", "jdoe30Node02Cell")
Save a copy of the widgets-config.xml file. Open the file in a text editor. Add a widget layout under the <widgets> element, as in the following example:
<layoutConfiguration> <widgets xmlns:tns="http://www.ibm.com/profiles-config"> <layout resourceSubType="debug"> <page pageId="profilesView"> <widgetInstance uiLocation="col2" defIdRef="multiWidget" instanceId="tabsWidget1"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="board"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="contactInfo"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="backgroundInfo"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="multiFeedReader"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="socialTags"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="sand_thingsInCommon"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="sand_socialPath"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="reportStructure"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="friends"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="linkRoll"/> </page> </layout> <layout resourceSubType="restricted"> <page pageId="profilesView"> <!-- <widgetInstance uiLocation="col2" defIdRef="multiWidget" instanceId="mw1"/> --> <widgetInstance uiLocation="col2" defIdRef="contactInfo" instanceId="ci1"/> <widgetInstance uiLocation="col1" defIdRef="reportStructure"/> </page> </layout> <layout resourceSubType="mobile"> <page pageId="profilesView"> <widgetInstance uiLocation="col2" defIdRef="multiWidget" instanceId="tabsWidget1"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="board"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="contactInfo"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="backgroundInfo"/> <widgetInstance uiLocation="col2" defIdRef="multiWidget" instanceId="tabsWidget2"/> <widgetInstance uiLocation="tabsWidget2" defIdRef="multiFeedReader"/> <widgetInstance uiLocation="col1" defIdRef="socialTags"/> <widgetInstance uiLocation="col1" defIdRef="sand_thingsInCommon"/> <widgetInstance uiLocation="col1" defIdRef="sand_socialPath"/> <widgetInstance uiLocation="col3" defIdRef="reportStructure"/> <widgetInstance uiLocation="col3" defIdRef="friends"/> <widgetInstance uiLocation="col3" defIdRef="linkRoll"/> </page> </layout> <layout resourceSubType="default"> <page pageId="profilesView"> <widgetInstance uiLocation="col2" defIdRef="multiWidget" instanceId="tabsWidget1"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="board"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="contactInfo"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="backgroundInfo"/> <widgetInstance uiLocation="tabsWidget1" defIdRef="multiFeedReader"/> <widgetInstance uiLocation="col1" defIdRef="socialTags"/> <widgetInstance uiLocation="col1" defIdRef="sand_thingsInCommon"/> <widgetInstance uiLocation="col3" defIdRef="sand_socialPath"/> <widgetInstance uiLocation="col3" defIdRef="reportStructure"/> <widgetInstance uiLocation="col3" defIdRef="friends"/> <widgetInstance uiLocation="col3" defIdRef="linkRoll"/> </page> <page pageId="searchResultView"> <widgetInstance uiLocation="col1" defIdRef="commonTags"/> </page> <page pageId="searchView"> <widgetInstance uiLocation="col1" defIdRef="sand_DYK"/> <widgetInstance uiLocation="col1" defIdRef="commonTags"/> <!-- <widgetInstance uiLocation="col3" defIdRef="sand_recomItems"/> --> </page> <page pageId="networkView"> <widgetInstance uiLocation="col1" defIdRef="sand_DYK"/> </page> <page pageId="editProfileView"> ... </layout> </widgets> </layoutConfiguration>
Save your changes and check the widgets-config.xml file back in using the following command:
ProfilesConfigService.checkInWidgetConfig()
To exit the wsadmin client, type exit at the prompt. Stop and restart the Profiles server.
Parent topic
Add profile types
Related tasks
Apply property changes in ProfilesRelated reference
Search Profiles programmatically
});