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

matthew_swift
23.54.2007 a746467e2fd8921be0cd3390d188dc1bf643a5dd
Add support for overriding the user friendly singlular and plural names of components.

The user friendly names (UFN) are usually derived automatically from the component's "name" and "plural-name" attribute. However, sometimes these names are not that user friendly. For example, the names may be abbreviated forms (e.g. replication -> repl or password policy -> pwp). In these cases it would be nice to be abled to display the full human friendly name in help and documentation.

This change includes an overridden UFN for the global configuration. So we should stop seeing messages in applications like "The Global was updated successfully".
3 files modified
56 ■■■■ changed files
opends/resource/admin/admin.xsd 20 ●●●●● patch | view | raw | blame | history
opends/resource/admin/preprocessor.xsl 29 ●●●● patch | view | raw | blame | history
opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml 7 ●●●●● patch | view | raw | blame | history
opends/resource/admin/admin.xsd
@@ -47,6 +47,26 @@
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="user-friendly-name" minOccurs="0"
        type="tns:description-type">
        <xsd:annotation>
          <xsd:documentation>
            The user friendly name of this managed object. This element
            is optional and by default the user friendly name is derived
            from the definition's name attribute.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="user-friendly-plural-name" minOccurs="0"
        type="tns:description-type">
        <xsd:annotation>
          <xsd:documentation>
            The user friendly plural name of this managed object. This element
            is optional and by default the user friendly plural name is derived
            from the definition's plural-name attribute.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="synopsis" type="tns:rich-description-type">
        <xsd:annotation>
          <xsd:documentation>
opends/resource/admin/preprocessor.xsl
@@ -1061,14 +1061,31 @@
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="this-ufn">
    <xsl:call-template name="name-to-ufn">
      <xsl:with-param name="value" select="$this-name" />
    </xsl:call-template>
    <xsl:choose>
      <xsl:when test="/adm:managed-object/adm:user-friendly-name">
        <xsl:value-of
          select="normalize-space(/adm:managed-object/adm:user-friendly-name)" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="name-to-ufn">
          <xsl:with-param name="value" select="$this-name" />
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="this-ufpn">
    <xsl:call-template name="name-to-ufn">
      <xsl:with-param name="value" select="$this-plural-name" />
    </xsl:call-template>
    <xsl:choose>
      <xsl:when
        test="/adm:managed-object/adm:user-friendly-plural-name">
        <xsl:value-of
          select="normalize-space(/adm:managed-object/adm:user-friendly-plural-name)" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="name-to-ufn">
          <xsl:with-param name="value" select="$this-plural-name" />
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="_this">
    <xsl:call-template name="pre-process-managed-object" />
opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml
@@ -30,6 +30,13 @@
  package="org.opends.server.admin.std"
  xmlns:adm="http://www.opends.org/admin"
  xmlns:ldap="http://www.opends.org/admin-ldap">
  <adm:user-friendly-name>Global Configuration</adm:user-friendly-name>
  <adm:user-friendly-plural-name>
    Global Configurations
  </adm:user-friendly-plural-name>
  <adm:synopsis>
    The global configuration contains properties that affect the overall
    operation of the