Novell Home

Converting Boolean Attributes for OpenLDAP

Novell Cool Solutions: Tip

Digg This - Slashdot This

Posted: 20 Sep 2006
 

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>


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell