mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
16.03.2007 6f6d9089d12e4dce250ab71e937c68707e01b4e3
Add additional validation to the LDAP profile stylesheet: make sure that object classes, attribute types, and rdn sequences are present where required.
1 files modified
20 ■■■■■ changed files
opends/resource/admin/ldapMOProfile.xsl 20 ●●●●● patch | view | raw | blame | history
opends/resource/admin/ldapMOProfile.xsl
@@ -36,12 +36,26 @@
    Document parsing.
  -->
  <xsl:template match="/">
    <xsl:if
      test="not($this/adm:profile[@name='ldap']/ldap:object-class/ldap:name) and not($this-is-root)">
      <xsl:message terminate="yes">
        <xsl:value-of
          select="concat('No object class found for managed object definition ', $this-name)" />
      </xsl:message>
    </xsl:if>
    <xsl:value-of
      select="concat('objectclass=',
                     normalize-space($this/adm:profile[@name='ldap']/ldap:object-class/ldap:name),
                     '&#xa;')" />
    <xsl:for-each select="$this-all-properties">
      <xsl:sort select="@name" />
      <xsl:if
        test="not(adm:profile[@name='ldap']/ldap:attribute/ldap:name)">
        <xsl:message terminate="yes">
          <xsl:value-of
            select="concat('No attribute type found for property ', @name, ' in managed object definition ', $this-name)" />
        </xsl:message>
      </xsl:if>
      <xsl:value-of
        select="concat('attribute.',
                       normalize-space(@name),
@@ -51,6 +65,12 @@
    </xsl:for-each>
    <xsl:for-each select="$this-all-relations">
      <xsl:sort select="@name" />
      <xsl:if test="not(adm:profile[@name='ldap']/ldap:rdn-sequence)">
        <xsl:message terminate="yes">
          <xsl:value-of
            select="concat('No RDN sequence found for relation ', @name, ' in managed object definition ', $this-name)" />
        </xsl:message>
      </xsl:if>
      <xsl:value-of
        select="concat('rdn.',
                       normalize-space(@name),