From 86e392019c387bd7a85b80dbed94e5edb5a7520f Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Thu, 23 Aug 2007 15:54:22 +0000
Subject: [PATCH] Add support for overriding the user friendly singlular and plural names of components.

---
 opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml |    7 +++++++
 opendj-sdk/opends/resource/admin/admin.xsd                                           |   20 ++++++++++++++++++++
 opendj-sdk/opends/resource/admin/preprocessor.xsl                                    |   29 +++++++++++++++++++++++------
 3 files changed, 50 insertions(+), 6 deletions(-)

diff --git a/opendj-sdk/opends/resource/admin/admin.xsd b/opendj-sdk/opends/resource/admin/admin.xsd
index 92ece9c..b84659b 100644
--- a/opendj-sdk/opends/resource/admin/admin.xsd
+++ b/opendj-sdk/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>
diff --git a/opendj-sdk/opends/resource/admin/preprocessor.xsl b/opendj-sdk/opends/resource/admin/preprocessor.xsl
index dee2c1e..c527e89 100644
--- a/opendj-sdk/opends/resource/admin/preprocessor.xsl
+++ b/opendj-sdk/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" />
diff --git a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml b/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml
index 31a8846..a177cf7 100644
--- a/opendj-sdk/opends/src/admin/defn/org/opends/server/admin/std/GlobalConfiguration.xml
+++ b/opendj-sdk/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

--
Gitblit v1.10.0