directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r607915 [2/3] - in /directory/studio/trunk: studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/ studio-ldapbrowser-commo...
Date Tue, 01 Jan 2008 21:07:50 GMT
Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/SearchPageWrapper.java Tue Jan  1 13:07:48 2008
@@ -26,6 +26,7 @@
 import java.util.List;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
@@ -34,8 +35,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.Control;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.AttributeTypeDescription;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
@@ -742,7 +741,7 @@
         }
         if ( aliasesDereferencingWidget != null )
         {
-            AliasDereferencingMethod aliasesDereferencingMethod = aliasesDereferencingWidget
+            Connection.AliasDereferencingMethod aliasesDereferencingMethod = aliasesDereferencingWidget
                 .getAliasesDereferencingMethod();
             if ( aliasesDereferencingMethod != search.getAliasesDereferencingMethod() )
             {
@@ -752,7 +751,7 @@
         }
         if ( referralsHandlingWidget != null )
         {
-            ReferralHandlingMethod referralsHandlingMethod = referralsHandlingWidget.getReferralsHandlingMethod();
+            Connection.ReferralHandlingMethod referralsHandlingMethod = referralsHandlingWidget.getReferralsHandlingMethod();
             if ( referralsHandlingMethod != search.getReferralsHandlingMethod() )
             {
                 search.getSearchParameter().setReferralsHandlingMethod( referralsHandlingMethod );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionIO.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionIO.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionIO.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionIO.java Tue Jan  1 13:07:48 2008
@@ -31,14 +31,14 @@
 import javax.naming.InvalidNameException;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.io.ConnectionIOException;
 import org.apache.directory.studio.ldapbrowser.core.model.BookmarkParameter;
 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.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Bookmark;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
@@ -277,7 +277,7 @@
         {
             try
             {
-                searchParameter.setAliasesDereferencingMethod( AliasDereferencingMethod
+                searchParameter.setAliasesDereferencingMethod( Connection.AliasDereferencingMethod
                     .valueOf( aliasesDereferencingMethodAttribute.getValue() ) );
             }
             catch ( IllegalArgumentException e )
@@ -294,7 +294,7 @@
         {
             try
             {
-                searchParameter.setReferralsHandlingMethod( ReferralHandlingMethod
+                searchParameter.setReferralsHandlingMethod( Connection.ReferralHandlingMethod
                     .valueOf( referralsHandlingMethodAttribute.getValue() ) );
             }
             catch ( IllegalArgumentException e )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java Tue Jan  1 13:07:48 2008
@@ -45,8 +45,6 @@
 
     public static final String PREFERENCE_CHECK_FOR_CHILDREN = "checkForChildren"; //$NON-NLS-1$
 
-    public static final String PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS = "showAliasAndReferralObjects"; //$NON-NLS-1$
-
     public static final String PREFERENCE_FETCH_SUBENTRIES = "fetchSubentries"; //$NON-NLS-1$
 
     public static final String PREFERENCE_FORMAT_CSV_ATTRIBUTEDELIMITER = "formatCsvAttributeDelimiter"; //$NON-NLS-1$

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferencesInitializer.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferencesInitializer.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCorePreferencesInitializer.java Tue Jan  1 13:07:48 2008
@@ -43,7 +43,6 @@
         Preferences store = BrowserCorePlugin.getDefault().getPluginPreferences();
 
         store.setDefault( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN, true );
-        store.setDefault( BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS, true );
         store.setDefault( BrowserCoreConstants.PREFERENCE_FETCH_SUBENTRIES, false );
 
         store.setDefault( BrowserCoreConstants.PREFERENCE_FORMAT_CSV_ATTRIBUTEDELIMITER, "," );

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java Tue Jan  1 13:07:48 2008
@@ -34,6 +34,7 @@
 import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
+import javax.naming.ldap.Control;
 
 import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -41,7 +42,7 @@
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
-import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.ChildrenInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -201,9 +202,6 @@
      * 
      * @return the number of copied entries
      */
-//    static int copyEntry( IBrowserConnection browserConnection, LdapDN dnToCopy, LdapDN parentDn, Rdn newRdn,
-//        int scope, int numberOfCopiedEntries, EntryExistsCopyStrategyDialog dialog, StudioProgressMonitor dummyMonitor,
-//        StudioProgressMonitor monitor )
     static int copyEntry( IEntry entryToCopy, IEntry parent, Rdn newRdn, int scope, int numberOfCopiedEntries,
         EntryExistsCopyStrategyDialog dialog, StudioProgressMonitor dummyMonitor, StudioProgressMonitor monitor )
     {
@@ -212,9 +210,11 @@
         searchControls.setReturningAttributes( new String[]
             { ISearch.ALL_USER_ATTRIBUTES, IAttribute.REFERRAL_ATTRIBUTE } );
         searchControls.setSearchScope( SearchControls.OBJECT_SCOPE );
-        NamingEnumeration<SearchResult> result = entryToCopy.getBrowserConnection().getConnection().getJNDIConnectionWrapper().search(
-            entryToCopy.getDn().getUpName(), ISearch.FILTER_TRUE, searchControls, "never", JNDIConnectionWrapper.REFERRAL_IGNORE,
-            null, monitor, null );
+        Control[] controls = null;
+        NamingEnumeration<SearchResult> result = entryToCopy.getBrowserConnection().getConnection()
+            .getJNDIConnectionWrapper().search( entryToCopy.getDn().getUpName(), ISearch.FILTER_TRUE, searchControls,
+                entryToCopy.getBrowserConnection().getAliasesDereferencingMethod(),
+                entryToCopy.getBrowserConnection().getReferralsHandlingMethod(), controls, monitor, null );
 
         numberOfCopiedEntries = copyEntryRecursive( entryToCopy.getBrowserConnection(), result, parent
             .getBrowserConnection(), parent.getDn(), newRdn, scope, numberOfCopiedEntries, dialog, dummyMonitor,
@@ -270,10 +270,14 @@
 
                 // apply new RDN to the attributes
                 applyNewRdn( newAttributes, oldRdn, newRdn );
-                
+
+                // determine referrals handling method
+                ReferralHandlingMethod referralsHandlingMethod = newAttributes.get( "ref" ) != null ? ReferralHandlingMethod.MANAGE
+                    : ReferralHandlingMethod.FOLLOW;
+
                 // create entry
-                targetBrowserConnection.getConnection().getJNDIConnectionWrapper().createEntry( newLdapDn.getUpName(), newAttributes, null,
-                    dummyMonitor );
+                targetBrowserConnection.getConnection().getJNDIConnectionWrapper().createEntry( newLdapDn.getUpName(),
+                    newAttributes, referralsHandlingMethod, null, dummyMonitor, null );
 
                 while ( dummyMonitor.errorsReported() )
                 {
@@ -308,7 +312,7 @@
 
                                     // create entry
                                     targetBrowserConnection.getConnection().getJNDIConnectionWrapper().createEntry( newLdapDn.getUpName(),
-                                        newAttributes, null, dummyMonitor );
+                                        newAttributes, referralsHandlingMethod, null, dummyMonitor, null );
 
                                     break;
                             }
@@ -343,8 +347,9 @@
                             { ISearch.ALL_USER_ATTRIBUTES, IAttribute.REFERRAL_ATTRIBUTE } );
                         searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
                         NamingEnumeration<SearchResult> childEntries = sourceBrowserConnection.getConnection()
-                            .getJNDIConnectionWrapper().search( oldLdapDn.getUpName(), ISearch.FILTER_TRUE, searchControls, "never",
-                                JNDIConnectionWrapper.REFERRAL_IGNORE, null, monitor, null );
+                            .getJNDIConnectionWrapper().search( oldLdapDn.getUpName(), ISearch.FILTER_TRUE,
+                                searchControls, sourceBrowserConnection.getAliasesDereferencingMethod(),
+                                sourceBrowserConnection.getReferralsHandlingMethod(), null, monitor, null );
 
                         if ( scope == SearchControls.ONELEVEL_SCOPE )
                         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateEntryJob.java Tue Jan  1 13:07:48 2008
@@ -23,11 +23,10 @@
 
 import javax.naming.directory.Attributes;
 import javax.naming.directory.BasicAttributes;
-import javax.naming.ldap.Control;
-import javax.naming.ldap.ManageReferralControl;
 
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryAddedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -171,16 +170,12 @@
             }
         }
 
-        // controls
-        Control[] controls = null;
-        if ( entryToCreate.isReferral() )
-        {
-            controls = new Control[]
-                { new ManageReferralControl() };
-        }
+        // determine referrals handling method
+        ReferralHandlingMethod referralsHandlingMethod = entryToCreate.isReferral() ? ReferralHandlingMethod.MANAGE
+            : ReferralHandlingMethod.FOLLOW;
 
-        browserConnection.getConnection().getJNDIConnectionWrapper()
-            .createEntry( dn, jndiAttributes, controls, monitor );
+        browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( dn, jndiAttributes,
+            referralsHandlingMethod, null, monitor, null );
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CreateValuesJob.java Tue Jan  1 13:07:48 2008
@@ -27,10 +27,9 @@
 import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
-import javax.naming.ldap.Control;
-import javax.naming.ldap.ManageReferralControl;
 
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.AttributesInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryModificationEvent;
@@ -201,16 +200,12 @@
                 modificationItems[i] = new ModificationItem( DirContext.ADD_ATTRIBUTE, attribute );
             }
 
-            // controls
-            Control[] controls = null;
-            if ( entryToModify.isReferral() )
-            {
-                controls = new Control[]
-                    { new ManageReferralControl() };
-            }
+            // determine referrals handling method
+            ReferralHandlingMethod referralsHandlingMethod = entryToModify.isReferral() ? ReferralHandlingMethod.MANAGE
+                : ReferralHandlingMethod.FOLLOW;
 
-            browserConnection.getConnection().getJNDIConnectionWrapper().modifyAttributes( dn, modificationItems,
-                controls, monitor );
+            browserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry( dn, modificationItems,
+                referralsHandlingMethod, null, monitor, null );
         }
         else
         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteAttributesValueJob.java Tue Jan  1 13:07:48 2008
@@ -29,10 +29,9 @@
 import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
-import javax.naming.ldap.Control;
-import javax.naming.ldap.ManageReferralControl;
 
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.AttributeDeletedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.AttributesInitializedEvent;
@@ -245,16 +244,13 @@
                 }
             }
 
-            // controls
-            Control[] controls = null;
-            if ( entry.isReferral() )
-            {
-                controls = new Control[]
-                    { new ManageReferralControl() };
-            }
-
-            browserConnection.getConnection().getJNDIConnectionWrapper().modifyAttributes( dn,
-                modificationItems.toArray( new ModificationItem[modificationItems.size()] ), controls, monitor );
+            // determine referrals handling method
+            ReferralHandlingMethod referralsHandlingMethod = entry.isReferral() ? ReferralHandlingMethod.MANAGE
+                : ReferralHandlingMethod.FOLLOW;
+
+            browserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry( dn,
+                modificationItems.toArray( new ModificationItem[modificationItems.size()] ), referralsHandlingMethod,
+                null, monitor, null );
         }
         else
         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/DeleteEntriesJob.java Tue Jan  1 13:07:48 2008
