directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r597838 [1/2] - in /directory/studio/trunk: studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/ studio-connection-core/ studio-connection-core/META-INF/ studio-connection-core/src/main/java/org/apache/...
Date Sat, 24 Nov 2007 11:20:49 GMT
Author: seelmann
Date: Sat Nov 24 03:20:34 2007
New Revision: 597838

URL: http://svn.apache.org/viewvc?rev=597838&view=rev
Log:
- Added IJndiLogger interface and extendsion point
- Moved ModificationLogger to connection core plugin

Added:
    directory/studio/trunk/studio-connection-core/plugin.xml   (with props)
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/DnUtils.java   (contents, props changed)
      - copied, changed from r596470, directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/DnUtils.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java   (contents, props changed)
      - copied, changed from r596116, directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IModificationLogger.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java
      - copied, changed from r596470, directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ModificationLogger.java
    directory/studio/trunk/studio-connection-core/src/main/resources/jndiLogger.exsd   (with props)
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/ldapbrowser/
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/
Removed:
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IModificationLogger.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ModificationLogger.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/DnUtils.java
Modified:
    directory/studio/trunk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java
    directory/studio/trunk/studio-connection-core/META-INF/MANIFEST.MF
    directory/studio/trunk/studio-connection-core/build.properties
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Utils.java
    directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java
    directory/studio/trunk/studio-connection-ui/META-INF/MANIFEST.MF
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java
    directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/EntryWidget.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Entry.java
    directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/Utils.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/ModificationLogsViewUniversalListener.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/modificationlogs/OlderAction.java
    directory/studio/trunk/studio-ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java

Modified: directory/studio/trunk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java (original)
+++ directory/studio/trunk/studio-aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/SubtreeSpecificationDialog.java Sat Nov 24 03:20:34 2007
@@ -30,6 +30,7 @@
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecification;
 import org.apache.directory.shared.ldap.subtree.SubtreeSpecificationParser;
 import org.apache.directory.studio.aciitemeditor.Activator;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.TextDialog;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
@@ -37,7 +38,6 @@
 import org.apache.directory.studio.ldapbrowser.common.widgets.search.EntryWidget;
 import org.apache.directory.studio.ldapbrowser.common.widgets.search.FilterWidget;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.viewers.ArrayContentProvider;

Modified: directory/studio/trunk/studio-connection-core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/META-INF/MANIFEST.MF?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/META-INF/MANIFEST.MF (original)
+++ directory/studio/trunk/studio-connection-core/META-INF/MANIFEST.MF Sat Nov 24 03:20:34 2007
@@ -1,13 +1,14 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Apache Directory Studio Connection Core
-Bundle-SymbolicName: org.apache.directory.studio.connection.core
+Bundle-SymbolicName: org.apache.directory.studio.connection.core;singleton:=true
 Bundle-Version: 1.0.1
 Bundle-Activator: org.apache.directory.studio.connection.core.ConnectionCorePlugin
 Bundle-Vendor: Apache Software Foundation
 Bundle-Localization: plugin
 Require-Bundle: org.eclipse.core.runtime,
- org.apache.directory.studio.jars
+ org.apache.directory.studio.jars,
+ org.apache.directory.studio.ldifparser
 Eclipse-LazyStart: true
 Bundle-ClassPath: lib/commons-io-1.3.1.jar,
  .

Modified: directory/studio/trunk/studio-connection-core/build.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/build.properties?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/build.properties (original)
+++ directory/studio/trunk/studio-connection-core/build.properties Sat Nov 24 03:20:34 2007
@@ -2,4 +2,5 @@
 output.. = target/classes/
 bin.includes = META-INF/,\
                .,\
-               lib/commons-io-1.3.1.jar
+               lib/commons-io-1.3.1.jar,\
+               plugin.xml

Added: directory/studio/trunk/studio-connection-core/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/plugin.xml?rev=597838&view=auto
==============================================================================
--- directory/studio/trunk/studio-connection-core/plugin.xml (added)
+++ directory/studio/trunk/studio-connection-core/plugin.xml Sat Nov 24 03:20:34 2007
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension-point id="org.apache.directory.studio.jndilogger" name="JNDI Logger" schema="src/main/resources/jndiLogger.exsd"/>
+   <extension
+         point="org.apache.directory.studio.jndilogger">
+      <jndiLogger
+            class="org.apache.directory.studio.connection.core.io.jndi.LdifModificationLogger"
+            description="Logs modifications in LDIF format to a file."
+            id="org.apache.directory.studio.connection.core.io.jndi.LdifModificationLogger"
+            name="LDIF Modification Logger">
+      </jndiLogger>
+   </extension>
+
+</plugin>

Propchange: directory/studio/trunk/studio-connection-core/plugin.xml
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCoreConstants.java Sat Nov 24 03:20:34 2007
@@ -31,4 +31,8 @@
 
     /** The line separator. */
     public static final String LINE_SEPARATOR = System.getProperty( "line.separator" ); //$NON-NLS-1$
+
+    /** The date format of the modification logger */
+    public static final String DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS"; //$NON-NLS-1$
+
 }

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionCorePlugin.java Sat Nov 24 03:20:34 2007
@@ -20,9 +20,19 @@
 package org.apache.directory.studio.connection.core;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.directory.studio.connection.core.event.CoreEventRunner;
 import org.apache.directory.studio.connection.core.event.EventRunner;
+import org.apache.directory.studio.connection.core.io.jndi.LdifModificationLogger;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
 import org.osgi.framework.BundleContext;
 
 
@@ -53,6 +63,9 @@
     /** The referral handler */
     private IReferralHandler referralHandler;
 
+    /** The JNDI loggers. */
+    private List<IJndiLogger> jndiLoggers;
+
     /**
      * The constructor
      */
@@ -206,6 +219,63 @@
     public void setReferralHandler( IReferralHandler referralHandler )
     {
         this.referralHandler = referralHandler;
+    }
+
+
+    /**
+     * Gets the LDIF modification logger.
+     * 
+     * @return the LDIF modification logger, null if none found.
+     */
+    public LdifModificationLogger getLdifModificationLogger()
+    {
+        List<IJndiLogger> jndiLoggers = getJndiLoggers();
+        for ( IJndiLogger jndiLogger : jndiLoggers )
+        {
+            if(jndiLogger instanceof LdifModificationLogger)
+            {
+                return ( LdifModificationLogger ) jndiLogger;
+            }
+        }
+        return null;
+    }
+    
+    
+    /**
+     * Gets the jndi loggers.
+     * 
+     * @return the JNDI loggers
+     */
+    public List<IJndiLogger> getJndiLoggers()
+    {
+        if(jndiLoggers == null)
+        {
+            jndiLoggers = new ArrayList<IJndiLogger>();
+            
+            IExtensionRegistry registry = Platform.getExtensionRegistry();
+            IExtensionPoint extensionPoint = registry
+                .getExtensionPoint( "org.apache.directory.studio.jndilogger" );
+            IConfigurationElement[] members = extensionPoint.getConfigurationElements();
+            for ( IConfigurationElement member : members )
+            {
+                try
+                {
+                    IJndiLogger logger = ( IJndiLogger ) member.createExecutableExtension( "class" );
+                    logger.setId( member.getAttribute( "id" ) );
+                    logger.setName( member.getAttribute( "name" ) );
+                    logger.setDescription( member.getAttribute( "description" ) );
+                    jndiLoggers.add( logger );
+                }
+                catch ( Exception e )
+                {
+                   getLog().log(
+                        new Status( IStatus.ERROR, ConnectionCorePlugin.PLUGIN_ID, 1,
+                            "Unable to create JNDI logger " + member.getAttribute( "class" ), e ) );
+                }
+            }
+        }
+        
+        return jndiLoggers;
     }
 
 }

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/ConnectionManager.java Sat Nov 24 03:20:34 2007
@@ -34,6 +34,7 @@
 import org.apache.directory.studio.connection.core.event.ConnectionUpdateListener;
 import org.apache.directory.studio.connection.core.io.ConnectionIO;
 import org.apache.directory.studio.connection.core.io.ConnectionIOException;
