directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r664342 [3/7] - in /directory/sandbox/seelmann/testingframework: ./ apacheds-configuration-help/src/main/docbook/ apacheds-configuration-help/src/main/resources/html/images/ apacheds-configuration-help/src/main/resources/html/images/getting...
Date Sat, 07 Jun 2008 14:17:30 GMT
Modified: directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/Utils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/Utils.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/Utils.java (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/Utils.java Sat Jun  7 07:17:06 2008
@@ -20,7 +20,17 @@
 
 package org.apache.directory.studio.connection.core;
 
+
+import java.util.Arrays;
+
+import javax.naming.InvalidNameException;
+import javax.naming.directory.SearchControls;
+
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
+import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
 
 
 /**
@@ -78,7 +88,6 @@
         return sb.toString();
     }
 
-    
 
     /**
      * Converts a String into a String that could be used as a filename.
@@ -95,7 +104,6 @@
             return null;
         }
 
-        
         byte[] b = StringTools.getBytesUtf8( s );
         StringBuffer sb = new StringBuffer();
         for ( int i = 0; i < b.length; i++ )
@@ -121,4 +129,128 @@
         return sb.toString();
     }
 
+
+    /**
+     * Transforms the given search parameters into an LDAP URL.
+     *
+     * @param connection the connection
+     * @param searchBase the search base
+     * @param scope the search scope
+     * @param filter the search filter
+     * @param attributes the returning attributes
+     * 
+     * @return the LDAP URL for the given search parameters
+     */
+    public static LdapURL getLdapURL( Connection connection, String searchBase, int scope, String filter,
+        String[] attributes )
+    {
+        LdapURL url = new LdapURL();
+        url.setScheme( connection.getEncryptionMethod() == EncryptionMethod.LDAPS ? "ldaps://" : "ldap://" );
+        url.setHost( connection.getHost() );
+        url.setPort( connection.getPort() );
+        try
+        {
+            url.setDn( new LdapDN( searchBase ) );
+        }
+        catch ( InvalidNameException e )
+        {
+        }
+        url.setAttributes( Arrays.asList( attributes ) );
+        url.setScope( scope );
+        url.setFilter( filter );
+        return url;
+    }
+
+
+    /**
+     * Transforms the given search parameters into an ldapsearch command line.
+     *
+     * @param connection the connection
+     * @param searchBase the search base
+     * @param scope the search scope
+     * @param aliasesDereferencingMethod the aliases dereferencing method
+     * @param sizeLimit the size limit
+     * @param timeLimit the time limit
+     * @param filter the search filter
+     * @param attributes the returning attributes
+     * 
+     * @return the ldapsearch command line for the given search parameters
+     */
+    public static String getLdapSearchCommandLine( Connection connection, String searchBase, int scope,
+        AliasDereferencingMethod aliasesDereferencingMethod, long sizeLimit, long timeLimit, String filter,
+        String[] attributes )
+    {
+        StringBuilder cmdLine = new StringBuilder();
+
+        cmdLine.append( "ldapsearch" );
+
+        cmdLine.append( " -H " ).append(
+            connection.getEncryptionMethod() == EncryptionMethod.LDAPS ? "ldaps://" : "ldap://" ).append(
+            connection.getHost() ).append( ":" ).append( connection.getPort() );
+
+        if ( connection.getEncryptionMethod() == EncryptionMethod.START_TLS )
+        {
+            cmdLine.append( " -ZZ" );
+        }
+
+        switch ( connection.getAuthMethod() )
+        {
+            case SIMPLE:
+                cmdLine.append( " -x" );
+                cmdLine.append( " -D \"" ).append( connection.getBindPrincipal() ).append( "\"" );
+                cmdLine.append( " -W" );
+                break;
+            case SASL_CRAM_MD5:
+                cmdLine.append( " -U \"" ).append( connection.getBindPrincipal() ).append( "\"" );
+                cmdLine.append( " -Y \"CRAM-MD5\"" );
+                break;
+            case SASL_DIGEST_MD5:
+                cmdLine.append( " -U \"" ).append( connection.getBindPrincipal() ).append( "\"" );
+                cmdLine.append( " -Y \"DIGEST-MD5\"" );
+                break;
+            case SASL_GSSAPI:
+                cmdLine.append( " -Y \"GSSAPI\"" );
+                break;
+        }
+
+        cmdLine.append( " -b \"" ).append( searchBase ).append( "\"" );
+
+        String scopeAsString = scope == SearchControls.SUBTREE_SCOPE ? "sub"
+            : scope == SearchControls.ONELEVEL_SCOPE ? "one" : "base";
+        cmdLine.append( " -s " ).append( scopeAsString );
+
+        if ( aliasesDereferencingMethod != AliasDereferencingMethod.NEVER )
+        {
+            String aliasAsString = aliasesDereferencingMethod == AliasDereferencingMethod.ALWAYS ? "always"
+                : aliasesDereferencingMethod == AliasDereferencingMethod.FINDING ? "find"
+                    : aliasesDereferencingMethod == AliasDereferencingMethod.SEARCH ? "search" : "never";
+            cmdLine.append( " -a " ).append( aliasAsString );
+        }
+
+        if ( sizeLimit > 0 )
+        {
+            cmdLine.append( " -z " ).append( sizeLimit );
+        }
+        if ( timeLimit > 0 )
+        {
+            cmdLine.append( " -l " ).append( timeLimit );
+        }
+
+        cmdLine.append( " \"" ).append( filter ).append( "\"" );
+
+        if ( attributes != null )
+        {
+            if ( attributes.length == 0 )
+            {
+                cmdLine.append( " \"1.1\"" );
+            }
+            for ( String attribute : attributes )
+            {
+                cmdLine.append( " \"" ).append( attribute ).append( "\"" );
+            }
+        }
+
+        return cmdLine.toString();
+    }
+
 }

Modified: directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java Sat Jun  7 07:17:06 2008
@@ -84,6 +84,8 @@
 public class JNDIConnectionWrapper implements ConnectionWrapper
 {
 
+    private static int SEARCH_RESQUEST_NUM = 0;
+
     private Connection connection;
 
     private boolean useLdaps;
@@ -285,6 +287,7 @@
             {
                 // add ManageDsaIT control
                 Control[] localControls = addManageDsaItControls( controls, referralsHandlingMethod );
+                long requestNum = SEARCH_RESQUEST_NUM++;
 
                 try
                 {
@@ -299,10 +302,11 @@
                     searchCtx.addToEnvironment( Context.REFERRAL, REFERRAL_THROW );
 
                     // perform the search
-                    namingEnumeration = searchCtx.search( new LdapName( searchBase ), filter, searchControls );
-                    namingEnumeration = new StudioNamingEnumeration( connection, namingEnumeration, searchBase, filter,
-                        searchControls, aliasesDereferencingMethod, referralsHandlingMethod, controls, monitor,
-                        referralsInfo );
+                    NamingEnumeration<SearchResult> ne = searchCtx.search( new LdapName( searchBase ), filter,
+                        searchControls );
+                    namingEnumeration = new StudioNamingEnumeration( connection, ne, searchBase, filter,
+                        searchControls, aliasesDereferencingMethod, referralsHandlingMethod, controls, requestNum,
+                        monitor, referralsInfo );
                 }
                 catch ( PartialResultException pre )
                 {
@@ -352,10 +356,10 @@
                                     referralSearchControls.setDerefLinkFlag( searchControls.getDerefLinkFlag() );
                                     referralSearchControls.setReturningObjFlag( searchControls.getReturningObjFlag() );
 
-                                    namingEnumeration = referralConnection.getJNDIConnectionWrapper().search(
-                                        referralSearchBase, referralFilter, referralSearchControls,
-                                        aliasesDereferencingMethod, referralsHandlingMethod, controls, monitor,
-                                        newReferralsInfo );
+                                    namingEnumeration = ( StudioNamingEnumeration ) referralConnection
+                                        .getJNDIConnectionWrapper().search( referralSearchBase, referralFilter,
+                                            referralSearchControls, aliasesDereferencingMethod,
+                                            referralsHandlingMethod, controls, monitor, newReferralsInfo );
                                 }
                             }
                         }
@@ -370,6 +374,21 @@
                     // report each other naming exception
                     namingException = e;
                 }
+
+                for ( IJndiLogger logger : getJndiLoggers() )
+                {
+                    if ( namingEnumeration != null )
+                    {
+                        logger.logSearchRequest( connection, searchBase, filter, searchControls,
+                            aliasesDereferencingMethod, localControls, requestNum, namingException );
+                    }
+                    else
+                    {
+                        logger.logSearchRequest( connection, searchBase, filter, searchControls,
+                            aliasesDereferencingMethod, localControls, requestNum, namingException );
+                        logger.logSearchResultDone( connection, 0, requestNum, namingException );
+                    }
+                }
             }
         };
 
@@ -1063,7 +1082,7 @@
 
     abstract class InnerRunnable implements Runnable
     {
-        protected NamingEnumeration<SearchResult> namingEnumeration = null;
+        protected StudioNamingEnumeration namingEnumeration = null;
         protected NamingException namingException = null;
 
 

Modified: directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java Sat Jun  7 07:17:06 2008
@@ -43,6 +43,7 @@
 import javax.naming.directory.Attributes;
 import javax.naming.directory.DirContext;
 import javax.naming.directory.ModificationItem;
+import javax.naming.directory.SearchControls;
 import javax.naming.ldap.Control;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -53,6 +54,7 @@
 import org.apache.directory.studio.connection.core.ConnectionManager;
 import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.IJndiLogger;
+import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.ldifparser.LdifFormatParameters;
 import org.apache.directory.studio.ldifparser.model.container.LdifChangeAddRecord;
 import org.apache.directory.studio.ldifparser.model.container.LdifChangeDeleteRecord;
@@ -73,7 +75,7 @@
 
 
 /**
- * The ModificationLogger is used to log modifications in LDIF format into a file.
+ * The LdifModificationLogger is used to log modifications in LDIF format into a file.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -98,7 +100,7 @@
 
 
     /**
-     * Creates a new instance of ModificationLogger.
+     * Creates a new instance of LdifModificationLogger.
      */
     public LdifModificationLogger()
     {
@@ -217,12 +219,12 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.IModificationLogger#logChangetypeAdd(java.lang.String, javax.naming.directory.Attributes, javax.naming.ldap.Control[], javax.naming.NamingException)
+     * @see org.apache.directory.studio.connection.core.IJndiLogger#logChangetypeAdd(org.apache.directory.studio.connection.core.Connection, java.lang.String, javax.naming.directory.Attributes, javax.naming.ldap.Control[], javax.naming.NamingException)
      */
     public void logChangetypeAdd( Connection connection, final String dn, final Attributes attributes,
         final Control[] controls, NamingException ex )
     {
-        if (!isModificationLogEnabled())
+        if ( !isModificationLogEnabled() )
         {
             return;
         }
@@ -263,12 +265,12 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.IModificationLogger#logChangetypeDelete(java.lang.String, javax.naming.ldap.Control[], javax.naming.NamingException)
+     * @see org.apache.directory.studio.connection.core.IJndiLogger#logChangetypeDelete(org.apache.directory.studio.connection.core.Connection, java.lang.String, javax.naming.ldap.Control[], javax.naming.NamingException)
      */
     public void logChangetypeDelete( Connection connection, final String dn, final Control[] controls,
         NamingException ex )
     {
-        if (!isModificationLogEnabled())
+        if ( !isModificationLogEnabled() )
         {
             return;
         }
@@ -284,12 +286,12 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.IModificationLogger#logChangetypeModify(java.lang.String, javax.naming.directory.ModificationItem[], javax.naming.ldap.Control[], javax.naming.NamingException)
+     * @see org.apache.directory.studio.connection.core.IJndiLogger#logChangetypeModify(org.apache.directory.studio.connection.core.Connection, java.lang.String, javax.naming.directory.ModificationItem[], javax.naming.ldap.Control[], javax.naming.NamingException)
      */
     public void logChangetypeModify( Connection connection, final String dn,
         final ModificationItem[] modificationItems, final Control[] controls, NamingException ex )
     {
-        if (!isModificationLogEnabled())
+        if ( !isModificationLogEnabled() )
         {
             return;
         }
@@ -347,12 +349,12 @@
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.IModificationLogger#logChangetypeModDn(java.lang.String, java.lang.String, boolean, javax.naming.ldap.Control[], javax.naming.NamingException)
+     * @see org.apache.directory.studio.connection.core.IJndiLogger#logChangetypeModDn(org.apache.directory.studio.connection.core.Connection, java.lang.String, java.lang.String, boolean, javax.naming.ldap.Control[], javax.naming.NamingException)
      */
     public void logChangetypeModDn( Connection connection, final String oldDn, final String newDn,
         final boolean deleteOldRdn, final Control[] controls, NamingException ex )
     {
-        if (!isModificationLogEnabled())
+        if ( !isModificationLogEnabled() )
         {
             return;
         }
@@ -381,6 +383,36 @@
 
 
     /**
+     * @see org.apache.directory.studio.connection.core.IJndiLogger#logSearchRequest(org.apache.directory.studio.connection.core.Connection, java.lang.String, java.lang.String, javax.naming.directory.SearchControls, org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod, javax.naming.ldap.Control[], long, javax.naming.NamingException)
+     */
+    public void logSearchRequest( Connection connection, String searchBase, String filter,
+        SearchControls searchControls, AliasDereferencingMethod aliasesDereferencingMethod, Control[] controls,
+        long requestNum, NamingException ex )
+    {
+        // don't log searches
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.IJndiLogger#logSearchResultEntry(org.apache.directory.studio.connection.core.Connection, org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult, long, javax.naming.NamingException)
+     */
+    public void logSearchResultEntry( Connection connection, StudioSearchResult studioSearchResult, long requestNum,
+        NamingException ex )
+    {
+        // don't log searches 
+    }
+
+
+    /**
+     * @see org.apache.directory.studio.connection.core.IJndiLogger#logSearchResultDone(org.apache.directory.studio.connection.core.Connection, long, long, javax.naming.NamingException)
+     */
+    public void logSearchResultDone( Connection connection, long count, long requestNum, NamingException namingException )
+    {
+        // don't log searches 
+    }
+
+
+    /**
      * Adds control lines to the record
      *
      * @param record the recored
@@ -472,6 +504,7 @@
         return null;
     }
 
+
     /**
      * Checks if modification log is enabled.
      * 
@@ -479,10 +512,11 @@
      */
     private boolean isModificationLogEnabled()
     {
-        return ConnectionCorePlugin.getDefault().getPluginPreferences()
-            .getBoolean( ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE );
+        return ConnectionCorePlugin.getDefault().getPluginPreferences().getBoolean(
+            ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE );
     }
 
+
     public String getId()
     {
         return id;

Modified: directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/StudioNamingEnumeration.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/StudioNamingEnumeration.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/StudioNamingEnumeration.java (original)
+++ directory/sandbox/seelmann/testingframework/connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/StudioNamingEnumeration.java Sat Jun  7 07:17:06 2008
@@ -30,6 +30,8 @@
 
 import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
+import org.apache.directory.studio.connection.core.IJndiLogger;
 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;
@@ -47,6 +49,9 @@
     private final Connection connection;
     private NamingEnumeration<SearchResult> delegate;
 
+    private long requestNum;
+    private long resultEntryCounter;
+
     private String searchBase;
     private String filter;
     private SearchControls searchControls;
@@ -73,11 +78,13 @@
      */
     public StudioNamingEnumeration( Connection connection, NamingEnumeration<SearchResult> delegate, String searchBase,
         String filter, SearchControls searchControls, AliasDereferencingMethod aliasesDereferencingMethod,
-        ReferralHandlingMethod referralsHandlingMethod, Control[] controls, StudioProgressMonitor monitor,
-        ReferralsInfo referralsInfo )
+        ReferralHandlingMethod referralsHandlingMethod, Control[] controls, long requestNum,
+        StudioProgressMonitor monitor, ReferralsInfo referralsInfo )
     {
         this.connection = connection;
         this.delegate = delegate;
+        this.requestNum = requestNum;
+        this.resultEntryCounter = 0;
 
         this.searchBase = searchBase;
         this.filter = filter;
@@ -104,14 +111,22 @@
      */
     public boolean hasMore() throws NamingException
     {
+        NamingException logResultDoneException = null;
+        boolean logResultDone = false;
+
         while ( true )
         {
             try
             {
-                return delegate != null && delegate.hasMore();
+                boolean hasMore = delegate != null && delegate.hasMore();
+                logResultDone = !hasMore;
+                return hasMore;
             }
             catch ( PartialResultException pre )
             {
+                logResultDone = true;
+                logResultDoneException = pre;
+
                 // ignore exception if referrals handling method is IGNORE
                 // report exception if referrals handling method is FOLLOW or MANGAGE
                 if ( referralsHandlingMethod == ReferralHandlingMethod.IGNORE )
@@ -125,6 +140,9 @@
             }
             catch ( ReferralException re )
             {
+                logResultDone = true;
+                logResultDoneException = re;
+
                 // ignore exception if referrals handling method is IGNORE
                 // report exception if referrals handling method is MANGAGE
                 // follow referral if referrals handling method is FOLLOW
@@ -135,6 +153,7 @@
                 else if ( referralsHandlingMethod == ReferralHandlingMethod.FOLLOW )
                 {
                     referralsInfo = JNDIConnectionWrapper.handleReferralException( re, referralsInfo );
+                    logResultDone = false;
                     UrlAndDn urlAndDn = referralsInfo.getNext();
                     if ( urlAndDn != null )
                     {
@@ -169,6 +188,22 @@
                     throw re;
                 }
             }
+            catch ( NamingException ne )
+            {
+                logResultDone = true;
+                logResultDoneException = ne;
+                throw ne;
+            }
+            finally
+            {
+                if ( logResultDone )
+                {
+                    for ( IJndiLogger logger : ConnectionCorePlugin.getDefault().getJndiLoggers() )
+                    {
+                        logger.logSearchResultDone( connection, resultEntryCounter, requestNum, logResultDoneException );
+                    }
+                }
+            }
         }
     }
 
@@ -178,7 +213,15 @@
      */
     public boolean hasMoreElements()
     {
-        return delegate.hasMoreElements();
+        boolean hasMore = delegate.hasMoreElements();
+        if ( !hasMore )
+        {
+            for ( IJndiLogger logger : ConnectionCorePlugin.getDefault().getJndiLoggers() )
+            {
+                logger.logSearchResultDone( connection, resultEntryCounter, requestNum, null );
+            }
+        }
+        return hasMore;
     }
 
 
@@ -187,10 +230,27 @@
      */
     public SearchResult next() throws NamingException
     {
-        SearchResult searchResult = delegate.next();
-        StudioSearchResult studioSearchResult = new StudioSearchResult( searchResult, getConnection(),
-            referralsInfo != null );
-        return studioSearchResult;
+        StudioSearchResult studioSearchResult = null;
+        NamingException namingException = null;
+        try
+        {
+            SearchResult searchResult = delegate.next();
+            resultEntryCounter++;
+            studioSearchResult = new StudioSearchResult( searchResult, getConnection(), referralsInfo != null );
+            return studioSearchResult;
+        }
+        catch ( NamingException ne )
+        {
+            namingException = ne;
+            throw ne;
+        }
+        finally
+        {
+            for ( IJndiLogger logger : ConnectionCorePlugin.getDefault().getJndiLoggers() )
+            {
+                logger.logSearchResultEntry( connection, studioSearchResult, requestNum, namingException );
+            }
+        }
     }
 
 
@@ -200,7 +260,14 @@
     public SearchResult nextElement()
     {
         SearchResult searchResult = delegate.nextElement();
-        return new StudioSearchResult( searchResult, getConnection(), referralsInfo != null );
+        resultEntryCounter++;
+        StudioSearchResult studioSearchResult = new StudioSearchResult( searchResult, getConnection(),
+            referralsInfo != null );
+        for ( IJndiLogger logger : ConnectionCorePlugin.getDefault().getJndiLoggers() )
+        {
+            logger.logSearchResultEntry( connection, studioSearchResult, requestNum, null );
+        }
+        return studioSearchResult;
     }
 
 

Modified: directory/sandbox/seelmann/testingframework/jars/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/jars/META-INF/MANIFEST.MF?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/jars/META-INF/MANIFEST.MF (original)
+++ directory/sandbox/seelmann/testingframework/jars/META-INF/MANIFEST.MF Sat Jun  7 07:17:06 2008
@@ -142,8 +142,8 @@
  lib/commons-lang-2.3.jar,
  lib/dom4j-1.6.1.jar,
  lib/nlog4j-1.2.25.jar,
- lib/shared-asn1-0.9.9-SNAPSHOT.jar,
- lib/shared-ldap-0.9.9-SNAPSHOT.jar,
- lib/shared-ldap-constants-0.9.9-SNAPSHOT.jar,
- lib/studio-dsml-parser-0.4.1.SNAPSHOT.jar,
+ lib/shared-asn1-0.9.11-SNAPSHOT.jar,
+ lib/shared-ldap-0.9.11-SNAPSHOT.jar,
+ lib/shared-ldap-constants-0.9.11-SNAPSHOT.jar,
+ lib/studio-dsml-parser-0.4.2.SNAPSHOT.jar,
  lib/xpp3-1.1.3.4.O.jar

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionListener.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionListener.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionListener.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionListener.java Sat Jun  7 07:17:06 2008
@@ -25,7 +25,6 @@
 import java.util.Collection;
 import java.util.List;
 
-import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.syntax.AttributeTypeDescription;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.IConnectionListener;
@@ -34,15 +33,8 @@
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 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.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 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.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
-import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 
@@ -79,6 +71,9 @@
                 BrowserConnectionUpdateEvent browserConnectionUpdateEvent = new BrowserConnectionUpdateEvent(
                     browserConnection, BrowserConnectionUpdateEvent.Detail.BROWSER_CONNECTION_OPENED );
                 EventRegistry.fireBrowserConnectionUpdated( browserConnectionUpdateEvent, this );
+                BrowserConnectionUpdateEvent schemaUpdateEvent = new BrowserConnectionUpdateEvent( browserConnection,
+                    BrowserConnectionUpdateEvent.Detail.SCHEMA_UPDATED );
+                EventRegistry.fireBrowserConnectionUpdated( schemaUpdateEvent, this );
             }
         }
     }
@@ -117,78 +112,10 @@
      */
     private static void openBrowserConnection( IBrowserConnection browserConnection, StudioProgressMonitor monitor )
     {
+        ReloadSchemasJob.reloadSchema( false, browserConnection, monitor );
+
         IRootDSE rootDSE = browserConnection.getRootDSE();
         InitializeAttributesJob.initializeAttributes( rootDSE, true, monitor );
-
-        // check schema reload
-        if ( rootDSE != null )
-        {
-            try
-            {
-                monitor.reportProgress( BrowserCoreMessages.model__loading_schema );
-
-                // check if schema is cached
-                Schema schema = browserConnection.getSchema();
-                if ( schema == Schema.DEFAULT_SCHEMA )
-                {
-                    ReloadSchemasJob.reloadSchema( browserConnection, monitor );
-                }
-                else if ( rootDSE.getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY ) != null )
-                {
-                    // check if schema is up-to-date
-                    SearchParameter sp = new SearchParameter();
-                    sp.setSearchBase( new LdapDN( rootDSE.getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY )
-                        .getStringValue() ) );
-                    sp.setFilter( Schema.SCHEMA_FILTER );
-                    sp.setScope( SearchScope.OBJECT );
-                    sp.setReturningAttributes( new String[]
-                        { IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP,
-                            IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP, } );
-                    ISearch search = new Search( browserConnection, sp );
-
-                    SearchJob.searchAndUpdateModel( browserConnection, search, monitor );
-                    ISearchResult[] results = search.getSearchResults();
-
-                    if ( results != null && results.length == 1 )
-                    {
-                        String schemaTimestamp = results[0]
-                            .getAttribute( IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP ) != null ? results[0]
-                            .getAttribute( IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP ).getStringValue() : null;
-                        if ( schemaTimestamp == null )
-                        {
-                            schemaTimestamp = results[0]
-                                .getAttribute( IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP ) != null ? results[0]
-                                .getAttribute( IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP ).getStringValue()
-                                : null;
-                        }
-                        String cacheTimestamp = schema.getModifyTimestamp() != null ? schema.getModifyTimestamp()
-                            : schema.getCreateTimestamp();
-                        if ( cacheTimestamp == null
-                            || ( cacheTimestamp != null && schemaTimestamp != null && schemaTimestamp
-                                .compareTo( cacheTimestamp ) > 0 ) )
-                        {
-                            ReloadSchemasJob.reloadSchema( browserConnection, monitor );
-                        }
-                    }
-                    else
-                    {
-                        browserConnection.setSchema( Schema.DEFAULT_SCHEMA );
-                        monitor.reportError( BrowserCoreMessages.model__no_schema_information );
-                    }
-                }
-                else
-                {
-                    browserConnection.setSchema( Schema.DEFAULT_SCHEMA );
-                    monitor.reportError( BrowserCoreMessages.model__missing_schema_location );
-                }
-            }
-            catch ( Exception e )
-            {
-                browserConnection.setSchema( Schema.DEFAULT_SCHEMA );
-                monitor.reportError( BrowserCoreMessages.model__error_loading_schema, e );
-                e.printStackTrace();
-            }
-        }
     }
 
 

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/EventRegistry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/EventRegistry.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/EventRegistry.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/events/EventRegistry.java Sat Jun  7 07:17:06 2008
@@ -244,7 +244,7 @@
      *
      * @param listener the listener
      */
-    public static void removeBrowserConnectionpdateListener( BrowserConnectionUpdateListener listener )
+    public static void removeBrowserConnectionUpdateListener( BrowserConnectionUpdateListener listener )
     {
         if ( browserConnectionUpdateListeners.containsKey( listener ) )
         {

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ReloadSchemasJob.java Sat Jun  7 07:17:06 2008
@@ -21,6 +21,10 @@
 package org.apache.directory.studio.ldapbrowser.core.jobs;
 
 
+import javax.naming.NamingEnumeration;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.SearchResult;
+
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
@@ -94,14 +98,9 @@
             { browserConnection.getConnection().getName() } ) );
         monitor.worked( 1 );
 
-        // load root DSE
-        monitor.reportProgress( BrowserCoreMessages.model__loading_rootdse );
-        InitializeAttributesJob.initializeAttributes( browserConnection.getRootDSE(), true, monitor );
-        monitor.worked( 1 );
-        
         // load schema
         monitor.reportProgress( BrowserCoreMessages.model__loading_schema );
-        reloadSchema( browserConnection, monitor );
+        reloadSchema( true, browserConnection, monitor );
         monitor.worked( 1 );
     }
 
@@ -124,25 +123,39 @@
     {
         return BrowserCoreMessages.jobs__reload_schemas_error_1;
     }
-    
+
 
     /**
      * Reloads the schema.
      * 
+     * @param forceReload true to force the reload of the schema, otherwise it would only be reloaded
+     *                    if the server-side schema is newer than the cached schema.
      * @param browserConnection the browser connection
      * @param monitor the progress monitor
      */
-    public static void reloadSchema( IBrowserConnection browserConnection, StudioProgressMonitor monitor )
+    public static void reloadSchema( boolean forceReload, IBrowserConnection browserConnection,
+        StudioProgressMonitor monitor )
     {
-        browserConnection.setSchema( Schema.DEFAULT_SCHEMA );
+        LdapDN schemaLocation = getSchemaLocation( browserConnection, monitor );
+        if ( schemaLocation == null )
+        {
+            monitor.reportError( BrowserCoreMessages.model__missing_schema_location );
+            return;
+        }
 
-        try
+        Schema schema = browserConnection.getSchema();
+
+        boolean mustReload = forceReload || ( schema == Schema.DEFAULT_SCHEMA )
+            || mustReload( schemaLocation, browserConnection, monitor );
+
+        if ( mustReload )
         {
-            if ( browserConnection.getRootDSE().getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY ) != null )
+            browserConnection.setSchema( Schema.DEFAULT_SCHEMA );
+
+            try
             {
                 SearchParameter sp = new SearchParameter();
-                sp.setSearchBase( new LdapDN( browserConnection.getRootDSE().getAttribute( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY )
-                    .getStringValue() ) );
+                sp.setSearchBase( schemaLocation );
                 sp.setFilter( Schema.SCHEMA_FILTER );
                 sp.setScope( SearchScope.OBJECT );
                 sp.setReturningAttributes( new String[]
@@ -150,26 +163,80 @@
                         Schema.SCHEMA_ATTRIBUTE_LDAPSYNTAXES, Schema.SCHEMA_ATTRIBUTE_MATCHINGRULES,
                         Schema.SCHEMA_ATTRIBUTE_MATCHINGRULEUSE, IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP,
                         IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP, } );
-                
+
                 LdifEnumeration le = ExportLdifJob.search( browserConnection, sp, monitor );
                 if ( le.hasNext() )
                 {
                     LdifContentRecord schemaRecord = ( LdifContentRecord ) le.next();
-                    Schema schema = new Schema();
+                    schema = new Schema();
                     schema.loadFromRecord( schemaRecord );
                     browserConnection.setSchema( schema );
-                    // TODO: Schema update event
-//                    EventRegistry.fireConnectionUpdated( new ConnectionUpdateEvent( this,
-//                        ConnectionUpdateEvent.EventDetail.SCHEMA_LOADED ), this );
                 }
                 else
                 {
                     monitor.reportError( BrowserCoreMessages.model__no_schema_information );
                 }
             }
-            else
+            catch ( Exception e )
             {
-                monitor.reportError( BrowserCoreMessages.model__missing_schema_location );
+                monitor.reportError( BrowserCoreMessages.model__error_loading_schema, e );
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    /**
+     * Checks if the schema must be reloaded
+     * 
+     * @param browserConnection the browser connection
+     * @param monitor the progress monitor
+     */
+    private static boolean mustReload( LdapDN schemaLocation, IBrowserConnection browserConnection,
+        StudioProgressMonitor monitor )
+    {
+        Schema schema = browserConnection.getSchema();
+
+        try
+        {
+            SearchParameter sp = new SearchParameter();
+            sp.setSearchBase( schemaLocation );
+            sp.setFilter( Schema.SCHEMA_FILTER );
+            sp.setScope( SearchScope.OBJECT );
+            sp
+                .setReturningAttributes( new String[]
+                    { IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP,
+                        IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP } );
+            NamingEnumeration<SearchResult> enumeration = SearchJob.search( browserConnection, sp, monitor );
+            while ( enumeration != null && enumeration.hasMore() )
+            {
+                String createTimestamp = null;
+                String modifyTimestamp = null;
+
+                SearchResult sr = enumeration.next();
+                NamingEnumeration<? extends Attribute> attributes = sr.getAttributes().getAll();
+                while ( attributes.hasMore() )
+                {
+                    Attribute attribute = attributes.next();
+                    if ( attribute.getID().equalsIgnoreCase( IAttribute.OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP ) )
+                    {
+                        modifyTimestamp = ( String ) attribute.get();
+                    }
+                    if ( attribute.getID().equalsIgnoreCase( IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP ) )
+                    {
+                        createTimestamp = ( String ) attribute.get();
+                    }
+                }
+
+                String schemaTimestamp = modifyTimestamp != null ? modifyTimestamp : createTimestamp;
+                String cacheTimestamp = schema.getModifyTimestamp() != null ? schema.getModifyTimestamp() : schema
+                    .getCreateTimestamp();
+                if ( cacheTimestamp == null
+                    || ( cacheTimestamp != null && schemaTimestamp != null && schemaTimestamp
+                        .compareTo( cacheTimestamp ) > 0 ) )
+                {
+                    return true;
+                }
             }
         }
         catch ( Exception e )
@@ -177,5 +244,47 @@
             monitor.reportError( BrowserCoreMessages.model__error_loading_schema, e );
             e.printStackTrace();
         }
+
+        return false;
+    }
+
+
+    private static LdapDN getSchemaLocation( IBrowserConnection browserConnection, StudioProgressMonitor monitor )
+    {
+        try
+        {
+            SearchParameter sp = new SearchParameter();
+            sp.setSearchBase( new LdapDN() );
+            sp.setScope( SearchScope.OBJECT );
+            sp.setReturningAttributes( new String[]
+                { IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY } );
+            NamingEnumeration<SearchResult> enumeration = SearchJob.search( browserConnection, sp, monitor );
+            while ( enumeration != null && enumeration.hasMore() )
+            {
+                SearchResult sr = enumeration.next();
+                NamingEnumeration<? extends Attribute> attributes = sr.getAttributes().getAll();
+                while ( attributes.hasMore() )
+                {
+                    Attribute attribute = attributes.next();
+                    if ( attribute.getID().equalsIgnoreCase( IRootDSE.ROOTDSE_ATTRIBUTE_SUBSCHEMASUBENTRY ) )
+                    {
+                        String value = ( String ) attribute.get();
+                        if ( LdapDN.isValid( value ) )
+                        {
+                            LdapDN dn = new LdapDN( value );
+                            return dn;
+                        }
+                    }
+                }
+            }
+        }
+        catch ( Exception e )
+        {
+            monitor.reportError( BrowserCoreMessages.model__error_loading_schema, e );
+            return null;
+        }
+
+        return null;
     }
+
 }

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java Sat Jun  7 07:17:06 2008
@@ -643,23 +643,26 @@
                 Attribute attribute = attributeEnumeration.next();
                 String attributeDescription = attribute.getID();
 
-                IAttribute studioAttribute = null;
-                if ( entry.getAttribute( attributeDescription ) == null )
+                if( attribute.getAll().hasMore() )
                 {
-                    studioAttribute = new org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute( entry,
-                        attributeDescription );
-                    entry.addAttribute( studioAttribute );
-                }
-                else
-                {
-                    studioAttribute = entry.getAttribute( attributeDescription );
-                }
-
-                NamingEnumeration<?> valueEnumeration = attribute.getAll();
-                while ( valueEnumeration.hasMore() )
-                {
-                    Object value = valueEnumeration.next();
-                    studioAttribute.addValue( new Value( studioAttribute, value ) );
+                    IAttribute studioAttribute = null;
+                    if ( entry.getAttribute( attributeDescription ) == null )
+                    {
+                        studioAttribute = new org.apache.directory.studio.ldapbrowser.core.model.impl.Attribute( entry,
+                            attributeDescription );
+                        entry.addAttribute( studioAttribute );
+                    }
+                    else
+                    {
+                        studioAttribute = entry.getAttribute( attributeDescription );
+                    }
+    
+                    NamingEnumeration<?> valueEnumeration = attribute.getAll();
+                    while ( valueEnumeration.hasMore() )
+                    {
+                        Object value = valueEnumeration.next();
+                        studioAttribute.addValue( new Value( studioAttribute, value ) );
+                    }
                 }
             }
         }

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java Sat Jun  7 07:17:06 2008
@@ -23,6 +23,7 @@
 
 import java.io.Serializable;
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
@@ -73,7 +74,7 @@
      * 
      * @return the URL of this connection
      */
