We assign templates based on departments. The vault needs two pieces of
information to build an eDir account. It needs the attribute
eDIRContainerLocation and ProcessLevel.


The eDirContainerLocation is root\branch\location\users
The ProcessLevel is 11000

Both values come from a location object that tell where to built the
user object.

In eDIR the template is name ProcessLevel-TEMPLATE. But there is also a
Default template called USER TEMPLATE01.

I need to write code that searches for the template name
root\branch\users\ProcessLevel-TEMPLATE
This is the dn.

If it finds it set the template dn to that name.
If it does not set the template dn to USER TEMPLATE01

The code to set the template is fine but the search does not produce
results regardless of if the template is there or not.

<rule>
<description>Check for Template Name</description>
<comment name="author"
xml:space="preserve">tussat@Flagstar.com</comment>
<comment name="version" xml:space="preserve">1.01</comment>
<comment name="lastchanged"
xml:space="preserve">2008-06-19</comment>
<conditions>
<and>
<if-class-name op="equal">User</if-class-name>
</and>
</conditions>
<actions>
<do-set-local-variable name="lv-process-level">
<arg-string>
<token-src-attr name="fsbProcessLevel"/>
</arg-string>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-local-variable name="lv-process-level" op="available"/>
</and>
</arg-conditions>
<arg-actions>
<do-set-local-variable name="lv-template-name">
<arg-string>
<token-src-attr name="fsbFSNETContainerLocation"/>
<token-text xml:space="preserve">\</token-text>
<token-src-attr name="fsbProcessLevel"/>
<token-text xml:space="preserve">-TEMPLATE</token-text>
</arg-string>
</do-set-local-variable>
<do-trace-message level="2">
<arg-string>
<token-text xml:space="preserve">THE TEMPLATE IAM IS SEARCHING
FOR IS --></token-text>
<token-local-variable name="lv-template-name"/>
</arg-string>
</do-trace-message>
</arg-actions>
</do-if>
<do-set-local-variable name="TemplateQueryResult">
<arg-node-set>
<token-query scope="entry">
<arg-match-attr name="dn">
<arg-value>
<token-local-variable name="lv-template-name"/>
</arg-value>
</arg-match-attr>
</token-query>
</arg-node-set>
</do-set-local-variable>
<do-if>
<arg-conditions>
<and>
<if-xpath op="true">count($TemplateQueryResult) = 1</if-xpath>
</and>
</arg-conditions>
<arg-actions>
<do-trace-message level="2">
<arg-string>
<token-text xml:space="preserve">SETTING PROCESS LEVEL
TEMPLATE</token-text>
</arg-string>
</do-trace-message>
</arg-actions>
<arg-actions/>
</do-if>
<do-if>
<arg-conditions>
<and>
<if-xpath op="true">count($TemplateQueryResult) != 1</if-xpath>
</and>
</arg-conditions>
<arg-actions>
<do-trace-message level="2">
<arg-string>
<token-text xml:space="preserve">SETTING DEFAULT
TEMPLATE</token-text>
</arg-string>
</do-trace-message>
</arg-actions>
<arg-actions/>
</do-if>
</actions>
</rule>


--
tussat
------------------------------------------------------------------------
tussat's Profile: http://forums.novell.com/member.php?userid=9882
View this thread: http://forums.novell.com/showthread.php?t=333930