directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r827920 [4/4] - in /directory/studio/trunk: connection-core/src/main/java/org/apache/directory/studio/connection/core/ connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/ connection-ui/src/main/java/org/apache...
Date Wed, 21 Oct 2009 08:35:58 GMT
Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java Wed Oct 21 08:35:55 2009
@@ -28,6 +28,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.LdapURL;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
@@ -38,7 +39,6 @@
 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.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
@@ -56,22 +56,25 @@
     private static final long serialVersionUID = -3482673086666351174L;
 
     /** The connection. */
-    private IBrowserConnection connection;
+    protected IBrowserConnection connection;
 
     /** The search results. */
-    private ISearchResult[] searchResults;
+    protected ISearchResult[] searchResults;
 
     /** The search parameter. */
-    private SearchParameter searchParameter;
+    protected SearchParameter searchParameter;
 
     /** The count limit exceeded flag. */
-    private boolean countLimitExceeded;
+    protected boolean countLimitExceeded;
 
     /** The next search runnable. */
-    private StudioBulkRunnableWithProgress nextSearchRunnable;
+    protected StudioBulkRunnableWithProgress nextSearchRunnable;
 
     /** The top search runnable. */
-    private StudioBulkRunnableWithProgress topSearchRunnable;
+    protected StudioBulkRunnableWithProgress topSearchRunnable;
+
+    /** The search continuations. */
+    protected SearchContinuation[] searchContinuations;
 
 
     /**
@@ -114,6 +117,7 @@
         this.searchParameter = searchParameter;
         this.countLimitExceeded = false;
         this.nextSearchRunnable = null;
+        this.searchContinuations = null;
     }
 
 
@@ -190,7 +194,7 @@
      *
      * @param detail the SearchUpdateEvent detail
      */