-    public abstract URL getUrl();
+    public abstract LdapURL getUrl();
 
 
     /**

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IEntry.java Sat Jun  7 07:17:06 2008
@@ -23,6 +23,7 @@
 
 import java.io.Serializable;
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
@@ -413,6 +414,6 @@
      * 
      * @return the  LDAP URL of this entry
      */
-    public abstract URL getUrl();
+    public abstract LdapURL getUrl();
 
 }

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/ISearch.java Sat Jun  7 07:17:06 2008
@@ -23,6 +23,7 @@
 
 import java.io.Serializable;
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
@@ -128,7 +129,7 @@
      * 
      * @return the LDAP URL of this search
      */
-    public abstract URL getUrl();
+    public abstract LdapURL getUrl();
 
 
     /**

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/AbstractEntry.java Sat Jun  7 07:17:06 2008
@@ -28,6 +28,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
@@ -49,8 +50,8 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.URL;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Subschema;
+import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 
@@ -194,7 +195,7 @@
         }
         else
         {
-            throw new IllegalArgumentException( BrowserCoreMessages.model__attribute_does_not_exist );
+            throw new IllegalArgumentException( BrowserCoreMessages.model__attribute_does_not_exist + ": " + attributeToDelete );
         }
     }
 
@@ -821,9 +822,9 @@
     /**
      * {@inheritDoc}
      */
-    public URL getUrl()
+    public LdapURL getUrl()
     {
-        return new URL( getBrowserConnection(), getDn() );
+        return Utils.getLdapURL( this );
     }
 
 }

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java Sat Jun  7 07:17:06 2008
@@ -27,6 +27,7 @@
 
 import javax.naming.InvalidNameException;
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 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;
@@ -38,7 +39,6 @@
 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.URL;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
@@ -121,9 +121,9 @@
     /**
      * {@inheritDoc}
      */
-    public URL getUrl()
+    public LdapURL getUrl()
     {
-        return new URL( this );
+        return Utils.getLdapURL( this );
     }
 
 
@@ -142,7 +142,6 @@
         entryToChildrenInfoMap.clear();
         entryToChildrenFilterMap.clear();
 
-        schema = Schema.DEFAULT_SCHEMA;
         rootDSE = new RootDSE( this );
         cacheEntry( rootDSE );
 

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DelegateEntry.java Sat Jun  7 07:17:06 2008
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.ldapbrowser.core.model.impl;
 
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
@@ -42,8 +43,8 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.URL;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Subschema;
+import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 
@@ -162,7 +163,7 @@
     /**
      * {@inheritDoc}
      */
-    public URL getUrl()
+    public LdapURL getUrl()
     {
         if ( getDelegate() != null )
         {
@@ -170,7 +171,7 @@
         }
         else
         {
-            return new URL( getBrowserConnection(), getDn() );
+            return Utils.getLdapURL( this );
         }
     }
 

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java Sat Jun  7 07:17:06 2008
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.ldapbrowser.core.model.impl;
 
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.ldapbrowser.core.BookmarkManager;
@@ -28,7 +29,6 @@
 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.URL;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 
 
