directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r598395 [5/7] - in /directory/sandbox/felixk: studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/model/ studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/ studio-aciitemedito...
Date Mon, 26 Nov 2007 19:44:37 GMT
Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java Mon Nov 26 11:44:28 2007
@@ -41,11 +41,17 @@
 import org.apache.directory.shared.ldap.codec.search.PresentFilter;
 import org.apache.directory.shared.ldap.codec.search.SearchRequest;
 import org.apache.directory.shared.ldap.codec.search.SubstringFilter;
+import org.apache.directory.shared.ldap.filter.AndNode;
+import org.apache.directory.shared.ldap.filter.ApproximateNode;
 import org.apache.directory.shared.ldap.filter.BranchNode;
+import org.apache.directory.shared.ldap.filter.EqualityNode;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.ExtensibleNode;
 import org.apache.directory.shared.ldap.filter.FilterParser;
-import org.apache.directory.shared.ldap.filter.FilterParserImpl;
+import org.apache.directory.shared.ldap.filter.GreaterEqNode;
+import org.apache.directory.shared.ldap.filter.LessEqNode;
+import org.apache.directory.shared.ldap.filter.NotNode;
+import org.apache.directory.shared.ldap.filter.OrNode;
 import org.apache.directory.shared.ldap.filter.PresenceNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
 import org.apache.directory.shared.ldap.filter.SubstringNode;
@@ -253,10 +259,7 @@
     public static Filter convertToSharedLdapFilter( String filter ) throws IOException, ParseException,
         DecoderException
     {
-        FilterParser filterParser = new FilterParserImpl();
-
-        ExprNode exprNode = filterParser.parse( filter );
-
+        ExprNode exprNode = FilterParser.parse( filter );
         return convertToSharedLdapFilter( exprNode );
     }
 
@@ -278,36 +281,35 @@
         {
             BranchNode branchNode = ( BranchNode ) exprNode;
 
-            switch ( branchNode.getOperator() )
+            if( branchNode instanceof AndNode )
             {
-                case AND:
-                    AndFilter andFilter = new AndFilter();
-                    sharedLdapFilter = andFilter;
-
-                    List<Filter> andFilters = iterateOnFilters( branchNode.getChildren() );
-                    for ( int i = 0; i < andFilters.size(); i++ )
-                    {
-                        andFilter.addFilter( andFilters.get( i ) );
-                    }
-                    break;
-
-                case OR:
-                    OrFilter orFilter = new OrFilter();
-                    sharedLdapFilter = orFilter;
-
-                    List<Filter> orFilters = iterateOnFilters( branchNode.getChildren() );
-                    for ( int i = 0; i < orFilters.size(); i++ )
-                    {
-                        orFilter.addFilter( orFilters.get( i ) );
-                    }
-                    break;
-                case NOT:
-                    NotFilter notFilter = new NotFilter();
-                    sharedLdapFilter = notFilter;
-
-                    List<Filter> notFilters = iterateOnFilters( branchNode.getChildren() );
-                    notFilter.setNotFilter( notFilters.get( 0 ) );
-                    break;
+                AndFilter andFilter = new AndFilter();
+                sharedLdapFilter = andFilter;
+                
+                List<Filter> andFilters = iterateOnFilters( branchNode.getChildren() );
+                for ( int i = 0; i < andFilters.size(); i++ )
+                {
+                    andFilter.addFilter( andFilters.get( i ) );
+                }
+            }
+            else if( branchNode instanceof OrNode )
+            {
+                OrFilter orFilter = new OrFilter();
+                sharedLdapFilter = orFilter;
+                
+                List<Filter> orFilters = iterateOnFilters( branchNode.getChildren() );
+                for ( int i = 0; i < orFilters.size(); i++ )
+                {
+                    orFilter.addFilter( orFilters.get( i ) );
+                }
+            }
+            else if( branchNode instanceof NotNode )
+            {
+                NotFilter notFilter = new NotFilter();
+                sharedLdapFilter = notFilter;
+                
+                List<Filter> notFilters = iterateOnFilters( branchNode.getChildren() );
+                notFilter.setNotFilter( notFilters.get( 0 ) );
             }
         }
         else if ( exprNode instanceof PresenceNode )
@@ -323,31 +325,29 @@
         {
             SimpleNode simpleNode = ( SimpleNode ) exprNode;
 
-            switch ( simpleNode.getAssertionType() )
+            if ( simpleNode instanceof ApproximateNode )
             {
-                case APPROXIMATE:
-                    AttributeValueAssertionFilter approxMatchFilter = createAttributeValueAssertionFilter( simpleNode,
-                        LdapConstants.APPROX_MATCH_FILTER );
-                    sharedLdapFilter = approxMatchFilter;
-                    break;
-
-                case EQUALITY:
-                    AttributeValueAssertionFilter equalityMatchFilter = createAttributeValueAssertionFilter(
-                        simpleNode, LdapConstants.EQUALITY_MATCH_FILTER );
-                    sharedLdapFilter = equalityMatchFilter;
-                    break;
-
-                case GREATEREQ:
-                    AttributeValueAssertionFilter greaterOrEqualFilter = createAttributeValueAssertionFilter(
-                        simpleNode, LdapConstants.GREATER_OR_EQUAL_FILTER );
-                    sharedLdapFilter = greaterOrEqualFilter;
-                    break;
-
-                case LESSEQ:
-                    AttributeValueAssertionFilter lessOrEqualFilter = createAttributeValueAssertionFilter( simpleNode,
-                        LdapConstants.LESS_OR_EQUAL_FILTER );
-                    sharedLdapFilter = lessOrEqualFilter;
-                    break;
+                AttributeValueAssertionFilter approxMatchFilter = createAttributeValueAssertionFilter( simpleNode,
+                    LdapConstants.APPROX_MATCH_FILTER );
+                sharedLdapFilter = approxMatchFilter;
+            }
+            else if ( simpleNode instanceof EqualityNode )
+            {
+                AttributeValueAssertionFilter equalityMatchFilter = createAttributeValueAssertionFilter(
+                    simpleNode, LdapConstants.EQUALITY_MATCH_FILTER );
+                sharedLdapFilter = equalityMatchFilter;
+            }
+            else if ( simpleNode instanceof GreaterEqNode )
+            {
+                AttributeValueAssertionFilter greaterOrEqualFilter = createAttributeValueAssertionFilter(
+                    simpleNode, LdapConstants.GREATER_OR_EQUAL_FILTER );
+                sharedLdapFilter = greaterOrEqualFilter;
+            }
+            else if ( simpleNode instanceof LessEqNode )
+            {
+                AttributeValueAssertionFilter lessOrEqualFilter = createAttributeValueAssertionFilter( simpleNode,
+                    LdapConstants.LESS_OR_EQUAL_FILTER );
+                sharedLdapFilter = lessOrEqualFilter;
             }
         }
         else if ( exprNode instanceof ExtensibleNode )
