Add widgets to Profiles 

IBM Connections provides enhanced application customization of the user interface in the form of widgets. As administrator, you can add default widgets to Profiles by defining and configuring the widgets in the widgets-config.xml file.


Before you begin

To edit configuration files, use the wsadmin client. See Starting the wsadmin client for information about how to start the wsadmin command line tool.


About this task

Based on profile type, you can add widgets to Profiles and modify their layout to adapt to different usage patterns. You can also add and remove widgets so that different roles have different widgets and widget layouts. As well as adding default widgets, you can define and display widgets from external sources. The widgets are rendered by the web browser rather than a server.

To add widgets to Profiles, perform the following steps:


Procedure

  1. Use the wsadmin client to access the Profiles configuration files.

    1. Enter the following command to access the Profiles configuration files:

        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.

  2. 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 IBM Connections application. This argument is required even in stand-alone deployments.

      For example:

      ProfilesConfigService.checkOutWidgetConfig("/wsadminoutput", "jdoe30Node02Cell")

  3. Save a copy of widgets-config.xml.

  4. Open the file in a text editor, and specify attributes and values for the <widgetDef> element under the <widgets> element:

      Table 1. The widgetDef element
      Attribute Description
      defId Used by the internal framework to identify the widget. This value must be unique. It is also used as a resource bundle key. For information on adding a resource string to Profiles, see Add custom strings to IBM Connections.

      This attribute takes a string value.

      url Specifies the location of the widget definition document. This URL can be relative to the host system where Profiles is installed. The URL can also be absolute; the widget can be located on a different server from Profiles.

      This attribute takes a string value.

      showFullPageViewLinkInNavBar Specifies whether a link to the widget is displayed in the navigation bar. This link forwards the user to a full page view of the widget. The iWidget must be able to handle a normal view and a full page view.

      This attribute takes a Boolean value.

      navBarResourceBundleId Contains the resource bundle key that Profiles uses when displaying a link name in the navigation bar. For information on adding a resource string to Profiles, see Add custom strings to IBM Connections.

      This attribute takes a string value.

      loginRequired Specifies whether a user must be logged in to Profiles for the iWidget to display.

      This attribute takes a Boolean value.

      helpBodyResourceBundleId Contains the resource bundle key that Profiles uses when displaying a help text for an iWidget. For information on adding a resource string to Profiles, see Add custom strings to IBM Connections.

      This attribute takes a string value.


      The configData element can contain a list of child elements named attr. The attr elements are a list of name-value pairs that are passed into the iWidget as an AttributeItemSet. The attributes specified in this section can also be specified as an <iw:itemSet/> in the widget definition file.

      Table 2. The layout element

      Attribute Description
      profileType Contains the name of the profile type that is used to render the widget layout. Multiple profile type layout configuration is allowed in Profiles. For more information, see Add profile types.

      This attribute takes a string value.

      Table 3. The page element

      Attribute Description
      pageId Contains the pageId for the page that Profiles uses to render the widget layout. Possible values include profilesView and reportingStructureView.

      This attribute takes a string value.

      Table 4. The widgetInstance element

      Attribute Description
      defIdRef Contains a reference to the <widgetDef> defId attribute.

      This attribute takes a string value.

      ui-location Specifies the location of the widget in the Profiles page.

      Possible values include col1, col2, and col3.

      This attribute takes a string value.

      For example:

      <widgets xmlns:tns="http://www.ibm.com/profiles-config">
        <definitions>
          ...
          <widgetDef defId="photoApp" url="http://mycompany.com/photoApp/widgetDefition.xml" fullPageView="true" 
          showFullPageViewLinkInNavBar="true" navBarResourceBundleId="photoAppTitleId" helpBodyResourceBundleId="photoAppHelpTextId">
            <configData>
              <attr key="numberOfPhotoToDisplay" value="4" />
            </configData>
          </widgetDef>
          ...
        </definitions>
        <layout profileType="default">
          <page pageId="profilesView">
            ...
            <widgetInstance uiLocation="col3" defIdRef="photoApp"/>
            ...
          </page>
          <page pageId="reportingStructureView"/>
        </layout>
      <layout profileType="management">
          <page pageId="profilesView">
            ...
            <widgetInstance uiLocation="col2" defIdRef="photoApp"/>
            ...
          </page>
          <page pageId="reportingStructureView">
            ...
            <widgetInstance uiLocation="col2" defIdRef="photoApp"/>
            ...
          </page>
        </layout>
      </widgets>

  5. Save your changes and check the widgets-config.xml file back in using the following command:

      ProfilesConfigService.checkInWidgetConfig()

  6. To exit the wsadmin client, type exit at the prompt.

  7. Stop and restart the Profiles server.

Related tasks
Apply property changes in Profiles


   

 

});