+import org.eclipse.core.runtime.IPath;
 
 
 /**
@@ -57,6 +58,27 @@
         this.connectionList = new HashSet<Connection>();
         loadConnections();
         ConnectionEventRegistry.addConnectionUpdateListener( this, ConnectionCorePlugin.getDefault().getEventRunner() );
+    }
+
+
+    /**
+     * Gets the Modification Log filename for the corresponding connection.
+     *
+     * @param connection
+     *      the connection
+     * @return
+     *      the Modification Log filename
+     */
+    public static final String getModificationLogFileName( Connection connection )
+    {
+        IPath p = ConnectionCorePlugin.getDefault().getStateLocation().append( "logs" ); //$NON-NLS-1$
+        File file = p.toFile();
+        if ( !file.exists() )
+        {
+            file.mkdir();
+        }
+        return p
+            .append( "modifications-" + Utils.getFilenameString( connection.getId() ) + "-%u-%g.ldiflog" ).toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
 

Copied: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/DnUtils.java (from r596470, directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/DnUtils.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/DnUtils.java?p2=directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/DnUtils.java&p1=directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/DnUtils.java&r1=596470&r2=597838&rev=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/utils/DnUtils.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/DnUtils.java Sat Nov 24 03:20:34 2007
@@ -1,14 +1,10 @@
-package org.apache.directory.studio.ldapbrowser.core.utils;
+package org.apache.directory.studio.connection.core;
 
 
-import java.util.Iterator;
-
 import javax.naming.InvalidNameException;
 
-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.ldapbrowser.core.model.schema.Schema;
 
 
 /**
@@ -21,68 +17,6 @@
 {
 
     /**
-     * Transforms the given DN into a normalized String, usable by the schema cache.
-     * The following transformations are permformed:
-     * <ul>
-     *   <li>The attribute type is replaced by the OID
-     *   <li>The attribute value is trimmed and lowercased
-     * </ul> 
-     * Example: the surname=Bar will be transformed to
-     * 2.5.4.4=bar
-     * 
-     * 
-     * @param dn the DN
-     * @param schema the schema
-     * 
-     * @return the oid string
-     */
-    public static String getNormalizedOidString( LdapDN dn, Schema schema )
-    {
-        StringBuffer sb = new StringBuffer();
-
-        Iterator<Rdn> it = dn.getRdns().iterator();
-        while ( it.hasNext() )
-        {
-            Rdn rdn = it.next();
-            sb.append( getOidString( rdn, schema ) );
-            if ( it.hasNext() )
-            {
-                sb.append( ',' );
-            }
-        }
-
-        return sb.toString();
-    }
-
-
-    private static String getOidString( Rdn rdn, Schema schema )
-    {
-        StringBuffer sb = new StringBuffer();
-
-        Iterator<AttributeTypeAndValue> it = rdn.iterator();
-        while ( it.hasNext() )
-        {
-            AttributeTypeAndValue atav = it.next();
-            sb.append( getOidString( atav, schema ) );
-            if ( it.hasNext() )
-            {
-                sb.append( '+' );
-            }
-        }
-
-        return sb.toString();
-    }
-
-
-    private static String getOidString( AttributeTypeAndValue atav, Schema schema )
-    {
-        String oid = schema != null ? schema.getAttributeTypeDescription( atav.getNormType() ).getNumericOID() : atav
-            .getNormType();
-        return oid.trim().toLowerCase() + "=" + ( ( String ) atav.getUpValue() ).trim().toLowerCase(); //$NON-NLS-1$
-    }
-
-
-    /**
      * Composes an DN based on the given RDN and DN.
      * 
      * @param rdn the RDN
@@ -147,15 +81,16 @@
     public static LdapDN composeDn( LdapDN prefix, LdapDN suffix )
     {
         LdapDN ldapDn = ( LdapDN ) suffix.clone();
-        
+
         for ( Rdn rdn : prefix.getRdns() )
         {
             ldapDn.add( ( Rdn ) rdn.clone() );
         }
-        
+
         return ldapDn;
     }
-    
+
+
     /**
      * Gets the prefix, cuts the suffix from the given DN.
      * 
@@ -193,11 +128,11 @@
         StringBuffer sb = new StringBuffer();
         for ( int i = 0; i < rdnTypes.length; i++ )
         {
-            if( i > 0 )
+            if ( i > 0 )
             {
                 sb.append( '+' );
             }
-            
+
             sb.append( rdnTypes[i] );
             sb.append( '=' );
             sb.append( Rdn.escapeValue( rdnValues[i] ) );

Propchange: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/DnUtils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java (from r596116, directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IModificationLogger.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java?p2=directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java&p1=directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IModificationLogger.java&r1=596116&r2=597838&rev=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IModificationLogger.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java Sat Nov 24 03:20:34 2007
@@ -13,50 +13,103 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public interface IModificationLogger
+public interface IJndiLogger
 {
 
     /**
      * Logs a changetype:add.
      * 
-     * @param dn the dn
+     * @param connection the connection
+     * @param dn the DN
      * @param attributes the attributes
      * @param controls the controls
      * @param ex the naming exception if an error occurred, null otherwise
      */
-    public void logChangetypeAdd( final String dn, final Attributes attributes, final Control[] controls, NamingException ex );
+    public void logChangetypeAdd( Connection connection, final String dn, final Attributes attributes, final Control[] controls, NamingException ex );
 
 
     /**
      * Logs a changetype:delete.
      * 
-     * @param dn the dn
+     * @param connection the connection
+     * @param dn the DN
      * @param controls the controls
      * @param ex the naming exception if an error occurred, null otherwise
+     * 
      */
-    public void logChangetypeDelete( final String dn, final Control[] controls, NamingException ex );
+    public void logChangetypeDelete( Connection connection, final String dn, final Control[] controls, NamingException ex );
 
 
     /**
      * Logs a changetype:modify.
      * 
-     * @param dn the dn
+     * @param connection the connection
+     * @param dn the DN
      * @param modificationItems the modification items
-     * @param controls the controls
      * @param ex the naming exception if an error occurred, null otherwise
+     * @param controls the controls
      */
-    public void logChangetypeModify( final String dn, final ModificationItem[] modificationItems, final Control[] controls, NamingException ex );
+    public void logChangetypeModify( Connection connection, final String dn, final ModificationItem[] modificationItems, final Control[] controls, NamingException ex );
 
 
     /**
      * Logs a changetype:moddn.
      * 
-     * @param oldDn the old dn
-     * @param newDn the new dn
-     * @param deleteOldRdn the delete old rdn
+     * @param connection the connection
+     * @param oldDn the old DN
+     * @param newDn the new DN
+     * @param deleteOldRdn the delete old RDN
      * @param controls the controls
      * @param ex the naming exception if an error occurred, null otherwise
      */
-    public void logChangetypeModDn( final String oldDn, final String newDn, final boolean deleteOldRdn, final Control[] controls, NamingException ex );
+    public void logChangetypeModDn( Connection connection, final String oldDn, final String newDn, final boolean deleteOldRdn, final Control[] controls, NamingException ex );
+
+
+    /**
+     * Sets the logger ID.
+     * 
+     * @param id the new logger ID
+     */
+    public void setId( String id );
+
+
+    /**
+     * Gets the logger ID.
+     * 
+     * @return the logger ID
+     */
+    public String getId();
+    
+    
+    /**
+     * Sets the logger name.
+     * 
+     * @param name the new logger name
+     */
+    public void setName( String name );
+
+
+    /**
+     * Gets the logger name.
+     * 
+     * @return the logger name
+     */
+    public String getName();
+    
+    
+    /**
+     * Sets the logger description.
+     * 
+     * @param description the new logger description
+     */
+    public void setDescription( String description );
+    
+    
+    /**
+     * Gets the logger description.
+     * 
+     * @return the logger description
+     */
+    public String getDescription();
 
 }

Propchange: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/IJndiLogger.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Utils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Utils.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Utils.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/Utils.java Sat Nov 24 03:20:34 2007
@@ -20,6 +20,8 @@
 
 package org.apache.directory.studio.connection.core;
 
+import org.apache.directory.shared.ldap.util.StringTools;
+
 
 /**
  * Some utils.
@@ -70,6 +72,49 @@
             else
             {
                 sb.append( c );
+            }
+        }
+
+        return sb.toString();
+    }
+
+    
+
+    /**
+     * Converts a String into a String that could be used as a filename.
+     *
+     * @param s
+     *      the String to convert
+     * @return
+     *      the converted String
+     */
+    public static String getFilenameString( String s )
+    {
+        if ( s == null )
+        {
+            return null;
+        }
+
+        
+        byte[] b = StringTools.getBytesUtf8( s );
+        StringBuffer sb = new StringBuffer();
+        for ( int i = 0; i < b.length; i++ )
+        {
+
+            if ( b[i] == '-' || b[i] == '_' || ( '0' <= b[i] && b[i] <= '9' ) || ( 'A' <= b[i] && b[i] <= 'Z' )
+                || ( 'a' <= b[i] && b[i] <= 'z' ) )
+            {
+                sb.append( ( char ) b[i] );
+            }
+            else
+            {
+                int x = ( int ) b[i];
+                if ( x < 0 )
+                    x = 256 + x;
+                String t = Integer.toHexString( x );
+                if ( t.length() == 1 )
+                    t = "0" + t; //$NON-NLS-1$
+                sb.append( t );
             }
         }
 

Modified: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/JNDIConnectionWrapper.java Sat Nov 24 03:20:34 2007
@@ -21,6 +21,7 @@
 
 
 import java.util.Hashtable;
+import java.util.List;
 
 import javax.naming.CommunicationException;
 import javax.naming.Context;
@@ -50,7 +51,7 @@
 import org.apache.directory.studio.connection.core.ConnectionParameter;
 import org.apache.directory.studio.connection.core.IAuthHandler;
 import org.apache.directory.studio.connection.core.ICredentials;
-import org.apache.directory.studio.connection.core.IModificationLogger;
+import org.apache.directory.studio.connection.core.IJndiLogger;
 import org.apache.directory.studio.connection.core.IReferralHandler;
 import org.apache.directory.studio.connection.core.Messages;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
@@ -94,8 +95,6 @@
 
     private Thread jobThread;
 
-    private IModificationLogger modificationLogger;
-
     /** JNDI constant for "throw" referrals handling */
     public static final String REFERRAL_THROW = "throw";
     
@@ -469,9 +468,9 @@
                     namingException = ne;
                 }
 
-                if ( modificationLogger != null )
+                for ( IJndiLogger logger : getJndiLoggers() )
                 {
-                    modificationLogger.logChangetypeModify( dn, modificationItems, controls, namingException );
+                    logger.logChangetypeModify( connection, dn, modificationItems, controls, namingException );
                 }
             }
 
