I'm trying to do something very similar to what was discussed in the
thread "How to send email on multiple match ?" from July of 2008.

I want to find all groups for which a user is the owner, then compose
an e-mail containing the list of groups. My code is creating a node-set,
counting the number of elements, and displaying the elements correctly
in a trace but I can't make the join work. As shown below I tried Father
Ramon's suggestion from the above referenced thread but can't seem to
make it work.

Any suggestions would be greatly appreciated!

Actions from by publisher-command transform policy rule shown below.

<actions>
<do-set-local-variable name="lv_srcdn">
<arg-string>
<token-src-dn/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="lvGroupNodeSet" scope="policy">
<arg-node-set>
<token-xpath expression='query:search($destQueryProcessor, "subtree",
"", "US", "Group", "Owner", $lv_srcdn, "DN")/@qualified-src-dn'/>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="lvGroupCount">
<arg-string>
<token-xpath expression="count($lvGroupNodeSet)"/>
</arg-string>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-local-variable name="lvGroupCount"
op="equal">0</if-local-variable>
</and>
</arg-conditions>
<arg-actions>
<do-veto/>
</arg-actions>
<arg-actions>
<do-for-each>
<arg-node-set>
<token-local-variable name="lvGroupNodeSet"/>
</arg-node-set>
<arg-actions>
<do-trace-message>
<arg-string>
<token-text xml:space="preserve">Group = </token-text>
<token-local-variable name="current-node"/>
</arg-string>
</do-trace-message>
</arg-actions>
</do-for-each>
</arg-actions>
</do-if>
<do-set-local-variable name="lvMsgBody" scope="policy">
<arg-string>
<token-join csv="true" delimiter=";"/>
<token-xpath expression="$lvGroupNodeSet/@qualified-src-dn"/>
</arg-string>
</do-set-local-variable>


And a snippet from the trace. Sorry, there's a lot of stuff and I've
pared the trace down to only 2 group DN's being displayed although
you'll notice that 18 were found. The important piece is at the bottom -
lvMsgBody comes back empty but I expected it to be a semi-colon
delimited string containing the values in node-set lvGroupNodeSet.

Generic Loopback PT:Applying policy: pub-ctp.
Generic Loopback PT: Applying to add #1.
Generic Loopback PT: Evaluating selection criteria for rule 'Group
Owner Match'.
Generic Loopback PT: (if-class-name equal "User") = TRUE.
Generic Loopback PT: Rule selected.
Generic Loopback PT: Applying rule 'Group Owner Match'.
Generic Loopback PT: Action:
do-set-local-variable("lv_srcdn",token-src-dn()).
Generic Loopback PT: arg-string(token-src-dn())
Generic Loopback PT: token-src-dn()
Generic Loopback PT: Token Value:
"\FP-NA-DEVL\US\BASF_CORP\ANDERSON\NTI\user_acct2".
Generic Loopback PT: Arg Value:
"\FP-NA-DEVL\US\BASF_CORP\ANDERSON\NTI\user_acct2".
Generic Loopback PT: Action:
do-set-local-variable("lvGroupNodeSet",scope="policy",arg-node-set(token-xpath("query:search($destQueryProcessor,
"subtree", "", "US", "Group", "Owner", $lv_srcdn,
"DN")/@qualified-src-dn"))).
Generic Loopback PT:
arg-node-set(token-xpath("query:search($destQueryProcessor, "subtree",
"", "US", "Group", "Owner", $lv_srcdn, "DN")/@qualified-src-dn"))
Generic Loopback PT: token-xpath("query:search($destQueryProcessor,
"subtree", "", "US", "Group", "Owner", $lv_srcdn,
"DN")/@qualified-src-dn")
Generic Loopback PT: Query from policy
Generic Loopback PT:
<nds dtdversion="3.5" ndsversion="8.x">
<source>
<product version="3.6.0.4294">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<query class-name="Group" dest-dn="US" scope="subtree">
<search-class class-name="Group"/>
<search-attr attr-name="Owner">
<value>\FP-NA-DEVL\US\BASF_CORP\ANDERSON\NTI\user_acct2</value>
</search-attr>
<read-attr attr-name="DN"/>
</query>
</input>
</nds>
Generic Loopback PT: Pumping XDS to eDirectory.
Generic Loopback PT: Performing operation query for US.
Generic Loopback PT: Query from policy result
Generic Loopback PT:
<nds dtdversion="3.5" ndsversion="8.x">
<source>
<product version="3.6.0.4294">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<output>
<instance class-name="Group" event-id="0"
qualified-src-dn="C=US\O=BASF_CORP\OU=Tomcat-Roles\CN=admin"
src-dn="\FP-NA-DEVL\US\BASF_CORP\Tomcat-Roles\admin"
src-entry-id="33866"/>
<instance class-name="Group" event-id="0"
qualified-src-dn="C=US\O=BASF_CORP\OU=GEISMAR\OU=Tomcat-Roles\CN=admin"
src-dn="\FP-NA-DEVL\US\BASF_CORP\GEISMAR\Tomcat-Roles\admin"
src-entry-id="32858"/>
<status event-id="0" level="success"></status>
</output>
</nds>
Generic Loopback PT: Token Value: {@qualified-src-dn =
"C=US\O=BASF_CORP\OU=Tomcat-Roles\CN=admin",@qualified-src-dn =
"C=US\O=BASF_CORP\OU=GEISMAR\OU=Tomcat-Roles\CN=admin"}
Generic Loopback PT: Arg Value: {@qualified-src-dn =
"C=US\O=BASF_CORP\OU=Tomcat-Roles\CN=admin",@qualified-src-dn =
"C=US\O=BASF_CORP\OU=GEISMAR\OU=Tomcat-Roles\CN=admin"}.
Generic Loopback PT: Action:
do-set-local-variable("lvGroupCount",token-xpath("count($lvGroupNodeSet)")).
Generic Loopback PT: arg-string(token-xpath("count($lvGroupNodeSet)"))
Generic Loopback PT: token-xpath("count($lvGroupNodeSet)")
Generic Loopback PT: Token Value: "18".
Generic Loopback PT: Arg Value: "18".
Generic Loopback PT: Action: do-if().
Generic Loopback PT: Evaluating conditions.
Generic Loopback PT: (if-local-variable 'lvGroupCount' equal "0") =
FALSE.
Generic Loopback PT: Performing else actions.
Generic Loopback PT: Action:
do-for-each(arg-node-set(token-local-variable("lvGroupNodeSet"))).
Generic Loopback PT:
arg-node-set(token-local-variable("lvGroupNodeSet"))
Generic Loopback PT: token-local-variable("lvGroupNodeSet")
Generic Loopback PT: Token Value: {@qualified-src-dn =
"C=US\O=BASF_CORP\OU=Tomcat-Roles\CN=admin",@qualified-src-dn =
"C=US\O=BASF_CORP\OU=GEISMAR\OU=Tomcat-Roles\CN=admin"}.
Generic Loopback PT: Arg Value: {@qualified-src-dn =
"C=US\O=BASF_CORP\OU=Tomcat-Roles\CN=admin",@qualified-src-dn =
"C=US\O=BASF_CORP\OU=GEISMAR\OU=Tomcat-Roles\CN=admin"}.
Generic Loopback PT: Performing actions for
local-variable(current-node) = @qualified-src-dn =
"C=US\O=BASF_CORP\OU=Tomcat-Roles\CN=admin".
Generic Loopback PT: Action: do-trace-message("Group =
"+token-local-variable("current-node")).
Generic Loopback PT: arg-string("Group =
"+token-local-variable("current-node"))
Generic Loopback PT: token-text("Group = ")
Generic Loopback PT: token-local-variable("current-node")
Generic Loopback PT: Token Value:
"C=US\O=BASF_CORP\OU=Tomcat-Roles\CN=admin".
Generic Loopback PT: Arg Value: "Group =
C=US\O=BASF_CORP\OU=Tomcat-Roles\CN=admin".
Generic Loopback PT:Group = C=US\O=BASF_CORP\OU=Tomcat-Roles\CN=admin
Generic Loopback PT: Performing actions for
local-variable(current-node) = @qualified-src-dn =
"C=US\O=BASF_CORP\OU=GEISMAR\OU=Tomcat-Roles\CN=admin".
Generic Loopback PT: Action: do-trace-message("Group =
"+token-local-variable("current-node")).
Generic Loopback PT: arg-string("Group =
"+token-local-variable("current-node"))
Generic Loopback PT: token-text("Group = ")
Generic Loopback PT: token-local-variable("current-node")
Generic Loopback PT: Token Value:
"C=US\O=BASF_CORP\OU=GEISMAR\OU=Tomcat-Roles\CN=admin".
Generic Loopback PT: Arg Value: "Group =
C=US\O=BASF_CORP\OU=GEISMAR\OU=Tomcat-Roles\CN=admin".
Generic Loopback PT:Group =
C=US\O=BASF_CORP\OU=GEISMAR\OU=Tomcat-Roles\CN=admin
Generic Loopback PT: Action:
do-set-local-variable("lvMsgBody",scope="policy",token-join(";",csv="true")+token-xpath("$lvGroupNodeSet/@qualified-src-dn")).
Generic Loopback PT:
arg-string(token-join(";",csv="true")+token-xpath("$lvGroupNodeSet/@qualified-src-dn"))
Generic Loopback PT: token-join(";",csv="true")
Generic Loopback PT: token-join(";",csv="true")
Generic Loopback PT: Arg Value: {}.
Generic Loopback PT: Token Value: "".
Generic Loopback PT: token-xpath("$lvGroupNodeSet/@qualified-src-dn")
Generic Loopback PT: Token Value: "".
Generic Loopback PT: Arg Value: "".


--
queenw
------------------------------------------------------------------------
queenw's Profile: http://forums.novell.com/member.php?userid=31932
View this thread: http://forums.novell.com/showthread.php?t=364002