I am trying to get the ldap dn of an object by way of query.

IDM 3.51 - eDir 8.7.3.10

Seems i just cant get the syntax right or something.

I have the value of a group return from an event "Group membership"

I want to take that value and do a entry search for the object then
pull the dn from the node set. I dont really need anything else from the
object

Im trying to pull the dn into SOURCE-DN then add it to another string
for ouput.

I intend on converting the dn to a proper LDAP syntax for output to a
log. <long story on that one>

MY CODE:
<do-if>
<arg-conditions>
<and>
<if-local-variable mode="nocase" name="DoLogAttribute"
op="equal">Group Membership</if-local-variable>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="SOURCE-DN" scope="policy">
<arg-node-set>
<token-query class-name="Group" datastore="src"
max-result-count="1" scope="entry">
<arg-dn>
<token-parse-dn dest-dn-format="src-dn" src-dn-format="slash">
<token-local-variable name="Dlookup"/>
</token-parse-dn>
</arg-dn>
<arg-string>
<token-text xml:space="preserve">Object Class</token-text>
</arg-string>
</token-query>
</arg-node-set>
</do-set-local-variable>
<do-set-local-variable name="SOURCE-DN" scope="policy">
<arg-string>
<token-xpath expression="$SOURCE-DN/@src-dn"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="Dlookup" scope="policy">
<arg-string>
<token-text xml:space="preserve">TEST,</token-text>
<token-local-variable name="current-node"/>
<token-text xml:space="preserve">,</token-text>
<token-local-variable name="SOURCE-DN"/>
<token-char value="10"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="DoLogItem" scope="policy">
<arg-string>
<token-xpath expression="es:fileWrite($Log_Change_File,
$Dlookup)"/>
</arg-string>
</do-set-local-variable>
</arg-actions>
<arg-actions/>
</do-if>

TRACE:

[12/20/10 05:29:58.906]:Auth2AuthMirror ST:
(if-local-variable 'DoLogAttribute' equal "Group Membership") = TRUE.
[12/20/10 05:29:58.906]:Auth2AuthMirror ST: Performing
if actions.
[12/20/10 05:29:58.907]:Auth2AuthMirror ST: Action:
do-set-local-variable("SOURCE-DN",scope="policy",arg-node-set(token-query(class-name="Group",datastore="src",max-result-count="1",scope="entry",arg-dn(token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))),"Object
Class"))).
[12/20/10 05:29:58.907]:Auth2AuthMirror ST:
arg-node-set(token-query(class-name="Group",datastore="src",max-result-count="1",scope="entry",arg-dn(token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))),"Object
Class"))
[12/20/10 05:29:58.908]:Auth2AuthMirror ST:
token-query(class-name="Group",datastore="src",max-result-count="1",scope="entry",arg-dn(token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))),"Object
Class")
[12/20/10 05:29:58.909]:Auth2AuthMirror ST:
arg-dn(token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup")))
[12/20/10 05:29:58.909]:Auth2AuthMirror ST:
token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))
[12/20/10 05:29:58.909]:Auth2AuthMirror ST:
token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))
[12/20/10 05:29:58.910]:Auth2AuthMirror ST:
token-local-variable("Dlookup")
[12/20/10 05:29:58.910]:Auth2AuthMirror ST:
Token Value: "".
[12/20/10 05:29:58.910]:Auth2AuthMirror ST:
Arg Value: "".
[12/20/10 05:29:58.911]:Auth2AuthMirror ST:
Token Value: "".
[12/20/10 05:29:58.911]:Auth2AuthMirror ST:
Arg Value: "".
[12/20/10 05:29:58.911]:Auth2AuthMirror ST:
DirXML Log Event -------------------
Driver: \B1ALPHA\net\bankone\DirXML\DriverSet\Auth2AuthMir ror
[12/20/10 05:29:58.907]:Auth2AuthMirror ST:
arg-node-set(token-query(class-name="Group",datastore="src",max-result-count="1",scope="entry",arg-dn(token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))),"Object
Class"))
[12/20/10 05:29:58.908]:Auth2AuthMirror ST:
token-query(class-name="Group",datastore="src",max-result-count="1",scope="entry",arg-dn(token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))),"Object
Class")
[12/20/10 05:29:58.909]:Auth2AuthMirror ST:
arg-dn(token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup")))
[12/20/10 05:29:58.909]:Auth2AuthMirror ST:
token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))
[12/20/10 05:29:58.909]:Auth2AuthMirror ST:
token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))
[12/20/10 05:29:58.910]:Auth2AuthMirror ST:
token-local-variable("Dlookup")
[12/20/10 05:29:58.910]:Auth2AuthMirror ST:
Token Value: "".
[12/20/10 05:29:58.910]:Auth2AuthMirror ST:
Arg Value: "".
[12/20/10 05:29:58.911]:Auth2AuthMirror ST:
Token Value: "".
[12/20/10 05:29:58.911]:Auth2AuthMirror ST:
Arg Value: "".
[12/20/10 05:29:58.911]:Auth2AuthMirror ST:
DirXML Log Event -------------------
Driver: \B1ALPHA\net\bankone\DirXML\DriverSet\Auth2AuthMir ror
Channel: Subscriber
Status: Error
Message: Code(-9145) Error in
vnd.nds.stream://B1ALPHA/net/bankone/DirXML/DriverSet/Auth2AuthMirror/Subscriber/Audit_Local#XmlData:139
: Unable to determine target object for action
'token-query(class-name="Group",datastore="src",max-result-count="1",scope="entry",arg-dn(token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))),"Object
Class")'.
[12/20/10 05:29:58.912]:Auth2AuthMirror ST:
DirXML Log Event -------------------
Driver: \B1ALPHA\net\bankone\DirXML\DriverSet\Auth2AuthMir ror
Channel: Subscriber
Status: Error
Message: Code(-9083) Error submitting event to subscriber:
Code(-9145) Error in
vnd.nds.stream://B1ALPHA/net/bankone/DirXML/DriverSet/Auth2AuthMirror/Subscriber/Audit_Local#XmlData:139
: Unable to determine target object for action
'token-query(class-name="Group",datastore="src",max-result-count="1",scope="entry",arg-dn(token-parse-dn(dest-dn-format="src-dn",src-dn-format="slash",token-local-variable("Dlookup"))),"Object
Class")'.
[12/20/10 05:29:58.915]:Auth2AuthMirror ST:Start transaction.
[12/20/10 05:29:58.915]:Auth2AuthMirror
ST:type(modify-entry)entry-id(35557)
dn(\T=B1ALPHA\dc=net\dc=bankone\OU=Groups\OU=ITR\C N=COEAdmins)
class-id(434) class-name(Group)
[12/20/10 05:29:58.916]:Auth2AuthMirror
ST:type(remove-value)Syntax=SYNTAX_CI_STRING,
attributeName=modifiersName,
string=CN=DSS0L234,dc=svr,dc=bankone,dc=net
[12/20/10 05:29:58.916]:Auth2AuthMirror
ST:type(add-value)Syntax=SYNTAX_CI_STRING, attributeName=modifiersName,
string=CN=admin,OU=Administration,dc=bankone,dc=ne t
[12/20/10 05:29:58.917]:Auth2AuthMirror
ST:type(add-value)Syntax=SYNTAX_DIST_NAME,
distName=\B1ALPHA\net\bankone\People\O019676
[12/20/10 05:29:58.917]:Auth2AuthMirror
ST:type(add-value)Syntax=SYNTAX_DIST_NAME,
distName=\B1ALPHA\net\bankone\People\O019676
[12/20/10 05:29:58.917]:Auth2AuthMirror ST:Processing events for
transaction.
[12/20/10 05:29:58.918]:Auth2AuthMirror ST:
<nds dtdversion="3.5" ndsversion="8.x">
<source>
<product version="3.5.11.20080307 ">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<modify cached-time="20101220052958.744Z" class-name="Group"
event-id="DSS0L234#20101220052958#2#2"
qualified-src-dn="dc=net\dc=bankone\OU=Groups\OU=ITR\CN=COEAdmin s"
src-dn="\B1ALPHA\net\bankone\Groups\ITR\COEAdmins" src-entry-id="35557"
timestamp="1292822998#10">
<modify-attr attr-name="modifiersName">
<remove-value>
<value timestamp="1292822986#16"
type="string">CN=DSS0L234,dc=svr,dc=bankone,dc=net </value>
</remove-value>
<add-value>
<value timestamp="1292822998#10"
type="string">CN=admin,OU=Administration,dc=bankon e,dc=net</value>
</add-value>
</modify-attr>
<modify-attr attr-name="Equivalent To Me">
<add-value>
<value timestamp="1292822998#8"
type="dn">\B1ALPHA\net\bankone\People\O019676</value>
</add-value>
</modify-attr>
<modify-attr attr-name="Member">
<add-value>
<value timestamp="1292822998#9"
type="dn">\B1ALPHA\net\bankone\People\O019676</value>
</add-value>
</modify-attr>
</modify>
</input>
</nds>


--
Dieseloreo
------------------------------------------------------------------------
Dieseloreo's Profile: http://forums.novell.com/member.php?userid=36110
View this thread: http://forums.novell.com/showthread.php?t=428522