directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r525316 - in /directory/ldapstudio/trunk: ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/ ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/ ldapstudio...
Date Tue, 03 Apr 2007 22:47:14 GMT
Author: seelmann
Date: Tue Apr  3 15:47:13 2007
New Revision: 525316

URL: http://svn.apache.org/viewvc?view=rev&rev=525316
Log:
DIRSTUDIO-74: 
- Added handling for empty DN in namingContexts
- Empty DN could be used as base DN
- Restructured browser widget, the RootDSE is now the root of the tree
- Added search support for the empty DN

Modified:
    directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/BaseDNEntry.java
    directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/Connection.java
    directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java
    directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/FetchBaseDNsJob.java
    directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/InitializeChildrenJob.java
    directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/DN.java
    directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IConnection.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/actions/SelectionUtils.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/SelectEntryDialog.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserContentProvider.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserLabelProvider.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/connection/ConnectionPageWrapper.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java

Modified: directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/BaseDNEntry.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/BaseDNEntry.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/BaseDNEntry.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/BaseDNEntry.java Tue Apr  3 15:47:13 2007
@@ -53,9 +53,6 @@
         {
             throw new ModelModificationException( BrowserCoreMessages.model__empty_dn );
         }
-        if ( "".equals( baseDn.toString() ) ) { //$NON-NLS-1$
-            throw new ModelModificationException( BrowserCoreMessages.model__empty_dn );
-        }
         if ( connection == null )
         {
             throw new ModelModificationException( BrowserCoreMessages.model__empty_connection );
@@ -76,7 +73,7 @@
 
     public IEntry getParententry()
     {
-        return null;
+        return getConnection().getRootDSE();
     }
 
 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/Connection.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/Connection.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/Connection.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/Connection.java Tue Apr  3 15:47:13 2007
@@ -26,8 +26,10 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.directory.ldapstudio.browser.core.BookmarkManager;
 import org.apache.directory.ldapstudio.browser.core.BrowserCoreMessages;
@@ -67,10 +69,6 @@
 
     private ConnectionParameter connectionParameter;
 
-    private IEntry[] baseDNEntries;
-
-    private IEntry[] metadataEntries;
-
     private IRootDSE rootDSE;
 
     private Schema schema;
@@ -124,8 +122,6 @@
         this.connectionParameter.setBindPrincipal( bindPrincipal );
         this.connectionParameter.setBindPassword( bindPassword );
 
-        this.baseDNEntries = new IEntry[0];
-        this.metadataEntries = new IEntry[0];
         this.rootDSE = null;
 
         this.schema = Schema.DEFAULT_SCHEMA;
@@ -248,8 +244,6 @@
 
     public void fetchRootDSE( ExtendedProgressMonitor monitor )
     {
-        this.bind( monitor );
-
         if ( this.connectionProvider != null )
         {
             try
@@ -269,36 +263,14 @@
 
     public void open( ExtendedProgressMonitor monitor )
     {
+        this.bind( monitor );
+        
         this.fetchRootDSE( monitor );
 
         if ( this.connectionProvider != null && this.rootDSE != null )
         {
             try
             {
-                monitor.reportProgress( BrowserCoreMessages.model__setting_base_dn );
-                if ( !this.connectionParameter.isFetchBaseDNs() )
-                {
-                    this.baseDNEntries = new BaseDNEntry[1];
-                    this.baseDNEntries[0] = new BaseDNEntry( new DN( this.connectionParameter.getBaseDN() ), this );
-                    this.cacheEntry( this.baseDNEntries[0] );
-                }
-            }
-            catch ( ModelModificationException mme )
-            {
-                monitor.reportError( BrowserCoreMessages.model__error_setting_base_dn, mme );
-            }
-
-            try
-            {
-                this.loadDirectoryMetadataEntries();
-            }
-            catch ( ModelModificationException mme )
-            {
-                monitor.reportError( BrowserCoreMessages.model__error_setting_metadata, mme );
-            }
-
-            try
-            {
                 monitor.reportProgress( BrowserCoreMessages.model__loading_schema );
 
                 // check if schema is cached
@@ -415,15 +387,6 @@
                 this.connectionProvider = null;
             }
 
-            if ( this.baseDNEntries != null )
-            {
-                this.baseDNEntries = new BaseDNEntry[0];
-            }
-            if ( this.metadataEntries != null )
-            {
-                this.metadataEntries = new IEntry[0];
-            }
-
             for ( int i = 0; i < this.getSearchManager().getSearchCount(); i++ )
             {
                 this.getSearchManager().getSearches()[i].setSearchResults( null );
@@ -446,87 +409,96 @@
 
     private void loadRootDSE( ExtendedProgressMonitor monitor ) throws Exception
     {
-        this.rootDSE = new RootDSE( this );
-        this.cacheEntry( this.rootDSE );
-
-        // First get ALL attributes
-        ISearch search = new Search( null, this, new DN(), ISearch.FILTER_TRUE, null, ISearch.SCOPE_OBJECT, 0, 0,
-            IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
-        this.search( search, monitor );
+        if(rootDSE == null)
+        {
+            rootDSE = new RootDSE( this );
+            cacheEntry( rootDSE );
+        }
 
-        // Second get well-known root DSE attributes
-        search = new Search( null, this, new DN(), ISearch.FILTER_TRUE, ROOT_DSE_ATTRIBUTES, ISearch.SCOPE_OBJECT, 0,
+        // get well-known root DSE attributes, includes + and *
+        ISearch search = new Search( null, this, new DN(), ISearch.FILTER_TRUE, ROOT_DSE_ATTRIBUTES, ISearch.SCOPE_OBJECT, 0,
             0, IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
-        this.search( search, monitor );
+        search( search, monitor );
 
-        // Set base DNs from root DSE
-        if ( this.rootDSE != null )
+        // get base DNs
+        if( !isFetchBaseDNs() && getBaseDN() != null && !"".equals( getBaseDN().toString() ))
         {
-            try
+            // only add the specified base DN
+            IEntry entry = new BaseDNEntry( new DN( getBaseDN() ), this );
+            rootDSE.addChild( entry );
+            cacheEntry( entry );
+        }
+        else
+        {
+            // get naming contexts 
+            Set<String> namingContextSet = new HashSet<String>();
+            IAttribute attribute = rootDSE.getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS );
+            if ( attribute != null )
             {
-                List baseDnEntryList = new ArrayList();
-                String[] baseDnAttributeNames = new String[]
-                    { IRootDSE.ROOTDSE_ATTRIBUTE_NAMINGCONTEXTS };
-                for ( int x = 0; x < baseDnAttributeNames.length; x++ )
+                String[] values = attribute.getStringValues();
+                for ( int i = 0; i < values.length; i++ )
                 {
-                    IAttribute attribute = this.rootDSE.getAttribute( baseDnAttributeNames[x] );
-                    if ( attribute != null )
+                    namingContextSet.add( values[i] );
+                }
+            }
+            for ( String namingContext : namingContextSet )
+            {
+                if ( !"".equals( namingContext ) ) { //$NON-NLS-1$
+                    try
                     {
-                        String[] values = attribute.getStringValues();
-                        for ( int i = 0; i < values.length; i++ )
-                        {
-                            if ( !"".equals( values[i] ) ) { //$NON-NLS-1$
-                                baseDnEntryList.add( values[i] );
-                            }
-                        }
+                        IEntry entry = new BaseDNEntry( new DN( namingContext ), this );
+                        rootDSE.addChild( entry );
+                        cacheEntry( entry );
+                    }
+                    catch ( Exception e )
+                    {
+                        monitor.reportError( BrowserCoreMessages.model__error_setting_base_dn, e );
                     }
                 }
-                this.baseDNEntries = new BaseDNEntry[baseDnEntryList.size()];
-                for ( int i = 0; i < this.baseDNEntries.length; i++ )
+                else
                 {
-                    this.baseDNEntries[i] = new BaseDNEntry( new DN( ( String ) baseDnEntryList.get( i ) ), this );
-                    this.cacheEntry( this.baseDNEntries[i] );
+                    // special handling of empty namingContext: perform a one-level search and add all result DNs to the set
+                    search = new Search( null, this, new DN(), ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, ISearch.SCOPE_ONELEVEL, 0,
+                        0, IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
+                    search( search, monitor );
+                    ISearchResult[] results = search.getSearchResults();
+                    for ( int k = 0; results != null && k < results.length; k++ )
+                    {
+                        ISearchResult result = results[k];
+                        IEntry entry = result.getEntry();
+                        rootDSE.addChild( entry );
+                    }
                 }
-
-                // this.loadDirectoryMetadataEntries();
-            }
-            catch ( Exception e )
-            {
-                monitor.reportError( BrowserCoreMessages.model__error_setting_base_dn, e );
             }
         }
-    }
-
-
-    private void loadDirectoryMetadataEntries() throws ModelModificationException
-    {
-
-        List metadataEntryList = new ArrayList();
 
-        // special case for schema entry
+        // get schema entry
         DirectoryMetadataEntry[] schemaEntries = getDirectoryMetadataEntries( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY );
         for ( int i = 0; i < schemaEntries.length; i++ )
         {
             schemaEntries[i].setSchemaEntry( true );
+            rootDSE.addChild( ( IEntry ) schemaEntries[i] );
         }
-        metadataEntryList.addAll( Arrays.asList( schemaEntries ) );
-
-        // other metadata entries
+        
+        // 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++ )
         {
             DirectoryMetadataEntry[] metadataEntries = getDirectoryMetadataEntries( metadataAttributeNames[x] );
-            metadataEntryList.addAll( Arrays.asList( metadataEntries ) );
-        }
-
-        this.metadataEntries = new IEntry[metadataEntryList.size()];
-        for ( int i = 0; i < metadataEntryList.size(); i++ )
-        {
-            this.metadataEntries[i] = ( IEntry ) metadataEntryList.get( i );
-            this.cacheEntry( this.metadataEntries[i] );
+            for ( int i = 0; i < metadataEntries.length; i++ )
+            {
+                rootDSE.addChild( ( IEntry ) metadataEntries[i] );
+            }
         }
+        
+        // set flags
+        rootDSE.setHasMoreChildren( false );
+        rootDSE.setAttributesInitialized( true );
+        rootDSE.setChildrenInitialized( true );
+        rootDSE.setHasChildrenHint( true );
+        rootDSE.setDirectoryEntry( true );
 
     }
 
@@ -556,6 +528,7 @@
         {
             metadataEntries[i] = new DirectoryMetadataEntry( ( DN ) metadataEntryList.get( i ), this );
             metadataEntries[i].setDirectoryEntry( true );
+            cacheEntry( metadataEntries[i] );
         }
         return metadataEntries;
     }
@@ -569,10 +542,6 @@
         try
         {
 
-            // System.out.println(this.rootDSE);
-            // System.out.println(Arrays.asList(this.rootDSE.getAttributes()));
-            // System.out.println(this.rootDSE.getAttribute(IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY));
-
             if ( this.rootDSE.getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY ) != null )
             {
                 SearchParameter sp = new SearchParameter();
@@ -641,28 +610,6 @@
         {
             return this.rootDSE;
         }
-        if ( this.baseDNEntries != null )
-        {
-            for ( int i = 0; i < this.baseDNEntries.length; i++ )
-            {
-                if ( this.baseDNEntries[i] != null && this.baseDNEntries[i].getDn() != null
-                    && this.baseDNEntries[i].getDn().equals( dn ) )
-                {
-                    return this.baseDNEntries[i];
-                }
-            }
-        }
-        if ( this.metadataEntries != null )
-        {
-            for ( int i = 0; i < this.metadataEntries.length; i++ )
-            {
-                if ( this.metadataEntries[i] != null && this.metadataEntries[i].getDn() != null
-                    && this.metadataEntries[i].getDn().equals( dn ) )
-                {
-                    return this.metadataEntries[i];
-                }
-            }
-        }
         return null;
     }
 
@@ -904,18 +851,6 @@
         this.connectionParameter.setConnectionProviderClassName( connectionProviderClassName );
         EventRegistry.fireConnectionUpdated( new ConnectionUpdateEvent( this,
             ConnectionUpdateEvent.CONNECTION_PARAMETER_UPDATED ), this );
-    }
-
-
-    public final IEntry[] getBaseDNEntries()
-    {
-        return this.baseDNEntries;
-    }
-
-
-    public final IEntry[] getMetadataEntries()
-    {
-        return this.metadataEntries;
     }
 
 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/internal/model/RootDSE.java Tue Apr  3 15:47:13 2007
@@ -27,6 +27,7 @@
 
 import org.apache.directory.ldapstudio.browser.core.model.DN;
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
+import org.apache.directory.ldapstudio.browser.core.model.IEntry;
 import org.apache.directory.ldapstudio.browser.core.model.IRootDSE;
 import org.apache.directory.ldapstudio.browser.core.model.ModelModificationException;
 
@@ -63,31 +64,21 @@
 
     public RootDSE( IConnection connection ) throws ModelModificationException
     {
-        super();
-        this.setDirectoryEntry( true );
-        // this.connectionName = connection.getName();
-        this.connection = connection;
-        this.baseDn = new DN();
+        super( new DN(), connection );
     }
 
-
-    public boolean hasChildren()
-    {
-        return false;
-    }
-
-
-    public boolean isAttributesInitialized()
+    
+    public IEntry getParententry()
     {
-        return true;
+        return null;
     }
-
+    
 
     public String[] getSupportedExtensions()
     {
-        if ( getAttribute( ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION ) != null )
+        if ( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION ) != null )
         {
-            return get( getAttribute( ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION ).getStringValues() );
+            return get( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDEXTENSION ).getStringValues() );
         }
         else
         {
@@ -98,9 +89,9 @@
 
     public String[] getSupportedControls()
     {
-        if ( getAttribute( ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL ) != null )
+        if ( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL ) != null )
         {
-            return get( getAttribute( ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL ).getStringValues() );
+            return get( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDCONTROL ).getStringValues() );
         }
         else
         {
@@ -111,9 +102,9 @@
 
     public String[] getSupportedFeatures()
     {
-        if ( getAttribute( ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES ) != null )
+        if ( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES ) != null )
         {
-            return get( getAttribute( ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES ).getStringValues() );
+            return get( getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUPPORTEDFEATURES ).getStringValues() );
         }
         else
         {

Modified: directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/FetchBaseDNsJob.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/FetchBaseDNsJob.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/FetchBaseDNsJob.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/FetchBaseDNsJob.java Tue Apr  3 15:47:13 2007
@@ -65,9 +65,10 @@
         monitor.reportProgress( " " ); //$NON-NLS-1$
         monitor.worked( 1 );
 
+        connection.bind( monitor );
         connection.fetchRootDSE( monitor );
 
-        IEntry[] baseDNEntries = connection.getBaseDNEntries();
+        IEntry[] baseDNEntries = connection.getRootDSE().getChildren();
         baseDNs = new String[baseDNEntries.length];
         for ( int i = 0; i < baseDNs.length; i++ )
         {

Modified: directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/InitializeChildrenJob.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/InitializeChildrenJob.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/InitializeChildrenJob.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/jobs/InitializeChildrenJob.java Tue Apr  3 15:47:13 2007
@@ -121,13 +121,6 @@
             new String[]
                 { parent.getDn().toString() } ) );
 
-        // root DSE has no children
-        if ( parent instanceof IRootDSE )
-        {
-            parent.setChildrenInitialized( true );
-            return;
-        }
-
         // clear old children
         IEntry[] oldChildren = parent.getChildren();
         for ( int i = 0; oldChildren != null && i < oldChildren.length; i++ )
@@ -139,111 +132,123 @@
         }
         parent.setChildrenInitialized( false );
 
-        // determine alias and referral handling
-        int scope = ISearch.SCOPE_ONELEVEL;
-        int derefAliasMethod = parent.getConnection().getAliasesDereferencingMethod();
-        int handleReferralsMethod = parent.getConnection().getReferralsHandlingMethod();
-        if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-            BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS ) )
+        if ( parent instanceof IRootDSE )
         {
-            scope = ( parent.isAlias() || parent.isReferral() ) ? ISearch.SCOPE_OBJECT : ISearch.SCOPE_ONELEVEL;
-            derefAliasMethod = parent.isAlias() ? IConnection.DEREFERENCE_ALIASES_FINDING
-                : IConnection.DEREFERENCE_ALIASES_NEVER;
-            handleReferralsMethod = parent.isReferral() ? IConnection.HANDLE_REFERRALS_FOLLOW
-                : IConnection.HANDLE_REFERRALS_IGNORE;
+            // special handling for Root DSE 
+            //parent.setChildrenInitialized( true );
+            //return;
+            parent.getConnection().fetchRootDSE( monitor );
+            parent.setChildrenInitialized( true );
+            return;
         }
-
-        // get children,
-        ISearch search = new Search( null, parent.getConnection(), parent.getDn(), parent.getChildrenFilter(),
-            ISearch.NO_ATTRIBUTES, scope, parent.getConnection().getCountLimit(),
-            parent.getConnection().getTimeLimit(), derefAliasMethod, handleReferralsMethod, BrowserCorePlugin
-                .getDefault().getPluginPreferences().getBoolean( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ),
-            BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-                BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS ), null );
-        parent.getConnection().search( search, monitor );
-        ISearchResult[] srs = search.getSearchResults();
-        monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_subcount,
-            new String[]
-                { srs == null ? Integer.toString( 0 ) : Integer.toString( srs.length ), parent.getDn().toString() } ) );
-
-        // fill children in search result
-        if ( srs != null && srs.length > 0 )
+        else
         {
-
-            /*
-             * clearing old children before filling new subenties is
-             * necessary to handle aliases and referrals.
-             */
-            IEntry[] connChildren = parent.getChildren();
-            for ( int i = 0; connChildren != null && i < connChildren.length; i++ )
+            // determine alias and referral handling
+            int scope = ISearch.SCOPE_ONELEVEL;
+            int derefAliasMethod = parent.getConnection().getAliasesDereferencingMethod();
+            int handleReferralsMethod = parent.getConnection().getReferralsHandlingMethod();
+            if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
+                BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS ) )
             {
-                if ( connChildren[i] != null )
-                {
-                    parent.deleteChild( connChildren[i] );
-                }
+                scope = ( parent.isAlias() || parent.isReferral() ) ? ISearch.SCOPE_OBJECT : ISearch.SCOPE_ONELEVEL;
+                derefAliasMethod = parent.isAlias() ? IConnection.DEREFERENCE_ALIASES_FINDING
+                    : IConnection.DEREFERENCE_ALIASES_NEVER;
+                handleReferralsMethod = parent.isReferral() ? IConnection.HANDLE_REFERRALS_FOLLOW
+                    : IConnection.HANDLE_REFERRALS_IGNORE;
             }
-            parent.setChildrenInitialized( false );
+    
+            // get children,
+            ISearch search = new Search( null, parent.getConnection(), parent.getDn(), parent.getChildrenFilter(),
+                ISearch.NO_ATTRIBUTES, scope, parent.getConnection().getCountLimit(),
+                parent.getConnection().getTimeLimit(), derefAliasMethod, handleReferralsMethod, BrowserCorePlugin
+                    .getDefault().getPluginPreferences().getBoolean( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ),
+                BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
+                    BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS ), null );
+            parent.getConnection().search( search, monitor );
+            ISearchResult[] srs = search.getSearchResults();
+            monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_subcount,
+                new String[]
+                    { srs == null ? Integer.toString( 0 ) : Integer.toString( srs.length ), parent.getDn().toString() } ) );
 
-            for ( int i = 0; srs != null && i < srs.length; i++ )
+            // fill children in search result
+            if ( srs != null && srs.length > 0 )
             {
-                if ( parent.isReferral() )
-                {
-                    ReferralBaseEntry referralBaseEntry = new ReferralBaseEntry( srs[i].getEntry().getConnection(),
-                        srs[i].getEntry().getDn() );
-                    parent.addChild( referralBaseEntry );
-                    // System.out.println("Ref: " +
-                    // referralBaseEntry.getUrl());
-                }
-                else if ( parent.isAlias() )
+    
+                /*
+                 * clearing old children before filling new subenties is
+                 * necessary to handle aliases and referrals.
+                 */
+                IEntry[] connChildren = parent.getChildren();
+                for ( int i = 0; connChildren != null && i < connChildren.length; i++ )
                 {
-                    AliasBaseEntry aliasBaseEntry = new AliasBaseEntry( srs[i].getEntry().getConnection(), srs[i]
-                        .getEntry().getDn() );
-                    parent.addChild( aliasBaseEntry );
-                    // System.out.println("Ali: " +
-                    // aliasBaseEntry.getUrl());
+                    if ( connChildren[i] != null )
+                    {
+                        parent.deleteChild( connChildren[i] );
+                    }
                 }
-                else
+                parent.setChildrenInitialized( false );
+    
+                for ( int i = 0; srs != null && i < srs.length; i++ )
                 {
-                    parent.addChild( srs[i].getEntry() );
+                    if ( parent.isReferral() )
+                    {
+                        ReferralBaseEntry referralBaseEntry = new ReferralBaseEntry( srs[i].getEntry().getConnection(),
+                            srs[i].getEntry().getDn() );
+                        parent.addChild( referralBaseEntry );
+                        // System.out.println("Ref: " +
+                        // referralBaseEntry.getUrl());
+                    }
+                    else if ( parent.isAlias() )
+                    {
+                        AliasBaseEntry aliasBaseEntry = new AliasBaseEntry( srs[i].getEntry().getConnection(), srs[i]
+                            .getEntry().getDn() );
+                        parent.addChild( aliasBaseEntry );
+                        // System.out.println("Ali: " +
+                        // aliasBaseEntry.getUrl());
+                    }
+                    else
+                    {
+                        parent.addChild( srs[i].getEntry() );
+                    }
                 }
             }
