i am working with adding xml-elements to nds-documents in the event
transformation to distinguish between modify-events which set
logindisabled to true | false.
xml-elements have the advantage, that they can be used in my case
(interlaced dirxml-script and xls) for local-variables can not be passed
to stylesheets. i can handle synthtetic add, but when a match is found
in the matching policies it comes to a merge of values and my
xml-element is gone.
in order to prevent that i added the policy for "re-enabling" of a user
(when disable)

user:
logindisabled=changing-to TRUE > add to notes noaccess-group, remove
association
logindisabled=changing-to FALSE > remove from notes noaccess-group

event transformation sets xml-elements: disable-element or
enable-element, when modify-operation changes logindisabled-attribute or
membership of a defined group (notes-user-group in eDir)
if the user is "disabled" (by one of these two means) due to the
existing association my xml-element wanders through to the
command-transformation policies where a xsl-files takes care of it.
if the user is "re-enabled" the modify traverses matching (no
association anymore) policies and getīs changed to a synthetic add. if a
match is found that results in a merge of values (another new type of
nds-document). so in that case i set a local variable in EVT, which
leads to (if present) in the command transformation to adding the
xml-element before the stylesheet is processed.

this is working, but not very elegantly crafted. it would be much
easier to define a local-variable in the EVT, which is valued 0/1 and
work with that later-on dirxml-wise.
but: how? can somebody help me simplify the policies (resp. hint me
through it ?


hereīs my xsl:
---------------------------------------------------------------------------------------------

<xsl:template match="input//*[@class-name='User']">
<xsl:choose>
<xsl:when test="disable-element">
<xsl:variable name="noaccess-group"
select="'~gcv-driver-noaccessgroup~'"/>
<xsl:variable name="setup-notes-group-query">
<xsl:call-template name="setup-notes-group-query">
<xsl:with-param
name="object-name-noaccess-group" select="$noaccess-group"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="query-instances-group"
select="query:query($destQueryProcessor,$setup-notes-group-query)//instance"/>-->
<xsl:variable name="grpassoc"
select="string($query-instances-group/association)"/>
<xsl:variable name="userassoc" select="association"/>
<xsl:variable name="usersrcdn" select="@src-dn"/>
<modify>
<xsl:attribute
name="class-name">Group</xsl:attribute>
<association state="associated">
<xsl:value-of select="$grpassoc"/>
</association>
<modify-attr attr-name="Member">
<add-value>
<value type="dn">
<xsl:attribute name="association-ref">
<xsl:value-of
select="$userassoc"/>
</xsl:attribute>
<xsl:value-of select="$usersrcdn"/>
</value>
</add-value>
</modify-attr>
</modify>
</xsl:when>
<xsl:when test="enable-element">
<xsl:variable name="noaccess-group"
select="'~gcv-driver-noaccessgroup~'"/>
<xsl:variable name="setup-notes-group-query">
<xsl:call-template name="setup-notes-group-query">
<xsl:with-param
name="object-name-noaccess-group" select="$noaccess-group"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="query-instances-group"
select="query:query($destQueryProcessor,$setup-notes-group-query)//instance"/>-->
<xsl:variable name="grpassoc"
select="string($query-instances-group/association)"/>
<xsl:variable name="userassoc" select="association"/>
<xsl:variable name="usersrcdn" select="@src-dn"/>
<modify>
<xsl:attribute
name="class-name">Group</xsl:attribute>
<association state="associated">
<xsl:value-of select="$grpassoc"/>
</association>
<modify-attr attr-name="Member">
<remove-value>
<value type="dn">
<xsl:attribute name="association-ref">
<xsl:value-of
select="$userassoc"/>
</xsl:attribute>
<xsl:value-of select="$usersrcdn"/>
</value>
</remove-value>
</modify-attr>
</modify>
</xsl:when>
<xsltherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsltherwise>
</xsl:choose>
</xsl:template>
<!--
================================================== ============================== -->
<!--TEMPLATE "setup-Notes-Group-query -->
<!--
================================================== ============================== -->
<xsl:template name="setup-notes-group-query">
<xslaram name="object-name-noaccess-group"/>
<!-- build an xds query as a result tree fragment -->
<nds dtdversion="1.0" ndsversion="8.5">
<input>
<query>
<search-class class-name="Group"/>
<search-attr attr-name="ListName">
<value>
<xsl:value-of
select="$object-name-noaccess-group"/>
</value>
</search-attr>
<!-- put an empty read attribute in so that we
don't get the whole object back -->
<read-attr attr-name="Members"/>
</query>
</input>
</nds>
</xsl:template>


--
florianz
------------------------------------------------------------------------
florianz's Profile: http://forums.novell.com/member.php?userid=210
View this thread: http://forums.novell.com/showthread.php?t=351903