@@ -357,7 +357,7 @@
             ExtensibleMatchFilter extensibleMatchFilter = new ExtensibleMatchFilter();
             sharedLdapFilter = extensibleMatchFilter;
 
-            extensibleMatchFilter.setDnAttributes( extensibleNode.dnAttributes() );
+            extensibleMatchFilter.setDnAttributes( extensibleNode.hasDnAttributes() );
             extensibleMatchFilter.setMatchingRule( extensibleNode.getMatchingRuleId() );
             extensibleMatchFilter.setMatchValue( extensibleNode.getValue() );
             extensibleMatchFilter.setType( extensibleNode.getAttribute() );
@@ -372,10 +372,10 @@
             substringFilter.setType( substringNode.getAttribute() );
             substringFilter.setInitialSubstrings( substringNode.getInitial() );
             substringFilter.setFinalSubstrings( substringNode.getFinal() );
-            List anys = substringNode.getAny();
+            List<String> anys = substringNode.getAny();
             for ( int i = 0; i < anys.size(); i++ )
             {
-                substringFilter.addAnySubstrings( ( String ) anys.get( i ) );
+                substringFilter.addAnySubstrings( anys.get( i ) );
             }
         }
 

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportLdifJob.java Mon Nov 26 11:44:28 2007
@@ -40,18 +40,16 @@
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.model.ConnectionException;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
-import org.apache.directory.studio.ldapbrowser.core.model.ReferralException;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifEnumeration;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContainer;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifAttrValLine;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifDnLine;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifSepLine;
 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.Utils;
+import org.apache.directory.studio.ldifparser.model.LdifEnumeration;
+import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
+import org.apache.directory.studio.ldifparser.model.container.LdifContentRecord;
+import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifDnLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifSepLine;
 
 
 /**
@@ -149,11 +147,11 @@
         try
         {
             AttributeComparator comparator = new AttributeComparator( browserConnection );
-            LdifEnumeration enumeration = search( browserConnection, searchParameter, monitor );
+            JndiLdifEnumeration enumeration = search( browserConnection, searchParameter, monitor );
             
-            while ( !monitor.isCanceled() && enumeration.hasNext( monitor ) )
+            while ( !monitor.isCanceled() && enumeration.hasNext() )
             {
-                LdifContainer container = enumeration.next( monitor );
+                LdifContainer container = enumeration.next();
 
                 if ( container instanceof LdifContentRecord )
                 {
@@ -170,7 +168,7 @@
                         newRecord.addAttrVal( attrValLines[i] );
                     }
                     newRecord.finish( sepLine );
-                    String s = newRecord.toFormattedString();
+                    String s = newRecord.toFormattedString( Utils.getLdifFormatParameters() );
 
                     // String s = record.toFormattedString();
                     bufferedWriter.write( s );
@@ -190,22 +188,6 @@
             {
                 // ignore
             }
-            else if ( ce instanceof ReferralException )
-            {
-                if ( searchParameter.getReferralsHandlingMethod() == ReferralHandlingMethod.FOLLOW )
-                {
-                    ReferralException re = ( ReferralException ) ce;
-                    ISearch[] referralSearches = re.getReferralSearches();
-                    for ( int i = 0; i < referralSearches.length; i++ )
-                    {
-                        ISearch referralSearch = referralSearches[i];
-
-                        // export recursive
-                        export( referralSearch.getBrowserConnection(), referralSearch.getSearchParameter(), bufferedWriter,
-                            count, monitor );
-                    }
-                }
-            }
             else
             {
                 monitor.reportError( ce );
@@ -220,7 +202,7 @@
     }
 
     
-    static LdifEnumeration search( IBrowserConnection browserConnection, SearchParameter parameter, StudioProgressMonitor monitor )
+    static JndiLdifEnumeration search( IBrowserConnection browserConnection, SearchParameter parameter, StudioProgressMonitor monitor )
         throws ConnectionException
     {
         NamingEnumeration<SearchResult> result = SearchJob.search( browserConnection, parameter, monitor );
@@ -247,7 +229,7 @@
         }
 
 
-        public boolean hasNext( StudioProgressMonitor monitor ) throws ConnectionException
+        public boolean hasNext() throws ConnectionException
         {
             try
             {
@@ -260,7 +242,7 @@
         }
 
 
-        public LdifContainer next( StudioProgressMonitor monitor ) throws ConnectionException
+        public LdifContainer next() throws ConnectionException
         {
             try
             {

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportXlsJob.java Mon Nov 26 11:44:28 2007
@@ -32,15 +32,12 @@
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ExportLdifJob.JndiLdifEnumeration;
 import org.apache.directory.studio.ldapbrowser.core.model.ConnectionException;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
-import org.apache.directory.studio.ldapbrowser.core.model.ReferralException;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifEnumeration;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContainer;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
+import org.apache.directory.studio.ldifparser.model.container.LdifContentRecord;
 import org.apache.poi.hssf.usermodel.HSSFCell;
 import org.apache.poi.hssf.usermodel.HSSFRow;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
@@ -223,10 +220,10 @@
     {
         try
         {
-            LdifEnumeration enumeration = ExportLdifJob.search( browserConnection, searchParameter, monitor );
-            while ( !monitor.isCanceled() && enumeration.hasNext( monitor ) )
+            JndiLdifEnumeration enumeration = ExportLdifJob.search( browserConnection, searchParameter, monitor );
+            while ( !monitor.isCanceled() && enumeration.hasNext() )
             {
-                LdifContainer container = enumeration.next( monitor );
+                LdifContainer container = enumeration.next();
 
                 if ( container instanceof LdifContentRecord )
                 {
@@ -244,24 +241,9 @@
         }
         catch ( ConnectionException ce )
         {
-
             if ( ce.getLdapStatusCode() == 3 || ce.getLdapStatusCode() == 4 || ce.getLdapStatusCode() == 11 )
             {
                 // nothing
-            }
-            else if ( ce instanceof ReferralException )
-            {
-                if ( searchParameter.getReferralsHandlingMethod() == ReferralHandlingMethod.FOLLOW )
-                {
-                    ReferralException re = ( ReferralException ) ce;
-                    ISearch[] referralSearches = re.getReferralSearches();
-                    for ( ISearch referralSearch : referralSearches )
-                    {
-                        // export recursive
-                        exportToXls( referralSearch.getBrowserConnection(), referralSearch.getSearchParameter(), sheet,
-                            headerRow, count, monitor, attributeNameMap, valueDelimiter, binaryEncoding, exportDn );
-                    }
-                }
             }
             else
             {

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java Mon Nov 26 11:44:28 2007
@@ -48,30 +48,32 @@
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionCoreConstants;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
-import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.ConnectionException;
 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.ldif.LdifEnumeration;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeAddRecord;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeDeleteRecord;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeModDnRecord;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeModifyRecord;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeRecord;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContainer;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifModSpec;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifRecord;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifAttrValLine;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifCommentLine;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifControlLine;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifModSpecTypeLine;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.parser.LdifParser;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
+import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
+import org.apache.directory.studio.ldifparser.LdifFormatParameters;
+import org.apache.directory.studio.ldifparser.model.LdifEnumeration;
+import org.apache.directory.studio.ldifparser.model.container.LdifChangeAddRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifChangeDeleteRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifChangeModDnRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifChangeModifyRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifChangeRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
+import org.apache.directory.studio.ldifparser.model.container.LdifContentRecord;
+import org.apache.directory.studio.ldifparser.model.container.LdifModSpec;
+import org.apache.directory.studio.ldifparser.model.container.LdifRecord;
+import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifCommentLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifControlLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifModSpecTypeLine;
+import org.apache.directory.studio.ldifparser.parser.LdifParser;
 
 
 /**
@@ -235,9 +237,9 @@
         int errorCount = 0;
         try
         {
-            while ( !monitor.isCanceled() && enumeration.hasNext( monitor ) )
+            while ( !monitor.isCanceled() && enumeration.hasNext() )
             {
-                LdifContainer container = enumeration.next( monitor );
+                LdifContainer container = enumeration.next();
 
                 if ( container instanceof LdifRecord )
                 {
@@ -515,21 +517,24 @@
     {
         try
         {
-            DateFormat df = new SimpleDateFormat( BrowserCoreConstants.DATEFORMAT );
+            LdifFormatParameters ldifFormatParameters = Utils.getLdifFormatParameters();
+            DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT );
 
             String errorComment = "#!ERROR " + exception.getMessage(); //$NON-NLS-1$
             errorComment = errorComment.replaceAll( "\r", " " ); //$NON-NLS-1$ //$NON-NLS-2$
             errorComment = errorComment.replaceAll( "\n", " " ); //$NON-NLS-1$ //$NON-NLS-2$
             LdifCommentLine errorCommentLine = LdifCommentLine.create( errorComment );
 
-            logWriter.write( LdifCommentLine.create( "#!RESULT ERROR" ).toFormattedString() ); //$NON-NLS-1$
+            logWriter.write( LdifCommentLine.create( "#!RESULT ERROR" )
+                .toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NL LdifFormatParameters.DEFAULTS-1$
             logWriter
                 .write( LdifCommentLine
                     .create(
-                        "#!CONNECTION ldap://" + browserConnection.getConnection().getHost() + ":" + browserConnection.getConnection().getPort() ).toFormattedString() ); //$NON-NLS-1$ //$NON-NLS-2$
-            logWriter.write( LdifCommentLine.create( "#!DATE " + df.format( new Date() ) ).toFormattedString() ); //$NON-NLS-1$
-            logWriter.write( errorCommentLine.toFormattedString() );
-            logWriter.write( record.toFormattedString() );
+                        "#!CONNECTION ldap://" + browserConnection.getConnection().getHost() + ":" + browserConnection.getConnection().getPort() ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$ //$NON-NLS-2$
+            logWriter.write( LdifCommentLine
+                .create( "#!DATE " + df.format( new Date() ) ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$
+            logWriter.write( errorCommentLine.toFormattedString( LdifFormatParameters.DEFAULT ) );
+            logWriter.write( record.toFormattedString( ldifFormatParameters ) );
         }
         catch ( IOException ioe )
         {
@@ -551,14 +556,16 @@
     {
         try
         {
-            DateFormat df = new SimpleDateFormat( BrowserCoreConstants.DATEFORMAT );
-            logWriter.write( LdifCommentLine.create( "#!RESULT OK" ).toFormattedString() ); //$NON-NLS-1$
+            LdifFormatParameters ldifFormatParameters = Utils.getLdifFormatParameters();
+            DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT );
+            logWriter.write( LdifCommentLine.create( "#!RESULT OK" ).toFormattedString( ldifFormatParameters ) ); //$NON-NLS-1$
             logWriter
                 .write( LdifCommentLine
                     .create(
-                        "#!CONNECTION ldap://" + browserConnection.getConnection().getHost() + ":" + browserConnection.getConnection().getPort() ).toFormattedString() ); //$NON-NLS-1$ //$NON-NLS-2$
-            logWriter.write( LdifCommentLine.create( "#!DATE " + df.format( new Date() ) ).toFormattedString() ); //$NON-NLS-1$
-            logWriter.write( record.toFormattedString() );
+                        "#!CONNECTION ldap://" + browserConnection.getConnection().getHost() + ":" + browserConnection.getConnection().getPort() ).toFormattedString( ldifFormatParameters ) ); //$NON-NLS-1$ //$NON-NLS-2$
+            logWriter.write( LdifCommentLine
+                .create( "#!DATE " + df.format( new Date() ) ).toFormattedString( ldifFormatParameters ) ); //$NON-NLS-1$
+            logWriter.write( record.toFormattedString( ldifFormatParameters ) );
         }
         catch ( IOException ioe )
         {

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java Mon Nov 26 11:44:28 2007
@@ -23,9 +23,11 @@
 
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import javax.naming.InvalidNameException;
@@ -33,7 +35,9 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.events.AttributesInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
@@ -212,43 +216,11 @@
             new String[]
                 { entry.getDn().getUpName() } ) );
 
-        // entry.setAttributesInitialized(false, entry.getConnection());
-
         if ( entry instanceof IRootDSE )
         {
-//            IEntry[] oldChildren = entry.getChildren();
-//            for ( int i = 0; oldChildren != null && i < oldChildren.length; i++ )
-//            {
-//                if ( oldChildren[i] != null )
-//                {
-//                    entry.deleteChild( oldChildren[i] );
-//                }
-//            }
-//            entry.setChildrenInitialized( false );
-            
             // special handling for Root DSE
             loadRootDSE( entry.getBrowserConnection(), monitor );
             
-//            if ( !monitor.errorsReported() )
-//            {
-//                try
-//                {
-//                    monitor.reportProgress( BrowserCoreMessages.model__loading_rootdse );
-//                    loadRootDSE( entry.getBrowserConnection(), monitor );
-//                    monitor.worked( 1 );
-//                }
-//                catch ( Exception e )
-//                {
-//                    monitor.reportError( BrowserCoreMessages.model__error_loading_rootdse );
-//                    rootDSE = null;
-//                }
-//
-//                if ( monitor.errorsReported() )
-//                {
-//                    close();
-//                }
-//            }
-            
         	entry.setAttributesInitialized( true );
         	entry.setChildrenInitialized( true );
         }
@@ -276,46 +248,44 @@
      */
     static void loadRootDSE( IBrowserConnection browserConnection, StudioProgressMonitor monitor )
     {
-//        if(rootDSE == null)
-//        {
-//            rootDSE = new RootDSE( this );
-//            cacheEntry( rootDSE );
-//        }
-        
         // delete old children
         IEntry[] oldChildren = browserConnection.getRootDSE().getChildren();
-        for ( int i = 0; oldChildren != null && i < oldChildren.length; i++ )
+        if(oldChildren != null)
         {
-            if ( oldChildren[i] != null )
+            for ( IEntry entry : oldChildren )
             {
-                browserConnection.getRootDSE().deleteChild( oldChildren[i] );
+                if ( entry != null )
+                {
+                    browserConnection.getRootDSE().deleteChild( entry );
+                }
             }
         }
         browserConnection.getRootDSE().setChildrenInitialized( false );
 
-        // get well-known root DSE attributes, includes + and *
+        // load well-known Root DSE attributes, includes + and *
         ISearch search = new Search( null, browserConnection, LdapDN.EMPTY_LDAPDN, ISearch.FILTER_TRUE,
             InitializeAttributesJob.ROOT_DSE_ATTRIBUTES, SearchScope.OBJECT, 0, 0,
             AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, false, false,
             null );
         SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
 
-        // get base DNs
+        // the list of entries under the Root DSE
+        Map<LdapDN, IEntry> rootDseEntries = new HashMap<LdapDN, IEntry>();
+        
+        // 1st: add base DNs, either the specified or from the namingContexts attribute
         if( !browserConnection.isFetchBaseDNs() && browserConnection.getBaseDN() != null && !"".equals( browserConnection.getBaseDN().toString() ))
         {
+            // only add the specified base DN
             try
             {
-                // only add the specified base DN
                 LdapDN dn = browserConnection.getBaseDN();
-                IEntry entry = new BaseDNEntry( new LdapDN( dn ), browserConnection );
-                browserConnection.cacheEntry( entry );
-                browserConnection.getRootDSE().addChild( entry );
-                
-                // check if entry exists
-                // TODO: use browserConnection.getEntry( dn, monitor ) ??
-                search = new Search( null, browserConnection, dn, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, SearchScope.OBJECT, 1, 0,
-                    AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, true, true, null );
-                SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
+                IEntry entry = browserConnection.getEntryFromCache( dn );
+                if(entry == null)
+                {
+                    entry = new BaseDNEntry( new LdapDN( dn ), browserConnection );
+                    browserConnection.cacheEntry( entry );
+                }
+                rootDseEntries.put( dn, entry );
             }
             catch ( InvalidNameException e )
             {
@@ -324,7 +294,7 @@
         }
         else
         {
-            // get naming contexts 
+            // get base DNs from namingContexts attribute
             Set<String> namingContextSet = new HashSet<String>();
             IAttribute attribute = browserConnection.getRootDSE().getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS );
             if ( attribute != null )
@@ -340,9 +310,14 @@
                 if ( !"".equals( namingContext ) ) { //$NON-NLS-1$
                     try
                     {
-                        IEntry entry = new BaseDNEntry( new LdapDN( namingContext ), browserConnection );
-                        browserConnection.getRootDSE().addChild( entry );
-                        browserConnection.cacheEntry( entry );
+                        LdapDN dn = new LdapDN( namingContext );
+                        IEntry entry = browserConnection.getEntryFromCache( dn );
+                        if(entry == null)
+                        {
+                            entry = new BaseDNEntry( new LdapDN( dn ), browserConnection );
+                            browserConnection.cacheEntry( entry );
+                        }
+                        rootDseEntries.put( dn, entry );
                     }
                     catch ( InvalidNameException e )
                     {
@@ -351,42 +326,65 @@
                 }
                 else
                 {
-                    // special handling of empty namingContext: perform a one-level search and add all result DNs to the set
+                    // special handling of empty namingContext (Novell eDirectory): 
+                    // perform a one-level search and add all result DNs to the set
                     search = new Search( null, browserConnection, LdapDN.EMPTY_LDAPDN, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, SearchScope.ONELEVEL, 0,
                         0, AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, false, false, null );
                     SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
                     ISearchResult[] results = search.getSearchResults();
-                    for ( int k = 0; results != null && k < results.length; k++ )
+                    for ( ISearchResult searchResult : results )
                     {
-                        ISearchResult result = results[k];
-                        IEntry entry = result.getEntry();
-                        browserConnection.getRootDSE().addChild( entry );
+                        IEntry entry = searchResult.getEntry();
+                        rootDseEntries.put( entry.getDn(), entry );
                     }
                 }
             }
         }
 
-        // get schema sub-entry
-        DirectoryMetadataEntry[] schemaEntries = getDirectoryMetadataEntries( browserConnection, IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY );
-        for ( int i = 0; i < schemaEntries.length; i++ )
+        // 2nd: add schema sub-entry
+        IEntry[] schemaEntries = getDirectoryMetadataEntries( browserConnection,
+            IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY );
+        for ( IEntry entry : schemaEntries )
         {
-            schemaEntries[i].setSchemaEntry( true );
-            browserConnection.getRootDSE().addChild( ( IEntry ) schemaEntries[i] );
+            if ( entry instanceof DirectoryMetadataEntry )
+            {
+                ( ( DirectoryMetadataEntry ) entry ).setSchemaEntry( true );
+            }
+            rootDseEntries.put( entry.getDn(), entry );
         }
         
-        // get other metadata entries
-        String[] metadataAttributeNames = new String[]
-            { IRootDSE.ROOTDSE_ATTRIBUTE_MONITORCONTEXT, IRootDSE.ROOTDSE_ATTRIBUTE_CONFIGCONTEXT,
-                IRootDSE.ROOTDSE_ATTRIBUTE_DSANAME };
-        for ( int x = 0; x < metadataAttributeNames.length; x++ )
+        // get other meta data entries
+        IAttribute[] rootDseAttributes = browserConnection.getRootDSE().getAttributes();
+        for ( IAttribute attribute : rootDseAttributes )
         {
-            DirectoryMetadataEntry[] metadataEntries = getDirectoryMetadataEntries( browserConnection, metadataAttributeNames[x] );
-            for ( int i = 0; i < metadataEntries.length; i++ )
+            IEntry[] metadataEntries = getDirectoryMetadataEntries( browserConnection, attribute.getDescription() );
+            for ( IEntry entry : metadataEntries )
             {
-                browserConnection.getRootDSE().addChild( ( IEntry ) metadataEntries[i] );
+                rootDseEntries.put( entry.getDn(), entry );
             }
         }
         
+//        // TODO: check all attributes if they are valid DNs
+//        String[] metadataAttributeNames = new String[]
+//            { IRootDSE.ROOTDSE_ATTRIBUTE_MONITORCONTEXT, IRootDSE.ROOTDSE_ATTRIBUTE_CONFIGCONTEXT,
+//                IRootDSE.ROOTDSE_ATTRIBUTE_DSANAME };
+//        for ( int x = 0; x < metadataAttributeNames.length; x++ )
+//        {
+//            IEntry[] metadataEntries = getDirectoryMetadataEntries( browserConnection, metadataAttributeNames[x] );
+//            for ( int i = 0; i < metadataEntries.length; i++ )
+//            {
+//                rootDseEntries.add( metadataEntries[i] );
+//            }
+//        }
+        
+        // try to init entries
+        StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
+        for ( IEntry entry : rootDseEntries.values() )
+        {
+            initBaseEntry( entry.getBrowserConnection(), entry.getDn(), dummyMonitor );
+            // TODO: log if a base entry doesn't exist
+        }
+        
         // set flags
         browserConnection.getRootDSE().setHasMoreChildren( false );
         browserConnection.getRootDSE().setAttributesInitialized( true );
@@ -396,32 +394,71 @@
     }
 
 
-    private static DirectoryMetadataEntry[] getDirectoryMetadataEntries( IBrowserConnection browserConnection, String metadataAttributeName )
+    private static void initBaseEntry( IBrowserConnection browserConnection, LdapDN dn, StudioProgressMonitor monitor )
+    {
+        ISearch search;
+        IEntry entry;
+        // search the entry
+        AliasDereferencingMethod derefAliasMethod = browserConnection.getAliasesDereferencingMethod();
+        ReferralHandlingMethod handleReferralsMethod = browserConnection.getReferralsHandlingMethod();
+        if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
+            BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS )
+            && browserConnection.getRootDSE().isControlSupported(
+                IBrowserConnection.CONTROL_MANAGEDSAIT ) )
+        {
+            derefAliasMethod = AliasDereferencingMethod.NEVER;
+            handleReferralsMethod = ReferralHandlingMethod.IGNORE;
+        }
+        search = new Search( null, browserConnection, dn, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, SearchScope.OBJECT, 1, 0,
+            derefAliasMethod, handleReferralsMethod, true, true, null );
+        SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
+        
+        // add entry to Root DSE
+        ISearchResult[] results = search.getSearchResults();
+        if(results != null && results.length == 1)
+        {
+            ISearchResult result = results[0];
+            entry = result.getEntry();
+            browserConnection.getRootDSE().addChild( entry );
+        }
+    }
+
+
+    private static IEntry[] getDirectoryMetadataEntries( IBrowserConnection browserConnection, String metadataAttributeName )
     {
-        List<LdapDN> metadataEntryList = new ArrayList<LdapDN>();
+        List<LdapDN> metadataEntryDnList = new ArrayList<LdapDN>();
         IAttribute attribute = browserConnection.getRootDSE().getAttribute( metadataAttributeName );
         if ( attribute != null )
         {
             String[] values = attribute.getStringValues();
-            for ( int i = 0; i < values.length; i++ )
+            for ( String dn : values )
             {
-                try
-                {
-                    metadataEntryList.add( new LdapDN( values[i] ) );
-                }
-                catch ( InvalidNameException e )
+                if( dn != null && !"".equals( dn ))
                 {
+                    try
+                    {
+                        metadataEntryDnList.add( new LdapDN( dn ) );
+                    }
+                    catch ( InvalidNameException e )
+                    {
+                    }
                 }
             }
         }
 
-        DirectoryMetadataEntry[] metadataEntries = new DirectoryMetadataEntry[metadataEntryList.size()];
-        for ( int i = 0; i < metadataEntryList.size(); i++ )
+        IEntry[] metadataEntries = new IEntry[metadataEntryDnList.size()];
+        for ( int i = 0; i < metadataEntryDnList.size(); i++ )
         {
-            metadataEntries[i] = new DirectoryMetadataEntry( metadataEntryList.get( i ), browserConnection );
-            metadataEntries[i].setDirectoryEntry( true );
-            browserConnection.cacheEntry( metadataEntries[i] );
+            LdapDN dn = metadataEntryDnList.get( i );
+            metadataEntries[i] = browserConnection.getEntryFromCache( dn );
+            if(metadataEntries[i] == null)
+            {
+                metadataEntries[i] = new DirectoryMetadataEntry( dn, browserConnection );
+                metadataEntries[i].setDirectoryEntry( true );
+                browserConnection.cacheEntry( metadataEntries[i] );
+            }
         }
         return metadataEntries;
     }
+
 }

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java Mon Nov 26 11:44:28 2007
@@ -33,6 +33,7 @@
 import org.apache.directory.studio.ldapbrowser.core.events.ChildrenInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.Control;
+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.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
@@ -41,7 +42,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.AliasBaseEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.impl.ReferralBaseEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
 
 
@@ -178,7 +178,9 @@
             AliasDereferencingMethod derefAliasMethod = parent.getBrowserConnection().getAliasesDereferencingMethod();
             ReferralHandlingMethod handleReferralsMethod = parent.getBrowserConnection().getReferralsHandlingMethod();
             if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-                BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS ) )
+                BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS )
+                && parent.getBrowserConnection().getRootDSE().isControlSupported(
+                    IBrowserConnection.CONTROL_MANAGEDSAIT ) )
             {
                 scope = ( parent.isAlias() || parent.isReferral() ) ? SearchScope.OBJECT : SearchScope.ONELEVEL;
                 derefAliasMethod = parent.isAlias() ? AliasDereferencingMethod.FINDING
@@ -205,7 +207,7 @@
             {
 
                 /*
-                 * clearing old children before filling new subenties is
+                 * clearing old children before filling new children is
                  * necessary to handle aliases and referrals.
                  */
                 IEntry[] connChildren = parent.getChildren();
@@ -220,15 +222,7 @@
 
                 for ( int i = 0; srs != null && i < srs.length; i++ )
                 {
-                    if ( parent.isReferral() )
-                    {
-                        ReferralBaseEntry referralBaseEntry = new ReferralBaseEntry( srs[i].getEntry().getBrowserConnection(),
-                            srs[i].getEntry().getDn() );
-                        parent.addChild( referralBaseEntry );
-                        // System.out.println("Ref: " +
-                        // referralBaseEntry.getUrl());
-                    }
-                    else if ( parent.isAlias() )
+                    if ( parent.isAlias() && !( srs[i].getEntry() instanceof AliasBaseEntry ) )
                     {
                         AliasBaseEntry aliasBaseEntry = new AliasBaseEntry( srs[i].getEntry().getBrowserConnection(), srs[i]
                             .getEntry().getDn() );

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java Mon Nov 26 11:44:28 2007
@@ -32,6 +32,7 @@
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryMovedEvent;
@@ -41,7 +42,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 
 
 /**

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java Mon Nov 26 11:44:28 2007
@@ -32,9 +32,9 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifEnumeration;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
+import org.apache.directory.studio.ldifparser.model.LdifEnumeration;
+import org.apache.directory.studio.ldifparser.model.container.LdifContentRecord;
 
 
 /**
@@ -152,9 +152,9 @@
                         IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP, } );
                 
                 LdifEnumeration le = ExportLdifJob.search( browserConnection, sp, monitor );
-                if ( le.hasNext( monitor ) )
+                if ( le.hasNext() )
                 {
-                    LdifContentRecord schemaRecord = ( LdifContentRecord ) le.next( monitor );
+                    LdifContentRecord schemaRecord = ( LdifContentRecord ) le.next();
                     Schema schema = new Schema();
                     schema.loadFromRecord( schemaRecord );
                     browserConnection.setSchema( schema );

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java Mon Nov 26 11:44:28 2007
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryRenamedEvent;
@@ -41,7 +42,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 
 
 /**

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java Mon Nov 26 11:44:28 2007
@@ -39,8 +39,12 @@
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
+import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateEvent;
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeHierarchy;
@@ -51,14 +55,12 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.model.ReferralException;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.BaseDNEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Entry;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.ReferralBaseEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassDescription;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 import org.apache.directory.studio.ldapbrowser.core.utils.JNDIUtils;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 
@@ -170,6 +172,15 @@
     public static void searchAndUpdateModel( IBrowserConnection browserConnection, ISearch search,
         StudioProgressMonitor monitor )
     {
+        if ( browserConnection.getConnection() == null )
+        {
+            if ( search != null )
+            {
+                search.setSearchResults( new ISearchResult[0] );
+            }
+            return;
+        }
+        
         try
         {
             if ( !monitor.isCanceled() )
@@ -184,27 +195,47 @@
                     NamingEnumeration<SearchResult> enumeration = search( browserConnection, searchParameter, monitor );
 
                     // iterate through the search result
-                    while ( !monitor.isCanceled() && enumeration.hasMore() )
+                    while ( !monitor.isCanceled() && enumeration != null && enumeration.hasMore() )
                     {
-                        SearchResult sr = enumeration.nextElement(); // TODO: referrals exception
+                        SearchResult sr = enumeration.next();
                         LdapDN dn = JNDIUtils.getDn( sr );
+                        boolean isReferral = false;
+                        IBrowserConnection resultBrowserConnection = browserConnection;
+                        if ( sr instanceof StudioSearchResult )
+                        {
+                            StudioSearchResult ssr = ( StudioSearchResult ) sr;
+                            
+                            isReferral = ssr.isReferral();
+                            
+                            Connection connection = ssr.getConnection();
+                            IBrowserConnection bc = BrowserCorePlugin.getDefault().getConnectionManager()
+                                .getBrowserConnection( connection );
+                            if( bc != null )
+                            {
+                                resultBrowserConnection = bc;
+                            }
+                        }
 
                         // get entry from cache or create it
-                        IEntry entry = browserConnection.getEntryFromCache( dn );
+                        IEntry entry = resultBrowserConnection.getEntryFromCache( dn );
                         if ( entry == null )
                         {
-                            entry = createAndCacheEntry( browserConnection, dn );
+                            entry = createAndCacheEntry( resultBrowserConnection, dn );
                         }
-
+                        
                         // initialize special flags
                         initFlags( entry, sr, searchParameter );
 
                         // fill the attributes
                         fillAttributes( entry, sr, search.getSearchParameter() );
-
-                        searchResultList
-                            .add( new org.apache.directory.studio.ldapbrowser.core.model.impl.SearchResult( entry,
-                                search ) );
+                        
+                        if ( isReferral  )
+                        {
+                            entry = new ReferralBaseEntry( resultBrowserConnection, dn );
+                        }
+                        
+                        searchResultList.add( new org.apache.directory.studio.ldapbrowser.core.model.impl.SearchResult(
+                            entry, search ) );
 
                         monitor
                             .reportProgress( searchResultList.size() == 1 ? BrowserCoreMessages.model__retrieved_1_entry
@@ -221,28 +252,6 @@
                     {
                         search.setCountLimitExceeded( true );
                     }
-                    else if ( ce instanceof ReferralException )
-                    {
-                        if ( search.getReferralsHandlingMethod() == ReferralHandlingMethod.FOLLOW )
-                        {
-                            ReferralException re = ( ReferralException ) ce;
-                            ISearch[] referralSearches = re.getReferralSearches();
-                            for ( int i = 0; i < referralSearches.length; i++ )
-                            {
-                                ISearch referralSearch = referralSearches[i];
-
-                                searchAndUpdateModel( referralSearch.getBrowserConnection(), referralSearch, monitor );
-
-                                ISearchResult[] referralSearchResults = referralSearch.getSearchResults();
-                                for ( int j = 0; referralSearchResults != null && j < referralSearchResults.length; j++ )
-                                {
-                                    ISearchResult referralSearchResult = referralSearchResults[j];
-                                    referralSearchResult.setSearch( search );
-                                    searchResultList.add( referralSearchResult );
-                                }
-                            }
-                        }
-                    }
                     else
                     {
                         monitor.reportError( ce );
@@ -307,7 +316,7 @@
         }
 
         NamingEnumeration<SearchResult> result = browserConnection.getConnection().getJNDIConnectionWrapper().search(
-            searchBase, filter, controls, derefAliasMethod, handleReferralsMethod, ldapControls, monitor );
+            searchBase, filter, controls, derefAliasMethod, handleReferralsMethod, ldapControls, monitor, null );
         return result;
     }
 
@@ -338,16 +347,15 @@
 
     private static String getReferralsHandlingMethod( SearchParameter parameter )
     {
-        String m = "follow"; //$NON-NLS-1$
+        String m = JNDIConnectionWrapper.REFERRAL_FOLLOW; //$NON-NLS-1$
 
         switch ( parameter.getReferralsHandlingMethod() )
         {
             case IGNORE:
-                m = "ignore"; //$NON-NLS-1$
+                m = JNDIConnectionWrapper.REFERRAL_IGNORE; //$NON-NLS-1$
                 break;
             case FOLLOW:
-                // m = "follow"; //$NON-NLS-1$
-                m = "throw"; //$NON-NLS-1$
+                m = JNDIConnectionWrapper.REFERRAL_FOLLOW; //$NON-NLS-1$
                 break;
         }
 

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/AttributeDescription.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/AttributeDescription.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/AttributeDescription.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/AttributeDescription.java Mon Nov 26 11:44:28 2007
@@ -88,8 +88,9 @@
         this.parsedAttributeType = attributeDescriptionComponents[0];
         this.parsedLangList = new ArrayList<String>();
         this.parsedOptionList = new ArrayList<String>();
-        for ( String component : attributeDescriptionComponents )
+        for ( int i = 1; i < attributeDescriptionComponents.length; i++ )
         {
+            String component = attributeDescriptionComponents[i];
             if ( component.startsWith( IAttribute.OPTION_LANG_PREFIX ) )
             {
                 this.parsedLangList.add( component );

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Control.java Mon Nov 26 11:44:28 2007
@@ -23,7 +23,7 @@
 
 import java.io.Serializable;
 
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifControlLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifControlLine;
 
 
 /**
@@ -50,6 +50,18 @@
     public static final Control SUBENTRIES_CONTROL = new Control( "Subentries Control", "1.3.6.1.4.1.4203.1.10.1",
         false, new byte[]
             { 0x01, 0x01, ( byte ) 0xFF } );
+
+    /**
+     * The Manage DSA IT control as defined in RFC 3296.
+     */
+    public static final Control MANAGEDSAIT_CONTROL = new Control( "Manage DSA IT Control", "2.16.840.1.113730.3.4.2",
+        false, null );
+
+    /**
+     * The Tree Delete control as defined in draft-armijo-ldap-treedelete-02.
+     */
+    public static final Control TREEDELETE_CONTROL = new Control( "Tree Delete Control", "1.2.840.113556.1.4.805",
+        false, null );
 
     /** The symbolic name. */
     private String name;

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java Mon Nov 26 11:44:28 2007
@@ -28,7 +28,6 @@
 import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
 import org.apache.directory.studio.ldapbrowser.core.BookmarkManager;
 import org.apache.directory.studio.ldapbrowser.core.SearchManager;
-import org.apache.directory.studio.ldapbrowser.core.model.impl.ModificationLogger;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.eclipse.core.runtime.IAdaptable;
 
@@ -340,14 +339,6 @@
      * @return the bookmark manager
      */
     public abstract BookmarkManager getBookmarkManager();
-
-
-    /**
-     * Gets the modification logger.
-     * 
-     * @return the modification logger
-     */
-    public abstract ModificationLogger getModificationLogger();
 
 
     /**

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IRootDSE.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IRootDSE.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IRootDSE.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IRootDSE.java Mon Nov 26 11:44:28 2007
@@ -87,4 +87,15 @@
      */
     public String[] getSupportedFeatures();
 
+
+    
+    /**
+     * Checks if control is supported.
+     * 
+     * @param oid the OID
+     * 
+     * @return true, if control is supported
+     */
+    public boolean isControlSupported( String oid );
+
 }

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Password.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Password.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Password.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/Password.java Mon Nov 26 11:44:28 2007
@@ -26,8 +26,8 @@
 import java.security.SecureRandom;
 
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
-import org.apache.directory.studio.ldapbrowser.core.utils.LdifUtils;
 import org.apache.directory.studio.ldapbrowser.core.utils.UnixCrypt;
+import org.apache.directory.studio.ldifparser.LdifUtils;
 
 
 /**

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapAndFilterComponent.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapAndFilterComponent.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapAndFilterComponent.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapAndFilterComponent.java Mon Nov 26 11:44:28 2007
@@ -21,8 +21,6 @@
 package org.apache.directory.studio.ldapbrowser.core.model.filter;
 
 
-import java.util.Iterator;
-
 import org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken;
 
 
@@ -88,9 +86,8 @@
     public String toString()
     {
         String s = startToken != null ? "&" : "";
-        for ( Iterator it = filterList.iterator(); it.hasNext(); )
+        for ( LdapFilter filter : filterList )
         {
-            LdapFilter filter = ( LdapFilter ) it.next();
             if ( filter != null )
             {
                 s += filter.toString();

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapOrFilterComponent.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapOrFilterComponent.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapOrFilterComponent.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/LdapOrFilterComponent.java Mon Nov 26 11:44:28 2007
@@ -21,8 +21,6 @@
 package org.apache.directory.studio.ldapbrowser.core.model.filter;
 
 
-import java.util.Iterator;
-
 import org.apache.directory.studio.ldapbrowser.core.model.filter.parser.LdapFilterToken;
 
 
@@ -88,9 +86,8 @@
     public String toString()
     {
         String s = startToken != null ? "|" : "";
-        for ( Iterator it = filterList.iterator(); it.hasNext(); )
+        for ( LdapFilter filter : filterList )
         {
-            LdapFilter filter = ( LdapFilter ) it.next();
             if ( filter != null )
             {
                 s += filter.toString();

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/parser/LdapFilterToken.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/parser/LdapFilterToken.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/parser/LdapFilterToken.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/filter/parser/LdapFilterToken.java Mon Nov 26 11:44:28 2007
@@ -27,7 +27,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class LdapFilterToken implements Comparable
+public class LdapFilterToken implements Comparable<LdapFilterToken>
 {
 
     /** The token identifier for a new filter */
@@ -183,7 +183,7 @@
     /**
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
-    public int compareTo( Object o )
+    public int compareTo( LdapFilterToken o )
     {
         if ( o instanceof LdapFilterToken )
         {

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java Mon Nov 26 11:44:28 2007
@@ -43,7 +43,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.URL;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
+import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 
@@ -85,9 +85,6 @@
     /** The entry to children info map. */
     private volatile Map<IEntry, ChildrenInfo> entryToChildrenInfoMap;
 
-    /** The modification logger. */
-    transient ModificationLogger modificationLogger;
-
 
     /**
      * Creates a new instance of BrowserConnection.
@@ -112,7 +109,6 @@
 
         this.searchManager = new SearchManager( this );
         this.bookmarkManager = new BookmarkManager( this );
-        this.modificationLogger = new ModificationLogger( this );
 
         this.entryToChildrenFilterMap = new HashMap<IEntry, String>();
         this.dnToEntryCache = new HashMap<String, IEntry>();
@@ -123,8 +119,6 @@
         this.rootDSE = new RootDSE( this );
         cacheEntry( this.rootDSE );
 
-        this.connection.getJNDIConnectionWrapper().setModificationLogger( this.modificationLogger );
-
         ConnectionEventRegistry.addConnectionUpdateListener( this, ConnectionCorePlugin.getDefault().getEventRunner() );
     }
 
@@ -166,7 +160,7 @@
      */
     public IEntry getEntryFromCache( LdapDN dn )
     {
-        String oidDn = DnUtils.getNormalizedOidString( dn, getSchema() );
+        String oidDn = Utils.getNormalizedOidString( dn, getSchema() );
         if ( dnToEntryCache != null && dnToEntryCache.containsKey( oidDn ) )
         {
             return dnToEntryCache.get( oidDn );
@@ -363,15 +357,6 @@
     /**
      * {@inheritDoc}
      */
-    public ModificationLogger getModificationLogger()
-    {
-        return modificationLogger;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     @SuppressWarnings("unchecked")
     public Object getAdapter( Class adapter )
     {
@@ -394,7 +379,7 @@
      */
     public synchronized void cacheEntry( IEntry entry )
     {
-        dnToEntryCache.put( DnUtils.getNormalizedOidString( entry.getDn(), getSchema() ), entry );
+        dnToEntryCache.put( Utils.getNormalizedOidString( entry.getDn(), getSchema() ), entry );
     }
 
 
@@ -405,7 +390,7 @@
      */
     protected synchronized void uncacheEntry( IEntry entry )
     {
-        dnToEntryCache.remove( DnUtils.getNormalizedOidString( entry.getDn(), getSchema() ) );
+        dnToEntryCache.remove( Utils.getNormalizedOidString( entry.getDn(), getSchema() ) );
     }
 
 
@@ -433,7 +418,7 @@
      */
     protected synchronized void uncacheEntry( LdapDN dn )
     {
-        dnToEntryCache.remove( DnUtils.getNormalizedOidString( dn, getSchema() ) );
+        dnToEntryCache.remove( Utils.getNormalizedOidString( dn, getSchema() ) );
     }
 
 

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java Mon Nov 26 11:44:28 2007
@@ -778,4 +778,21 @@
         return null;
     }
 
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean equals( Object o )
+    {
+        // check argument
+        if ( o == null || !( o instanceof IEntry ) )
+        {
+            return false;
+        }
+        IEntry e = ( IEntry ) o;
+
+        // compare dn and connection
+        return getDn() == null ? e.getDn() == null : ( getDn().equals( e.getDn() ) && getBrowserConnection().equals(
+            e.getBrowserConnection() ) );
+    }
 }

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java Mon Nov 26 11:44:28 2007
@@ -220,15 +220,6 @@
     /** 
      * {@inheritDoc}
      */
-    public ModificationLogger getModificationLogger()
-    {
-        return null;
-    }
-
-
-    /** 
-     * {@inheritDoc}
-     */
     public ReferralHandlingMethod getReferralsHandlingMethod()
     {
         return ReferralHandlingMethod.IGNORE;

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Entry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Entry.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Entry.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Entry.java Mon Nov 26 11:44:28 2007
@@ -23,9 +23,9 @@
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.studio.connection.core.DnUtils;
 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.utils.DnUtils;
 
 
 /**

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/RootDSE.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/RootDSE.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/RootDSE.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/RootDSE.java Mon Nov 26 11:44:28 2007
@@ -124,5 +124,14 @@
     {
         return false;
     }
+    
+    /**
+     * @see org.apache.directory.studio.ldapbrowser.core.model.IRootDSE#isControlSupported(java.lang.String)
+     */
+    public boolean isControlSupported( String oid )
+    {
+        String[] supportedControls = getSupportedControls();
+        return Arrays.asList( supportedControls ).contains( oid );
+    }
 
 }

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Value.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Value.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Value.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Value.java Mon Nov 26 11:44:28 2007
@@ -30,8 +30,8 @@
 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.utils.LdifUtils;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
+import org.apache.directory.studio.ldifparser.LdifUtils;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java Mon Nov 26 11:44:28 2007
@@ -40,13 +40,14 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.ldapbrowser.core.model.AttributeDescription;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifEnumeration;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContainer;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifAttrValLine;
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.parser.LdifParser;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.parser.SchemaLexer;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.parser.SchemaParser;
+import org.apache.directory.studio.ldifparser.LdifFormatParameters;
+import org.apache.directory.studio.ldifparser.model.LdifEnumeration;
+import org.apache.directory.studio.ldifparser.model.container.LdifContainer;
+import org.apache.directory.studio.ldifparser.model.container.LdifContentRecord;
+import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
+import org.apache.directory.studio.ldifparser.parser.LdifParser;
 
 
 public class Schema implements Serializable
@@ -152,9 +153,9 @@
         {
             LdifParser parser = new LdifParser();
             LdifEnumeration enumeration = parser.parse( reader );
-            if ( enumeration.hasNext( null ) )
+            if ( enumeration.hasNext() )
             {
-                LdifContainer container = enumeration.next( null );
+                LdifContainer container = enumeration.next();
                 if ( container instanceof LdifContentRecord )
                 {
                     LdifContentRecord schemaRecord = ( LdifContentRecord ) container;
@@ -191,7 +192,7 @@
     {
         try
         {
-            writer.write( this.getSchemaRecord().toFormattedString() );
+            writer.write( this.getSchemaRecord().toFormattedString( LdifFormatParameters.DEFAULT ) );
         }
         catch ( Exception e )
         {

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaPart.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaPart.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaPart.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/SchemaPart.java Mon Nov 26 11:44:28 2007
@@ -23,7 +23,7 @@
 
 import java.io.Serializable;
 
-import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifAttrValLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
 
 
 public abstract class SchemaPart implements Comparable, Serializable

Modified: directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/AttributeComparator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/AttributeComparator.java?rev=598395&r1=598394&r2=598395&view=diff
==============================================================================
--- directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/AttributeComparator.java (original)
+++ directory/sandbox/felixk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/AttributeComparator.java Mon Nov 26 11:44:28 2007
@@ -30,7 +30,7 @@
 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.ldapbrowser.core.model.ldif.lines.LdifAttrValLine;
+import org.apache.directory.studio.ldifparser.model.lines.LdifAttrValLine;
 
 
 public class AttributeComparator implements Comparator



Mime
View raw message