Adding custom strings for widgets and other specified scenarios

You can add custom strings or modify existing strings when performing certain IBM® Connections tasks.

Before you begin

When adding custom strings, you must use the wsadmin client. See Starting the wsadmin client for details.
IBM Connections provides a external resource bundle loader for adding and updating strings to Profiles, Communities, and the Home page. You can only use this process when performing the following tasks:
  • Adding custom extension attributes to profiles
  • Customizing the Profiles business card
  • Adding custom widgets to Communities, Profiles, and the Home page
  • Configuring the vCard export application
  • Renaming the tabs in the Home page
  • Adding custom themes to Communities
You can add custom strings for other tasks using the procedure outlined in Customizing product strings.

About this task

To add custom strings for the listed tasks, create a bundle containing the custom strings and save it in the customization_dir/strings directory that is created at installation time. You then register the file in the LotusConnections-config.xml file. For performance reasons, include all the resource strings in a single bundle.

For a complete example, see Creating a simple profile data model and template customization.

Procedure

  1. Create a properties file containing the strings that you want to add in the customization_dir/strings directory.
    • To specify the name of the default properties file, use the following syntax: resource_bundle_name.properties_file_name
    • To specify custom strings in multiple languages, append an underscore followed by the appropriate language code to the resource bundle name using the following syntax: resource_bundle_name_language_code.properties_file_name

    For example, if your string bundle is named com.example.resources, you might create a file in the strings directory that looks like the following:customization_dir/strings/com.example.resources.properties This file contains the strings used for the default locale. When there is no specific bundle for the user's locale, the labels in this default properties file are used.

    To include an English version of the strings, you might create the following file: <customization_dir>/strings/com.example.resources_en.properties

    And to include a Slovakian version of the strings, you might include the following file:customization_dir/strings/com.example.resources_sk.properties

    The following sample string is contained in the properties file.
    label.vcard.encoding.cp943c=Japanese Encoding
  2. Register the resource bundle in the LotusConnections-config.xml file:
    1. Open a command window and start the wsadmin command-line tool as described in the topic, Starting the wsadmin client.
    2. Enter the following command to access the IBM Connections configuration file:
      execfile("$WAS_HOME/profiles/DMGR/config/bin_lc_admin/connectionsConfig.py")
    3. Enter the following command to check out the IBM Connections configuration file:
      LCConfigService.checkOutConfig(working_directory, cell_name) where:
      • working_directory is the temporary working directory to which the configuration XML and XSD files are copied. The files are kept in this working directory while you make changes to them.
      • cell_name is the name of the IBM WebSphere® Application Server cell hosting the IBM Connections application. This argument is required. It is also case-sensitive, so type it with care.
      For example:
      LCConfigService.checkOutConfig("/temp", "foo01Cell01")
    4. From the temporary directory to which you just checked out the IBM Connections configuration files, open the LotusConnections-config.xml file in a text editor.
    5. Add the following line of code into the <resources> element block to register the resource bundle:
      <widgetBundle prefix=bundle_prefix name=bundle_name />
      where
      • bundle_prefix is a globally unique name that identifies the bundle. This is a string value. The bundle prefix is used to uniquely scope the keys in each bundle. The prefix must be unique across all registered widget bundles.

        This bundle prefix maps to the bundle ID reference that you specify when you define a custom resource attribute or widget. For more information about defining custom resource attributes, see Enabling custom extension attributes for Profiles. For information about defining custom widgets, see Enabling custom widgets for Communities or Enabling custom widgets for Profiles.

      • bundle_name is the Java™ package name. This parameter takes a string value. When you name the resource bundle, the elements in the bundle name must correspond to the file name of the properties file that you created in step 1.

        For example, if the strings customization directory contains the files com.example.resources.properties, com.example.resources_en.properties, and com.example.resources_sk.properties, the name of the bundle is com.example.resources.

      The following sample code is used to register the com.example.resources bundle:
      <resources>
      
        <!--  Example:  The attribute 'prefix' must be globally unique as it identifies the bundle when used in IBM Connections.  -->
      
        <widgetBundle prefix="example" name="com.example.resources"/>
      
      </resources>
    6. Save your changes to the LotusConnections-config.xml file.
    7. To check in the updated file, use the following command:
      LCConfigService.checkInConfig()
    8. To exit the wsadmin client, type exit at the prompt.

What to do next

After completing this procedure, you can use the labels in other configuration settings or in your JavaScript™ code. For example, you can use the strings when customizing the business card in Profiles (to add labels for custom extension attributes) and adding widgets to Profiles, Communities, and the Home page (to provide widget titles and descriptions). You can also use the strings to rename the Updates, Widgets, and Administration tabs in the Home page.

Note that when you specify external labels for attributes, editable attributes, or custom extension attributes, the labels are only applied to the user interface element that the configuration object represents. For example, if you apply a custom label to a business card <attribute> element, the label does not automatically apply to the same element in the advanced search page layout.

For information about how to apply the label configuration to each user interface element individually, see Specifying external labels for attributes.