directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r640065 - in /directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs: InitializeAttributesJob.java InitializeChildrenJob.java
Date Sat, 22 Mar 2008 19:19:55 GMT
Author: seelmann
Date: Sat Mar 22 12:19:54 2008
New Revision: 640065

URL: http://svn.apache.org/viewvc?rev=640065&view=rev
Log:
Fixed alias and referrals handling in searches

Modified:
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java?rev=640065&r1=640064&r2=640065&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeAttributesJob.java
Sat Mar 22 12:19:54 2008
@@ -35,6 +35,8 @@
 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.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.AttributesInitializedEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
@@ -222,11 +224,22 @@
         }
         else
         {
+            AliasDereferencingMethod aliasesDereferencingMethod = entry.getBrowserConnection()
+                .getAliasesDereferencingMethod();
+            if ( entry.isAlias() )
+            {
+                aliasesDereferencingMethod = AliasDereferencingMethod.NEVER;
+            }
+            ReferralHandlingMethod referralsHandlingMethod = entry.getBrowserConnection().getReferralsHandlingMethod();
+            if ( entry.isReferral() )
+            {
+                referralsHandlingMethod = ReferralHandlingMethod.MANAGE;
+            }
+            
             // search
             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 );
+                0, aliasesDereferencingMethod, referralsHandlingMethod, false, null );
             SearchJob.searchAndUpdateModel( entry.getBrowserConnection(), search, monitor
);
 
             // set initialized state
@@ -394,8 +407,8 @@
         ISearch search;
         IEntry entry;
         // search the entry
-        Connection.AliasDereferencingMethod derefAliasMethod = browserConnection.getAliasesDereferencingMethod();
-        Connection.ReferralHandlingMethod handleReferralsMethod = browserConnection.getReferralsHandlingMethod();
+        AliasDereferencingMethod derefAliasMethod = browserConnection.getAliasesDereferencingMethod();
+        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 );

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java?rev=640065&r1=640064&r2=640065&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/InitializeChildrenJob.java
Sat Mar 22 12:19:54 2008
@@ -174,24 +174,22 @@
             
             // determine alias and referral handling
             SearchScope scope = SearchScope.ONELEVEL;
-            AliasDereferencingMethod derefAliasMethod = parent.getBrowserConnection().getAliasesDereferencingMethod();
-            ReferralHandlingMethod handleReferralsMethod = parent.getBrowserConnection().getReferralsHandlingMethod();
+            AliasDereferencingMethod aliasesDereferencingMethod = parent.getBrowserConnection().getAliasesDereferencingMethod();
+            if ( parent.isAlias() )
+            {
+                aliasesDereferencingMethod = AliasDereferencingMethod.NEVER;
+            }
+            ReferralHandlingMethod referralsHandlingMethod = parent.getBrowserConnection().getReferralsHandlingMethod();
+            if ( parent.isReferral() )
+            {
+                referralsHandlingMethod = ReferralHandlingMethod.MANAGE;
+            }
             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,
+                parent.getBrowserConnection().getTimeLimit(), aliasesDereferencingMethod,
referralsHandlingMethod,
                 BrowserCorePlugin.getDefault().getPluginPreferences().getBoolean(
                     BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), controls );
             SearchJob.searchAndUpdateModel( parent.getBrowserConnection(), search, monitor
);
@@ -238,7 +236,7 @@
             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
+                    .getBrowserConnection().getTimeLimit(), aliasesDereferencingMethod, referralsHandlingMethod,
BrowserCorePlugin
                     .getDefault().getPluginPreferences()
                     .getBoolean( BrowserCoreConstants.PREFERENCE_CHECK_FOR_CHILDREN ), new
Control[]
                     { Control.SUBENTRIES_CONTROL } );



Mime
View raw message