@@ -33,18 +33,19 @@
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 import javax.naming.ldap.BasicControl;
+import javax.naming.ldap.Control;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
-import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
+import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.ChildrenInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryDeletedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateEvent;
 import org.apache.directory.studio.ldapbrowser.core.model.ConnectionException;
-import org.apache.directory.studio.ldapbrowser.core.model.Control;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
@@ -206,7 +207,7 @@
      * 
      * @param browserConnection the browser connection
      * @param dn the DN to delete
-     * @param numberOfDeletedEntries the number of delted entries
+     * @param numberOfDeletedEntries the number of deleted entries
      * @param dummyMonitor the dummy monitor
      * @param monitor the progress monitor
      * 
@@ -228,6 +229,12 @@
         }
         else if ( dummyMonitor.getException() instanceof ContextNotEmptyException )
         {
+            // do not follow referrals or dereference aliases when deleting entries
+            AliasDereferencingMethod aliasDereferencingMethod = AliasDereferencingMethod.NEVER;
+            ReferralHandlingMethod referralsHandlingMethod = browserConnection.getRootDSE().isControlSupported(
+                org.apache.directory.studio.ldapbrowser.core.model.Control.MANAGEDSAIT_CONTROL.getOid() ) ? ReferralHandlingMethod.MANAGE
+                : ReferralHandlingMethod.IGNORE;
+
             // perform one-level search and delete recursively
             int numberInBatch;
             dummyMonitor.reset();
@@ -240,8 +247,8 @@
                 searchControls.setReturningAttributes( new String[0] );
                 searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
                 NamingEnumeration<SearchResult> result = browserConnection.getConnection().getJNDIConnectionWrapper()
-                    .search( dn.getUpName(), ISearch.FILTER_TRUE, searchControls, "never", JNDIConnectionWrapper.REFERRAL_IGNORE,
-                        null, dummyMonitor, null );
+                    .search( dn.getUpName(), ISearch.FILTER_TRUE, searchControls, aliasDereferencingMethod,
+                        referralsHandlingMethod, null, dummyMonitor, null );
 
                 try
                 {
@@ -333,17 +340,26 @@
     static void deleteEntry( IBrowserConnection browserConnection, LdapDN dn, StudioProgressMonitor monitor )
     {
         // controls
-        List<BasicControl> controls = new ArrayList<BasicControl>();
-        if ( browserConnection.getRootDSE().isControlSupported( Control.TREEDELETE_CONTROL.getOid() ) )
+        List<Control> controlList = new ArrayList<Control>();
+        if ( browserConnection.getRootDSE().isControlSupported(
+            org.apache.directory.studio.ldapbrowser.core.model.Control.TREEDELETE_CONTROL.getOid() ) )
         {
-            BasicControl treeDeleteControl = new BasicControl( Control.TREEDELETE_CONTROL.getOid(),
-                Control.TREEDELETE_CONTROL.isCritical(), Control.TREEDELETE_CONTROL.getControlValue() );
-            controls.add( treeDeleteControl );
+            Control treeDeleteControl = new BasicControl(
+                org.apache.directory.studio.ldapbrowser.core.model.Control.TREEDELETE_CONTROL.getOid(),
+                org.apache.directory.studio.ldapbrowser.core.model.Control.TREEDELETE_CONTROL.isCritical(),
+                org.apache.directory.studio.ldapbrowser.core.model.Control.TREEDELETE_CONTROL.getControlValue() );
+            controlList.add( treeDeleteControl );
         }
+        Control[] controls = controlList.toArray( new Control[controlList.size()] );
+
+        // do not follow referrals
+        ReferralHandlingMethod referralsHandlingMethod = browserConnection.getRootDSE().isControlSupported(
+            org.apache.directory.studio.ldapbrowser.core.model.Control.MANAGEDSAIT_CONTROL.getOid() ) ? ReferralHandlingMethod.MANAGE
+            : ReferralHandlingMethod.IGNORE;
 
         // delete entry
         browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( dn.getUpName(),
-            controls.toArray( new BasicControl[controls.size()] ), monitor );
+            referralsHandlingMethod, controls, monitor, null );
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ExportDsmlJob.java Tue Jan  1 13:07:48 2008
@@ -64,7 +64,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.Control;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.dom4j.Document;
 import org.dom4j.DocumentHelper;
@@ -163,7 +162,7 @@
             }
 
             // DerefAliases
-            AliasDereferencingMethod derefAliases = searchParameter.getAliasesDereferencingMethod();
+            Connection.AliasDereferencingMethod derefAliases = searchParameter.getAliasesDereferencingMethod();
             switch ( derefAliases )
             {
                 case ALWAYS:

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java Tue Jan  1 13:07:48 2008
@@ -51,6 +51,7 @@
 import org.apache.directory.studio.connection.core.ConnectionCoreConstants;
 import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -400,7 +401,7 @@
             }
 
             browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( dn, jndiAttributes,
-                getControls( attrValRecord ), monitor );
+                ReferralHandlingMethod.IGNORE, getControls( attrValRecord ), monitor, null );
         }
         else if ( record instanceof LdifChangeAddRecord )
         {
@@ -423,13 +424,13 @@
             }
 
             browserConnection.getConnection().getJNDIConnectionWrapper().createEntry( dn, jndiAttributes,
-                getControls( changeAddRecord ), monitor );
+                ReferralHandlingMethod.IGNORE, getControls( changeAddRecord ), monitor, null );
         }
         else if ( record instanceof LdifChangeDeleteRecord )
         {
             LdifChangeDeleteRecord changeDeleteRecord = ( LdifChangeDeleteRecord ) record;
             browserConnection.getConnection().getJNDIConnectionWrapper().deleteEntry( dn,
-                getControls( changeDeleteRecord ), monitor );
+                ReferralHandlingMethod.IGNORE, getControls( changeDeleteRecord ), monitor, null );
         }
         else if ( record instanceof LdifChangeModifyRecord )
         {
@@ -461,8 +462,8 @@
                 }
             }
 
