Blog Entry

preycor's picture
blog
Reads:

2923

Score:
5
5
1
 
Comments:

3

Input Transformation: Names and Titles

Author Info

20 October 2009 - 3:00am
Submitted by: preycor

(View Disclaimer)

In a recent Identity Management project I found myself reading information from an HR system via JDBC, then needing to write it into the Identity Vault. From there it would disperse to other systems, one of which was GroupWise.

The HR system stored all information in a capitalised fashion. It's quite obviously undesirable for all entries in a GroupWise address book to be capitalised, so I needed to transform the data.

I wrote two ECMAScript functions to handle this.

The two scripts were added to the Driver Set Library and added to the JDBC Driver's configuration.

In an input transformation policy, the following rules were added. Only two example rules have been added here for the sake of brevity. Obviously if you use them you would need to adjust the class and attribute names.

	<rule>
		<description>Capitalise SURNAME correctly</description>
		<conditions>
			<and>
				<if-class-name mode="nocase" op="equal">IDM_EMPLIST</if-class-name>
				<if-op-attr name="SURNAME" op="available"/>
			</and>
		</conditions>
		<actions>
			<do-reformat-op-attr name="SURNAME">
				<arg-value>
					<token-xpath expression="es:nameCapitalise($current-value)"/>
				</arg-value>
			</do-reformat-op-attr>
		</actions>
	</rule>
	<rule>
		<description>Capitalise POS_TITLE correctly</description>
		<conditions>
			<and>
				<if-class-name mode="nocase" op="equal">IDM_EMPLIST</if-class-name>
				<if-op-attr name="POS_TITLE" op="available"/>
			</and>
		</conditions>
		<actions>
			<do-reformat-op-attr name="POS_TITLE">
				<arg-value>
					<token-xpath expression="es:toTitleCase($current-value)"/>
				</arg-value>
			</do-reformat-op-attr>
		</actions>
	</rule>

I hope that the scripts (being in the wiki) will be contributed to over time to make them more robust and to cater for more situations.


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

geoffc's picture

Scripts in the Wiki

Submitted by geoffc on 21 October 2009 - 6:18am.

I hate editing the Wiki, so I just added a link to my article, Open Call for ECMA functions in IDM to the bottom of it. I suppose I should do the converse and add a link in my article to the Wiki as well. Complete the reciprocal mapping. Dang it, the engine is supposed to do that for us in 3.6.

I like your two functions though!

iammi's picture

Formatting attributes with accents like é, è, ê....

Submitted by iammi on 14 December 2009 - 8:53am.

How about this issue

I am trying to reformat the attribut 'givenName' from the identity Vault to Active directory server.

I use the ECMAScript to reformat the attribut and replace 'é, ê , è' with 'e'
I developped the function reformat() that do the following

attribut.replace(/(é)|(ê)|(è)/g, "e");

The function works fine.

The problem is when I deploy the whole project, for example if I have givenName='éééééééé' in the identity vault, it will be transmitted within the subscriber as '���...' or '□□□□...', so when applying the reformatting, the script could not detect the chars 'é, ê , è' and in the destination (Active directory) the givenName stay unchanged ='éééééééé'

I know its a pure encoding issue, but I dont see how to fix this issue

Please reply!

eladouceur's picture

Fix french caracter with xpath

Submitted by eladouceur on 14 December 2009 - 10:26am.

To convert french caracter:

Use the following xpath

Var is the string you want to convert

translate($VAR,$Source,$Destination)

With these 2 GCVs
Source:ÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜàáâãäçèéêëìíîïñòóôõöùúûü
Destination:AAAAACEEEEIIIINOOOOOUUUUaaaaaceeeeiiiinooooouuuu

I put those string in a GCV just in case I need to add other caracter in the future

© 2013 Novell