ldapMOProfile.xsl revision 3215
619N/A<!--
619N/A ! CDDL HEADER START
619N/A !
619N/A ! The contents of this file are subject to the terms of the
619N/A ! Common Development and Distribution License, Version 1.0 only
619N/A ! (the "License"). You may not use this file except in compliance
619N/A ! with the License.
619N/A !
619N/A ! You can obtain a copy of the license at
619N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
619N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
619N/A ! See the License for the specific language governing permissions
619N/A ! and limitations under the License.
619N/A !
619N/A ! When distributing Covered Code, include this CDDL HEADER in each
619N/A ! file and include the License file at
619N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
619N/A ! add the following below this CDDL HEADER, with the fields enclosed
619N/A ! by brackets "[]" replaced with your own identifying information:
619N/A ! Portions Copyright [yyyy] [name of copyright owner]
619N/A !
619N/A ! CDDL HEADER END
619N/A !
619N/A !
619N/A ! Copyright 2008 Sun Microsystems, Inc.
619N/A ! -->
619N/A<xsl:stylesheet version="1.0"
619N/A xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
619N/A xmlns:adm="http://www.opends.org/admin"
619N/A xmlns:ldap="http://www.opends.org/admin-ldap">
619N/A <xsl:import href="java-utilities.xsl" />
619N/A <xsl:import href="preprocessor.xsl" />
619N/A <xsl:import href="property-types.xsl" />
619N/A <xsl:output method="text" encoding="us-ascii" />
619N/A <!--
619N/A Document parsing.
619N/A -->
619N/A <xsl:template match="/">
619N/A <xsl:if
619N/A test="not($this/adm:profile[@name='ldap']/ldap:object-class/ldap:name) and not($this-is-root)">
619N/A <xsl:message terminate="yes">
619N/A <xsl:value-of
619N/A select="concat('No object class found for managed object definition ', $this-name)" />
619N/A </xsl:message>
619N/A </xsl:if>
619N/A <xsl:value-of
619N/A select="concat('objectclass=',
619N/A normalize-space($this/adm:profile[@name='ldap']/ldap:object-class/ldap:name),
619N/A '&#xa;')" />
619N/A <xsl:for-each select="$this-all-properties">
619N/A <xsl:sort select="@name" />
619N/A <xsl:if
619N/A test="not(adm:profile[@name='ldap']/ldap:attribute/ldap:name)">
619N/A <xsl:message terminate="yes">
619N/A <xsl:value-of
619N/A select="concat('No attribute type found for property ', @name, ' in managed object definition ', $this-name)" />
619N/A </xsl:message>
619N/A </xsl:if>
619N/A <xsl:value-of
619N/A select="concat('attribute.',
619N/A normalize-space(@name),
619N/A '=',
619N/A normalize-space(adm:profile[@name='ldap']/ldap:attribute/ldap:name),
619N/A '&#xa;')" />
619N/A </xsl:for-each>
619N/A <xsl:for-each select="$this-all-relations">
619N/A <xsl:sort select="@name" />
619N/A <xsl:if test="not(adm:profile[@name='ldap']/ldap:rdn-sequence)">
619N/A <xsl:message terminate="yes">
619N/A <xsl:value-of
619N/A select="concat('No RDN sequence found for relation ', @name, ' in managed object definition ', $this-name)" />
619N/A </xsl:message>
619N/A </xsl:if>
619N/A <xsl:value-of
619N/A select="concat('rdn.',
619N/A normalize-space(@name),
619N/A '=',
619N/A normalize-space(adm:profile[@name='ldap']/ldap:rdn-sequence),
619N/A '&#xa;')" />
619N/A <xsl:choose>
619N/A <xsl:when
619N/A test="adm:profile[@name='ldap']/ldap:naming-attribute">
619N/A <xsl:if test="not(adm:one-to-many)">
619N/A <xsl:message terminate="yes">
619N/A <xsl:value-of
624N/A select="concat('Naming attribute specified for relation ',
624N/A @name, ' in managed object definition ',
619N/A $this-name, ' which is not a one-to-many relation.')" />
619N/A </xsl:message>
619N/A </xsl:if>
619N/A <xsl:if test="adm:one-to-many/@naming-property">
619N/A <xsl:message terminate="yes">
619N/A <xsl:value-of
619N/A select="concat('Naming attribute specified for one-to-many relation ',
619N/A @name, ' in managed object definition ',
619N/A $this-name, ' which uses a naming property.')" />
619N/A </xsl:message>
619N/A </xsl:if>
619N/A <xsl:value-of
619N/A select="concat('naming-attribute.',
619N/A normalize-space(@name),
619N/A '=',
619N/A normalize-space(adm:profile[@name='ldap']/ldap:naming-attribute),
619N/A '&#xa;')" />
619N/A </xsl:when>
619N/A <xsl:otherwise>
619N/A <xsl:value-of
619N/A select="concat('naming-attribute.', normalize-space(@name), '=cn&#xa;')" />
619N/A </xsl:otherwise>
619N/A </xsl:choose>
619N/A </xsl:for-each>
619N/A </xsl:template>
619N/A</xsl:stylesheet>
619N/A