-        }
-        else
-        {
-            parent.setHasChildrenHint( false );
-        }
-
-        // get subentries
-        ISearch subSearch = new Search( null, parent.getConnection(), parent.getDn(), parent.getChildrenFilter(),
-            ISearch.NO_ATTRIBUTES, scope, parent.getConnection().getCountLimit(),
-            parent.getConnection().getTimeLimit(), derefAliasMethod, handleReferralsMethod, BrowserCorePlugin
-                .getDefault().getPluginPreferences().getBoolean( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ),
-            BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-                BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS ), new Control[]
-                { Control.SUBENTRIES_CONTROL } );
-        if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-            BrowserCoreConstants.PREFERENCE_FETCH_SUBENTRIES ) )
-        {
-            parent.getConnection().search( subSearch, monitor );
-            ISearchResult[] subSrs = subSearch.getSearchResults();
-            monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_subcount,
-                new String[]
-                    { subSrs == null ? Integer.toString( 0 ) : Integer.toString( subSrs.length ),
-                        parent.getDn().toString() } ) );
-            // fill children in search result
-            if ( subSrs != null && subSrs.length > 0 )
+            else
             {
-
-                for ( int i = 0; subSrs != null && i < subSrs.length; i++ )
+                parent.setHasChildrenHint( false );
+            }
+    
+            // get subentries
+            ISearch subSearch = new Search( null, parent.getConnection(), parent.getDn(), parent.getChildrenFilter(),
+                ISearch.NO_ATTRIBUTES, scope, parent.getConnection().getCountLimit(),
+                parent.getConnection().getTimeLimit(), derefAliasMethod, handleReferralsMethod, BrowserCorePlugin
+                    .getDefault().getPluginPreferences().getBoolean( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ),
+                BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
+                    BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS ), new Control[]
+                    { Control.SUBENTRIES_CONTROL } );
+            if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
+                BrowserCoreConstants.PREFERENCE_FETCH_SUBENTRIES ) )
+            {
+                parent.getConnection().search( subSearch, monitor );
+                ISearchResult[] subSrs = subSearch.getSearchResults();
+                monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_subcount,
+                    new String[]
+                        { subSrs == null ? Integer.toString( 0 ) : Integer.toString( subSrs.length ),
+                            parent.getDn().toString() } ) );
+                // fill children in search result
+                if ( subSrs != null && subSrs.length > 0 )
                 {
-                    parent.addChild( subSrs[i].getEntry() );
+    
+                    for ( int i = 0; subSrs != null && i < subSrs.length; i++ )
+                    {
+                        parent.addChild( subSrs[i].getEntry() );
+                    }
                 }
             }
