Novell Home

Example Stylesheets to Help with AD eDirectory Mapping

Novell Cool Solutions: Trench
By Sylvain Maertchik

Digg This - Slashdot This

Posted: 11 Sep 2003
 

The Problem

The Default ADdriver setup does not synchronize organizations and OU between AD and eDirectory. How do I map Organization between Active Directory and eDirectory with DirXML?

The Solution

First set the placement rules for the Organization and OU classes. Then use the following Stylesheet to modify the Dest-dn: Remove the \Acme\com that correspond to the DC=Acme,DC=com

Some Sample Code

ADD driver Suscriber Placement Rule

<?xml version="1.0" encoding="UTF-8"?>
<placement-rules dest-dn-format="ldap" src-dn-format="slash">
  <placement-rule description="Users">
    <match-class class-name="User"/>
    <placement>
      <copy-path-suffix/>,dc=acme,dc=com</placement>
  </placement-rule>
  <placement-rule description="ou">
    <match-class class-name="Organizational Unit"/>
    <placement>
      <copy-path-suffix/>,dc=acme,dc=com</placement>
  </placement-rule>
  <placement-rule description="O">
    <match-class class-name="Organization"/>
    <placement>O=<copy-name/>,dc=acme,dc=com</placement>
  </placement-rule>
</placement-rules>

ADD driver Publisher Placement Rule

<?xml version="1.0" encoding="UTF-8"?>
<placement-rules dest-dn-format="slash" src-dn-format="ldap">
  <placement-rule description="O">
    <match-class class-name="Organization"/>
    <placement>\Acme\<copy-path-suffix/>
    </placement>
  </placement-rule>
  <placement-rule description="OU">
    <match-class class-name="Organizational Unit"/>
    <placement>\Acme\<copy-path-suffix/>
    </placement>
  </placement-rule>
  <placement-rule description="User">
    <match-class class-name="User"/>
    <placement>
      <copy-path/>
    </placement>
  </placement-rule>
</placement-rules>

ADD driver Transformation Rule appended to publisher placement rule

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <!-- This is for testing the stylesheet outside of DirXML so things are pretty to look at -->
  <xsl:strip-space elements="*"/>
  <xsl:preserve-space elements="association add-association remove-association value component password check-password"/>
  <xsl:output indent="yes" method="xml"/>
  <xsl:template match="add[@class-name='User']">
    <add class-name="User">
      <xsl:attribute name="dest-dn">
        <xsl:value-of select="substring-after(string(@dest-dn),'com\ACME\')"/>
      </xsl:attribute>
      <xsl:apply-templates/>
    </add>
  </xsl:template>
  <xsl:template match="add[@class-name='Organizational Unit']">
    <add class-name="Organizational Unit">
      <xsl:attribute name="dest-dn">
        <xsl:value-of select="substring-after(string(@dest-dn),'\Acme\com')"/>
      </xsl:attribute>
      <xsl:apply-templates/>
    </add>
  </xsl:template>
  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>

If you have questions about this solution, you can contact the author at Sylvain.Maertchik@TAKETHISOUTidsa.ch


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

© 2014 Novell