Custom Message Files in IDM

For my first post I wanted to tackle something that is easy and comes up often with customers. In this first post I want to talk about how to set up a custom message catalog in IDM.  

What a custom message catalog can do is reduce maintenance in a clustered environment and simplifies version control.

IDM retrieves the message catalog in the following order.

1. User defined Message catalog ( only 1 is permitted)
2. System defined defaultCustomCatalog
3. config/WPMessages.properties file
4. WPMessages.properties file in idmcommon.jar


Steps to create a custom message catalog

1. If overriding the default message catalog entries, locate the appropriate error message keys in the WPMessages.properties file. These keys must be in the customized message file.

2. Create the XML file. I have a sample below.

3. Import into IDM

4. Add the following line in the System Configuration  within the <Configuration><Extension><Object> element:

<Attribute name='customMessageCatalog' value='CatalogName'/>

5. Save the changes and restart the App Server.

When you start up the app server you will see something like the following


Starting: Identity Server...
LOADED: custom catalog: CustomMessageCatalog
Starting: Identity Manager Service Provider Edition...
...Finished starting Startup Servlet

This tells you that the custom message file is loaded.

Sample custom message file :

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Configuration PUBLIC 'waveset.dtd' 'waveset.dtd'>
  <Extension>
    <CustomCatalog id='customMessageCatalog' enabled='true'>
      <MessageSet language='po' country='PL'>
      <Msg id='UI_USERID_LABEL'>konto</Msg>
      <Msg id='UI_PWD_LABEL'>haslo </Msg>

MessageSet language='cs' country='CZ'>
      <Msg id='UI_USERID_LABEL'>ucet</Msg>
      <Msg id='UI_PWD_LABEL'>heslo </Msg>

</MessageSet>
    </CustomCatalog>
  </Extension>
  <MemberObjectGroups>
    <ObjectRef type='ObjectGroup' id='#ID#Top' name='Top'/>
  </MemberObjectGroups>
</Configuration>

In here you can see it is a little different than the WPMessages.properties file. In the WPMessages.properties file it is listed as KeyName=MessageText but in the custom file the KeyName is specified in the ID attribute while the Messagetext is between the <Msg> and </Msg> tags.


For Internationalization you need to create a message catalog with the KeyNames and messagetext in your appropriate languages. You also need to edit the System Configuration with the following before it will work.


<Attribute name='LoadedLanguages'>
        <List>
          <Object name='cs_CZ'>
            <Attribute name='cntry' value='CZ'/>
            <Attribute name='gif' value='images/f0-cs.gif'/>
            <Attribute name='lang' value='cs'/>
          </Object>
          <Object name='po_PL'>
            <Attribute name='cntry' value='PL'/>
            <Attribute name='gif' value='images/f0- po.gif'/>
            <Attribute name='lang' value='po'/>
          </Object>
           </List>

<Attribute name='customMessageCatalog' value='customMessageCatalog'/>

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

I have been in support for about 10 years now and have been doing IDM support for 5 years now. I have been working for SUN for 9 years and have supported the whole JES Stack during that time.

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today