+            
+            // check exceeded limits / canceled
+            parent.setHasMoreChildren( search.isCountLimitExceeded() || subSearch.isCountLimitExceeded()
+                || monitor.isCanceled() );
         }
-
-        // check exceeded limits / canceled
-        parent.setHasMoreChildren( search.isCountLimitExceeded() || subSearch.isCountLimitExceeded()
-            || monitor.isCanceled() );
 
         // set initialized state
         parent.setChildrenInitialized( true );

Modified: directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/DN.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/DN.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/DN.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/DN.java Tue Apr  3 15:47:13 2007
@@ -192,7 +192,7 @@
      */
     public DN getParentDn()
     {
-        if ( this.rdns.length < 2 )
+        if ( this.rdns.length < 1 )
         {
             return null;
         }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IConnection.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IConnection.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IConnection.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-core/src/main/java/org/apache/directory/ldapstudio/browser/core/model/IConnection.java Tue Apr  3 15:47:13 2007
@@ -152,12 +152,6 @@
     public void setAuthMethod( int authMethod );
 
 
-    public abstract IEntry[] getBaseDNEntries();
-
-
-    public abstract IEntry[] getMetadataEntries();
-
-
     public abstract IRootDSE getRootDSE();
 
 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/actions/SelectionUtils.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/actions/SelectionUtils.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/actions/SelectionUtils.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/actions/SelectionUtils.java Tue Apr  3 15:47:13 2007
@@ -212,18 +212,26 @@
             {
                 IConnection connection = ( IConnection ) obj;
                 exampleSearch.setConnection( connection );
-                if ( connection.getBaseDNEntries().length > 0 )
+                if ( connection.getRootDSE().getChildrenCount() > 0 )
                 {
-                    exampleSearch.setSearchBase( connection.getBaseDNEntries()[0].getDn() );
+                    exampleSearch.setSearchBase( connection.getRootDSE().getChildren()[0].getDn() );
+                }
+                else
+                {
+                    exampleSearch.setSearchBase( connection.getRootDSE().getDn() );
                 }
             }
             else if ( obj instanceof BrowserCategory )
             {
                 BrowserCategory cat = ( BrowserCategory ) obj;
                 exampleSearch.setConnection( cat.getParent() );
-                if ( cat.getParent().getBaseDNEntries().length > 0 )
+                if ( cat.getParent().getRootDSE().getChildrenCount() > 0 )
+                {
+                    exampleSearch.setSearchBase( cat.getParent().getRootDSE().getChildren()[0].getDn() );
+                }
+                else
                 {
-                    exampleSearch.setSearchBase( cat.getParent().getBaseDNEntries()[0].getDn() );
+                    exampleSearch.setSearchBase( cat.getParent().getRootDSE().getDn() );
                 }
             }
 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/SelectEntryDialog.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/SelectEntryDialog.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/SelectEntryDialog.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/SelectEntryDialog.java Tue Apr  3 15:47:13 2007
@@ -144,7 +144,8 @@
         // create main widget
         this.mainWidget = new BrowserWidget( this.configuration, null );
         this.mainWidget.createWidget( composite );
-        this.mainWidget.setInput( this.connection.getBaseDNEntries() );
+        this.mainWidget.setInput( new IEntry[]
+            { this.connection.getRootDSE() } );
 
         // create actions and context menu (and register global actions)
         this.actionGroup = new BrowserActionGroup( this.mainWidget, this.configuration );
@@ -171,6 +172,7 @@
             }
         } );
 
+        this.mainWidget.getViewer().expandToLevel( 2 );
         if ( this.initialEntry != null )
         {
             IEntry entry = this.initialEntry;

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/dialogs/properties/RootDSEPropertyPage.java Tue Apr  3 15:47:13 2007
@@ -25,6 +25,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.directory.ldapstudio.browser.core.internal.model.RootDSE;
 import org.apache.directory.ldapstudio.browser.core.model.IAttribute;
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.core.model.IEntry;
@@ -250,7 +251,7 @@
         controlsViewer.setLabelProvider( new LabelProvider() );
         if ( connection != null && connection.getRootDSE() != null )
         {
-            controlsViewer.setInput( connection.getRootDSE().getSupportedControls() );
+            controlsViewer.setInput( ((RootDSE)connection.getRootDSE()).getSupportedControls() );
         }
         this.controlsTab = new TabItem( this.tabFolder, SWT.NONE );
         this.controlsTab.setText( "Controls" );
@@ -266,7 +267,7 @@
         extensionViewer.setLabelProvider( new LabelProvider() );
         if ( connection != null && connection.getRootDSE() != null )
         {
-            extensionViewer.setInput( connection.getRootDSE().getSupportedExtensions() );
+            extensionViewer.setInput( ((RootDSE)connection.getRootDSE()).getSupportedExtensions() );
         }
         this.extensionsTab = new TabItem( this.tabFolder, SWT.NONE );
         this.extensionsTab.setText( "Extensions" );
@@ -282,7 +283,7 @@
         featureViewer.setLabelProvider( new LabelProvider() );
         if ( connection != null && connection.getRootDSE() != null )
         {
-            featureViewer.setInput( connection.getRootDSE().getSupportedFeatures() );
+            featureViewer.setInput( ((RootDSE)connection.getRootDSE()).getSupportedFeatures() );
         }
         this.featuresTab = new TabItem( this.tabFolder, SWT.NONE );
         this.featuresTab.setText( "Features" );

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java Tue Apr  3 15:47:13 2007
@@ -40,6 +40,7 @@
 import org.apache.directory.ldapstudio.browser.core.model.IBookmark;
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.core.model.IEntry;
+import org.apache.directory.ldapstudio.browser.core.model.IRootDSE;
 import org.apache.directory.ldapstudio.browser.core.model.ISearch;
 import org.apache.directory.ldapstudio.browser.core.model.ISearchResult;
 import org.apache.directory.ldapstudio.browser.ui.actions.SelectionUtils;
@@ -48,7 +49,6 @@
 import org.apache.directory.ldapstudio.browser.ui.editors.searchresult.SearchResultEditor;
 import org.apache.directory.ldapstudio.browser.ui.editors.searchresult.SearchResultEditorInput;
 import org.apache.directory.ldapstudio.browser.ui.views.connection.ConnectionView;
-import org.apache.directory.ldapstudio.browser.ui.widgets.browser.BrowserCategory;
 import org.apache.directory.ldapstudio.browser.ui.widgets.browser.BrowserUniversalListener;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -399,24 +399,18 @@
     {
         if ( connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.CONNECTION_OPENED )
         {
+            // expand viewer
             viewer.refresh( connectionUpdateEvent.getConnection() );
             viewer.expandToLevel( 2 );
+            
+            // expand root DSE to show base entries
+            IRootDSE rootDSE = connectionUpdateEvent.getConnection().getRootDSE();
+            viewer.expandToLevel( rootDSE, 1 );
 
+            // expand base entries, if requested
             if ( view.getConfiguration().getPreferences().isExpandBaseEntries() )
             {
-                Object[] expandedElements = viewer.getExpandedElements();
-                for ( int i = 0; i < expandedElements.length; i++ )
-                {
-                    Object object = expandedElements[i];
-                    if ( object instanceof BrowserCategory )
-                    {
-                        BrowserCategory bc = ( BrowserCategory ) object;
-                        if ( bc.getType() == BrowserCategory.TYPE_DIT )
-                        {
-                            viewer.expandToLevel( bc, 3 );
-                        }
-                    }
-                }
+                viewer.expandToLevel( rootDSE, 2 );
             }
         }
         else if ( connectionUpdateEvent.getDetail() == ConnectionUpdateEvent.CONNECTION_CLOSED )

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserContentProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserContentProvider.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserContentProvider.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserContentProvider.java Tue Apr  3 15:47:13 2007
@@ -31,13 +31,13 @@
 import org.apache.directory.ldapstudio.browser.core.BrowserCoreConstants;
 import org.apache.directory.ldapstudio.browser.core.BrowserCorePlugin;
 import org.apache.directory.ldapstudio.browser.core.internal.model.DirectoryMetadataEntry;
-import org.apache.directory.ldapstudio.browser.core.internal.model.RootDSE;
 import org.apache.directory.ldapstudio.browser.core.jobs.InitializeChildrenJob;
 import org.apache.directory.ldapstudio.browser.core.jobs.OpenConnectionsJob;
 import org.apache.directory.ldapstudio.browser.core.jobs.SearchJob;
 import org.apache.directory.ldapstudio.browser.core.model.IBookmark;
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.core.model.IEntry;
+import org.apache.directory.ldapstudio.browser.core.model.IRootDSE;
 import org.apache.directory.ldapstudio.browser.core.model.ISearch;
 import org.apache.directory.ldapstudio.browser.core.model.ISearchResult;
 import org.eclipse.jface.viewers.ITreeContentProvider;
@@ -268,9 +268,37 @@
                 return objects;
             }
         }
