I'm trying to create GroupWise distibution lists for the various trips
that my college runs. All of the trip data is stored in a mysql
database, with the students going on the trip stored by their college ID
number (which has nothing to do with their DN in the vault).

In the code below, I can successfuly read the list of IDs for the trip
group that I'm creating. What I need to do now, and this is where I'm
stuck, is to iterate through the IDs, use them to find the matching user
object in the vault (matching on an attribute called "pscUniteID") and
then add that user DN to the group membership for my newly created trip
goup.

I've looked at using do-find-matching-object, but it looks like this
will just change the DN for the group I'm creating and won't return
anything that I can use? What should I do?

I can add users to the group using do-add-dest-attr-value, but I need
someway of retrieving the DNs first.


Code:
--------------------

<?xml version="1.0" encoding="UTF-8"?>
<policy xmlns:cmd="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsCommandProcessor">
<rule>
<description>Add Students to Group</description>
<conditions>
<and>
<if-operation op="equal">add</if-operation>
</and>
</conditions>
<actions>
<do-set-local-variable name="sql-statement">
<arg-string>
<token-text xml:space="preserve">SELECT StudentID FROM idm_gateway.student_trip WHERE TripID=</token-text>
<token-op-attr name="pscTripID"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="query">
<arg-node-set>
<token-xml-parse>
<token-text xml:space="preserve">&lt;jdbc:statement xmlns:jdbc="urn:dirxml:jdbc">&lt;jdbc:sql></token-text>
<token-xml-serialize>
<token-local-variable name="sql-statement"/>
</token-xml-serialize>
<token-text xml:space="preserve">&lt;/jdbc:sql>&lt;/jdbc:statement></token-text>
</token-xml-parse>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="resultset">
<arg-node-set>
<token-xpath expression="query:query($srcQueryProcessor, $query)"/>
</arg-node-set>
</do-set-local-variable>
<do-for-each>
<arg-node-set>
<token-xpath expression="$resultset//jdbc:value"/>
</arg-node-set>
<arg-actions>
?????
</arg-actions>
</do-for-each>
</actions>
</rule>
</policy>

--------------------


Thanks,
Sam King


--
samjking
------------------------------------------------------------------------
samjking's Profile: http://forums.novell.com/member.php?userid=68487
View this thread: http://forums.novell.com/showthread.php?t=403400