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