-            browserConnection.getConnection().getJNDIConnectionWrapper().modifyAttributes( dn, mis,
-                getControls( modifyRecord ), monitor );
+            browserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry( dn, mis,
+                ReferralHandlingMethod.IGNORE, getControls( modifyRecord ), monitor, null );
         }
         else if ( record instanceof LdifChangeModDnRecord )
         {
@@ -484,8 +485,8 @@
                         newDn = DnUtils.composeDn( newRdn, parent.getUpName() );
                     }
 
-                    browserConnection.getConnection().getJNDIConnectionWrapper().rename( dn, newDn.toString(),
-                        deleteOldRdn, getControls( modDnRecord ), monitor );
+                    browserConnection.getConnection().getJNDIConnectionWrapper().renameEntry( dn, newDn.toString(),
+                        deleteOldRdn, ReferralHandlingMethod.IGNORE, getControls( modDnRecord ), monitor, null );
                 }
                 catch ( InvalidNameException ne )
                 {
@@ -514,8 +515,7 @@
             for ( int i = 0; i < controlLines.length; i++ )
             {
                 LdifControlLine line = controlLines[i];
-                // TODO: encoded control value
-                controls[i] = new BasicControl( line.getUnfoldedOid(), line.isCritical(), null );
+                controls[i] = new BasicControl( line.getUnfoldedOid(), line.isCritical(), line.getControlValueAsBinary() );
             }
         }
         return controls;

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java Tue Jan  1 13:07:48 2008
@@ -35,9 +35,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
-import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
-import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.events.AttributesInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
@@ -46,8 +44,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.BaseDNEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DirectoryMetadataEntry;
@@ -227,10 +223,11 @@
         else
         {
 	        // search
-	        ISearch search = new Search( null, entry.getBrowserConnection(), entry.getDn(), entry.isSubentry()?ISearch.FILTER_SUBENTRY:ISearch.FILTER_TRUE, attributes,
-	            SearchScope.OBJECT, 0, 0, AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE,
-	            false, false, null );
-	        SearchJob.searchAndUpdateModel( entry.getBrowserConnection(), search, monitor );
+            ISearch search = new Search( null, entry.getBrowserConnection(), entry.getDn(),
+                entry.isSubentry() ? ISearch.FILTER_SUBENTRY : ISearch.FILTER_TRUE, attributes, SearchScope.OBJECT, 0,
+                0, entry.getBrowserConnection().getAliasesDereferencingMethod(), entry.getBrowserConnection()
+                    .getReferralsHandlingMethod(), false, null );
+            SearchJob.searchAndUpdateModel( entry.getBrowserConnection(), search, monitor );
 	
 	        // set initialized state
 	        entry.setAttributesInitialized( true );
@@ -264,9 +261,8 @@
 
         // load well-known Root DSE attributes, includes + and *
         ISearch search = new Search( null, browserConnection, LdapDN.EMPTY_LDAPDN, ISearch.FILTER_TRUE,
-            InitializeAttributesJob.ROOT_DSE_ATTRIBUTES, SearchScope.OBJECT, 0, 0,
-            AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, false, false,
-            null );
+            InitializeAttributesJob.ROOT_DSE_ATTRIBUTES, SearchScope.OBJECT, 0, 0, Connection.AliasDereferencingMethod.NEVER,
+            Connection.ReferralHandlingMethod.IGNORE, false, null );
         SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
 
         // the list of entries under the Root DSE
@@ -328,8 +324,9 @@
                 {
                     // special handling of empty namingContext (Novell eDirectory): 
                     // perform a one-level search and add all result DNs to the set
-                    search = new Search( null, browserConnection, LdapDN.EMPTY_LDAPDN, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, SearchScope.ONELEVEL, 0,
-                        0, AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, false, false, null );
+                    search = new Search( null, browserConnection, LdapDN.EMPTY_LDAPDN, ISearch.FILTER_TRUE,
+                        ISearch.NO_ATTRIBUTES, SearchScope.ONELEVEL, 0, 0, Connection.AliasDereferencingMethod.NEVER,
+                        Connection.ReferralHandlingMethod.IGNORE, false, null );
                     SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
                     ISearchResult[] results = search.getSearchResults();
                     for ( ISearchResult searchResult : results )
@@ -364,19 +361,6 @@
             }
         }
         
-//        // TODO: check all attributes if they are valid DNs
-//        String[] metadataAttributeNames = new String[]
-//            { IRootDSE.ROOTDSE_ATTRIBUTE_MONITORCONTEXT, IRootDSE.ROOTDSE_ATTRIBUTE_CONFIGCONTEXT,
-//                IRootDSE.ROOTDSE_ATTRIBUTE_DSANAME };
-//        for ( int x = 0; x < metadataAttributeNames.length; x++ )
-//        {
-//            IEntry[] metadataEntries = getDirectoryMetadataEntries( browserConnection, metadataAttributeNames[x] );
-//            for ( int i = 0; i < metadataEntries.length; i++ )
-//            {
-//                rootDseEntries.add( metadataEntries[i] );
-//            }
-//        }
-        
         // try to init entries
         StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
         for ( IEntry entry : rootDseEntries.values() )
@@ -399,18 +383,10 @@
         ISearch search;
         IEntry entry;
         // search the entry
-        AliasDereferencingMethod derefAliasMethod = browserConnection.getAliasesDereferencingMethod();
-        ReferralHandlingMethod handleReferralsMethod = browserConnection.getReferralsHandlingMethod();
-        if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-            BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS )
-            && browserConnection.getRootDSE().isControlSupported(
-                IBrowserConnection.CONTROL_MANAGEDSAIT ) )
-        {
-            derefAliasMethod = AliasDereferencingMethod.NEVER;
-            handleReferralsMethod = ReferralHandlingMethod.IGNORE;
-        }
-        search = new Search( null, browserConnection, dn, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES, SearchScope.OBJECT, 1, 0,
-            derefAliasMethod, handleReferralsMethod, true, true, null );
+        Connection.AliasDereferencingMethod derefAliasMethod = browserConnection.getAliasesDereferencingMethod();
+        Connection.ReferralHandlingMethod handleReferralsMethod = browserConnection.getReferralsHandlingMethod();
+        search = new Search( null, browserConnection, dn, ISearch.FILTER_TRUE, ISearch.NO_ATTRIBUTES,
+            SearchScope.OBJECT, 1, 0, derefAliasMethod, handleReferralsMethod, true, null );
         SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
         
         // add entry to Root DSE

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java Tue Jan  1 13:07:48 2008
@@ -27,19 +27,18 @@
 
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.events.ChildrenInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.Control;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IRootDSE;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.AliasBaseEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
@@ -177,25 +176,24 @@
             SearchScope scope = SearchScope.ONELEVEL;
             AliasDereferencingMethod derefAliasMethod = parent.getBrowserConnection().getAliasesDereferencingMethod();
             ReferralHandlingMethod handleReferralsMethod = parent.getBrowserConnection().getReferralsHandlingMethod();
-            if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-                BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS )
-                && parent.getBrowserConnection().getRootDSE().isControlSupported(
-                    IBrowserConnection.CONTROL_MANAGEDSAIT ) )
-            {
-                scope = ( parent.isAlias() || parent.isReferral() ) ? SearchScope.OBJECT : SearchScope.ONELEVEL;
-                derefAliasMethod = parent.isAlias() ? AliasDereferencingMethod.FINDING
-                    : AliasDereferencingMethod.NEVER;
-                handleReferralsMethod = parent.isReferral() ? ReferralHandlingMethod.FOLLOW
-                    : ReferralHandlingMethod.IGNORE;
-            }
-
+            Control[] controls = null;
+//            if( parent.isReferral() && handleReferralsMethod == ReferralHandlingMethod.MANAGE )
+//            {
+//                handleReferralsMethod = ReferralHandlingMethod.FOLLOW;
+//                scope = SearchScope.OBJECT;
+//            }
+//            if( parent.isAlias() && derefAliasMethod == AliasDereferencingMethod.NEVER )
+//            {
+//                derefAliasMethod = AliasDereferencingMethod.FINDING;
+//                scope = SearchScope.OBJECT;
+//            }
+            
             // get children,
-            ISearch search = new Search( null, parent.getBrowserConnection(), parent.getDn(), parent.getChildrenFilter(),
-                ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(),
-                parent.getBrowserConnection().getTimeLimit(), derefAliasMethod, handleReferralsMethod, BrowserCorePlugin
-                    .getDefault().getPluginPreferences().getBoolean( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ),
+            ISearch search = new Search( null, parent.getBrowserConnection(), parent.getDn(), parent
+                .getChildrenFilter(), ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(),
+                parent.getBrowserConnection().getTimeLimit(), derefAliasMethod, handleReferralsMethod,
                 BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
-                    BrowserCoreConstants.PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS ), null );
+                    BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), controls );
             SearchJob.searchAndUpdateModel( parent.getBrowserConnection(), search, monitor );
             ISearchResult[] srs = search.getSearchResults();
             monitor.reportProgress( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__init_entries_progress_subcount,
@@ -205,11 +203,8 @@
             // fill children in search result
             if ( srs != null && srs.length > 0 )
             {
-
-                /*
-                 * clearing old children before filling new children is
-                 * necessary to handle aliases and referrals.
-                 */
+                // clearing old children before filling new children is
+                // necessary to handle aliases and referrals.
                 IEntry[] connChildren = parent.getChildren();
                 for ( int i = 0; connChildren != null && i < connChildren.length; i++ )
                 {
@@ -227,8 +222,6 @@
                         AliasBaseEntry aliasBaseEntry = new AliasBaseEntry( srs[i].getEntry().getBrowserConnection(), srs[i]
                             .getEntry().getDn() );
                         parent.addChild( aliasBaseEntry );
-                        // System.out.println("Ali: " +
-                        // aliasBaseEntry.getUrl());
                     }
                     else
                     {
@@ -241,13 +234,13 @@
                 parent.setHasChildrenHint( false );
             }
 
-            // get subentries
-            ISearch subSearch = new Search( null, parent.getBrowserConnection(), parent.getDn(), parent.getChildrenFilter()!=null?parent.getChildrenFilter():ISearch.FILTER_SUBENTRY,
-                ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(),
-                parent.getBrowserConnection().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[]
+            // get sub-entries
+            ISearch subSearch = new Search( null, parent.getBrowserConnection(), parent.getDn(), parent
+                .getChildrenFilter() != null ? parent.getChildrenFilter() : ISearch.FILTER_SUBENTRY,
+                ISearch.NO_ATTRIBUTES, scope, parent.getBrowserConnection().getCountLimit(), parent
+                    .getBrowserConnection().getTimeLimit(), derefAliasMethod, handleReferralsMethod, BrowserCorePlugin
+                    .getDefault().getPluginPreferences()
+                    .getBoolean( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), new Control[]
                     { Control.SUBENTRIES_CONTROL } );
             if ( BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
                 BrowserCoreConstants.PREFERENCE_FETCH_SUBENTRIES ) )
@@ -258,6 +251,7 @@
                     new String[]
                         { subSrs == null ? Integer.toString( 0 ) : Integer.toString( subSrs.length ),
                             parent.getDn().getUpName() } ) );
