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