@@ -550,9 +549,9 @@
                     namingException = ne;
                 }
 
-                if ( modificationLogger != null )
+                for ( IJndiLogger logger : getJndiLoggers() )
                 {
-                    modificationLogger.logChangetypeModDn( oldDn, newDn, deleteOldRdn, controls, namingException );
+                    logger.logChangetypeModDn( connection, oldDn, newDn, deleteOldRdn, controls, namingException );
                 }
             }
 
@@ -622,9 +621,9 @@
                     namingException = ne;
                 }
 
-                if ( modificationLogger != null )
+                for ( IJndiLogger logger : getJndiLoggers() )
                 {
-                    modificationLogger.logChangetypeAdd( dn, attributes, controls, namingException );
+                    logger.logChangetypeAdd( connection, dn, attributes, controls, namingException );
                 }
             }
 
@@ -691,9 +690,9 @@
                     namingException = ne;
                 }
 
-                if ( modificationLogger != null )
+                for ( IJndiLogger logger : getJndiLoggers() )
                 {
-                    modificationLogger.logChangetypeDelete( dn, controls, namingException );
+                    logger.logChangetypeDelete( connection, dn, controls, namingException );
                 }
             }
 
@@ -1082,15 +1081,8 @@
         void reset();
     }
 
-
-    /**
-     * Sets the modification logger.
-     * 
-     * @param modificationLogger the new modification logger
-     */
-    public void setModificationLogger( IModificationLogger modificationLogger )
+    private List<IJndiLogger> getJndiLoggers()
     {
-        this.modificationLogger = modificationLogger;
+        return ConnectionCorePlugin.getDefault().getJndiLoggers();
     }
-
 }

