cliMOProfile.xsl revision 1530
1530N/A<!--
1530N/A ! CDDL HEADER START
1530N/A !
1530N/A ! The contents of this file are subject to the terms of the
1530N/A ! Common Development and Distribution License, Version 1.0 only
1530N/A ! (the "License"). You may not use this file except in compliance
1530N/A ! with the License.
1530N/A !
1530N/A ! You can obtain a copy of the license at
1530N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
1530N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
1530N/A ! See the License for the specific language governing permissions
1530N/A ! and limitations under the License.
1530N/A !
1530N/A ! When distributing Covered Code, include this CDDL HEADER in each
1530N/A ! file and include the License file at
1530N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
1530N/A ! add the following below this CDDL HEADER, with the fields enclosed
1530N/A ! by brackets "[]" replaced with your own identifying information:
1530N/A ! Portions Copyright [yyyy] [name of copyright owner]
1530N/A !
1530N/A ! CDDL HEADER END
1530N/A !
1530N/A !
1530N/A ! Portions Copyright 2007 Sun Microsystems, Inc.
1530N/A ! -->
1530N/A<xsl:stylesheet version="1.0"
1530N/A xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1530N/A xmlns:adm="http://www.opends.org/admin"
1530N/A xmlns:cli="http://www.opends.org/admin-cli">
1530N/A <xsl:import href="preprocessor.xsl" />
1530N/A <xsl:output method="text" encoding="us-ascii" />
1530N/A <!--
1530N/A Document parsing.
1530N/A -->
1530N/A <xsl:template match="/">
1530N/A <!--
1530N/A Process each relation definition.
1530N/A -->
1530N/A <xsl:for-each select="$this-all-relations">
1530N/A <xsl:sort select="@name" />
1530N/A <!--
1530N/A Generate list of properties which should be displayed by default in list-xxx operations.
1530N/A -->
1530N/A <xsl:value-of
1530N/A select="concat('relation.', @name, '.list-properties=')" />
1530N/A <xsl:for-each
1530N/A select="adm:profile[@name='cli']/cli:relation/cli:default-property">
1530N/A <xsl:value-of select="@name" />
1530N/A <xsl:if test="current() != last()">
1530N/A <xsl:value-of select="','" />
1530N/A </xsl:if>
1530N/A </xsl:for-each>
1530N/A <xsl:value-of select="'&#xa;'" />
1530N/A <xsl:if test="adm:one-to-many">
1530N/A <!--
1530N/A Generate operand names for one-to-many relations.
1530N/A -->
1530N/A <xsl:variable name="operand">
1530N/A <xsl:choose>
1530N/A <xsl:when
1530N/A test="adm:profile[@name='cli']/cli:relation/@operand-name">
1530N/A <xsl:value-of
1530N/A select="adm:profile[@name='cli']/cli:relation/@operand-name" />
1530N/A </xsl:when>
1530N/A <xsl:otherwise>
1530N/A <xsl:if test="not($this-is-root)">
1530N/A <xsl:message>
1530N/A <xsl:value-of
1530N/A select="concat('relation ', @name, ' in managed object definition ', $this-name,' does not specify a CLI operand name, defaulting to NAME.')" />
1530N/A </xsl:message>
1530N/A </xsl:if>
1530N/A <xsl:value-of select="'NAME'" />
1530N/A </xsl:otherwise>
1530N/A </xsl:choose>
1530N/A </xsl:variable>
1530N/A <xsl:value-of
1530N/A select="concat('relation.', @name, '.operand-name=', $operand, '&#xa;')" />
1530N/A </xsl:if>
1530N/A </xsl:for-each>
1530N/A </xsl:template>
1530N/A</xsl:stylesheet>