messagesMO.xsl revision 1548
3112N/A<!--
3112N/A ! CDDL HEADER START
3112N/A !
3112N/A ! The contents of this file are subject to the terms of the
3112N/A ! Common Development and Distribution License, Version 1.0 only
3112N/A ! (the "License"). You may not use this file except in compliance
3112N/A ! with the License.
3112N/A !
3112N/A ! You can obtain a copy of the license at
3112N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE
3112N/A ! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
3112N/A ! See the License for the specific language governing permissions
3112N/A ! and limitations under the License.
3112N/A !
3112N/A ! When distributing Covered Code, include this CDDL HEADER in each
3112N/A ! file and include the License file at
3112N/A ! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
3112N/A ! add the following below this CDDL HEADER, with the fields enclosed
3112N/A ! by brackets "[]" replaced with your own identifying information:
3112N/A ! Portions Copyright [yyyy] [name of copyright owner]
3112N/A !
3112N/A ! CDDL HEADER END
3112N/A !
4251N/A !
3112N/A ! Portions Copyright 2007 Sun Microsystems, Inc.
4458N/A ! -->
4458N/A<xsl:stylesheet version="1.0"
4458N/A xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4458N/A xmlns:adm="http://www.opends.org/admin"
3832N/A xmlns:ldap="http://www.opends.org/admin-ldap">
3832N/A <xsl:import href="java-utilities.xsl" />
4458N/A <xsl:import href="preprocessor.xsl" />
3832N/A <xsl:import href="property-types.xsl" />
3832N/A <xsl:output method="text" encoding="us-ascii" />
4458N/A <!--
3832N/A Document parsing.
4714N/A -->
4458N/A <xsl:template match="/">
4714N/A <!--
4251N/A Generate user friendly names.
4714N/A -->
4714N/A <xsl:value-of
4251N/A select="concat('user-friendly-name=', $this-ufn, '&#xa;')" />
4616N/A <xsl:value-of
3832N/A select="concat('user-friendly-plural-name=', $this-ufpn, '&#xa;')" />
4458N/A <!--
4458N/A Pull out the managed object synopsis (mandatory).
4458N/A -->
4458N/A <xsl:if test="not($this/adm:synopsis)">
4458N/A <xsl:message terminate="yes">
4458N/A <xsl:value-of
4458N/A select="concat('No synopsis found for managed object definition ', $this-name)" />
4495N/A </xsl:message>
4495N/A </xsl:if>
4495N/A <xsl:value-of
4495N/A select="concat('synopsis=', normalize-space($this/adm:synopsis), '&#xa;')" />
4495N/A <!--
4495N/A Pull out the managed object description (optional).
4458N/A -->
4458N/A <xsl:if test="$this/adm:description">
4458N/A <xsl:value-of
4458N/A select="concat('description=', normalize-space($this/adm:description), '&#xa;')" />
4458N/A </xsl:if>
4714N/A <!--
4714N/A Process tag definitions if this is the root configuration.
4714N/A -->
4458N/A <xsl:if test="$this-is-root">
4458N/A <xsl:for-each select="$this/adm:tag-definition">
4458N/A <xsl:sort select="@name" />
4495N/A <xsl:value-of
4458N/A select="concat('tag.', @name, '.synopsis=', normalize-space(adm:synopsis), '&#xa;')" />
4458N/A </xsl:for-each>
4458N/A </xsl:if>
4458N/A <!--
4458N/A Process each property definition.
4458N/A -->
4458N/A <xsl:for-each select="$this-all-properties">
4458N/A <xsl:sort select="@name" />
4458N/A <!--
4458N/A Pull out the property definition synopsis (mandatory).
4458N/A -->
4458N/A <xsl:if test="not(adm:synopsis)">
4458N/A <xsl:message terminate="yes">
4458N/A <xsl:value-of
880N/A select="concat('No synopsis found for property ', @name, ' in managed object definition ', $this-name)" />
4714N/A </xsl:message>
4714N/A </xsl:if>
4714N/A <xsl:value-of
4714N/A select="concat('property.', normalize-space(@name), '.synopsis=', normalize-space(adm:synopsis), '&#xa;')" />
3832N/A <!--
4458N/A Pull out the property definition description (optional).
4458N/A -->
4458N/A <xsl:if test="adm:description">
4458N/A <xsl:value-of
4458N/A select="concat('property.', normalize-space(@name), '.description=', normalize-space(adm:description), '&#xa;')" />
4458N/A </xsl:if>
900N/A <!--
4458N/A Process alias default behavior synopsis.
900N/A -->
927N/A <xsl:if test="adm:default-behavior/adm:alias">
900N/A <xsl:if
4714N/A test="not(adm:default-behavior/adm:alias/adm:synopsis)">
3832N/A <xsl:message terminate="yes">
4495N/A <xsl:value-of
4714N/A select="concat('No alias default behavior synopsis found for property ', @name, ' in managed object definition ', $this-name)" />
4458N/A </xsl:message>
4714N/A </xsl:if>
4495N/A <xsl:value-of
4458N/A select="concat('property.', normalize-space(@name), '.default-behavior.alias.synopsis=', normalize-space(adm:default-behavior/adm:alias/adm:synopsis), '&#xa;')" />
4495N/A </xsl:if>
4459N/A <!--
4459N/A Process requires admin action (other) synopsis.
4631N/A -->
<xsl:if test="adm:requires-admin-action/adm:other">
<xsl:if
test="not(adm:requires-admin-action/adm:other/adm:synopsis)">
<xsl:message terminate="yes">
<xsl:value-of
select="concat('No requires admin action (other) synopsis found for property ', @name, ' in managed object definition ', $this-name)" />
</xsl:message>
</xsl:if>
<xsl:value-of
select="concat('property.', normalize-space(@name), '.requires-admin-action.other.synopsis=', normalize-space(adm:requires-admin-action/adm:other/adm:synopsis), '&#xa;')" />
</xsl:if>
<!--
Process syntax related descriptions.
-->
<xsl:choose>
<xsl:when test="adm:syntax/adm:integer">
<!--
Process integer syntax unit synopsis (optional).
-->
<xsl:if test="adm:syntax/adm:integer/adm:synopsis">
<xsl:value-of
select="concat('property.', normalize-space(@name), '.syntax.integer.unit-synopsis=', normalize-space(adm:syntax/adm:integer/adm:synopsis), '&#xa;')" />
</xsl:if>
</xsl:when>
<xsl:when test="adm:syntax/adm:string/adm:pattern">
<!--
Process string syntax pattern synopsis (mandatory if pattern defined).
-->
<xsl:if
test="not(adm:syntax/adm:string/adm:pattern/adm:synopsis)">
<xsl:message terminate="yes">
<xsl:value-of
select="concat('No string pattern synopsis found for property ', @name, ' in managed object definition ', $this-name)" />
</xsl:message>
</xsl:if>
<xsl:value-of
select="concat('property.', normalize-space(@name), '.syntax.string.pattern.synopsis=', normalize-space(adm:syntax/adm:string/adm:pattern/adm:synopsis), '&#xa;')" />
</xsl:when>
<xsl:when test="adm:syntax/adm:enumeration">
<!--
Process enumeration value synopsis (mandatory).
-->
<xsl:for-each select="adm:syntax/adm:enumeration/adm:value">
<xsl:sort select="@name" />
<xsl:if test="not(adm:synopsis)">
<xsl:message terminate="yes">
<xsl:value-of
select="concat('No synopsis found for enumeration value ', @name, ' for property ', ../../../@name, ' in managed object definition ', $this-name)" />
</xsl:message>
</xsl:if>
<xsl:value-of
select="concat('property.', normalize-space(../../../@name), '.syntax.enumeration.value.', @name,'.synopsis=', normalize-space(adm:synopsis), '&#xa;')" />
</xsl:for-each>
</xsl:when>
</xsl:choose>
</xsl:for-each>
<!--
Process each relation definition.
-->
<xsl:for-each select="$this-all-relations">
<xsl:sort select="@name" />
<!--
Generate user friendly names.
-->
<xsl:value-of
select="concat('relation.', normalize-space(@name), '.user-friendly-name=')" />
<xsl:call-template name="name-to-ufn">
<xsl:with-param name="value" select="@name" />
</xsl:call-template>
<xsl:value-of select="'&#xa;'" />
<xsl:if test="adm:one-to-many">
<xsl:value-of
select="concat('relation.', normalize-space(@name), '.user-friendly-plural-name=')" />
<xsl:call-template name="name-to-ufn">
<xsl:with-param name="value"
select="adm:one-to-many/@plural-name" />
</xsl:call-template>
<xsl:value-of select="'&#xa;'" />
</xsl:if>
<!--
Pull out the relation definition synopsis (mandatory).
-->
<xsl:if test="not(adm:synopsis)">
<xsl:message terminate="yes">
<xsl:value-of
select="concat('No synopsis found for relation ', @name, ' in managed object definition ', $this-name)" />
</xsl:message>
</xsl:if>
<xsl:value-of
select="concat('relation.', normalize-space(@name), '.synopsis=', normalize-space(adm:synopsis), '&#xa;')" />
<!--
Pull out the relation definition description (optional).
-->
<xsl:if test="adm:description">
<xsl:value-of
select="concat('relation.', normalize-space(@name), '.description=', normalize-space(adm:description), '&#xa;')" />
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>