Article
Problem
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 ...
Solution
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> 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.
Related Articles
User Comments
- Be the first to comment! To leave a comment you need to Login or Register
- 3665 reads


0