-    private void fireSearchUpdated( SearchUpdateEvent.EventDetail detail )
+    protected void fireSearchUpdated( SearchUpdateEvent.EventDetail detail )
     {
         if ( getName() != null && !"".equals( getName() ) ) { //$NON-NLS-1$
             EventRegistry.fireSearchUpdated( new SearchUpdateEvent( this, detail ), this );
@@ -499,6 +503,29 @@
     /**
      * {@inheritDoc}
      */
+    public SearchContinuation[] getSearchContinuations()
+    {
+        return searchContinuations;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setSearchContinuations( SearchContinuation[] searchContinuations )
+    {
+        this.searchContinuations = searchContinuations;
+        if ( searchContinuations != null && getName() != null )
+        {
+            fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PERFORMED );
+        }
+
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
     public String toString()
     {
         return getName() + " (" + getBrowserConnection() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
@@ -568,7 +595,10 @@
         final int prime = 31;
         int result = 1;
         result = prime * result + ( ( connection == null ) ? 0 : connection.hashCode() );
-        result = prime * result + ( ( searchParameter == null ) ? 0 : searchParameter.getName().hashCode() );
+        result = prime
+            * result
+            + ( ( searchParameter == null || searchParameter.getName() == null ) ? 0 : searchParameter.getName()
+                .hashCode() );
         return result;
     }
 
@@ -600,9 +630,9 @@
         {
             return false;
         }
-        if ( searchParameter == null )
+        if ( searchParameter == null || searchParameter.getName() == null )
         {
-            if ( other.searchParameter != null )
+            if ( other.searchParameter != null && other.searchParameter.getName() != null )
             {
                 return false;
             }

Added: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchContinuation.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchContinuation.java?rev=827920&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchContinuation.java (added)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchContinuation.java Wed Oct 21 08:35:55 2009
@@ -0,0 +1,193 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapbrowser.core.model.impl;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IContinuation;
+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.SearchParameter;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
+
+
+/**
+ * An {@link SearchContinuation} represents a search continuation.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SearchContinuation extends Search implements IContinuation
+{
+
+    private static final long serialVersionUID = 9039452279802784225L;
+
+    /** The search continuation URL */
+    private LdapURL searchContinuationURL;
+
+    /** The state */
+    private State state;
+
+    /** The dummy connection. */
+    private DummyConnection dummyConnection;
+
+
+    /**
+     * Creates a new instance of ContinuedSearchResultEntry.
+     * 
+     * @param dn the DN
+     * @param resultBrowserConnection the connection 
+     * @param connection the connection of the continued search
+     * @param dn the DN of the entry
+     */
+    public SearchContinuation( ISearch originalSearch, LdapURL searchContinuationURL )
+    {
+        super( null, ( SearchParameter ) originalSearch.getSearchParameter().clone() );
+        this.searchContinuationURL = searchContinuationURL;
+        this.state = State.UNRESOLVED;
+
+        getSearchParameter().setName( searchContinuationURL.toString() );
+
+        // apply parameters from URL
+        if ( searchContinuationURL.getDn() != null && !searchContinuationURL.getDn().isEmpty() )
+        {
+            getSearchParameter().setSearchBase( searchContinuationURL.getDn() );
+        }
+        if ( searchContinuationURL.getFilter() != null && getSearchParameter().getFilter().length() > 0 )
+        {
+            getSearchParameter().setFilter( searchContinuationURL.getFilter() );
+        }
+        if ( searchContinuationURL.getScope() > -1 )
+        {
+            switch ( searchContinuationURL.getScope() )
+            {
+                case 0:
+                    getSearchParameter().setScope( SearchScope.OBJECT );
+                    break;
+                case 1:
+                    getSearchParameter().setScope( SearchScope.ONELEVEL );
+                    break;
+                case 2:
+                    getSearchParameter().setScope( SearchScope.SUBTREE );
+                    break;
+            }
+        }
+        if ( searchContinuationURL.getAttributes() != null && !searchContinuationURL.getAttributes().isEmpty() )
+        {
+            getSearchParameter()
+                .setReturningAttributes( searchContinuationURL.getAttributes().toArray( new String[0] ) );
+        }
+    }
+
+
+    @Override
+    public IBrowserConnection getBrowserConnection()
+    {
+        if ( state == State.RESOLVED )
+        {
+            return super.getBrowserConnection();
+        }
+        else
+        {
+            if ( dummyConnection == null )
+            {
+                dummyConnection = new DummyConnection( Schema.DEFAULT_SCHEMA );
+            }
+            return dummyConnection;
+        }
+    }
+
+
+    @Override
+    public ISearchResult[] getSearchResults()
+    {
+        if ( state == State.RESOLVED )
+        {
+            return super.getSearchResults();
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public State getState()
+    {
+        return state;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void resolve()
+    {
+        // get referral connection, exit if canceled
+        List<LdapURL> urls = new ArrayList<LdapURL>();
+        urls.add( searchContinuationURL );
+        Connection referralConnection = ConnectionCorePlugin.getDefault().getReferralHandler().getReferralConnection(
+            urls );
+        if ( referralConnection == null )
+        {
+            state = State.CANCELED;
+            return;
+        }
+        else
+        {
+            super.connection = BrowserCorePlugin.getDefault().getConnectionManager().getBrowserConnection(
+                referralConnection );
+            state = State.RESOLVED;
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public LdapURL getUrl()
+    {
+        return searchContinuationURL;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Object clone()
+    {
+        SearchContinuation clone = new SearchContinuation( this, getUrl() );
+        clone.state = this.state;
+        clone.dummyConnection = this.dummyConnection;
+        clone.connection = super.connection;
+        return clone;
+    }
+}

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchResult.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchResult.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchResult.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/SearchResult.java Wed Oct 21 08:35:55 2009
@@ -203,7 +203,7 @@
                 return false;
             }
         }
-        else if ( !entry.getDn().equals( other.entry.getDn() ) )
+        else if ( !entry.equals( other.entry ) )
         {
             return false;
         }

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/ModelConverter.java Wed Oct 21 08:35:55 2009
@@ -33,13 +33,13 @@
 import javax.naming.directory.ModificationItem;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
@@ -211,28 +211,31 @@
     {
         LdifContentRecord record = LdifContentRecord.create( entry.getDn().getUpName() );
 
-        for ( IAttribute attribute : entry.getAttributes() )
+        if(entry.getAttributes() != null)
         {
-            String name = attribute.getDescription();
-            for ( IValue value : attribute.getValues() )
+            for ( IAttribute attribute : entry.getAttributes() )
             {
-                if ( !value.isEmpty() )
+                String name = attribute.getDescription();
+                for ( IValue value : attribute.getValues() )
                 {
-                    if ( value.getRawValue() instanceof LdifPart )
+                    if ( !value.isEmpty() )
                     {
-                        LdifPart part = ( LdifPart ) value.getRawValue();
-                        if ( part instanceof LdifCommentLine )
+                        if ( value.getRawValue() instanceof LdifPart )
                         {
-                            record.addComment( ( LdifCommentLine ) part );
+                            LdifPart part = ( LdifPart ) value.getRawValue();
+                            if ( part instanceof LdifCommentLine )
+                            {
+                                record.addComment( ( LdifCommentLine ) part );
+                            }
+                        }
+                        else if ( value.isString() )
+                        {
+                            record.addAttrVal( LdifAttrValLine.create( name, value.getStringValue() ) );
+                        }
+                        else
+                        {
+                            record.addAttrVal( LdifAttrValLine.create( name, value.getBinaryValue() ) );
                         }
-                    }
-                    else if ( value.isString() )
-                    {
-                        record.addAttrVal( LdifAttrValLine.create( name, value.getStringValue() ) );
-                    }
-                    else
-                    {
-                        record.addAttrVal( LdifAttrValLine.create( name, value.getBinaryValue() ) );
                     }
                 }
             }

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java Wed Oct 21 08:35:55 2009
@@ -40,6 +40,7 @@
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.parsers.AttributeTypeDescription;
 import org.apache.directory.shared.ldap.util.LdapURL;
+import org.apache.directory.studio.connection.core.StudioControl;
 import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
@@ -48,7 +49,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.IValue;
-import org.apache.directory.studio.ldapbrowser.core.model.StudioControl;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ModifyMode;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ModifyOrder;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorInput.java Wed Oct 21 08:35:55 2009
@@ -158,7 +158,7 @@
         if ( entry != null )
         {
             IBrowserConnection connection = entry.getBrowserConnection();
-            if ( connection != null )
+            if ( connection != null && connection.getConnection() != null )
             {
                 return getName() + " - " + connection.getConnection().getName();//$NON-NLS-1$
             }
@@ -212,22 +212,30 @@
      */
     public IEntry getResolvedEntry()
     {
+        IEntry resolvedEntry;
         if ( entry != null )
         {
-            return entry;
+            resolvedEntry = entry;
         }
         else if ( searchResult != null )
         {
-            return searchResult.getEntry();
+            resolvedEntry = searchResult.getEntry();
         }
         else if ( bookmark != null )
         {
-            return bookmark.getEntry();
+            resolvedEntry = bookmark.getEntry();
         }
         else
         {
-            return null;
+            resolvedEntry = null;
         }
+
+        if ( resolvedEntry != null )
+        {
+            resolvedEntry = resolvedEntry.getBrowserConnection().getEntryFromCache( resolvedEntry.getDn() );
+        }
+
+        return resolvedEntry;
     }
 
 

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorManager.java Wed Oct 21 08:35:55 2009
@@ -46,9 +46,11 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IContinuation;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
+import org.apache.directory.studio.ldapbrowser.core.model.IContinuation.State;
 import org.apache.directory.studio.ldapbrowser.core.utils.CompoundModification;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
@@ -66,7 +68,6 @@
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.osgi.util.NLS;
-import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IEditorReference;
 import org.eclipse.ui.IPartListener2;
@@ -710,22 +711,36 @@
     public void openEntryEditor( EntryEditorExtension extension, IEntry[] entries, ISearchResult[] searchResults,
         IBookmark[] bookmarks )
     {
-        IEditorInput input = null;
+        EntryEditorInput input = null;
+        IEntry entry;
         if ( entries.length == 1 )
         {
             input = new EntryEditorInput( entries[0], extension );
+            entry = entries[0];
         }
         else if ( searchResults.length == 1 )
         {
             input = new EntryEditorInput( searchResults[0], extension );
+            entry = searchResults[0].getEntry();
         }
         else if ( bookmarks.length == 1 )
         {
             input = new EntryEditorInput( bookmarks[0], extension );
+            entry = bookmarks[0].getEntry();
         }
         else
         {
             input = new EntryEditorInput( ( IEntry ) null, extension );
+            entry = null;
+        }
+
+        if ( entry != null && entry instanceof IContinuation )
+        {
+            IContinuation continuation = ( IContinuation ) entry;
+            if ( continuation.getState() == State.UNRESOLVED )
+            {
+                continuation.resolve();
+            }
         }
 
         String editorId = extension.getEditorId();

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorUtils.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorUtils.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/entryeditors/EntryEditorUtils.java Wed Oct 21 08:35:55 2009
@@ -82,41 +82,45 @@
         {
             if ( input.getEntryInput() != null )
             {
+                String connectionName = input.getEntryInput().getBrowserConnection().getConnection() == null ? "" //$NON-NLS-1$
+                    : " - " + input.getEntryInput().getBrowserConnection().getConnection().getName(); //$NON-NLS-1$
                 if ( input.getEntryInput() instanceof IRootDSE )
                 {
-                    return Messages.getString( "EntryEditorNavigationLocation.RootDSE" ) + " - " + input.getEntryInput().getBrowserConnection().getConnection().getName(); //$NON-NLS-1$ //$NON-NLS-2$
+                    return Messages.getString( "EntryEditorNavigationLocation.RootDSE" ) + connectionName; //$NON-NLS-1$ //$NON-NLS-2$
                 }
                 else
                 {
                     return NLS.bind( Messages.getString( "EntryEditorNavigationLocation.Entry" ), //$NON-NLS-1$
                         input.getEntryInput().getDn().getUpName() )
-                        + " - " + input.getEntryInput().getBrowserConnection().getConnection().getName(); //$NON-NLS-1$
+                        + connectionName;
                 }
             }
             else if ( input.getSearchResultInput() != null )
             {
+                String connectionName = input.getSearchResultInput().getEntry().getBrowserConnection().getConnection() == null ? "" //$NON-NLS-1$
+                    : " - " + input.getSearchResultInput().getEntry().getBrowserConnection().getConnection().getName(); //$NON-NLS-1$
                 if ( input.getSearchResultInput() instanceof IRootDSE )
                 {
-                    return Messages.getString( "EntryEditorNavigationLocation.RootDSE" ) + " - " + input.getEntryInput().getBrowserConnection().getConnection().getName(); //$NON-NLS-1$ //$NON-NLS-2$
+                    return Messages.getString( "EntryEditorNavigationLocation.RootDSE" ) + connectionName; //$NON-NLS-1$ //$NON-NLS-2$
                 }
                 else
                 {
                     return NLS.bind( Messages.getString( "EntryEditorNavigationLocation.SearchResult" ), //$NON-NLS-1$
-                        input.getSearchResultInput().getDn().getUpName() )
-                        + " - " + input.getSearchResultInput().getEntry().getBrowserConnection().getConnection().getName(); //$NON-NLS-1$
+                        input.getSearchResultInput().getDn().getUpName() ) + connectionName; //$NON-NLS-1$
                 }
             }
             else if ( input.getBookmarkInput() != null )
             {
+                String connectionName = input.getBookmarkInput().getBrowserConnection().getConnection() == null ? "" //$NON-NLS-1$
+                    : " - " + input.getBookmarkInput().getBrowserConnection().getConnection().getName(); //$NON-NLS-1$
                 if ( input.getBookmarkInput() instanceof IRootDSE )
                 {
-                    return Messages.getString( "EntryEditorNavigationLocation.RootDSE" ) + " - " + input.getEntryInput().getBrowserConnection().getConnection().getName(); //$NON-NLS-1$ //$NON-NLS-2$
+                    return Messages.getString( "EntryEditorNavigationLocation.RootDSE" ) + connectionName; //$NON-NLS-1$
                 }
                 else
                 {
                     return NLS.bind( Messages.getString( "EntryEditorNavigationLocation.Bookmark" ), //$NON-NLS-1$
-                        input.getBookmarkInput().getDn().getUpName() )
-                        + " - " + input.getBookmarkInput().getBrowserConnection().getConnection().getName(); //$NON-NLS-1$
+                        input.getBookmarkInput().getDn().getUpName() ) + connectionName;
                 }
             }
             else

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditor.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditor.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditor.java Wed Oct 21 08:35:55 2009
@@ -98,7 +98,7 @@
 
             IEntry modifiedEntry = event.getModifiedEntry();
 
-            if ( workingCopy != null )
+            if ( workingCopy != null && workingCopy.getSearchResults() != null )
             {
                 for ( ISearchResult sr : workingCopy.getSearchResults() )
                 {

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorNavigationLocation.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorNavigationLocation.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorNavigationLocation.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorNavigationLocation.java Wed Oct 21 08:35:55 2009
@@ -59,9 +59,11 @@
         ISearch search = getSearch();
         if ( search != null )
         {
+            String connectionName = search.getBrowserConnection().getConnection() != null ? " - " //$NON-NLS-1$ 
+                + search.getBrowserConnection().getConnection().getName() : ""; //$NON-NLS-1$ 
             return NLS.bind(
                 Messages.getString( "SearchResultEditorNavigationLocation.Search" ), new String[] { search.getName() } ) //$NON-NLS-1$
-                + " - " + search.getBrowserConnection().getConnection().getName(); //$NON-NLS-1$ 
+                + connectionName;
         }
         else
         {

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewLabelDecorator.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewLabelDecorator.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewLabelDecorator.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewLabelDecorator.java Wed Oct 21 08:35:55 2009
@@ -21,11 +21,11 @@
 package org.apache.directory.studio.ldapbrowser.ui.views.browser;
 
 
+import org.apache.directory.studio.ldapbrowser.core.model.IContinuation;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
-
 import org.eclipse.jface.viewers.IDecoration;
 import org.eclipse.jface.viewers.ILightweightLabelDecorator;
 import org.eclipse.jface.viewers.LabelProvider;
@@ -48,11 +48,9 @@
     public void decorate( Object element, IDecoration decoration )
     {
         IEntry entry = null;
-
         if ( element instanceof ISearchResult )
         {
-            ISearchResult searchResult = ( ISearchResult ) element;
-            entry = searchResult.getEntry();
+            entry = ( ( ISearchResult ) element ).getEntry();
             decoration.addOverlay( BrowserUIPlugin.getDefault().getImageDescriptor(
                 BrowserUIConstants.IMG_OVR_SEARCHRESULT ), IDecoration.BOTTOM_RIGHT );
         }
@@ -65,14 +63,11 @@
                     BrowserUIConstants.IMG_OVR_FILTERED ), IDecoration.BOTTOM_RIGHT );
             }
         }
-        else
-        {
-            decoration.addOverlay( null, IDecoration.BOTTOM_RIGHT );
-        }
 
-        if ( entry != null )
+        if ( entry instanceof IContinuation || element instanceof IContinuation )
         {
-            decoration.addOverlay( null, IDecoration.BOTTOM_LEFT );
+            decoration.addOverlay( BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_OVR_REF ),
+                IDecoration.TOP_LEFT );
         }
     }
 

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewUniversalListener.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewUniversalListener.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/BrowserViewUniversalListener.java Wed Oct 21 08:35:55 2009
@@ -49,6 +49,7 @@
 import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateListener;
 import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IContinuation;
 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;
@@ -515,9 +516,14 @@
     public void searchUpdated( SearchUpdateEvent searchUpdateEvent )
     {
         ISearch search = searchUpdateEvent.getSearch();
+        viewer.setSelection( StructuredSelection.EMPTY );
         viewer.refresh();
 
-        if ( search.getBrowserConnection().getSearchManager().getSearches().contains( search ) )
+        if ( search instanceof IContinuation )
+        {
+            viewer.setSelection( new StructuredSelection( search ), true );
+        }
+        else if ( search.getBrowserConnection().getSearchManager().getSearches().contains( search ) )
         {
             viewer.setSelection( new StructuredSelection( search ), true );
         }
@@ -528,7 +534,10 @@
         else
         {
             Object searchCategory = ( ( ITreeContentProvider ) viewer.getContentProvider() ).getParent( search );
-            viewer.setSelection( new StructuredSelection( searchCategory ), true );
+            if ( searchCategory != null )
+            {
+                viewer.setSelection( new StructuredSelection( searchCategory ), true );
+            }
         }
     }
 

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/BatchOperationApplyOnWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/BatchOperationApplyOnWizardPage.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/BatchOperationApplyOnWizardPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/BatchOperationApplyOnWizardPage.java Wed Oct 21 08:35:55 2009
@@ -145,6 +145,7 @@
         BaseWidgetUtils.createRadioIndent( searchComposite, 1 );
         Composite innerSearchComposite = BaseWidgetUtils.createColumnContainer( searchComposite, 3, 1 );
         this.spw = new SearchPageWrapper( SearchPageWrapper.NAME_INVISIBLE
+            | SearchPageWrapper.REFERRALOPTIONS_FOLLOW_MANUAL_INVISIBLE
             | SearchPageWrapper.RETURNINGATTRIBUTES_INVISIBLE | SearchPageWrapper.REFERRALOPTIONS_READONLY );
         this.spw.createContents( innerSearchComposite );
         this.spw.loadFromSearch( this.initSearch );

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportCsvFromWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportCsvFromWizardPage.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportCsvFromWizardPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportCsvFromWizardPage.java Wed Oct 21 08:35:55 2009
@@ -51,7 +51,8 @@
     public ExportCsvFromWizardPage( String pageName, ExportBaseWizard wizard )
     {
         super( pageName, wizard, new SearchPageWrapper( SearchPageWrapper.NAME_INVISIBLE
-            | SearchPageWrapper.RETURN_DN_VISIBLE | SearchPageWrapper.RETURN_DN_CHECKED ) );
+            | SearchPageWrapper.REFERRALOPTIONS_FOLLOW_MANUAL_INVISIBLE | SearchPageWrapper.RETURN_DN_VISIBLE
+            | SearchPageWrapper.RETURN_DN_CHECKED ) );
         super.setImageDescriptor( BrowserUIPlugin.getDefault().getImageDescriptor(
             BrowserUIConstants.IMG_EXPORT_CSV_WIZARD ) );
     }

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportDsmlFromWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportDsmlFromWizardPage.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportDsmlFromWizardPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportDsmlFromWizardPage.java Wed Oct 21 08:35:55 2009
@@ -53,6 +53,7 @@
     {
         super( pageName, wizard, new SearchPageWrapper(
             SearchPageWrapper.NAME_INVISIBLE
+                | SearchPageWrapper.REFERRALOPTIONS_FOLLOW_MANUAL_INVISIBLE
                 | SearchPageWrapper.RETURN_ALLATTRIBUTES_VISIBLE
                 | SearchPageWrapper.RETURN_OPERATIONALATTRIBUTES_VISIBLE
                 | ( ( wizard.getSearch().getReturningAttributes() == null || wizard.getSearch()

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportExcelFromWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportExcelFromWizardPage.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportExcelFromWizardPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportExcelFromWizardPage.java Wed Oct 21 08:35:55 2009
@@ -52,6 +52,7 @@
     {
         super( pageName, wizard, new SearchPageWrapper(
             SearchPageWrapper.NAME_INVISIBLE
+                | SearchPageWrapper.REFERRALOPTIONS_FOLLOW_MANUAL_INVISIBLE
                 | SearchPageWrapper.RETURN_DN_VISIBLE
                 | SearchPageWrapper.RETURN_DN_CHECKED
                 | SearchPageWrapper.RETURN_ALLATTRIBUTES_VISIBLE

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportLdifFromWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportLdifFromWizardPage.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportLdifFromWizardPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportLdifFromWizardPage.java Wed Oct 21 08:35:55 2009
@@ -51,6 +51,7 @@
     {
         super( pageName, wizard, new SearchPageWrapper(
             SearchPageWrapper.NAME_INVISIBLE
+                | SearchPageWrapper.REFERRALOPTIONS_FOLLOW_MANUAL_INVISIBLE
                 | SearchPageWrapper.RETURN_ALLATTRIBUTES_VISIBLE
                 | SearchPageWrapper.RETURN_OPERATIONALATTRIBUTES_VISIBLE
                 | ( ( wizard.getSearch().getReturningAttributes() == null || wizard.getSearch()

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportOdfFromWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportOdfFromWizardPage.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportOdfFromWizardPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportOdfFromWizardPage.java Wed Oct 21 08:35:55 2009
@@ -52,6 +52,7 @@
     {
         super( pageName, wizard, new SearchPageWrapper(
             SearchPageWrapper.NAME_INVISIBLE
+                | SearchPageWrapper.REFERRALOPTIONS_FOLLOW_MANUAL_INVISIBLE
                 | SearchPageWrapper.RETURN_DN_VISIBLE
                 | SearchPageWrapper.RETURN_DN_CHECKED
                 | SearchPageWrapper.RETURN_ALLATTRIBUTES_VISIBLE

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java (original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java Wed Oct 21 08:35:55 2009
@@ -108,31 +108,31 @@
                 HANDLE_REFERALS_METHOD, null, ( StudioProgressMonitor ) monitor, null );
         if ( answer != null )
         {
-            while ( answer.hasMoreElements() )
+            try
             {
-                SearchResult searchResult = ( SearchResult ) answer.nextElement();
+                while ( answer.hasMore() )
+                {
+                    SearchResult searchResult = ( SearchResult ) answer.next();
 
-                // Getting the 'cn' Attribute
-                Attribute cnAttribute = searchResult.getAttributes().get( "cn" );
+                    // Getting the 'cn' Attribute
+                    Attribute cnAttribute = searchResult.getAttributes().get( "cn" );
 
-                // Looping on the values
-                NamingEnumeration<?> ne = null;
-                try
-                {
+                    // Looping on the values
+                    NamingEnumeration<?> ne = null;
                     ne = cnAttribute.getAll();
                     if ( ne != null )
                     {
-                        while ( ne.hasMoreElements() )
+                        while ( ne.hasMore() )
                         {
-                            String value = ( String ) ne.nextElement();
+                            String value = ( String ) ne.next();
                             schemas.add( getSchema( wrapper, value, monitor ) );
                         }
                     }
                 }
-                catch ( NamingException e )
-                {
-                    monitor.reportError( e );
-                }
+            }
+            catch ( NamingException e )
+            {
+                monitor.reportError( e );
             }
         }
 
@@ -159,32 +159,39 @@
 
         if ( answer != null )
         {
-            if ( answer.hasMoreElements() )
+            try
             {
-                SearchResult searchResult = ( SearchResult ) answer.nextElement();
-
-                Attribute vendorNameAttribute = searchResult.getAttributes().get( "vendorName" );
-                if ( vendorNameAttribute == null )
+                if ( answer.hasMore() )
                 {
-                    return false;
-                }
+                    SearchResult searchResult = ( SearchResult ) answer.next();
 
-                if ( vendorNameAttribute.size() != 1 )
-                {
-                    return false;
-                }
+                    Attribute vendorNameAttribute = searchResult.getAttributes().get( "vendorName" );
+                    if ( vendorNameAttribute == null )
+                    {
+                        return false;
+                    }
 
-                String vendorName = null;
-                try
-                {
-                    vendorName = ( String ) vendorNameAttribute.get();
-                }
-                catch ( NamingException e )
-                {
-                    return false;
-                }
+                    if ( vendorNameAttribute.size() != 1 )
+                    {
+                        return false;
+                    }
 
-                return ( ( vendorName != null ) && vendorName.equalsIgnoreCase( "Apache Software Foundation" ) );
+                    String vendorName = null;
+                    try
+                    {
+                        vendorName = ( String ) vendorNameAttribute.get();
+                    }
+                    catch ( NamingException e )
+                    {
+                        return false;
+                    }
+
+                    return ( ( vendorName != null ) && vendorName.equalsIgnoreCase( "Apache Software Foundation" ) );
+                }
+            }
+            catch ( NamingException e )
+            {
+                monitor.reportError( e );
             }
         }
 
@@ -208,40 +215,47 @@
             constraintSearch, DEREF_ALIAS_METHOD, HANDLE_REFERALS_METHOD, null, monitor, null );
         if ( answer != null )
         {
-            while ( answer.hasMoreElements() )
+            try
             {
-                SearchResult searchResult = ( SearchResult ) answer.nextElement();
-                switch ( getNodeType( searchResult ) )
+                while ( answer.hasMore() )
                 {
-                    case ATTRIBUTE_TYPE:
-                        AttributeTypeImpl at = createAttributeType( searchResult );
-                        at.setSchema( name );
-                        at.setSchemaObject( schema );
-                        schema.addAttributeType( at );
-                        break;
-                    case OBJECT_CLASS:
-                        ObjectClassImpl oc = createObjectClass( searchResult );
-                        oc.setSchema( name );
-                        oc.setSchemaObject( schema );
-                        schema.addObjectClass( oc );
-                        break;
-                    case MATCHING_RULE:
-                        MatchingRuleImpl mr = createMatchingRule( searchResult );
-                        mr.setSchema( name );
-                        mr.setSchemaObject( schema );
-                        schema.addMatchingRule( mr );
-                        break;
-                    case SYNTAX:
-                        SyntaxImpl syntax = createSyntax( searchResult );
-                        syntax.setSchema( name );
-                        syntax.setSchemaObject( schema );
-                        schema.addSyntax( syntax );
-                        break;
-                    default:
-                        break;
+                    SearchResult searchResult = ( SearchResult ) answer.next();
+                    switch ( getNodeType( searchResult ) )
+                    {
+                        case ATTRIBUTE_TYPE:
+                            AttributeTypeImpl at = createAttributeType( searchResult );
+                            at.setSchema( name );
+                            at.setSchemaObject( schema );
+                            schema.addAttributeType( at );
+                            break;
+                        case OBJECT_CLASS:
+                            ObjectClassImpl oc = createObjectClass( searchResult );
+                            oc.setSchema( name );
+                            oc.setSchemaObject( schema );
+                            schema.addObjectClass( oc );
+                            break;
+                        case MATCHING_RULE:
+                            MatchingRuleImpl mr = createMatchingRule( searchResult );
+                            mr.setSchema( name );
+                            mr.setSchemaObject( schema );
+                            schema.addMatchingRule( mr );
+                            break;
+                        case SYNTAX:
+                            SyntaxImpl syntax = createSyntax( searchResult );
+                            syntax.setSchema( name );
+                            syntax.setSchemaObject( schema );
+                            schema.addSyntax( syntax );
+                            break;
+                        default:
+                            break;
+                    }
                 }
             }
-        }
+            catch ( NamingException e )
+            {
+                monitor.reportError( e );
+            }
+       }
 
         return schema;
     }

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java?rev=827920&r1=827919&r2=827920&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java (original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/GenericSchemaConnector.java Wed Oct 21 08:35:55 2009
@@ -94,18 +94,25 @@
             DEREF_ALIAS_METHOD, HANDLE_REFERALS_METHOD, null, ( StudioProgressMonitor ) monitor, null );
         if ( answer != null )
         {
-            while ( answer.hasMoreElements() )
+            try
             {
-                SearchResult searchResult = ( SearchResult ) answer.nextElement();
-                try
+                while ( answer.hasMore() )
                 {
-                    schemas.add( getSchema( wrapper, searchResult, monitor ) );
-                }
-                catch ( Exception e )
-                {
-                    monitor.reportError( e );
+                    SearchResult searchResult = ( SearchResult ) answer.next();
+                    try
+                    {
+                        schemas.add( getSchema( wrapper, searchResult, monitor ) );
+                    }
+                    catch ( Exception e )
+                    {
+                        monitor.reportError( e );
+                    }
                 }
             }
+            catch ( NamingException e )
+            {
+                monitor.reportError( e );
+            }
         }
 
         monitor.worked( 1 );
@@ -137,32 +144,39 @@
 
         if ( answer != null )
         {
-            if ( answer.hasMoreElements() )
+            try
             {
-                SearchResult searchResult = ( SearchResult ) answer.nextElement();
-
-                Attribute subschemaSubentryAttribute = searchResult.getAttributes().get( "subschemaSubentry" );
-                if ( subschemaSubentryAttribute == null )
+                if ( answer.hasMore() )
                 {
-                    return null;
-                }
+                    SearchResult searchResult = ( SearchResult ) answer.next();
 
-                if ( subschemaSubentryAttribute.size() != 1 )
-                {
-                    return null;
-                }
+                    Attribute subschemaSubentryAttribute = searchResult.getAttributes().get( "subschemaSubentry" );
+                    if ( subschemaSubentryAttribute == null )
+                    {
+                        return null;
+                    }
 
-                String subschemaSubentry = null;
-                try
-                {
-                    subschemaSubentry = ( String ) subschemaSubentryAttribute.get();
-                }
-                catch ( NamingException e )
-                {
-                    return null;
-                }
+                    if ( subschemaSubentryAttribute.size() != 1 )
+                    {
+                        return null;
+                    }
+
+                    String subschemaSubentry = null;
+                    try
+                    {
+                        subschemaSubentry = ( String ) subschemaSubentryAttribute.get();
+                    }
+                    catch ( NamingException e )
+                    {
+                        return null;
+                    }
 
-                return subschemaSubentry;
+                    return subschemaSubentry;
+                }
+            }
+            catch ( NamingException e )
+            {
+                monitor.reportError( e );
             }
         }
 



Mime
View raw message