From ad63cf4d78352153373252616c1cb5048b2ee41a Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Mon, 14 Jan 2008 18:53:41 +0000
Subject: [PATCH] Add support to admin framework for retrieving an i18n description of the constraints applicable to an aggregation property. This is required for issue 2004 (HTML configuration guide generation).

---
 opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java |   52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java b/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
index 2661aa0..cca6a9d 100644
--- a/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
+++ b/opends/src/server/org/opends/server/admin/AggregationPropertyDefinition.java
@@ -39,7 +39,9 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
+import java.util.MissingResourceException;
 import java.util.SortedSet;
 
 import org.opends.messages.Message;
@@ -1021,13 +1023,61 @@
    * @return Returns the constraint which should be enforced on the
    *         aggregating managed object.
    */
-  public Constraint getSourceConstraint() {
+  public final Constraint getSourceConstraint() {
     return sourceConstraint;
   }
 
 
 
   /**
+   * Gets the optional constraint synopsis of this aggregation
+   * property definition in the default locale. The constraint
+   * synopsis describes when and how referenced managed objects must
+   * be enabled. When there are no constraints between the source
+   * managed object and the objects it references through this
+   * aggregation, <code>null</code> is returned.
+   *
+   * @return Returns the optional constraint synopsis of this
+   *         aggregation property definition in the default locale, or
+   *         <code>null</code> if there is no constraint synopsis.
+   */
+  public final Message getSourceConstraintSynopsis() {
+    return getSourceConstraintSynopsis(Locale.getDefault());
+  }
+
+
+
+  /**
+   * Gets the optional constraint synopsis of this aggregation
+   * property definition in the specified locale.The constraint
+   * synopsis describes when and how referenced managed objects must
+   * be enabled. When there are no constraints between the source
+   * managed object and the objects it references through this
+   * aggregation, <code>null</code> is returned.
+   *
+   * @param locale
+   *          The locale.
+   * @return Returns the optional constraint synopsis of this
+   *         aggregation property definition in the specified locale,
+   *         or <code>null</code> if there is no constraint
+   *         synopsis.
+   */
+  public final Message getSourceConstraintSynopsis(Locale locale) {
+    ManagedObjectDefinitionI18NResource resource =
+      ManagedObjectDefinitionI18NResource.getInstance();
+    String property = "property." + getName()
+        + ".syntax.aggregation.constraint-synopsis";
+    try {
+      return resource
+          .getMessage(getManagedObjectDefinition(), property, locale);
+    } catch (MissingResourceException e) {
+      return null;
+    }
+  }
+
+
+
+  /**
    * Gets the condition which is used to determine if a referenced
    * managed object is enabled.
    *

--
Gitblit v1.10.0