Novell Home

Synching One Source to Two Destinations in the Same Tree

Novell Cool Solutions: Tip

Digg This - Slashdot This

Posted: 11 Oct 2006
 

Problem

A Forum reader described the following situation:

"I want to sync one source to two destinations in the same tree, going one way, with one DirXML driver.

It's my understanding that the placement stylesheet contains only one dest-dn attribute that can be used to set one destination. How can I set 2 destinations in a placement stylesheet, or should that stylesheet have a new event to create another one?"

For example, \tree\O\srcDept\user1 would sync to
\tree\O\destDept\subDept1\user1 and
\tree\O\destDept\subDept2\user1 ..."

And here's some advice from Father Ramon ...

Solution

The way that is least likely to cause you problems is to use two drivers (or two sets of drivers in the case of an eDir-eDir connection).

You could also do something like this:

do-set-dest-dn(\tree\O\destDept\subDept2\user1)
do-clone-xpath(".", "..")
do-set-dest-dn(\tree\O\destDept\subDept1\user1)

It could also be done in a stylesheet, but exactly how would depend on the structure of your existing stylesheet. The basic idea is that you have to create another add that is a copy of the original and give it a different dest-dn. I would expect the template to look something like this:

<xsl:template match="add[@class-name="User]">
  <xsl:copy>
   <xsl:apply-templates select="@*"/>
    <xsl:attribute name="dest-dn">
     <!-- some code to generate and output the first dn ->
    </xsl:attribute>
   <xsl:apply-templates select="node()"/>
  </xsl:copy>
  <xsl:copy>
   <xsl:apply-templates select="@*"/>
    <xsl:attribute name="dest-dn">
     <!-- some code to generate and output the second dn ->
    </xsl:attribute>
   <xsl:apply-templates select="node()"/>
  </xsl:copy>
</xsl:template>


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell