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