Enabling custom widgets for Profiles
To make custom widgets available for use in Profiles, you need to configure the widgets in the widget definition file, widgets-config.xml.
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 contains information about widget definitions, widget attributes, widget location, default widget templates, and page definitions. Custom widget attributes are defined by the widget developer but, as administrator, you need to configure the widgets by adding a <widgetDef> element containing the appropriate attributes for each widget in the widget configuration file. The file is stored in the following location:
WAS_HOME\profiles\AppSrv01\config\cells\CELL_NAME\LotusConnections-config\widgets-config.xml
You can integrate a custom widget as part of IBM® Connections and you can also integrate the widget as an external application. To integrate the widget inside the IBM® Connections application, your widget must provide a full page mode. To integrate the widget as an external application, you must use a navBarLink attribute to register a navigation link along with your widget configuration information.
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.
- 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.
- Define the custom widget by specifying a resource type
of profile and adding a <widgetDef> element using the attributes
and parameters defined in Profiles widget attributes.
When adding custom strings using the resource bundle loader, the value of the category, description, and widgetDef attributes in the <widgetDef> element are used as the resource key for your custom bundle. For more information about adding widget strings, see Adding custom strings for widgets and other specified scenarios.For example:
The url, navBarLink, and item or @value XML attributes can be parameterized using substitution variables. For more information about the substitution variables that you can use, see Profiles widget configuration variables.<config id="widgets"> <resource type="profile"> <widgets> <definitions> <widgetDef defId="HelloWorld" primaryWidget="false" modes="view fullpage edit search" url="{contextRoot}/comm.widgets/helloWorld/HelloWorld.xml?version={version}"/> <!-- XML attribute with substitution variables --> </definitions> <layout resourceSubType="default"> <page pageId="profilesView"> <widgetInstance uiLocation="col3" defIdRef="reportStructure"/> <widgetInstance uiLocation="col3" defIdRef="friends"/> <widgetInstance uiLocation="col1" defIdRef="socialTags"/> <widgetInstance uiLocation="col3" defIdRef="linkRoll"/> <widgetInstance uiLocation="col2" defIdRef="multiFeedReader"/> </page> <page pageId="searchResultView"> <widgetInstance uiLocation="col1" defIdRef="commonTags"/> </page> <page pageId="searchView"> <widgetInstance uiLocation="col1" defIdRef="commonTags"/> </page> </layout> </widgets> </resource> ..... </config>
- 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.