I am attempting to populae an attribute in eDirectory that looks like
the following:
<add-attr attr-name="pplAppData">
<component name="AppName">AMS</component>
<component name="Role">AMS Admin</component>
<component name="Account">JoeUserName</component>
<component name="Type">Application</component>
<component name="Location">NA</component>
</add-attr>

My policy code is as follows:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE policy PUBLIC
"policy-builder-dtd" "C:\Program
Files\Novell\Designer\plugins\com.novell.idm.polic ybuilder_3.5.0.200909160331\DTD\dirxmlscript3.6.1. dtd"><policy>
<rule>
<description>Build App Attr</description>
<conditions>
<and>
<if-op-attr name="pplApplication" op="available"/>
</and>
</conditions>
<actions>
<do-set-local-variable name="pplAppInfo" scope="policy">
<arg-string>
<token-op-attr name="pplApplication"/>
<token-text xml:space="preserve">;</token-text>
<token-op-attr name="pplApplicationRole"/>
<token-text xml:space="preserve">;</token-text>
<token-op-attr name="pplAppAccount"/>
<token-text xml:space="preserve">;</token-text>
<token-op-attr name="pplAppType"/>
<token-text xml:space="preserve">;</token-text>
<token-op-attr name="pplAppLocation"/>
</arg-string>
</do-set-local-variable>
<do-set-local-variable name="pplAppInfohdrs" scope="policy">
<arg-string>
<token-text
xml:space="preserve">AppName;Role;Account;Type;Loc ation</token-text>
</arg-string>
</do-set-local-variable>
<do-strip-op-attr name="pplApplication"/>
<do-strip-op-attr name="pplApplicationRole"/>
<do-strip-op-attr name="pplAppAccount"/>
<do-strip-op-attr name="pplAppType"/>
<do-strip-op-attr name="pplAppLocation"/>
<do-append-xml-element expression="../add" name="add-attr"/>
<do-set-xml-attr expression="../add/add-attr" name="attr-name">
<arg-string>
<token-text xml:space="preserve">pplAppData</token-text>
</arg-string>
</do-set-xml-attr>
<do-for-each>
<arg-node-set>
<token-split csv="false" delimiter=";">
<token-local-variable name="pplAppInfohdrs"/>
</token-split>
</arg-node-set>
<arg-actions>
<do-append-xml-element
expression="../add/add-attr[@attr-name='pplAppData']"
name="component"/>
<do-set-xml-attr
expression="../add/add-attr/component[last()][last()]" name="name">
<arg-string>
<token-text xml:space="preserve">$current-node$</token-text>
</arg-string>
</do-set-xml-attr>
</arg-actions>
</do-for-each>
<do-for-each>
<arg-node-set>
<token-split csv="false" delimiter=";">
<token-local-variable name="pplAppInfo"/>
</token-split>
</arg-node-set>
<arg-actions>
<do-append-xml-text expression="../add/add-attr/component">
<arg-string>
<token-text xml:space="preserve">$current-node$</token-text>
</arg-string>
</do-append-xml-text>
</arg-actions>
</do-for-each>
</actions>
</rule>
</policy>

This yields the following output:

<input>
<add class-name="User" src-dn="\IDV-TREE\IDV\Users\117888">
<add-attr attr-name="pplAppData">
<component name="AppName">AMSAMS
AdminJoeUserNameApplicationNA</component>
<component name="Role">AMSAMS
AdminJoeUserNameApplicationNA</component>
<component name="Account">AMSAMS
AdminJoeUserNameApplicationNA</component>
<component name="Type">AMSAMS
AdminJoeUserNameApplicationNA</component>
<component name="Location">AMSAMS
AdminJoeUserNameApplicationNA</component>
</add-attr>
</add>
</input>

Please assist as soon as possible, thanks in advance...


--
tmcdident
------------------------------------------------------------------------
tmcdident's Profile: http://forums.novell.com/member.php?userid=85306
View this thread: http://forums.novell.com/showthread.php?t=414713