directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r765949 - in /directory/studio/trunk: ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ ldapbrowser-ui/src/main/java/org/apac...
Date Fri, 17 Apr 2009 11:22:15 GMT
Author: seelmann
Date: Fri Apr 17 11:22:14 2009
New Revision: 765949

URL: http://svn.apache.org/viewvc?rev=765949&view=rev
Log:
DIRSTUDIO-167: AttributeComparator needs the entry with initialized objectClass attribute

Modified:
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/AttributeComparator.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyEntryAsCsvAction.java

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java?rev=765949&r1=765948&r2=765949&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
Fri Apr 17 11:22:14 2009
@@ -45,8 +45,10 @@
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
 import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.model.StudioPagedResultsControl;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldapbrowser.core.utils.AttributeComparator;
 import org.apache.directory.studio.ldapbrowser.core.utils.JNDIUtils;
+import org.apache.directory.studio.ldapbrowser.core.utils.ModelConverter;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.apache.directory.studio.ldifparser.model.LdifEnumeration;
 import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
@@ -150,7 +152,6 @@
     {
         try
         {
-            AttributeComparator comparator = new AttributeComparator( browserConnection );
             JndiLdifEnumeration enumeration = search( browserConnection, searchParameter,
monitor );
 
             while ( !monitor.isCanceled() && !monitor.errorsReported() &&
enumeration.hasNext() )
@@ -165,6 +166,8 @@
                     LdifSepLine sepLine = record.getSepLine();
 
                     // sort and format
+                    DummyEntry entry = ModelConverter.ldifContentRecordToEntry( record, browserConnection
);
+                    AttributeComparator comparator = new AttributeComparator( entry );
                     Arrays.sort( attrValLines, comparator );
                     LdifContentRecord newRecord = new LdifContentRecord( dnLine );
                     for ( int i = 0; i < attrValLines.length; i++ )

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/AttributeComparator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/AttributeComparator.java?rev=765949&r1=765948&r2=765949&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/AttributeComparator.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/AttributeComparator.java
Fri Apr 17 11:22:14 2009
@@ -23,28 +23,19 @@
 
 import java.util.Comparator;
 
-import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
 
 
-public class AttributeComparator implements Comparator
+public class AttributeComparator implements Comparator<Object>
 {
 
     private IEntry dummyEntry;
 
 
-    public AttributeComparator( IBrowserConnection connection )
-    {
-        this.dummyEntry = new DummyEntry( LdapDN.EMPTY_LDAPDN, connection );
-    }
-
-
     public AttributeComparator( IEntry entry )
     {
         this.dummyEntry = entry;

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyEntryAsCsvAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyEntryAsCsvAction.java?rev=765949&r1=765948&r2=765949&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyEntryAsCsvAction.java
(original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyEntryAsCsvAction.java
Fri Apr 17 11:22:14 2009
@@ -224,7 +224,7 @@
 
             if ( attributes.length > 0 )
             {
-                AttributeComparator comparator = new AttributeComparator( entries[0].getBrowserConnection()
);
+                AttributeComparator comparator = new AttributeComparator( entries[0] );
                 Arrays.sort( attributes, comparator );
             }
 



Mime
View raw message