+
                 // fill children in search result
                 if ( subSrs != null && subSrs.length > 0 )
                 {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ModifyValueJob.java Tue Jan  1 13:07:48 2008
@@ -24,10 +24,9 @@
 import javax.naming.directory.BasicAttribute;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
-import javax.naming.ldap.Control;
-import javax.naming.ldap.ManageReferralControl;
 
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.AttributesInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryModificationEvent;
@@ -184,16 +183,12 @@
                 modificationItems[1] = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, oldAttribute );
             }
 
-            // controls
-            Control[] controls = null;
-            if ( entry.isReferral() )
-            {
-                controls = new Control[]
-                    { new ManageReferralControl() };
-            }
+            // determine referrals handling method
+            ReferralHandlingMethod referralsHandlingMethod = entry.isReferral() ? ReferralHandlingMethod.MANAGE
+                : ReferralHandlingMethod.FOLLOW;
 
-            browserConnection.getConnection().getJNDIConnectionWrapper().modifyAttributes( dn, modificationItems,
-                controls, monitor );
+            browserConnection.getConnection().getJNDIConnectionWrapper().modifyEntry( dn, modificationItems,
+                referralsHandlingMethod, null, monitor, null );
         }
         else
         {

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java Tue Jan  1 13:07:48 2008
@@ -148,7 +148,7 @@
             LdapDN newDn = DnUtils.composeDn( oldDn.getRdn(), parentDn );
 
             // try to move entry
-            moveEntry( browserConnection, oldDn, newDn, dummyMonitor );
+            RenameEntryJob.renameEntry( browserConnection, oldEntry, newDn, dummyMonitor );
 
             // do a simulated rename, if renaming of a non-leaf entry is not supported.
             if ( dummyMonitor.errorsReported() )
@@ -261,24 +261,6 @@
     {
         return oldEntries.length == 1 ? BrowserCoreMessages.jobs__move_entry_error_1
             : BrowserCoreMessages.jobs__move_entry_error_n;
-    }
-
-
-    /**
-     * Moves an entry.
-     * 
-     * @param browserConnection the browser connection
-     * @param oldDn the old DN
-     * @param newDn the new DN
-     * @param monitor the progress monitor
-     */
-    static void moveEntry( IBrowserConnection browserConnection, LdapDN oldDn, LdapDN newDn,
-        StudioProgressMonitor monitor )
-    {
-        String oldDnString = oldDn.getUpName();
-        String newDnString = newDn.getUpName();
-        browserConnection.getConnection().getJNDIConnectionWrapper().rename( oldDnString, newDnString, false, null,
-            monitor );
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReadEntryJob.java Tue Jan  1 13:07:48 2008
@@ -29,8 +29,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
 
@@ -157,9 +155,9 @@
             }
 
             // search in directory
-            ISearch search = new Search( null, browserConnection, dn, null, ISearch.NO_ATTRIBUTES,
-                SearchScope.OBJECT, 1, 0, AliasDereferencingMethod.NEVER,
-                ReferralHandlingMethod.IGNORE, true, true, null );
+            ISearch search = new Search( null, browserConnection, dn, null, ISearch.NO_ATTRIBUTES, SearchScope.OBJECT,
+                1, 0, browserConnection.getAliasesDereferencingMethod(),
+                browserConnection.getReferralsHandlingMethod(), true, null );
             SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
             ISearchResult[] srs = search.getSearchResults();
             if ( srs.length > 0 )

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java Tue Jan  1 13:07:48 2008
@@ -34,6 +34,7 @@
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryRenamedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -135,7 +136,7 @@
         StudioProgressMonitor dummyMonitor = new StudioProgressMonitor( monitor );
 
         // try to rename entry
-        renameEntry( browserConnection, oldDn, newDn, dummyMonitor );
+        renameEntry( browserConnection, oldEntry, newDn, dummyMonitor );
 
         // do a simulated rename, if renaming of a non-leaf entry is not supported.
         if ( dummyMonitor.errorsReported() )
@@ -241,21 +242,28 @@
     }
 
 
+    
     /**
-     * Renames the entry.
+     * Moves/Renames an entry.
      * 
      * @param browserConnection the browser connection
-     * @param oldDn the old DN
+     * @param entry the entry to move/rename
      * @param newDn the new DN
      * @param monitor the progress monitor
      */
-    static void renameEntry( IBrowserConnection browserConnection, LdapDN oldDn, LdapDN newDn,
+    static void renameEntry( IBrowserConnection browserConnection, IEntry entry, LdapDN newDn,
         StudioProgressMonitor monitor )
     {
-        String oldDnString = oldDn.getUpName();
+        // DNs
+        String oldDnString = entry.getDn().getUpName();
         String newDnString = newDn.getUpName();
-        browserConnection.getConnection().getJNDIConnectionWrapper().rename( oldDnString, newDnString, true, null,
-            monitor );
+
+        // determine referrals handling method
+        ReferralHandlingMethod referralsHandlingMethod = entry.isReferral() ? ReferralHandlingMethod.MANAGE
+            : ReferralHandlingMethod.FOLLOW;
+
+        browserConnection.getConnection().getJNDIConnectionWrapper().renameEntry( oldDnString, newDnString, false,
+            referralsHandlingMethod, null, monitor, null );
     }
 
 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java Tue Jan  1 13:07:48 2008
@@ -41,7 +41,8 @@
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
-import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
+import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
@@ -301,8 +302,8 @@
         controls.setCountLimit( parameter.getCountLimit() );
         controls.setTimeLimit( parameter.getTimeLimit() );
         String filter = parameter.getFilter();
-        String derefAliasMethod = getDerefAliasMethod( parameter );
-        String handleReferralsMethod = getReferralsHandlingMethod( parameter );
+        AliasDereferencingMethod aliasesDereferencingMethod = parameter.getAliasesDereferencingMethod();
+        ReferralHandlingMethod referralsHandlingMethod = parameter.getReferralsHandlingMethod();
 
         Control[] ldapControls = null;
         if ( parameter.getControls() != null )
@@ -316,53 +317,11 @@
         }
 
         NamingEnumeration<SearchResult> result = browserConnection.getConnection().getJNDIConnectionWrapper().search(
-            searchBase, filter, controls, derefAliasMethod, handleReferralsMethod, ldapControls, monitor, null );
+            searchBase, filter, controls, aliasesDereferencingMethod, referralsHandlingMethod, ldapControls, monitor, null );
         return result;
     }
 
 
