Article

coolguys's picture
article
Reads:

3513

Score:
0
0
 
Comments:

0

Converting Boolean Attributes for OpenLDAP

(View Disclaimer)

Problem

A Forum reader recently asked:

"I want to synchronize some Boolean attributes with IDM3 to an OpenLDAP directory. Doing so, I get the error "value #0 invalid per syntax". I found out that Boolean values in NDS are stored in lowercase letters (true/false) but OpenLDAP requires uppercase values (TRUE/FALSE) according to RFC 2252, section 6.4.

I there a way to change all Boolean attributes from NDS to uppercase values for OpenLDAP in general? Or do I need to change each attribute separately?"

And here's a solution from Father Ramon ...

Solution

You can use something like this in an output transformation policy:

<rule>
  <description>convert boolean values to upper case</description>
  <conditions/>
  <actions>
   <do-for-each>
    <arg-node-set>
     <token-xpath expression="value[@type='state']"/>
    </arg-node-set>
    <arg-actions>
     <do-set-local-variable name="uppervalue">
      <arg-string>
       <token-upper-case>
        <token-local-variable name="current-node"/>
       </token-upper-case>
      </arg-string>
     </do-set-local-variable>
     <do-strip-xpath expression="$current-node/text()"/>
     <do-append-xml-text expression="$current-node">
      <arg-string>
       <token-local-variable name="uppervalue"/>
      </arg-string>
     </do-append-xml-text>
    </arg-actions>
   </do-for-each>
  </actions>
</rule>

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

© 2013 Novell