Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Event transmformation: OU modify to contained User Objects modify

10 views
Skip to first unread message

Stefan Völkel

unread,
Jan 26, 2004, 6:58:31 AM1/26/04
to
Hello,

I would like to replace a modify event on an attribute of an OU with
modify events of all contained Users.

I extended the Schema with an auxClass "quota" with two optional
attributes: quotaHome, quotaProfile (both integer). I add this class to an
OU to define default values for users. I this class to an User if I want
to override the default values:

OU Users
attr Users.quotaHome = 512
USER Users.joe
USER Users.max
attr Users.max.quotaHome = 1024

meaning joe would get a quota of 512 on his home drive, whereas max would
get 1014.

The query/override logic is implemented in a delimited text driver
(see Subject: Delimited Test Driver and ou attributes.)

Now if I change the quotaHomeattribute on the Users OU, I'd like to act as
if all Users beneath the OU were changed. Thus I can use my already
implemented default query logic.

This is what I added to my Transform rule:

<xsl:template match="modify[@class-name='Organizational Unit']">
<xsl:variable name="query">
<nds dtdversion="1.0" ndsversion="8.5">
<input>
<query class-name="User" dest-dn="{@src-dn}" scopy="subtree">
<search-class class-name="User"/>
<read-attr attr-name="uniqueID"/>
<read-attr attr-name="quotaHome"/>
<read-attr attr-name="quotaProfile"/>
</query>
</input>
</nds>
</xsl:variable>
<xsl:variable name="result" select="query:query($srcQueryProcessor,$query)"/>
<xsl:for-each select="$result/nds/output/instance">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>

which results in something like this:

<instance class-name="User" src-dn="\mytree\Users\svoelke" src-entry-id="36060">
<attr attr-name="uniqueID">
<value timestamp="1073571850#3" type="string">svoelke</value>
</attr>
<attr attr-name="quotaHome">
<value timestamp="1074779719#2" type="int">513</value>
</attr>
</instance>

But I am not sure on how to go on further from this. How do I create
modify events from the returned <output> document and apply my existing
default query template?

Thanks in advance
Stefan

Stefan Völkel

unread,
Jan 26, 2004, 10:06:15 AM1/26/04
to
On Mon, 26 Jan 2004 11:58:31 +0000, Stefan Völkel wrote:

> Hello,
>
> I would like to replace a modify event on an attribute of an OU with
> modify events of all contained Users.

After realizing that the output rule matches <instance>, not <modify> I
found that this sniplet does the trick:

<xsl:template match="modify[@class-name='Organizational Unit']">
<xsl:variable name="query">
<nds dtdversion="1.0" ndsversion="8.5">
<input>

<query class-name="User" dest-dn="{@src-dn}" scope="subtree">


<search-class class-name="User"/>
<read-attr attr-name="uniqueID"/>
<read-attr attr-name="quotaHome"/>
<read-attr attr-name="quotaProfile"/>
</query>
</input>
</nds>
</xsl:variable>
<xsl:variable name="result" select="query:query($srcQueryProcessor,$query)"/>

<xsl:copy-of select="$result//instance"/>
</xsl:template>

Stefan

Uwe Carsten Krause

unread,
Feb 1, 2004, 10:53:12 AM2/1/04
to
Hi Stefan,
 
just in english to give all the chance to read this.
 
First a comment on your point of entry:
 
you make a match on modify[@class-name='Organizational Unit']
 
Basicly you should implement an xsl:choose as well to test if there is an modify onyour attributes as well. Otherwise you will loose changes on modifications of other attributes.
 
Second: after you got the $result it would be a good idea the check all the instances an there currently applied quota and do a xdscmdprocessor command to write the info to eDir. You need the SrcCmdProcessor to get this because you are normaly on the Subscriber, right?
 
You can use a xsl:for-each or a named template which calls itself as long as there are instances left in $result.
 
if you have further questions contact me directly. Feel free to join our NUI Germany Community (www.nuinet.de)
 
Regs
 
Uwe
 
Kind regards
 
Uwe Carsten Krause
Maintainet AG
Zum Wartturm 9
63571 Gelnhausen
 
0 new messages