-    private static String getDerefAliasMethod( SearchParameter parameter )
-    {
-        String m = "always"; //$NON-NLS-1$
-
-        switch ( parameter.getAliasesDereferencingMethod() )
-        {
-            case NEVER:
-                m = "never"; //$NON-NLS-1$
-                break;
-            case ALWAYS:
-                m = "always"; //$NON-NLS-1$
-                break;
-            case FINDING:
-                m = "finding"; //$NON-NLS-1$
-                break;
-            case SEARCH:
-                m = "searching"; //$NON-NLS-1$
-                break;
-        }
-
-        return m;
-    }
-
-
-    private static String getReferralsHandlingMethod( SearchParameter parameter )
-    {
-        String m = JNDIConnectionWrapper.REFERRAL_FOLLOW; //$NON-NLS-1$
-
-        switch ( parameter.getReferralsHandlingMethod() )
-        {
-            case IGNORE:
-                m = JNDIConnectionWrapper.REFERRAL_IGNORE; //$NON-NLS-1$
-                break;
-            case FOLLOW:
-                m = JNDIConnectionWrapper.REFERRAL_FOLLOW; //$NON-NLS-1$
-                break;
-        }
-
-        return m;
-    }
-
-
     private static SearchParameter getSearchParameter( ISearch search )
     {
         SearchParameter searchParameter = ( SearchParameter ) search.getSearchParameter().clone();
@@ -404,33 +363,47 @@
                 searchParameter.setReturningAttributes( returningAttributes );
             }
         }
-
-        // to init the alias/referral flag we need the objectClass
-        if ( search.isInitAliasAndReferralFlag() )
-        {
-            if ( !Utils.containsIgnoreCase( Arrays.asList( searchParameter.getReturningAttributes() ),
-                IAttribute.OBJECTCLASS_ATTRIBUTE ) )
-            {
-                String[] returningAttributes = new String[searchParameter.getReturningAttributes().length + 1];
-                System.arraycopy( searchParameter.getReturningAttributes(), 0, returningAttributes, 0, searchParameter
-                    .getReturningAttributes().length );
-                returningAttributes[returningAttributes.length - 1] = IAttribute.OBJECTCLASS_ATTRIBUTE;
-                searchParameter.setReturningAttributes( returningAttributes );
-            }
-        }
-
-        // if returning attributes are requested but objectClass isn't included then add it
-        if ( search.getReturningAttributes() == null || search.getReturningAttributes().length > 0 )
-        {
-            if ( !Utils.containsIgnoreCase( Arrays.asList( searchParameter.getReturningAttributes() ),
-                IAttribute.OBJECTCLASS_ATTRIBUTE ) )
-            {
-                String[] returningAttributes = new String[searchParameter.getReturningAttributes().length + 1];
-                System.arraycopy( searchParameter.getReturningAttributes(), 0, returningAttributes, 0, searchParameter
-                    .getReturningAttributes().length );
-                returningAttributes[returningAttributes.length - 1] = IAttribute.OBJECTCLASS_ATTRIBUTE;
-                searchParameter.setReturningAttributes( returningAttributes );
-            }
+//
+//        // to init the alias/referral flag we need the objectClass
+//        if ( search.isInitAliasAndReferralFlag() )
+//        {
+//            if ( !Utils.containsIgnoreCase( Arrays.asList( searchParameter.getReturningAttributes() ),
+//                IAttribute.OBJECTCLASS_ATTRIBUTE ) )
+//            {
+//                String[] returningAttributes = new String[searchParameter.getReturningAttributes().length + 1];
+//                System.arraycopy( searchParameter.getReturningAttributes(), 0, returningAttributes, 0, searchParameter
+//                    .getReturningAttributes().length );
+//                returningAttributes[returningAttributes.length - 1] = IAttribute.OBJECTCLASS_ATTRIBUTE;
+//                searchParameter.setReturningAttributes( returningAttributes );
+//            }
+//        }
+//
+//        // if returning attributes are requested but objectClass isn't included then add it
+//        if ( search.getReturningAttributes() == null || search.getReturningAttributes().length > 0 )
+//        {
+//            if ( !Utils.containsIgnoreCase( Arrays.asList( searchParameter.getReturningAttributes() ),
+//                IAttribute.OBJECTCLASS_ATTRIBUTE ) )
+//            {
+//                String[] returningAttributes = new String[searchParameter.getReturningAttributes().length + 1];
+//                System.arraycopy( searchParameter.getReturningAttributes(), 0, returningAttributes, 0, searchParameter
+//                    .getReturningAttributes().length );
+//                returningAttributes[returningAttributes.length - 1] = IAttribute.OBJECTCLASS_ATTRIBUTE;
+//                searchParameter.setReturningAttributes( returningAttributes );
+//            }
+//        }
+        
+        // always add the objectClass attribute, we need it  
+        // - to detect alias and referral entries
+        // - to determine the entry's icon
+        // - to determine must and may attributes
+        if ( !Utils.containsIgnoreCase( Arrays.asList( searchParameter.getReturningAttributes() ),
+            IAttribute.OBJECTCLASS_ATTRIBUTE ) )
+        {
+            String[] returningAttributes = new String[searchParameter.getReturningAttributes().length + 1];
+            System.arraycopy( searchParameter.getReturningAttributes(), 0, returningAttributes, 0, searchParameter
+                .getReturningAttributes().length );
+            returningAttributes[returningAttributes.length - 1] = IAttribute.OBJECTCLASS_ATTRIBUTE;
+            searchParameter.setReturningAttributes( returningAttributes );
         }
 
         // filter controls if not supported by server
@@ -572,18 +545,17 @@
                         }
                     }
 
-                    if ( searchParameter.isInitAliasAndReferralFlag() )
+                    if ( IAttribute.OBJECTCLASS_ATTRIBUTE.equalsIgnoreCase( attributeDescription ) )
                     {
-                        if ( IAttribute.OBJECTCLASS_ATTRIBUTE.equalsIgnoreCase( attributeDescription ) )
+                        if ( ObjectClassDescription.OC_ALIAS.equalsIgnoreCase( value ) )
                         {
-                            if ( ObjectClassDescription.OC_ALIAS.equalsIgnoreCase( value ) )
-                            {
-                                entry.setAlias( true );
-                            }
-                            if ( ObjectClassDescription.OC_REFERRAL.equalsIgnoreCase( value ) )
-                            {
-                                entry.setReferral( true );
-                            }
+                            entry.setAlias( true );
+                            entry.setHasChildrenHint( false );
+                        }
+                        if ( ObjectClassDescription.OC_REFERRAL.equalsIgnoreCase( value ) )
+                        {
+                            entry.setReferral( true );
+                            entry.setHasChildrenHint( false );
                         }
                     }
                 }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java Tue Jan  1 13:07:48 2008
@@ -26,6 +26,8 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
+import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.BookmarkManager;
 import org.apache.directory.studio.ldapbrowser.core.SearchManager;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
@@ -61,133 +63,6 @@
 
     /** The key for the connection parameter "Referrals Handling". */
     public static String CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD = "ldapbrowser.referralsHandlingMethod";
