You can add custom widgets to Homepage, Communities, and Profiles to integrate key information, status, tasks or almost anything relevant to your organization in profiles, Widgets can be set as a "resourceOwnerWidget" whereby only the user sees the Widget on "My Profile" - task lists and status widgets are examples of Widgets that would work well with this setting. Other widgets are seen by all users and an example considered here is the Social Badge Widget.
A Social Badge Widget helps with adoption of IBM Connections and works by recognizing users for social contributions or profile completion.
This section covers the information to add the widget to the Profiles page, but does not cover writing the widget code. The example used here is a static HTML widget.
Before you begin
Ensure that you have a working widget, and that you have the URL where it is deployed.
Our example is a simple XML file containing the definition and HTML "payload".
<iw:iwidget name="badge" title="Social Badge" xmlns:iw="http://www.ibm.com/xmlns/prod/iWidget" supportedModes="view">
<div align="center" style="margin:6px;border-style:ridge;border-width:6px;background:yellow;border-color:yellow;padding:2px">
<b>Level Two Contributor</b></div>
<div style="margin:2px">Dan is a <b>Level 2</b> Contributor:
<li><b>24</b> followers </li>
<li><b>7</b> blog posts </li>
<li><b>4</b> communities </li>
<p>(Static example Widget)</p>
In this example, the widget is deployed on the same HTTP server as IBM Connections and has the following URL:
- Check out the widget-config.xml file.
The general process of checking out and checking in configuration files is described in 1.4 Publishing customizations with the wsadmin tool
Adapt the following example commands for your system:
wsadmin -lang jython -user wasmgr -password d3moL0tus
ProfilesConfigService.checkOutWidgetConfig("f:/temp", AdminControl.getCell() )
Remember to leave the wsadmin session open to check in the file in a later step.
- Define the Widget in the configuration file.
Add the following line to the configuration file within the <definitions> ... </definitions> section:
Placing the line immediately before the closing </definitions> line makes it easy to find.
- Add the widget to a profiles layout.
Typically, you add a widget to the default profiles layout, and the main profiles page.
Add the following line within the <layout resourceSubType="default"> <page pageId="profilesView"> ... sections.
<widgetInstance uiLocation="col3" defIdRef="socialBadge"/>
- Check in the widget-config file.
In the same wsadmin session checkin the widgets config file using the following command:
- Restart the the Profiles application.
This procedure shows how to add a new Widget. The following link shows how profile types can be used to control Widget Layout 5.6 Adding profile types
Parent topic: 5.0 Customizing Profiles