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/LDIFViewEntryPanel.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDIFViewEntryPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDIFViewEntryPanel.java
index 6d289a2..ad2ccbb 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDIFViewEntryPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/LDIFViewEntryPanel.java
@@ -34,6 +34,7 @@
 import javax.swing.tree.TreePath;
 
 import org.forgerock.i18n.LocalizableMessage;
+import org.forgerock.opendj.ldap.Attribute;
 import org.forgerock.opendj.ldap.ByteString;
 import org.opends.guitools.controlpanel.datamodel.CustomSearchResult;
 import org.opends.guitools.controlpanel.task.OfflineUpdateException;
@@ -167,9 +168,10 @@
     if (isReadOnly)
     {
       editableScroll.setVisible(false);
-      for (String attrName : sr.getAttributeNames())
+      for (Attribute attr : sr.getAllAttributes())
       {
-        for (ByteString v : sr.getAttributeValues(attrName))
+        final String attrName = attr.getAttributeDescriptionAsString();
+        for (ByteString v : attr)
         {
           sb.append("\n").append(getLDIFLine(attrName, v));
         }
@@ -183,11 +185,12 @@
     {
       editableScroll.setVisible(true);
 
-      for (String attrName : sr.getAttributeNames())
+      for (Attribute attr : sr.getAllAttributes())
       {
+        String attrName = attr.getAttributeDescriptionAsString();
         if (!schemaReadOnlyAttributesLowerCase.contains(attrName.toLowerCase()))
         {
-          for (ByteString v : sr.getAttributeValues(attrName))
+          for (ByteString v : attr)
           {
             sb.append("\n").append(getLDIFLine(attrName, v));
           }

--
Gitblit v1.10.0