From 7a573aef4c0df5e52534320f8b911e54349f7921 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 04 Aug 2016 15:02:41 +0000
Subject: [PATCH] Make CustomSearchResult closer to SDK's Entry

---
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
index 65cc089..3908639 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ViewEntryPanel.java
@@ -36,6 +36,7 @@
 
 import org.forgerock.i18n.LocalizableMessage;
 import org.forgerock.opendj.ldap.AVA;
+import org.forgerock.opendj.ldap.Attribute;
 import org.forgerock.opendj.ldap.AttributeDescription;
 import org.forgerock.opendj.ldap.ByteString;
 import org.forgerock.opendj.ldap.DN;
@@ -203,7 +204,7 @@
       title.setIcon(null);
     }
 
-    List<ByteString> ocs = sr.getAttributeValues(OBJECTCLASS_ATTRIBUTE_TYPE_NAME);
+    Attribute ocs = sr.getAttribute(OBJECTCLASS_ATTRIBUTE_TYPE_NAME);
     Schema schema = getInfo().getServerDescriptor().getSchema();
     if (!ocs.isEmpty() && schema != null)
     {
@@ -234,16 +235,16 @@
   /**
    * Returns an object class value representing all the object class values of
    * the entry.
-   * @param ocValues the list of object class values.
+   * @param ocAttr the list of object class values.
    * @param schema the schema.
    * @return an object class value representing all the object class values of
    * the entry.
    */
-  protected ObjectClassValue getObjectClassDescriptor(List<ByteString> ocValues, Schema schema)
+  protected ObjectClassValue getObjectClassDescriptor(Iterable<ByteString> ocAttr, Schema schema)
   {
     ObjectClass structuralObjectClass = null;
     SortedSet<String> auxiliaryClasses = new TreeSet<>();
-    for (ByteString oc : ocValues)
+    for (ByteString oc : ocAttr)
     {
       ObjectClass objectClass = schema.getObjectClass(oc.toString());
       if (!objectClass.isPlaceHolder())
@@ -489,16 +490,15 @@
   }
 
   /**
-   * Returns <CODE>true</CODE> if the provided attribute name is an editable
-   * attribute and <CODE>false</CODE> otherwise.
-   * @param attrName the attribute name.
+   * Returns whether the provided attribute name is an editable attribute.
+   * @param attrDesc the attribute description.
    * @param schema the schema.
-   * @return <CODE>true</CODE> if the provided attribute name is an editable
-   * attribute and <CODE>false</CODE> otherwise.
+   * @return {@code true} if the provided attribute name is an editable
+   * attribute, {@code false} otherwise.
    */
-  public static boolean isEditable(String attrName, Schema schema)
+  public static boolean isEditable(AttributeDescription attrDesc, Schema schema)
   {
-    attrName = AttributeDescription.valueOf(attrName).getNameOrOID();
+    String attrName = attrDesc.getNameOrOID();
     if (schema != null && schema.hasAttributeType(attrName))
     {
       AttributeType attrType = schema.getAttributeType(attrName);

--
Gitblit v1.10.0