Enable custom widgets for Profiles 

To make custom widgets available for use in Profiles, configure the widgets in the widget definition file, widgets-config.xml.


Before starting

To edit configuration files, use the IBM WAS 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, 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, use a navBarLink attribute to register a navigation link along with your widget configuration information.


Procedure

To configure a custom widget for Profiles...

  1. 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")

  • 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 Add custom strings for widgets and other specified scenarios.

      For example:

      <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>

      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.

  • 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.


    What to do next

    If you are adding widgets that are hosted on third-party servers, then you might need to update your proxy configuration. For more information on configuring the Ajax proxy for Profiles, see Configure the AJAX proxy for a specific application.


    Parent topic

    Add custom widgets to Profiles


    Related tasks


    Configure the AJAX proxy for a specific application
    Manage widgets in Profiles
    Configure profile types for widget layout
    Add custom strings for widgets and other specified scenarios

    Related reference
    Profiles widget attributes
    Profiles widget configuration variables

    +

    Search Tips   |   Advanced Search