@@ -237,7 +237,7 @@
     /** 
      * {@inheritDoc}
      */
-    public URL getUrl()
+    public LdapURL getUrl()
     {
         return null;
     }

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyEntry.java Sat Jun  7 07:17:06 2008
@@ -27,6 +27,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
@@ -41,8 +42,8 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.URL;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Subschema;
+import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 
 
 /**
@@ -223,9 +224,9 @@
     /**
      * {@inheritDoc}
      */
-    public URL getUrl()
+    public LdapURL getUrl()
     {
-        return new URL( getBrowserConnection(), getDn() );
+        return Utils.getLdapURL( this );
     }
 
 

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Search.java Sat Jun  7 07:17:06 2008
@@ -24,6 +24,7 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 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;
@@ -36,7 +37,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.URL;
+import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 
@@ -165,9 +166,9 @@
     /**
      * {@inheritDoc}
      */
-    public URL getUrl()
+    public LdapURL getUrl()
     {
-        return new URL( this );
+        return Utils.getLdapURL( this );
     }
 
 

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java Sat Jun  7 07:17:06 2008
@@ -247,36 +247,41 @@
             {
                 if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_OBJECTCLASSES ) )
                 {
-                    ObjectClassDescription ocd = new ObjectClassDescriptionSchemaParser()
-                        .parseObjectClassDescription( value );
+                    ObjectClassDescriptionSchemaParser parser = new ObjectClassDescriptionSchemaParser();
+                    parser.setQuirksMode( true );
+                    ObjectClassDescription ocd = parser.parseObjectClassDescription( value );
                     ocd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                     addObjectClassDescription( ocd );
                 }
                 else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_ATTRIBUTETYPES ) )
                 {
-                    AttributeTypeDescription atd = new AttributeTypeDescriptionSchemaParser()
-                        .parseAttributeTypeDescription( value );
+                    AttributeTypeDescriptionSchemaParser parser = new AttributeTypeDescriptionSchemaParser();
+                    parser.setQuirksMode( true );
+                    AttributeTypeDescription atd = parser.parseAttributeTypeDescription( value );
                     atd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                     addAttributeTypeDescription( atd );
                 }
                 else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_LDAPSYNTAXES ) )
                 {
-                    LdapSyntaxDescription lsd = new LdapSyntaxDescriptionSchemaParser()
-                        .parseLdapSyntaxDescription( value );
+                    LdapSyntaxDescriptionSchemaParser parser = new LdapSyntaxDescriptionSchemaParser();
+                    parser.setQuirksMode( true );
+                    LdapSyntaxDescription lsd = parser.parseLdapSyntaxDescription( value );
                     lsd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                     addLdapSyntaxDescription( lsd );
                 }
                 else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULES ) )
                 {
-                    MatchingRuleDescription mrd = new MatchingRuleDescriptionSchemaParser()
-                        .parseMatchingRuleDescription( value );
+                    MatchingRuleDescriptionSchemaParser parser = new MatchingRuleDescriptionSchemaParser();
+                    parser.setQuirksMode( true );
+                    MatchingRuleDescription mrd = parser.parseMatchingRuleDescription( value );
                     mrd.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                     addMatchingRuleDescription( mrd );
                 }
                 else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULEUSE ) )
                 {
-                    MatchingRuleUseDescription mrud = new MatchingRuleUseDescriptionSchemaParser()
-                        .parseMatchingRuleUseDescription( value );
+                    MatchingRuleUseDescriptionSchemaParser parser = new MatchingRuleUseDescriptionSchemaParser();
+                    parser.setQuirksMode( true );
+                    MatchingRuleUseDescription mrud = parser.parseMatchingRuleUseDescription( value );
                     mrud.addExtension( RAW_SCHEMA_DEFINITION_LDIF_VALUE, ldifValues );
                     addMatchingRuleUseDescription( mrud );
                 }

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java Sat Jun  7 07:17:06 2008
@@ -26,15 +26,21 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.studio.connection.core.ConnectionParameter.EncryptionMethod;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+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;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldifparser.LdifFormatParameters;
 import org.apache.directory.studio.ldifparser.LdifUtils;