-
-    /**
-     * Enum for alias dereferencing method.
-     * 
-     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
-     * @version $Rev$, $Date$
-     */
-    public enum AliasDereferencingMethod
-    {
-
-        /** Never. */
-        NEVER(0),
-
-        /** Always. */
-        ALWAYS(1),
-
-        /** Finding. */
-        FINDING(2),
-
-        /** Search. */
-        SEARCH(3);
-
-        private final int ordinal;
-
-
-        private AliasDereferencingMethod( int ordinal )
-        {
-            this.ordinal = ordinal;
-        }
-
-
-        /**
-         * Gets the ordinal.
-         * 
-         * @return the ordinal
-         */
-        public int getOrdinal()
-        {
-            return ordinal;
-        }
-
-
-        /**
-         * Gets the AliasDereferencingMethod by ordinal.
-         * 
-         * @param ordinal the ordinal
-         * 
-         * @return the AliasDereferencingMethod
-         */
-        public static AliasDereferencingMethod getByOrdinal( int ordinal )
-        {
-            switch ( ordinal )
-            {
-                case 0:
-                    return NEVER;
-                case 1:
-                    return ALWAYS;
-                case 2:
-                    return FINDING;
-                case 3:
-                    return SEARCH;
-                default:
-                    return null;
-            }
-        }
-    }
-
-    /**
-     * Enum for referral handling method.
-     * 
-     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
-     * @version $Rev$, $Date$
-     */
-    public enum ReferralHandlingMethod
-    {
-
-        /** Ignore. */
-        IGNORE(0),
-
-        /** Follow. */
-        FOLLOW(1),
-
-        /** Manual. */
-        MANUAL(2);
-
-        private final int ordinal;
-
-
-        private ReferralHandlingMethod( int ordinal )
-        {
-            this.ordinal = ordinal;
-        }
-
-
-        /**
-         * Gets the ordinal.
-         * 
-         * @return the ordinal
-         */
-        public int getOrdinal()
-        {
-            return ordinal;
-        }
-
-
-        /**
-         * Gets the ReferralHandlingMethod by ordinal.
-         * 
-         * @param ordinal the ordinal
-         * 
-         * @return the ReferralHandlingMethod
-         */
-        public static ReferralHandlingMethod getByOrdinal( int ordinal )
-        {
-            switch ( ordinal )
-            {
-                case 0:
-                    return IGNORE;
-                case 1:
-                    return FOLLOW;
-                case 2:
-                    return MANUAL;
-                default:
-                    return null;
-            }
-        }
-    }
 
     /** The MangageDsaIT control OID. */
     public static final String CONTROL_MANAGEDSAIT = "2.16.840.1.113730.3.4.2"; //$NON-NLS-1$

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java Tue Jan  1 13:07:48 2008
@@ -24,9 +24,8 @@
 import java.io.Serializable;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.propertypageproviders.SearchPropertyPageProvider;
 import org.eclipse.core.runtime.IAdaptable;
 
@@ -141,14 +140,6 @@
 
 
     /**
-     * Checks if the isAlias and isReferral flags should be initialized.
-     * 
-     * @return true, if the isAlias and isReferral flags should be initialized
-     */
-    public abstract boolean isInitAliasAndReferralFlag();
-
-
-    /**
      * Gets the controls.
      * 
      * @return the controls
@@ -234,7 +225,7 @@
      * 
      * @return the aliases dereferencing method
      */
-    public abstract AliasDereferencingMethod getAliasesDereferencingMethod();
+    public abstract Connection.AliasDereferencingMethod getAliasesDereferencingMethod();
 
 
     /**
@@ -244,7 +235,7 @@
      * 
      * @param aliasesDereferencingMethod the aliases dereferencing method
      */
-    public abstract void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod );
+    public abstract void setAliasesDereferencingMethod( Connection.AliasDereferencingMethod aliasesDereferencingMethod );
 
 
     /**
@@ -252,7 +243,7 @@
      *  
      * @return the referrals handling method
      */
-    public abstract ReferralHandlingMethod getReferralsHandlingMethod();
+    public abstract Connection.ReferralHandlingMethod getReferralsHandlingMethod();
 
 
     /**
@@ -262,7 +253,7 @@
      * 
      * @param referralsHandlingMethod the referrals handling method
      */
-    public abstract void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod );
+    public abstract void setReferralsHandlingMethod( Connection.ReferralHandlingMethod referralsHandlingMethod );
 
 
     /**

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/SearchParameter.java Tue Jan  1 13:07:48 2008
@@ -26,8 +26,8 @@
 import javax.naming.InvalidNameException;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
+import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 
 
@@ -77,9 +77,6 @@
     /** Flag indicating weather the hasChildren flag of IEntry should be initialized */
     private boolean initHasChildrenFlag;
 
-    /** Flag indicating weather the isAlias and isReferral flag of IEntry should be initialized */
-    private boolean initAliasAndReferralFlag;
-
 
     /**
      * Creates a new instance of SearchParameter with default search parameters:
@@ -91,8 +88,8 @@
      * <li>search scope one level
      * <li>no count limit
      * <li>no time limit
-     * <li>never dereference aliases
-     * <li>ignore referrals
+     * <li>always dereference aliases
+     * <li>follow referrals
      * <li>no initialization of hasChildren flag
      * <li>no initialization of isAlias and isReferral flag
      * <li>no controls 
@@ -107,11 +104,10 @@
         scope = SearchScope.ONELEVEL;
         timeLimit = 0;
         countLimit = 0;
-        aliasesDereferencingMethod = AliasDereferencingMethod.NEVER;
-        referralsHandlingMethod = ReferralHandlingMethod.IGNORE;
+        aliasesDereferencingMethod = AliasDereferencingMethod.ALWAYS;
+        referralsHandlingMethod = ReferralHandlingMethod.FOLLOW;
         controls = null;
         initHasChildrenFlag = false;
-        initAliasAndReferralFlag = false;
     }
 
 
@@ -364,31 +360,8 @@
         clone.setAliasesDereferencingMethod( getAliasesDereferencingMethod() );
         clone.setReferralsHandlingMethod( getReferralsHandlingMethod() );
         clone.setInitHasChildrenFlag( isInitHasChildrenFlag() );
-        clone.setInitAliasAndReferralFlag( isInitAliasAndReferralFlag() );
         clone.setControls( getControls() );
         return clone;
-    }
-
-
-    /**
-     * Checks if the isAlias and isReferral flags of IEntry should be initialized.
-     * 
-     * @return true, if the isAlias and isReferral flags of IEntry should be initialized
-     */
-    public boolean isInitAliasAndReferralFlag()
-    {
-        return initAliasAndReferralFlag;
-    }
-
-
-    /**
-     * Sets if the hasChildren flag of IEntry should be initialized.
-     * 
-     * @param initAliasAndReferralFlag the init isAlias and isReferral flag
-     */
-    public void setInitAliasAndReferralFlag( boolean initAliasAndReferralFlag )
-    {
-        this.initAliasAndReferralFlag = initAliasAndReferralFlag;
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java Tue Jan  1 13:07:48 2008
@@ -31,6 +31,8 @@
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.ConnectionFolder;
+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.event.ConnectionEventRegistry;
 import org.apache.directory.studio.connection.core.event.ConnectionUpdateListener;
 import org.apache.directory.studio.ldapbrowser.core.BookmarkManager;
@@ -97,12 +99,12 @@
 
         if ( connection.getConnectionParameter().getExtendedProperty( CONNECTION_PARAMETER_COUNT_LIMIT ) == null )
         {
-            connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_COUNT_LIMIT, 0 );
+            connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_COUNT_LIMIT, 1000 );
             connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_TIME_LIMIT, 0 );
             connection.getConnectionParameter().setExtendedIntProperty(
-                CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD, AliasDereferencingMethod.NEVER.getOrdinal() );
+                CONNECTION_PARAMETER_ALIASES_DEREFERENCING_METHOD, AliasDereferencingMethod.ALWAYS.getOrdinal() );
             connection.getConnectionParameter().setExtendedIntProperty( CONNECTION_PARAMETER_REFERRALS_HANDLING_METHOD,
-                ReferralHandlingMethod.IGNORE.getOrdinal() );
+                ReferralHandlingMethod.FOLLOW.getOrdinal() );
             connection.getConnectionParameter().setExtendedBoolProperty( CONNECTION_PARAMETER_FETCH_BASE_DNS, true );
             connection.getConnectionParameter().setExtendedProperty( CONNECTION_PARAMETER_BASE_DN, "" );
         }

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java Tue Jan  1 13:07:48 2008
@@ -89,9 +89,9 @@
     /** 
      * {@inheritDoc}
      */