-        else if ( parent instanceof IEntry )
+        else if ( parent instanceof IRootDSE )
         {
-            final IEntry parentEntry = ( IEntry ) parent;
+            final IRootDSE rootDSE = ( IRootDSE ) parent;
+
+            if ( !rootDSE.isChildrenInitialized() && rootDSE.isDirectoryEntry() )
+            {
+                new InitializeChildrenJob( new IEntry[]
+                    { rootDSE } ).execute();
+                return new String[]
+                    { "Fetching Entries..." };
+            }
+
+            // get base entries
+            List<IEntry> entryList = new ArrayList<IEntry>();
+            entryList.addAll( Arrays.asList( rootDSE.getChildren() ) );
+
+            // remove non-visible entries
+            for ( Iterator<IEntry> it = entryList.iterator(); it.hasNext(); )
+            {
+                Object o = it.next();
+                if ( !preferences.isShowDirectoryMetaEntries() && ( o instanceof DirectoryMetadataEntry ) )
+                {
+                    it.remove();
+                }
+            }
+
+            return entryList.toArray();
+        }
+        else if ( parent instanceof IEntry )
+            {
+                final IEntry parentEntry = ( IEntry ) parent;
 
             if ( !parentEntry.isChildrenInitialized() && parentEntry.isDirectoryEntry() )
             {
@@ -392,30 +420,11 @@
                     {
                         new OpenConnectionsJob( connection ).execute();
                         return new String[]
-                            { "Fetching Entries..." };
-                    }
-
-                    // get base entries
-                    List<IEntry> entryList = new ArrayList<IEntry>();
-                    if ( connection.isOpened() )
-                    {
-                        entryList.addAll( Arrays.asList( connection.getBaseDNEntries() ) );
-                        entryList.add( connection.getRootDSE() );
-                        entryList.addAll( Arrays.asList( connection.getMetadataEntries() ) );
-                    }
-
-                    // remove non-visible entries
-                    for ( Iterator<IEntry> it = entryList.iterator(); it.hasNext(); )
-                    {
-                        Object o = it.next();
-                        if ( !preferences.isShowDirectoryMetaEntries()
-                            && ( o instanceof DirectoryMetadataEntry || o instanceof RootDSE ) )
-                        {
-                            it.remove();
-                        }
+                            { "Opening Connection..." };
                     }
 
-                    return entryList.toArray();
+                    return new Object[]
+                        { connection.getRootDSE() };
                 }
 
                 case BrowserCategory.TYPE_SEARCHES:

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserLabelProvider.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserLabelProvider.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/browser/BrowserLabelProvider.java Tue Apr  3 15:47:13 2007
@@ -22,6 +22,7 @@
 
 
 import org.apache.directory.ldapstudio.browser.core.internal.model.AliasBaseEntry;
+import org.apache.directory.ldapstudio.browser.core.internal.model.BaseDNEntry;
 import org.apache.directory.ldapstudio.browser.core.internal.model.DirectoryMetadataEntry;
 import org.apache.directory.ldapstudio.browser.core.internal.model.ReferralBaseEntry;
 import org.apache.directory.ldapstudio.browser.core.model.IBookmark;
@@ -108,6 +109,10 @@
             {
                 return entry.getDn().toString() + " " + append.toString();
             }
+            else if ( entry instanceof BaseDNEntry )
+            {
+                return entry.getDn().toString() + " " + append.toString();
+            }
             else if ( entry.hasParententry() )
             {
 
@@ -179,10 +184,14 @@
             {
                 return sr.getEntry().getUrl().toString();
             }
-            else if ( sr.getEntry().hasParententry() )
+            else if ( sr.getEntry().hasParententry() || sr.getEntry() instanceof IRootDSE )
             {
                 String label = "";
-                if ( preferences.getSearchResultLabel() == BrowserUIConstants.SHOW_DN )
+                if ( sr.getEntry() instanceof IRootDSE )
+                {
+                    label = "Root DSE";
+                }
+                else if ( preferences.getSearchResultLabel() == BrowserUIConstants.SHOW_DN )
                 {
                     label = sr.getEntry().getDn().toString();
                 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/connection/ConnectionPageWrapper.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/connection/ConnectionPageWrapper.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/connection/ConnectionPageWrapper.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/connection/ConnectionPageWrapper.java Tue Apr  3 15:47:13 2007
@@ -812,20 +812,13 @@
 
         if ( baseDNCombo != null && baseDNCombo.isVisible() )
         {
-            if ( !autoFetchBaseDnsButton.getSelection() && "".equals( baseDNCombo.getText() ) )
+            try
             {
-                message = "Please enter a base DN. You can use the 'Fetch base DN' button to fetch valid base DNs from directory.";
+                new DN( baseDNCombo.getText() );
             }
-            else
+            catch ( NameException e )
             {
-                try
-                {
-                    new DN( baseDNCombo.getText() );
-                }
-                catch ( NameException e )
-                {
-                    message = "Please enter a valid base DN.";
-                }
+                message = "Please enter a valid base DN.";
             }
         }
         if ( simpleAuthBindPasswordText != null && simpleAuthSelected && simpleAuthBindPasswordText.isVisible() )

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java?view=diff&rev=525316&r1=525315&r2=525316
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java Tue Apr  3 15:47:13 2007
@@ -122,18 +122,11 @@
         {
             public void modifyText( ModifyEvent e )
             {
-                if ( dnCombo.getText().length() > 0 )
+                try
                 {
-                    try
-                    {
-                        dn = new DN( dnCombo.getText() );
-                    }
-                    catch ( NameException e1 )
-                    {
-                        dn = null;
-                    }
+                    dn = new DN( dnCombo.getText() );
                 }
-                else
+                catch ( NameException e1 )
                 {
                     dn = null;
                 }
@@ -181,10 +174,9 @@
                             entry = job.getReadEntry();
                         }
                     }
-                    if ( entry == null && connection.getBaseDNEntries() != null
-                        && connection.getBaseDNEntries().length > 0 )
+                    else
                     {
-                        entry = connection.getBaseDNEntries()[0];
+                        entry = connection.getRootDSE();
                     }
 
                     if ( entry != null )



Mime
View raw message