| | |
| | | <xsl:call-template name="generate-relation-constructor" /> |
| | | </xsl:for-each> |
| | | <!-- |
| | | Register any optins associated with this managed object definition. |
| | | --> |
| | | <xsl:if test="$this-is-advanced or $this-is-hidden"> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:text>
</xsl:text> |
| | | <xsl:value-of |
| | | select="' // Register the options associated with this managed object definition.
'" /> |
| | | <xsl:value-of select="' static {
'" /> |
| | | <xsl:if test="$this-is-advanced"> |
| | | <xsl:value-of |
| | | select="concat(' INSTANCE.registerOption(ManagedObjectOption.ADVANCED);
')" /> |
| | | </xsl:if> |
| | | <xsl:if test="$this-is-hidden"> |
| | | <xsl:value-of |
| | | select="concat(' INSTANCE.registerOption(ManagedObjectOption.HIDDEN);
')" /> |
| | | </xsl:if> |
| | | <xsl:value-of select="' }
'" /> |
| | | </xsl:if> |
| | | <!-- |
| | | Register any tags associated with this managed object definition. |
| | | --> |
| | | <xsl:if test="$this/adm:tag"> |
| | |
| | | 'CfgDefn.getInstance().get', |
| | | $java-property-name, 'PropertyDefinition());
')" /> |
| | | </xsl:if> |
| | | <xsl:if test="@advanced='true'"> |
| | | <xsl:value-of |
| | | select="' builder.setOption(RelationOption.ADVANCED);
'" /> |
| | | </xsl:if> |
| | | <xsl:if test="@hidden='true'"> |
| | | <xsl:value-of |
| | | select="' builder.setOption(RelationOption.HIDDEN);
'" /> |
| | |
| | | </xsl:message> |
| | | </xsl:if> |
| | | <!-- |
| | | Check that all advanced properties are non-mandatory or have a default. |
| | | Check that all advanced properties conform to one of |
| | | the following rules: |
| | | |
| | | * is mandatory and has a defined default value(s) |
| | | * is mandatory and is part of an advanced managed object |
| | | * is mandatory and is part of an abstract managed object |
| | | * is not mandatory |
| | | --> |
| | | <xsl:if |
| | | test="not($this-is-abstract) and @advanced='true' and @mandatory='true'"> |
| | | <xsl:choose> |
| | | <xsl:when test="adm:default-behavior/adm:defined"> |
| | | <!-- OK --> |
| | | </xsl:when> |
| | | <xsl:when test="adm:default-behavior/adm:inherited"> |
| | | <!-- OK --> |
| | | </xsl:when> |
| | | <xsl:otherwise> |
| | | <xsl:message terminate="yes"> |
| | | <xsl:value-of |
| | | select="concat('Property "', @name, |
| | | '" is advanced and mandatory but has no default values.')" /> |
| | | </xsl:message> |
| | | </xsl:otherwise> |
| | | </xsl:choose> |
| | | </xsl:if> |
| | | <xsl:choose> |
| | | <xsl:when test="$this-is-advanced"> |
| | | <!-- OK --> |
| | | </xsl:when> |
| | | <xsl:when test="$this-is-abstract"> |
| | | <!-- OK --> |
| | | </xsl:when> |
| | | <xsl:when test="@advanced='true' and @mandatory='true'"> |
| | | <xsl:choose> |
| | | <xsl:when test="adm:default-behavior/adm:defined"> |
| | | <!-- OK --> |
| | | </xsl:when> |
| | | <xsl:when test="adm:default-behavior/adm:inherited"> |
| | | <!-- OK --> |
| | | </xsl:when> |
| | | <xsl:otherwise> |
| | | <xsl:message terminate="yes"> |
| | | <xsl:value-of |
| | | select="concat('Advanced property "', @name, |
| | | '" must have defined or inherited default values.')" /> |
| | | </xsl:message> |
| | | </xsl:otherwise> |
| | | </xsl:choose> |
| | | </xsl:when> |
| | | </xsl:choose> |
| | | </xsl:for-each> |
| | | <!-- |
| | | Now generate the definition. |
| | |
| | | select="concat(@managed-object-package, '.server.', $java-class-name, 'Cfg')" /> |
| | | </xsl:element> |
| | | </xsl:for-each> |
| | | <xsl:if test="$this-local-relations[@hidden='true']"> |
| | | <xsl:if |
| | | test="$this-local-relations[@advanced='true' or @hidden='true']"> |
| | | <import>org.opends.server.admin.RelationOption</import> |
| | | </xsl:if> |
| | | <xsl:if test="$this-is-hidden or $this-is-advanced"> |
| | | <import>org.opends.server.admin.ManagedObjectOption</import> |
| | | </xsl:if> |
| | | <xsl:if test="$this-all-relations/adm:one-to-many"> |
| | | <import> |
| | | org.opends.server.admin.InstantiableRelationDefinition |