Copied: directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java (from r596470, directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ModificationLogger.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java?p2=directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java&p1=directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ModificationLogger.java&r1=596470&r2=597838&rev=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/ModificationLogger.java (original)
+++ directory/studio/trunk/studio-connection-core/src/main/java/org/apache/directory/studio/connection/core/io/jndi/LdifModificationLogger.java Sat Nov 24 03:20:34 2007
@@ -18,7 +18,7 @@
  *  
  */
 
-package org.apache.directory.studio.ldapbrowser.core.model.impl;
+package org.apache.directory.studio.connection.core.io.jndi;
 
 
 import java.io.File;
@@ -27,6 +27,8 @@
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.logging.FileHandler;
 import java.util.logging.Formatter;
 import java.util.logging.Handler;
@@ -45,10 +47,11 @@
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
-import org.apache.directory.studio.connection.core.IModificationLogger;
-import org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager;
-import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionCoreConstants;
+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.ldifparser.LdifFormatParameters;
 import org.apache.directory.studio.ldifparser.model.container.LdifChangeAddRecord;
 import org.apache.directory.studio.ldifparser.model.container.LdifChangeDeleteRecord;
@@ -65,51 +68,54 @@
 
 
 /**
- * The ModificationLogger is used to log modifications into a file.
+ * The ModificationLogger is used to log modifications in LDIF format into a file.
  *
- * TODO: LDIF of DSML logging
- * TODO: switch off logging
  * TODO: log controls
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class ModificationLogger implements IModificationLogger
+public class LdifModificationLogger implements IJndiLogger
 {
 
-    /** The browser connection. */
-    private BrowserConnection browserConnection;
+    /** The ID. */
+    private String id;
 
-    /** The file handler. */
-    private FileHandler fileHandler;
+    /** The name. */
+    private String name;
+
+    /** The description. */
+    private String description;
+
+    /** The file handlers. */
+    private Map<String, FileHandler> fileHandlers = new HashMap<String, FileHandler>();
+
+    /** The loggers. */
+    private Map<String, Logger> loggers = new HashMap<String, Logger>();
 
-    /** The logger. */
-    private Logger logger;
-    
 
     /**
      * Creates a new instance of ModificationLogger.
-     * 
-     * @param browserConnection the browser connection
      */
-    public ModificationLogger( BrowserConnection browserConnection )
+    public LdifModificationLogger()
     {
-        this.browserConnection = browserConnection;
     }
 
 
     /**
      * Inits the modification logger.
      */
-    private void initModificationLogger()
+    private void initModificationLogger( Connection connection )
     {
-        this.logger = Logger.getAnonymousLogger();
-        this.logger.setLevel( Level.ALL );
+        Logger logger = Logger.getAnonymousLogger();
+        loggers.put( connection.getId(), logger );
+        logger.setLevel( Level.ALL );
 
-        String logfileName = BrowserConnectionManager.getModificationLogFileName( browserConnection );
+        String logfileName = ConnectionManager.getModificationLogFileName( connection );
         try
         {
-            fileHandler = new FileHandler( logfileName, 100000, 10, true );
+            FileHandler fileHandler = new FileHandler( logfileName, 100000, 10, true );
+            fileHandlers.put( connection.getId(), fileHandler );
             fileHandler.setFormatter( new Formatter()
             {
                 public String format( LogRecord record )
@@ -117,7 +123,7 @@
                     return record.getMessage();
                 }
             } );
-            this.logger.addHandler( fileHandler );
+            logger.addHandler( fileHandler );
         }
         catch ( SecurityException e )
         {
@@ -131,42 +137,48 @@
 
 
     /**
-     * Disposes the modification logger.
+     * Disposes the modification logger of the given connection.
+     * 
+     * @param connection the connection
      */
-    public void dispose()
+    public void dispose( Connection connection )
     {
-        if ( this.logger != null )
+        String id = connection.getId();
+        if ( loggers.containsKey( id ) )
         {
-            Handler[] handlers = this.logger.getHandlers();
-            for ( int i = 0; i < handlers.length; i++ )
+            Handler[] handlers = loggers.get( id ).getHandlers();
+            for ( Handler handler : handlers )
             {
-                handlers[i].close();
+                handler.close();
             }
 
-            this.logger = null;
+            loggers.remove( id );
         }
     }
 
 
     /**
-     * Logs the given text.
+     * Logs the given text to the modification logger of the given connection.
      * 
      * @param text the text to log
      * @param ex the naming exception if an error occurred, null otherwise
+     * @param connection the connection
      */
-    private void log( String text, NamingException ex )
+    private void log( String text, NamingException ex, Connection connection )
     {
-        if ( logger == null )
+        String id = connection.getId();
+        if ( !loggers.containsKey( id ) )
         {
-            if ( browserConnection.getConnection().getName() != null )
+            if ( connection.getName() != null )
             {
-                initModificationLogger();
+                initModificationLogger( connection );
             }
         }
 
-        if ( logger != null )
+        if ( loggers.containsKey( id ) )
         {
-            DateFormat df = new SimpleDateFormat( BrowserCoreConstants.DATEFORMAT );
+            Logger logger = loggers.get( id );
+            DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT );
 
             if ( ex != null )
             {
@@ -183,8 +195,7 @@
                 .log(
                     Level.ALL,
                     LdifCommentLine
-                        .create(
-                            "#!CONNECTION ldap://" + browserConnection.getConnection().getHost() + ":" + browserConnection.getConnection().getPort() ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$ //$NON-NLS-2$
+                        .create( "#!CONNECTION ldap://" + connection.getHost() + ":" + connection.getPort() ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$ //$NON-NLS-2$
             logger.log( Level.ALL, LdifCommentLine
                 .create( "#!DATE " + df.format( new Date() ) ).toFormattedString( LdifFormatParameters.DEFAULT ) ); //$NON-NLS-1$
 
@@ -205,8 +216,8 @@
     /**
      * @see org.apache.directory.studio.connection.core.IModificationLogger#logChangetypeAdd(java.lang.String, javax.naming.directory.Attributes, javax.naming.ldap.Control[], javax.naming.NamingException)
      */
-    public void logChangetypeAdd( final String dn, final Attributes attributes, final Control[] controls,
-        NamingException ex )
+    public void logChangetypeAdd( Connection connection, final String dn, final Attributes attributes,
+        final Control[] controls, NamingException ex )
     {
         try
         {
@@ -234,7 +245,7 @@
             record.finish( LdifSepLine.create() );
 
             String formattedString = record.toFormattedString( LdifFormatParameters.DEFAULT );
-            log( formattedString, ex );
+            log( formattedString, ex, connection );
         }
         catch ( NamingException e )
         {
@@ -245,22 +256,23 @@
     /**
      * @see org.apache.directory.studio.connection.core.IModificationLogger#logChangetypeDelete(java.lang.String, javax.naming.ldap.Control[], javax.naming.NamingException)
      */
-    public void logChangetypeDelete( final String dn, final Control[] controls, NamingException ex )
+    public void logChangetypeDelete( Connection connection, final String dn, final Control[] controls,
+        NamingException ex )
     {
         LdifChangeDeleteRecord record = LdifChangeDeleteRecord.create( dn );
         //record.addControl( controlLine );
         record.finish( LdifSepLine.create() );
 
         String formattedString = record.toFormattedString( LdifFormatParameters.DEFAULT );
-        log( formattedString, ex );
+        log( formattedString, ex, connection );
     }
 
 
     /**
      * @see org.apache.directory.studio.connection.core.IModificationLogger#logChangetypeModify(java.lang.String, javax.naming.directory.ModificationItem[], javax.naming.ldap.Control[], javax.naming.NamingException)
      */
-    public void logChangetypeModify( final String dn, final ModificationItem[] modificationItems,
-        final Control[] controls, NamingException ex )
+    public void logChangetypeModify( Connection connection, final String dn,
+        final ModificationItem[] modificationItems, final Control[] controls, NamingException ex )
     {
         try
         {
@@ -305,7 +317,7 @@
             record.finish( LdifSepLine.create() );
 
             String formattedString = record.toFormattedString( LdifFormatParameters.DEFAULT );
-            log( formattedString, ex );
+            log( formattedString, ex, connection );
         }
         catch ( NamingException e )
         {
@@ -316,8 +328,8 @@
     /**
      * @see org.apache.directory.studio.connection.core.IModificationLogger#logChangetypeModDn(java.lang.String, java.lang.String, boolean, javax.naming.ldap.Control[], javax.naming.NamingException)
      */
-    public void logChangetypeModDn( final String oldDn, final String newDn, final boolean deleteOldRdn,
-        final Control[] controls, NamingException ex )
+    public void logChangetypeModDn( Connection connection, final String oldDn, final String newDn,
+        final boolean deleteOldRdn, final Control[] controls, NamingException ex )
     {
         try
         {
@@ -333,7 +345,7 @@
             record.finish( LdifSepLine.create() );
 
             String formattedString = record.toFormattedString( LdifFormatParameters.DEFAULT );
-            log( formattedString, ex );
+            log( formattedString, ex, connection );
         }
         catch ( InvalidNameException e )
         {
@@ -344,21 +356,24 @@
     /**
      * Gets the files.
      * 
+     * @param connection the connection
+     * 
      * @return the files
      */
-    public File[] getFiles()
+    public File[] getFiles( Connection connection )
     {
-        if ( this.logger == null )
+        String id = connection.getId();
+        if ( !loggers.containsKey( id ) )
         {
-            if ( browserConnection.getConnection().getName() != null )
+            if ( connection.getName() != null )
             {
-                this.initModificationLogger();
+                initModificationLogger( connection );
             }
         }
 
         try
         {
-            return getLogFiles( this.fileHandler );
+            return getLogFiles( fileHandlers.get( id ) );
         }
         catch ( Exception e )
         {
@@ -406,6 +421,42 @@
                 return fields[i];
         }
         return null;
+    }
+
+
+    public String getId()
+    {
+        return id;
+    }
+
+
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+
+    public String getName()
+    {
+        return name;
+    }
+
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+
+    public String getDescription()
+    {
+        return description;
+    }
+
+
+    public void setDescription( String description )
+    {
+        this.description = description;
     }
 
 }

Added: directory/studio/trunk/studio-connection-core/src/main/resources/jndiLogger.exsd
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-core/src/main/resources/jndiLogger.exsd?rev=597838&view=auto
==============================================================================
--- directory/studio/trunk/studio-connection-core/src/main/resources/jndiLogger.exsd (added)
+++ directory/studio/trunk/studio-connection-core/src/main/resources/jndiLogger.exsd Sat Nov 24 03:20:34 2007
@@ -0,0 +1,160 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.apache.directory.studio.connection.core">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.apache.directory.studio.connection.core" id="jndiLogger" name="JNDI Logger"/>
+      </appInfo>
+      <documentation>
+         An JNDI Logger is used to log an LDAP request send by the JNDIConnectionWrapper.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence minOccurs="1" maxOccurs="unbounded">
+            <element ref="jndiLogger"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The extension-point of this extension.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  Extension identifier.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  Name of this extension.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="jndiLogger">
+      <annotation>
+         <appInfo>
+            <meta.element labelAttribute="name" icon="icon"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The name of the function.
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="description" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The specific class implementing the function.
+               </documentation>
+               <appInfo>
+                  <meta.attribute kind="java" basedOn=":org.apache.directory.studio.connection.core.IJndiLogger"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         1.1.0
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         &lt;p&gt;
+&lt;pre&gt;
+   &lt;extension
+       point=&quot;org.apache.directory.studio.jndilogger&quot;&gt;
+
+    &lt;valueEditor
+          name=&quot;Browser Options&quot;
+          class=&quot;org.apache.directory.studio.ldapbrowser.common.wizard.connection.ConnectionParameterPage&quot;
+          /&gt;
+   &lt;/extension&gt;         
+&lt;/pre&gt;
+&lt;p&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  &quot;License&quot;); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+      </documentation>
+   </annotation>
+
+</schema>

Propchange: directory/studio/trunk/studio-connection-core/src/main/resources/jndiLogger.exsd
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: directory/studio/trunk/studio-connection-ui/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/META-INF/MANIFEST.MF?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/META-INF/MANIFEST.MF (original)
+++ directory/studio/trunk/studio-connection-ui/META-INF/MANIFEST.MF Sat Nov 24 03:20:34 2007
@@ -14,6 +14,7 @@
 Eclipse-LazyStart: true
 Export-Package: org.apache.directory.studio.connection.ui,
  org.apache.directory.studio.connection.ui.actions,
+ org.apache.directory.studio.connection.ui.dialogs,
  org.apache.directory.studio.connection.ui.dnd,
  org.apache.directory.studio.connection.ui.properties,
  org.apache.directory.studio.connection.ui.widgets,

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java (original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPage.java Sat Nov 24 03:20:34 2007
@@ -78,8 +78,16 @@
      */
     public String getMessage();
 
-    
+
+    /**
+     * Gets an info message that should be displayed
+     * to the user. Null means no info message so an 
+     * existing info message should be cleared.
+     * 
+     * @return the info message
+     */
     public String getInfoMessage();
+
 
     /**
      * Creates the composite.

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java (original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionParameterPageManager.java Sat Nov 24 03:20:34 2007
@@ -21,9 +21,7 @@
 package org.apache.directory.studio.connection.ui;
 
 
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Map;

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java (original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/ConnectionUIConstants.java Sat Nov 24 03:20:34 2007
@@ -20,34 +20,53 @@
 
 package org.apache.directory.studio.connection.ui;
 
+
+/**
+ * Constants used in the connection UI plugin.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public interface ConnectionUIConstants
 {
 
+    /** The dialog setting key used for the history of host names. */
     public static final String DIALOGSETTING_KEY_HOST_HISTORY = "hostHistory";
 
+    /** The dialog setting key used for the history of ports. */
     public static final String DIALOGSETTING_KEY_PORT_HISTORY = "portHistory";
-    
+
+    /** The dialog setting key used for the history of principals (bind DNs). */
     public static final String DIALOGSETTING_KEY_PRINCIPAL_HISTORY = "principalHistory";
-    
+
+    /** The dialog setting key used for the history of SASL realms. */
     public static final String DIALOGSETTING_KEY_REALM_HISTORY = "saslrealmHistory";
 
-    
+    /** The image to add a connection. */
     public static final String IMG_CONNECTION_ADD = "resources/icons/connection_add.gif";
 
+    /** The image used to display the connected state of connections. */
     public static final String IMG_CONNECTION_CONNECTED = "resources/icons/connection_connected.gif";
 
+    /** The image used to display the disconnected state of connections. */
     public static final String IMG_CONNECTION_DISCONNECTED = "resources/icons/connection_disconnected.gif";
 
+    /** The image to connect connections. */
     public static final String IMG_CONNECTION_CONNECT = "resources/icons/connection_connect.gif";
 
+    /** The image to disconnect connections. */
     public static final String IMG_CONNECTION_DISCONNECT = "resources/icons/connection_disconnect.gif";
-    
+
+    /** The new connection wizard image */
     public static final String IMG_CONNECTION_WIZARD = "resources/icons/connection_wizard.gif";
-    
+
+    /** The pull-down image */
     public static final String IMG_PULLDOWN = "resources/icons/pulldown.gif";
-    
+
+    /** The image used for connection folders. */
     public static final String IMG_CONNECTION_FOLDER = "resources/icons/connection_folder.gif";
-    
+
+    /** The image to add a connection folder. */
     public static final String IMG_CONNECTION_FOLDER_ADD = "resources/icons/connection_folder.gif";
 
 }

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java (original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/UIAuthHandler.java Sat Nov 24 03:20:34 2007
@@ -29,9 +29,19 @@
 import org.eclipse.ui.PlatformUI;
 
 
+/**
+ * Default authentication handler that ask for the password using
+ * a UI dialog.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class UIAuthHandler implements IAuthHandler
 {
 
+    /**
+     * {@inheritDoc}
+     */
     public ICredentials getCredentials( final ConnectionParameter connectionParameter )
     {
 

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/dialogs/MoveEntriesDialog.java Sat Nov 24 03:20:34 2007
@@ -22,12 +22,12 @@
 
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.DnBuilderWidget;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyListener;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java Sat Nov 24 03:20:34 2007
@@ -28,9 +28,9 @@
 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.DnUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.search.EntryWidget;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 import org.eclipse.jface.fieldassist.ComboContentAdapter;
 import org.eclipse.jface.fieldassist.ContentProposalAdapter;
 import org.eclipse.jface.fieldassist.DecoratedField;

Modified: directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/EntryWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/EntryWidget.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/EntryWidget.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/EntryWidget.java Sat Nov 24 03:20:34 2007
@@ -24,6 +24,7 @@
 import javax.naming.InvalidNameException;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.SelectEntryDialog;
@@ -34,7 +35,6 @@
 import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryJob;
 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.utils.DnUtils;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserConnectionManager.java Sat Nov 24 03:20:34 2007
@@ -22,13 +22,10 @@
 
 
 import java.beans.Encoder;
-import java.beans.ExceptionListener;
 import java.beans.Expression;
 import java.beans.PersistenceDelegate;
 import java.beans.XMLDecoder;
-import java.beans.XMLEncoder;
 import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -45,6 +42,7 @@
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionCorePlugin;
 import org.apache.directory.studio.connection.core.ConnectionFolder;
+import org.apache.directory.studio.connection.core.Utils;
 import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
 import org.apache.directory.studio.connection.core.event.ConnectionUpdateListener;
 import org.apache.directory.studio.connection.core.io.ConnectionIOException;
@@ -60,15 +58,10 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.SearchParameter;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.AliasDereferencingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection.ReferralHandlingMethod;
-import org.apache.directory.studio.ldapbrowser.core.model.ISearch.SearchScope;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Bookmark;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.BrowserConnection;
 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.ldifparser.LdifUtils;
-import org.eclipse.core.runtime.IPath;
 
 
 /**
@@ -109,28 +102,7 @@
     public static final String getSchemaCacheFileName( IBrowserConnection browserConnection )
     {
         return BrowserCorePlugin.getDefault().getStateLocation().append(
-            "schema-" + toSaveString( browserConnection.getConnection().getId() ) + ".ldif" ).toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
-    }
-
-
-    /**
-     * Gets the Modification Log filename for the corresponding browser connection.
-     *
-     * @param browserConnection
-     *      the browser connection
-     * @return
-     *      the Modification Log filename
-     */
-    public static final String getModificationLogFileName( IBrowserConnection browserConnection )
-    {
-        IPath p = BrowserCorePlugin.getDefault().getStateLocation().append( "logs" ); //$NON-NLS-1$
-        File file = p.toFile();
-        if ( !file.exists() )
-        {
-            file.mkdir();
-        }
-        return p
-            .append( "modifications-" + toSaveString( browserConnection.getConnection().getId() ) + "-%u-%g.ldiflog" ).toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
+            "schema-" + Utils.getFilenameString( browserConnection.getConnection().getId() ) + ".ldif" ).toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
     }
 
 
@@ -175,47 +147,6 @@
         }
 
         return filename;
-    }
-
-
-    /**
-     * Converts a String into a Saveable String.
-     *
-     * @param s
-     *      the String to convert
-     * @return
-     *      the converted String
-     */
-    private static String toSaveString( String s )
-    {
-        if ( s == null )
-        {
-            return null;
-        }
-
-        byte[] b = LdifUtils.utf8encode( s );
-        StringBuffer sb = new StringBuffer();
-        for ( int i = 0; i < b.length; i++ )
-        {
-
-            if ( b[i] == '-' || b[i] == '_' || ( '0' <= b[i] && b[i] <= '9' ) || ( 'A' <= b[i] && b[i] <= 'Z' )
-                || ( 'a' <= b[i] && b[i] <= 'z' ) )
-            {
-                sb.append( ( char ) b[i] );
-            }
-            else
-            {
-                int x = ( int ) b[i];
-                if ( x < 0 )
-                    x = 256 + x;
-                String t = Integer.toHexString( x );
-                if ( t.length() == 1 )
-                    t = "0" + t; //$NON-NLS-1$
-                sb.append( t );
-            }
-        }
-
-        return sb.toString();
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/BrowserCoreConstants.java Sat Nov 24 03:20:34 2007
@@ -43,8 +43,6 @@
 
     public static final String DEFAULT_ENCODING = new OutputStreamWriter( new ByteArrayOutputStream() ).getEncoding();
 
-    public static final String DATEFORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS"; //$NON-NLS-1$
-
     public static final String PREFERENCE_CHECK_FOR_CHILDREN = "checkForChildren"; //$NON-NLS-1$
 
     public static final String PREFERENCE_SHOW_ALIAS_AND_REFERRAL_OBJECTS = "showAliasAndReferralObjects"; //$NON-NLS-1$

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/CopyEntriesJob.java Sat Nov 24 03:20:34 2007
@@ -31,6 +31,7 @@
 import org.apache.directory.shared.ldap.name.AttributeTypeAndValue;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.ChildrenInitializedEvent;
@@ -49,7 +50,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Search;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 
 
 /**

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/ImportLdifJob.java Sat Nov 24 03:20:34 2007
@@ -48,15 +48,15 @@
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.ConnectionCoreConstants;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
-import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.BulkModificationEvent;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
 import org.apache.directory.studio.ldapbrowser.core.model.ConnectionException;
 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.utils.DnUtils;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.apache.directory.studio.ldifparser.LdifFormatParameters;
 import org.apache.directory.studio.ldifparser.model.LdifEnumeration;
@@ -518,7 +518,7 @@
         try
         {
             LdifFormatParameters ldifFormatParameters = Utils.getLdifFormatParameters();
-            DateFormat df = new SimpleDateFormat( BrowserCoreConstants.DATEFORMAT );
+            DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT );
 
             String errorComment = "#!ERROR " + exception.getMessage(); //$NON-NLS-1$
             errorComment = errorComment.replaceAll( "\r", " " ); //$NON-NLS-1$ //$NON-NLS-2$
@@ -557,7 +557,7 @@
         try
         {
             LdifFormatParameters ldifFormatParameters = Utils.getLdifFormatParameters();
-            DateFormat df = new SimpleDateFormat( BrowserCoreConstants.DATEFORMAT );
+            DateFormat df = new SimpleDateFormat( ConnectionCoreConstants.DATEFORMAT );
             logWriter.write( LdifCommentLine.create( "#!RESULT OK" ).toFormattedString( ldifFormatParameters ) ); //$NON-NLS-1$
             logWriter
                 .write( LdifCommentLine

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/MoveEntriesJob.java Sat Nov 24 03:20:34 2007
@@ -32,6 +32,7 @@
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryMovedEvent;
@@ -41,7 +42,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 
 
 /**

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/RenameEntryJob.java Sat Nov 24 03:20:34 2007
@@ -32,6 +32,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreMessages;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryRenamedEvent;
@@ -41,7 +42,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 
 
 /**

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java Sat Nov 24 03:20:34 2007
@@ -39,6 +39,7 @@
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.DnUtils;
 import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
 import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
@@ -60,7 +61,6 @@
 import org.apache.directory.studio.ldapbrowser.core.model.impl.ReferralBaseEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.Value;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.ObjectClassDescription;
-import org.apache.directory.studio.ldapbrowser.core.utils.DnUtils;
 import org.apache.directory.studio.ldapbrowser.core.utils.JNDIUtils;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/IBrowserConnection.java Sat Nov 24 03:20:34 2007
@@ -28,7 +28,6 @@
 import org.apache.directory.studio.connection.core.ConnectionPropertyPageProvider;
 import org.apache.directory.studio.ldapbrowser.core.BookmarkManager;
 import org.apache.directory.studio.ldapbrowser.core.SearchManager;
-import org.apache.directory.studio.ldapbrowser.core.model.impl.ModificationLogger;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.eclipse.core.runtime.IAdaptable;
 
@@ -340,14 +339,6 @@
      * @return the bookmark manager
      */
     public abstract BookmarkManager getBookmarkManager();
-
-
-    /**
-     * Gets the modification logger.
-     * 
-     * @return the modification logger
-     */
-    public abstract ModificationLogger getModificationLogger();
 
 
     /**

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/BrowserConnection.java Sat Nov 24 03:20:34 2007
@@ -43,7 +43,7 @@
 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.DnUtils;
+import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.eclipse.search.ui.ISearchPageScoreComputer;
 
 
@@ -85,9 +85,6 @@
     /** The entry to children info map. */
     private volatile Map<IEntry, ChildrenInfo> entryToChildrenInfoMap;
 
-    /** The modification logger. */
-    transient ModificationLogger modificationLogger;
-
 
     /**
      * Creates a new instance of BrowserConnection.
@@ -112,7 +109,6 @@
 
         this.searchManager = new SearchManager( this );
         this.bookmarkManager = new BookmarkManager( this );
-        this.modificationLogger = new ModificationLogger( this );
 
         this.entryToChildrenFilterMap = new HashMap<IEntry, String>();
         this.dnToEntryCache = new HashMap<String, IEntry>();
@@ -123,8 +119,6 @@
         this.rootDSE = new RootDSE( this );
         cacheEntry( this.rootDSE );
 
-        this.connection.getJNDIConnectionWrapper().setModificationLogger( this.modificationLogger );
-
         ConnectionEventRegistry.addConnectionUpdateListener( this, ConnectionCorePlugin.getDefault().getEventRunner() );
     }
 
@@ -166,7 +160,7 @@
      */
     public IEntry getEntryFromCache( LdapDN dn )
     {
-        String oidDn = DnUtils.getNormalizedOidString( dn, getSchema() );
+        String oidDn = Utils.getNormalizedOidString( dn, getSchema() );
         if ( dnToEntryCache != null && dnToEntryCache.containsKey( oidDn ) )
         {
             return dnToEntryCache.get( oidDn );
@@ -363,15 +357,6 @@
     /**
      * {@inheritDoc}
      */
-    public ModificationLogger getModificationLogger()
-    {
-        return modificationLogger;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     @SuppressWarnings("unchecked")
     public Object getAdapter( Class adapter )
     {
@@ -394,7 +379,7 @@
      */
     public synchronized void cacheEntry( IEntry entry )
     {
-        dnToEntryCache.put( DnUtils.getNormalizedOidString( entry.getDn(), getSchema() ), entry );
+        dnToEntryCache.put( Utils.getNormalizedOidString( entry.getDn(), getSchema() ), entry );
     }
 
 
@@ -405,7 +390,7 @@
      */
     protected synchronized void uncacheEntry( IEntry entry )
     {
-        dnToEntryCache.remove( DnUtils.getNormalizedOidString( entry.getDn(), getSchema() ) );
+        dnToEntryCache.remove( Utils.getNormalizedOidString( entry.getDn(), getSchema() ) );
     }
 
 
@@ -433,7 +418,7 @@
      */
     protected synchronized void uncacheEntry( LdapDN dn )
     {
-        dnToEntryCache.remove( DnUtils.getNormalizedOidString( dn, getSchema() ) );
+        dnToEntryCache.remove( Utils.getNormalizedOidString( dn, getSchema() ) );
     }
 
 

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/DummyConnection.java Sat Nov 24 03:20:34 2007
@@ -220,15 +220,6 @@
     /** 
      * {@inheritDoc}
      */
-    public ModificationLogger getModificationLogger()
-    {
-        return null;
-    }
-
-
-    /** 
-     * {@inheritDoc}
-     */
     public ReferralHandlingMethod getReferralsHandlingMethod()
     {
         return ReferralHandlingMethod.IGNORE;

Modified: directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Entry.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Entry.java?rev=597838&r1=597837&r2=597838&view=diff
==============================================================================
--- directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Entry.java (original)
+++ directory/studio/trunk/studio-ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/impl/Entry.java Sat Nov 24 03:20:34 2007
@@ -23,9 +23,9 @@
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.studio.connection.core.DnUtils;
 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.utils.DnUtils;
 
 
 /**



Mime
View raw message