@@ -44,7 +50,6 @@
 public class Utils
 {
 
-
     /**
      * Transforms the given DN into a normalized String, usable by the schema cache.
      * The following transformations are permformed:
@@ -286,4 +291,84 @@
         return ldifFormatParameters;
     }
 
+
+    /**
+     * Transforms an IBrowserConnection to an LdapURL. The following parameters are
+     * used to create the LDAP URL:
+     * <ul>
+     * <li>scheme
+     * <li>host
+     * <li>port
+     * </ul>
+     *
+     * @param entry the entry
+     * @return the LDAP URL
+     */
+    public static LdapURL getLdapURL( IBrowserConnection browserConnection )
+    {
+        LdapURL url = new LdapURL();
+        if ( browserConnection.getConnection().getEncryptionMethod() == EncryptionMethod.LDAPS )
+        {
+            url.setScheme( LdapURL.LDAPS_SCHEME );
+        }
+        else
+        {
+            url.setScheme( LdapURL.LDAP_SCHEME );
+        }
+        url.setHost( browserConnection.getConnection().getHost() );
+        url.setPort( browserConnection.getConnection().getPort() );
+        return url;
+    }
+
+
+    /**
+     * Transforms an IEntry to an LdapURL. The following parameters are
+     * used to create the LDAP URL:
+     * <ul>
+     * <li>scheme
+     * <li>host
+     * <li>port
+     * <li>dn
+     * </ul>
+     *
+     * @param entry the entry
+     * @return the LDAP URL
+     */
+    public static LdapURL getLdapURL( IEntry entry )
+    {
+        LdapURL url = getLdapURL( entry.getBrowserConnection() );
+        url.setDn( entry.getDn() );
+        return url;
+    }
+
+
+    /**
+     * Transforms an ISearch to an LdapURL. The following search parameters are
+     * used to create the LDAP URL:
+     * <ul>
+     * <li>scheme
+     * <li>host
+     * <li>port
+     * <li>search base
+     * <li>returning attributes
+     * <li>scope
+     * <li>filter
+     * </ul>
+     *
+     * @param search the search
+     * @return the LDAP URL
+     */
+    public static LdapURL getLdapURL( ISearch search )
+    {
+        LdapURL url = getLdapURL( search.getBrowserConnection() );
+        url.setDn( search.getSearchBase() );
+        if ( search.getReturningAttributes() != null )
+        {
+            url.setAttributes( Arrays.asList( search.getReturningAttributes() ) );
+        }
+        url.setScope( search.getScope().getOrdinal() );
+        url.setFilter( search.getFilter() );
+        return url;
+    }
+
 }

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-ui/plugin.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-ui/plugin.xml?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-ui/plugin.xml (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-ui/plugin.xml Sat Jun  7 07:17:06 2008
@@ -82,6 +82,13 @@
          icon="resources/icons/browser_modificationlogview.gif"
          id="org.apache.directory.studio.ldapbrowser.ui.views.modificationlogs.ModificationLogsView"
          name="Modification Logs"/>            
+   <view
+         allowMultiple="false"
+         category="org.apache.directory.studio.ldapbrowser.ui.category"
+         class="org.apache.directory.studio.ldapbrowser.ui.views.searchlogs.SearchLogsView"
+         icon="resources/icons/browser_modificationlogview.gif"
+         id="org.apache.directory.studio.ldapbrowser.ui.views.searchlogs.SearchLogsView"
+         name="Search Logs"/>            
    </extension>
    <extension
          point="org.eclipse.ui.newWizards">
@@ -237,6 +244,13 @@
             name="Modification Logs">
          <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldap"/>
       </page>
+      <page
+            category="org.apache.directory.studio.ldapbrowser.preferences.MainPreferencePage"
+            class="org.apache.directory.studio.ldapbrowser.ui.dialogs.preferences.SearchLogsPreferencePage"
+            id="org.apache.directory.studio.ldapbrowser.preferences.SearchLogsPreferencePage"
+            name="Search Logs">
+         <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldap"/>
+      </page>
    </extension>
 
 	<extension

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java Sat Jun  7 07:17:06 2008
@@ -51,6 +51,8 @@
     public static final String PREFERENCEPAGEID_SEARCHRESULTEDITOR = "org.apache.directory.studio.ldapbrowser.preferences.SearchResultEditorPreferencePage";
     
     public static final String PREFERENCEPAGEID_MODIFICATIONLOGS = "org.apache.directory.studio.ldapbrowser.preferences.ModificationLogsPreferencePage";
+    
+    public static final String PREFERENCEPAGEID_SEARCHLOGS = "org.apache.directory.studio.ldapbrowser.preferences.SearchLogsPreferencePage";
 
     
     public static final String IMG_EXPANDALL = "resources/icons/expandall.gif";

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyUrlAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyUrlAction.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyUrlAction.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyUrlAction.java Sat Jun  7 07:17:06 2008
@@ -21,12 +21,11 @@
 package org.apache.directory.studio.ldapbrowser.ui.actions;
 
 
+import org.apache.directory.shared.ldap.codec.util.LdapURL;
 import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
 import org.apache.directory.studio.ldapbrowser.common.actions.CopyAction;
-import org.apache.directory.studio.ldapbrowser.core.model.URL;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
-
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.dnd.TextTransfer;
 import org.eclipse.swt.dnd.Transfer;
@@ -54,7 +53,7 @@
      */
     public void run()
     {
-        URL url = null;
+        LdapURL url = null;
         if ( getSelectedSearches().length > 0 )
         {
             url = getSelectedSearches()[0].getUrl();

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/SchemaPropertyPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/SchemaPropertyPage.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/SchemaPropertyPage.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/SchemaPropertyPage.java Sat Jun  7 07:17:06 2008
@@ -33,8 +33,8 @@
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
@@ -45,24 +45,41 @@
 import org.eclipse.ui.dialogs.PropertyPage;
 
 
+/**
+ * Property page to shows some meta information of the schema an the 
+ * schema cache. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class SchemaPropertyPage extends PropertyPage implements IWorkbenchPropertyPage
 {
 
+    /** Text field containing the DN of the schema entry. */
     private Text dnText;
 
+    /** Text field containing the create timestamp of the schema entry. */
     private Text ctText;
 
+    /** Text field containing the modify timestamp of the schema entry. */
     private Text mtText;
 
+    /** Button to reload the scheam. */
     private Button reloadSchemaButton;
 
+    /** Text field containing the path to the schema cache file. */
     private Text cachePathText;
 
+    /** Text field containing last modify date of the schema cache file. */
     private Text cacheDateText;
 
+    /** Text field containing the size of the schema cache file. */
     private Text cacheSizeText;
 
 
+    /**
+     * Instantiates a new schema property page.
+     */
     public SchemaPropertyPage()
     {
         super();
@@ -70,9 +87,11 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     protected Control createContents( Composite parent )
     {
-
         Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
 
         Group infoGroup = BaseWidgetUtils.createGroup( BaseWidgetUtils.createColumnContainer( composite, 1, 1 ),
@@ -93,17 +112,12 @@
         GridData gd = new GridData();
         gd.verticalAlignment = SWT.BOTTOM;
         reloadSchemaButton.setLayoutData( gd );
-        reloadSchemaButton.addSelectionListener( new SelectionListener()
+        reloadSchemaButton.addSelectionListener( new SelectionAdapter()
         {
             public void widgetSelected( SelectionEvent e )
             {
                 reloadSchema();
             }
-
-
-            public void widgetDefaultSelected( SelectionEvent e )
-            {
-            }
         } );
 
         BaseWidgetUtils.createSpacer( composite, 1 );
@@ -123,25 +137,32 @@
         cacheSizeText = BaseWidgetUtils.createWrappedLabeledText( cacheComposite, "", 1 );
 
         IBrowserConnection connection = RootDSEPropertyPage.getConnection( getElement() );
-        this.connectionUpdated( connection );
+        update( connection );
 
         return composite;
     }
 
 
+    /**
+     * Reloads schema.
+     */
     private void reloadSchema()
     {
         final IBrowserConnection browserConnection = RootDSEPropertyPage.getConnection( getElement() );
         ReloadSchemasJob job = new ReloadSchemasJob( browserConnection );
         RunnableContextJobAdapter.execute( job );
-        this.connectionUpdated( browserConnection );
+        update( browserConnection );
     }
 
 
-    private void connectionUpdated( IBrowserConnection connection )
+    /**
+     * Updates the text fields.
+     * 
+     * @param connection the connection
+     */
+    private void update( IBrowserConnection connection )
     {
-
-        if ( !this.dnText.isDisposed() )
+        if ( !dnText.isDisposed() )
         {
             Schema schema = null;
             if ( connection != null )
@@ -209,9 +230,14 @@
     }
 
 
+    /**
+     * Checks if is disposed.
+     * 
+     * @return true, if is disposed
+     */
     public boolean isDisposed()
     {
-        return this.dnText.isDisposed();
+        return dnText.isDisposed();
     }
 
 }

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/perspective/BrowserPerspective.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/perspective/BrowserPerspective.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/perspective/BrowserPerspective.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/perspective/BrowserPerspective.java Sat Jun  7 07:17:06 2008
@@ -26,6 +26,7 @@
 import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
 import org.apache.directory.studio.ldapbrowser.ui.views.connection.ConnectionView;
 import org.apache.directory.studio.ldapbrowser.ui.views.modificationlogs.ModificationLogsView;
+import org.apache.directory.studio.ldapbrowser.ui.views.searchlogs.SearchLogsView;
 import org.apache.directory.studio.ldapbrowser.ui.wizards.BatchOperationWizard;
 import org.apache.directory.studio.ldapbrowser.ui.wizards.NewBookmarkWizard;
 import org.apache.directory.studio.ldapbrowser.ui.wizards.NewEntryWizard;
@@ -89,6 +90,7 @@
         layout.addShowViewShortcut( ConnectionView.getId() );
         layout.addShowViewShortcut( BrowserView.getId() );
         layout.addShowViewShortcut( ModificationLogsView.getId() );
+        layout.addShowViewShortcut( SearchLogsView.getId() );
         layout.addShowViewShortcut( IPageLayout.ID_OUTLINE );
         layout.addShowViewShortcut( "org.eclipse.ui.views.ProgressView" );
     }
@@ -128,6 +130,7 @@
         // Log folder
         IFolderLayout logFolder = layout.createFolder( "logFolder", IPageLayout.BOTTOM, ( float ) 0.75, editorArea );
         logFolder.addView( ModificationLogsView.getId() );
+        logFolder.addView( SearchLogsView.getId() );
         logFolder.addPlaceholder( "*" );
 
         // non-closable?

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/ConnectionViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/ConnectionViewUniversalListener.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/ConnectionViewUniversalListener.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/ConnectionViewUniversalListener.java Sat Jun  7 07:17:06 2008
@@ -27,6 +27,7 @@
 import org.apache.directory.studio.connection.ui.widgets.ConnectionUniversalListener;
 import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
 import org.apache.directory.studio.ldapbrowser.ui.views.modificationlogs.ModificationLogsView;
+import org.apache.directory.studio.ldapbrowser.ui.views.searchlogs.SearchLogsView;
 import org.eclipse.jface.viewers.DoubleClickEvent;
 import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -123,11 +124,23 @@
             catch ( NullPointerException e )
             {
             }
-            
+
             try
             {
                 PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView( ModificationLogsView.getId(),
-                    null, IWorkbenchPage.VIEW_VISIBLE );
+                    null, IWorkbenchPage.VIEW_CREATE );
+            }
+            catch ( PartInitException e )
+            {
+            }
+            catch ( NullPointerException e )
+            {
+            }
+
+            try
+            {
+                PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView( SearchLogsView.getId(),
+                    null, IWorkbenchPage.VIEW_CREATE );
             }
             catch ( PartInitException e )
             {

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/EnableModificationLogsAction.java Sat Jun  7 07:17:06 2008
@@ -55,6 +55,7 @@
     {
         ConnectionCorePlugin.getDefault().getPluginPreferences().setValue(
             ConnectionCoreConstants.PREFERENCE_MODIFICATIONLOGS_ENABLE, super.isChecked() );
+        ConnectionCorePlugin.getDefault().savePluginPreferences();
     }
 
 }

Modified: directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java
URL: http://svn.apache.org/viewvc/directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java?rev=664342&r1=664341&r2=664342&view=diff
==============================================================================
--- directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java (original)
+++ directory/sandbox/seelmann/testingframework/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OpenModificationLogsPreferencePageAction.java Sat Jun  7 07:17:06 2008
@@ -38,7 +38,7 @@
 {
 
     /**
-     * Creates a new instance of OpenEntryEditorPreferencePageAction.
+     * Creates a new instance of OpenModificationLogsPreferencePageAction.
      */
     public OpenModificationLogsPreferencePageAction()
     {



Mime
View raw message