-    public AliasDereferencingMethod getAliasesDereferencingMethod()
+    public Connection.AliasDereferencingMethod getAliasesDereferencingMethod()
     {
-        return AliasDereferencingMethod.NEVER;
+        return Connection.AliasDereferencingMethod.NEVER;
     }
 
 
@@ -168,7 +168,7 @@
     /** 
      * {@inheritDoc}
      */
-    public void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod )
+    public void setAliasesDereferencingMethod( Connection.AliasDereferencingMethod aliasesDereferencingMethod )
     {
     }
 
@@ -220,16 +220,16 @@
     /** 
      * {@inheritDoc}
      */
-    public ReferralHandlingMethod getReferralsHandlingMethod()
+    public Connection.ReferralHandlingMethod getReferralsHandlingMethod()
     {
-        return ReferralHandlingMethod.IGNORE;
+        return Connection.ReferralHandlingMethod.IGNORE;
     }
 
 
     /** 
      * {@inheritDoc}
      */
-    public void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod )
+    public void setReferralsHandlingMethod( Connection.ReferralHandlingMethod referralsHandlingMethod )
     {
     }
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/OpenBrowserConnectionsJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/OpenBrowserConnectionsJob.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/OpenBrowserConnectionsJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/OpenBrowserConnectionsJob.java Tue Jan  1 13:07:48 2008
@@ -29,6 +29,7 @@
 import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeAttributesJob;
 import org.apache.directory.studio.ldapbrowser.core.jobs.ReloadSchemasJob;
 import org.apache.directory.studio.ldapbrowser.core.jobs.SearchJob;
+import org.apache.directory.studio.ldapbrowser.core.model.Control;
 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.IRootDSE;

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java?rev=607915&r1=607914&r2=607915&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java Tue Jan  1 13:07:48 2008
@@ -26,6 +26,8 @@
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
+import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.events.SearchUpdateEvent;
 import org.apache.directory.studio.ldapbrowser.core.internal.search.LdapSearchPageScoreComputer;
@@ -35,8 +37,6 @@
 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.URL;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 
@@ -76,10 +76,9 @@
      * <li>search scope one level
      * <li>no count limit
      * <li>no time limit
-     * <li>never dereference aliases
-     * <li>ignore referrals
+     * <li>always dereference aliases
+     * <li>follow referrals
      * <li>no initialization of hasChildren flag
-     * <li>no initialization of isAlias and isReferral flag
      * <li>no controls
      * <li>
      * </ul>
@@ -89,7 +88,7 @@
         this(
             new SimpleDateFormat( "yyyy-MM-dd HH-mm-ss" ).format( new Date() ), //$NON-NLS-1$
             null, EMPTY_SEARCH_BASE, FILTER_TRUE, NO_ATTRIBUTES, SearchScope.ONELEVEL, 0, 0,
-            AliasDereferencingMethod.NEVER, ReferralHandlingMethod.IGNORE, false, false, null );
+            AliasDereferencingMethod.ALWAYS, ReferralHandlingMethod.FOLLOW, false, null );
     }
 
 
@@ -136,15 +135,13 @@
      *                the referrals handling method
      * @param initHasChildrenFlag
      *                the init hasChildren flag
-     * @param initAliasAndReferralsFlag
-     *                the init isAlias and isReferral flag
      * @param controls
      *                the controls
      */
     public Search( String searchName, IBrowserConnection conn, LdapDN searchBase, String filter,
         String[] returningAttributes, SearchScope scope, int countLimit, int timeLimit,
-        AliasDereferencingMethod aliasesDereferencingMethod, ReferralHandlingMethod referralsHandlingMethod,
-        boolean initHasChildrenFlag, boolean initAliasAndReferralsFlag, Control[] controls )
+        AliasDereferencingMethod aliasesDereferencingMethod,
+        ReferralHandlingMethod referralsHandlingMethod, boolean initHasChildrenFlag, Control[] controls )
     {
         this.connection = conn;
         this.searchResults = null;
@@ -161,7 +158,6 @@
         this.searchParameter.setAliasesDereferencingMethod( aliasesDereferencingMethod );
         this.searchParameter.setReferralsHandlingMethod( referralsHandlingMethod );
         this.searchParameter.setInitHasChildrenFlag( initHasChildrenFlag );
-        this.searchParameter.setInitAliasAndReferralFlag( initAliasAndReferralsFlag );
         this.searchParameter.setControls( controls );
     }
 
@@ -200,15 +196,6 @@
     /**
      * {@inheritDoc}
      */
-    public boolean isInitAliasAndReferralFlag()
-    {
-        return searchParameter.isInitAliasAndReferralFlag();
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public Control[] getControls()
     {
         return searchParameter.getControls();
@@ -303,7 +290,7 @@
     /**
      * {@inheritDoc}
      */
-    public void setAliasesDereferencingMethod( AliasDereferencingMethod aliasesDereferencingMethod )
+    public void setAliasesDereferencingMethod( Connection.AliasDereferencingMethod aliasesDereferencingMethod )
     {
         searchParameter.setAliasesDereferencingMethod( aliasesDereferencingMethod );
         fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED );
@@ -322,7 +309,7 @@
     /**
      * {@inheritDoc}
      */
-    public void setReferralsHandlingMethod( ReferralHandlingMethod referralsHandlingMethod )
+    public void setReferralsHandlingMethod( Connection.ReferralHandlingMethod referralsHandlingMethod )
     {
         searchParameter.setReferralsHandlingMethod( referralsHandlingMethod );
         fireSearchUpdated( SearchUpdateEvent.EventDetail.SEARCH_PARAMETER_UPDATED );
@@ -466,7 +453,7 @@
     {
         return new Search( getName(), getBrowserConnection(), getSearchBase(), getFilter(), getReturningAttributes(),
             getScope(), getCountLimit(), getTimeLimit(), getAliasesDereferencingMethod(), getReferralsHandlingMethod(),
-            isInitHasChildrenFlag(), isInitAliasAndReferralFlag(), getControls() );
+            isInitHasChildrenFlag(), getControls() );
     }
 
 



Mime
View raw message