Sun Java logo     Previous      Contents      Next     

Sun logo
Sun Java System Identity Installation Pack 2005Q4M3 Release Notes  

6

Customized Message Catalogs

In previous releases, deployers were encouraged to edit the WPMessages.properties file to add message catalog entries or modify entries provided with the system. It is now recommended that you create a customized message catalog. Custom message catalogs have the following benefits:

Identity Manager retrieves message catalog entries in the following order:

Message Catalog Format

In the WPMessages.properties file, entries are defined in the format KeyName=MessageText. In a customized message catalog, each entry is specified in a separate Msg element. The KeyName is specified in the id attribute, while the MessageText is text between . The following example illustrates a message catalog entry:

<Msg id='UI_REMEMBER_PASSWORD'>Remember to set your password.</Msg>

The message text may contain HTML tags to control how the text is rendered, although this is not recommended. If you need to use HTML tags, use codes such as &lt; and &gt; instead symbols such as < and >.

Message text may also contain variables for data that will be inserted into the string when it is displayed. The following example is the default message for the AR_CORRELATED_USER key:

Correlated account with user {0}.

The rendered version could appear as

Correlated account with user jdoe.

Creating a Customized Message Catalog

The following procedure describes how to create a user-defined message catalog.

  1. If you are overriding default message catalog entries, locate the appropriate error message keys in the WPMessages.properties file. These keys must be specified in the customized message catalog.
  2. If you are creating new messages, make sure the keys do not appear in the WPMessages.properties file

  3. Create an XML file or block with the following structure:
  4. <?xml version='1.0' encoding='UTF-8'?>

    <!DOCTYPE Configuration PUBLIC 'waveset.dtd' 'waveset.dtd'>

    <Configuration name='CatalogName'>

      <Extension>

        <CustomCatalog id='CatalogName' enabled='true'>

          <MessageSet language='en' country='US'>

            <Msg id='KeyName'>MessageText</Msg>

            <Msg id='KeyName'>MessageText</Msg>

            ...

          </MessageSet>

        </CustomCatalog>

      </Extension>

    </Configuration>

    where:

    CatalogName is the name of the message catalog. This value will also be used to define the catalog in the SystemConfiguration object.

    KeyName is the message key name.

    MessageText is a string that will be displayed on the graphical user interface. This text can contain HTML tags and variables.

    If you supporting a locale other than en_US, change the language and country attributes. If you are supporting multiple locales, create a separate MessageSet element for each locale.

    See the Example section for a working sample.

  5. Import the file or block into Identity Manager.
  6. Load the System Configuration object and add the following line within the <Configuration><Extension><Object> element:
  7. <Attribute name='customMessageCatalog' value='CatalogName'/>

  8. Save the changes to the System Configuration object.
  9. Restart the application server. The new message catalog entries are now available to the system.

Example

The following example creates a customized message catalog named myCustomCatalog. It replaces the label and help text for the Import Exchange File subtab.

<?xml version='1.0' encoding='UTF-8'?>

<!DOCTYPE Configuration PUBLIC 'waveset.dtd' 'waveset.dtd'>

<Configuration name='myCustomCatalog'>

  <Extension>

    <CustomCatalog id='myCustomCatalog' enabled='true'>

      <MessageSet language='en' country='US'>

        <Msg id='UI_SUBNAV_CONFIGURE_IMPORT_EXCHANGE'>Import XML File</Msg>

        <Msg id='UI_SUBNAV_CONFIGURE_IMPORT_EXCHANGE_HELP'>Loads the specified XML file.</Msg>

      </MessageSet>

    </CustomCatalog>

  </Extension>

</Configuration>



Previous      Contents      Next     


Copyright 2006 Sun Microsystems, Inc. All rights reserved.