Placing DNs in Multi-Valued Attributes
Novell Cool Solutions: Tip
Digg This -
Posted: 18 Apr 2007
A Forum reader recently asked:
"I am writing a policy where I need to run a query to get a list of one or more DNs, then place those DNs as the values of a multi-valued attribute in my destination data source. How do I do this? Can I use the do-add-dest-attr-value action and just specify the query as the values to add, or do I need to place the results of the query in a local variable and do something with that?
The driver will load User objects into eDirectory from a JDBC data source. We have a custom multi-valued attribute on each of these users that lists a number of locations for which the user has some administrative responsibilities."
And here's the response from Father Ramon ...
You need to use do-for-each to iterate over the values you are expecting to get back. For example:
<do-for-each> <arg-node-set> <token-query class-name="Locality"> <arg-dn> <token-parse-dn dest-dn-format="dest-dn" src-dn-format="ldap"> <token-text>o=foo, l=bar, dc=County, dc=Organizations, dc=baz</token-text> </token-parse-dn> </arg-dn> </token-query> </arg-node-set> <arg-actions> <do-add-dest-attr-value name="xxx"> <arg-value> <token-xpath expression="$current-node/@src-dn"/> </arg-value> </do-add-dest-attr-value> </arg-actions> </do-for-each>
If your custom attribute syntax is DN, then the above should work. If it is a string and you want it in LDAP format, then you'll want to change the value to something more like this:
<token-parse-dn src-dn-format="qualified-slash" dest-dn-format="ldap"> <token-xpath expression="$current-node/@qualified-src-dn"/> </token-parse-dn>
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com