Managing widgets in Profiles
Configure settings in the widget definition file, widgets-config.xml, when you want to modify the widgets that display in the Profiles application.
Before you begin
To edit configuration files, you must use the IBM® WebSphere® Application Server wsadmin client. See Starting the wsadmin client for details.
About this task
The widgets-config.xml file is stored in the following location:
WAS_HOME\profiles\AppSrv01\config\cells\CELL_NAME\LotusConnections-config\widgets-config.xml
Procedure
- Start the wsadmin client from the following
directory of the system on which you installed the Deployment Manager:
where app_server_root is the WebSphere® Application Server installation directory and dm_profile_root is the Deployment Manager profile directory, typically dmgr01.app_server_root\profiles\dm_profile_root\bin
You must start the client from this directory or subsequent commands that you enter do not execute correctly. For more information, see Starting the wsadmin client.
- Start the Profiles Jython script interpreter.
- Use
the following
command to 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 WebSphere® Application Server cell hosting the Profiles application. This argument is required.
ProfilesConfigService.checkOutWidgetConfig("/wsadminoutput", "jdoe30Node02Cell")
- Navigate to the temporary directory in which you saved the widgets_config.xml file, and then open the file in a text editor.
- Do one of the following:
- To edit a widget's properties, look for the corresponding <widgetDef> element, and then modify the widget attributes and parameters as needed. For information about the attributes and parameters, see Profiles widget attributes.
- To associate a widget with a different profile type, look for the relevant <widgetDef> element, and then modify the value of the resourceSubType attribute. For information about the resourceSubType attribute, see Profiles widget attributes.
- To move a widget to a different location, look for the relevant <widgetDef> element, and then modify the value of the pageId and uiLocation attributes. For information about these attributes, see Profiles widget attributes.
- To disable a widget, look for the relevant <widgetDef> element and either delete the element or comment it out of the code.
- 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.
Example
Although this example might not match the content of the widgets-config.xml included in your deployment, it does include the widgets supported for your deployment.
<layout resourceSubType="default">
<page pageId="searchView">
<widgetInstance uiLocation="col1" defIdRef="commonTags"/>
<widgetInstance uiLocation="col3" defIdRef="sand_DYK"/>
<widgetInstance uiLocation="col3" defIdRef="sand_recomItems"/>
</page >
<page pageId="profilesView">
<widgetInstance uiLocation="col1" defIdRef="socialTags"/>
<widgetInstance uiLocation="col1" defIdRef="sand_thingsInCommon"/>
<widgetInstance uiLocation="col2" defIdRef="multiWidget"/>
<widgetInstance uiLocation="multiWidget" defIdRef="board"/>
<widgetInstance uiLocation="multiWidget" defIdRef="contactInfo"/>
<widgetInstance uiLocation="multiWidget" defIdRef="backgroundInfo"/>
<widgetInstance uiLocation="multiWidget" defIdRef="multiFeedReader"/>
<widgetInstance uiLocation="col3" defIdRef="sand_socialPath"/>
<widgetInstance uiLocation="col3" defIdRef="reportStructure"/>
<widgetInstance uiLocation="col3" defIdRef="friends"/>
<widgetInstance uiLocation="col3" defIdRef="linkRoll"/>
</page >
<page pageId="searchView">
<widgetInstance uiLocation="col1" defIdRef="commonTags"/>
</page >
<page pageId="networkView">
<widgetInstance uiLocation="col1" defIdRef="sand_DYK"/>
</page >
<page pageId="editProfileView">
<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 >
</layout>
What to do next
- Register the widget using one of the methods described in the following topics:
- Gadget Registration Commands explains how to register gadgets and widgets from a command line.
- Configuring Home page widgets explains how to register gadgets and widgets from the administration interface.
Note: When you register a Profiles widget, theprereqs
setting should be set to "profiles
" as in the following example:NewsWidgetCatalogService.addWidget(title="helloworld", text="Hello World Widget.", url="https://serverName.ibm.com/helloworld/helloworld.xml", categoryName=WidgetCategories.NONE, isGadget=FALSE,appContexts=[WidgetContexts.EMBEDXP], policyFlags=[GadgetPolicyFlags.TRUSTED], prereqs=["profiles"])
- Run the run the
widgetEnable
command. - Run the
clearWidgetCaches
command.