directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1804081 [3/6] - in /directory/studio/branches/studio-value: ./ dist/ eclipse-trgt-platform/template/ features/apacheds.feature/ features/ldapbrowser.feature/ features/ldifeditor.feature/ features/nls.feature/ features/openldap.feature/ fea...
Date Fri, 04 Aug 2017 08:59:17 GMT
Modified: directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/LinkWithEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/LinkWithEditorAction.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/LinkWithEditorAction.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/browser/LinkWithEditorAction.java Fri Aug  4 08:59:15 2017
@@ -22,16 +22,11 @@ package org.apache.directory.studio.ldap
 
 
 import org.apache.directory.studio.entryeditors.EntryEditorInput;
-import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
-import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
 import org.apache.directory.studio.ldapbrowser.ui.editors.searchresult.SearchResultEditorInput;
-import org.eclipse.jface.action.Action;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPartListener2;
 import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
 
 
 /**
@@ -39,80 +34,11 @@ import org.eclipse.ui.IWorkbenchPartRefe
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LinkWithEditorAction extends Action
+public class LinkWithEditorAction extends AbstractLinkWithEditorAction
 {
     /** The browser view */
     private BrowserView browserView;
 
-    /** The listener listening on changes on editors */
-    private IPartListener2 editorListener = new IPartListener2()
-    {
-        /**
-         * {@inheritDoc}
-         */
-        public void partBroughtToTop( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partActivated( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partClosed( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partDeactivated( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partHidden( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partInputChanged( IWorkbenchPartReference partRef )
-        {
-            linkViewWithEditor( partRef.getPart( false ) );
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partOpened( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partVisible( IWorkbenchPartReference partRef )
-        {
-            linkViewWithEditor( partRef.getPart( false ) );
-        }
-    };
-
 
     /**
      * Creates a new instance of LinkWithEditorAction.
@@ -122,44 +48,9 @@ public class LinkWithEditorAction extend
      */
     public LinkWithEditorAction( BrowserView browserView )
     {
-        super( Messages.getString( "LinkWithEditorAction.LinkWithEditor" ), AS_CHECK_BOX ); //$NON-NLS-1$
-        setImageDescriptor( BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_LINK_WITH_EDITOR ) );
-        setEnabled( true );
-        setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
-            BrowserUIConstants.PREFERENCE_BROWSER_LINK_WITH_EDITOR ) );
+        super( browserView, Messages.getString( "LinkWithEditorAction.LinkWithEditor" ) ); //$NON-NLS-1$
         this.browserView = browserView;
-
-        // Enable the listeners
-        if ( isChecked() )
-        {
-            browserView.getSite().getWorkbenchWindow().getPartService().addPartListener( editorListener );
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void run()
-    {
-        setChecked( isChecked() );
-        BrowserUIPlugin.getDefault().getPreferenceStore().setValue(
-            BrowserUIConstants.PREFERENCE_BROWSER_LINK_WITH_EDITOR, isChecked() );
-
-        if ( isChecked() )
-        {
-            // Enable the listener
-            browserView.getSite().getWorkbenchWindow().getPartService().addPartListener( editorListener );
-
-            // link
-            IEditorPart activeEditor = browserView.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
-            linkViewWithEditor( activeEditor );
-        }
-        else
-        {
-            // Disable the listener
-            browserView.getSite().getWorkbenchWindow().getPartService().removePartListener( editorListener );
-        }
+        super.init();
     }
 
 
@@ -168,7 +59,7 @@ public class LinkWithEditorAction extend
      *
      * @param partRef the part
      */
-    private void linkViewWithEditor( IWorkbenchPart part )
+    protected void linkViewWithEditor( IWorkbenchPart part )
     {
         if ( part != null && browserView != null
             && part.getSite().getWorkbenchWindow() == browserView.getSite().getWorkbenchWindow() )
@@ -205,19 +96,4 @@ public class LinkWithEditorAction extend
         }
     }
 
-
-    /**
-     * Disposes this action.
-     */
-    public void dispose()
-    {
-        if ( editorListener != null )
-        {
-            browserView.getSite().getWorkbenchWindow().getPartService().removePartListener( editorListener );
-            editorListener = null;
-        }
-
-        browserView = null;
-    }
-
 }

Modified: directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/LinkWithEditorAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/LinkWithEditorAction.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/LinkWithEditorAction.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/LinkWithEditorAction.java Fri Aug  4 08:59:15 2017
@@ -24,18 +24,12 @@ package org.apache.directory.studio.ldap
 import org.apache.directory.studio.entryeditors.EntryEditorInput;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
-import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
-import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
 import org.apache.directory.studio.ldapbrowser.ui.editors.searchresult.SearchResultEditorInput;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
+import org.apache.directory.studio.ldapbrowser.ui.views.browser.AbstractLinkWithEditorAction;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPartListener2;
 import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
 
 
 /**
@@ -46,96 +40,11 @@ import org.eclipse.ui.IWorkbenchPartRefe
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LinkWithEditorAction extends Action
+public class LinkWithEditorAction extends AbstractLinkWithEditorAction
 {
     /** The connection view */
     private ConnectionView connectionView;
 
-    /** The listener listening on changes on editors */
-    private IPartListener2 editorListener = new IPartListener2()
-    {
-        /**
-         * {@inheritDoc}
-         */
-        public void partBroughtToTop( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partActivated( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partClosed( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partDeactivated( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partHidden( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partInputChanged( IWorkbenchPartReference partRef )
-        {
-            linkViewWithEditor( partRef.getPart( false ) );
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partOpened( IWorkbenchPartReference partRef )
-        {
-        }
-
-
-        /**
-         * {@inheritDoc}
-         */
-        public void partVisible( IWorkbenchPartReference partRef )
-        {
-            linkViewWithEditor( partRef.getPart( false ) );
-        }
-    };
-
-    /** The listener listening on changes of the link with editor action of the browser view */
-    private IPropertyChangeListener propertyChangeListener = new IPropertyChangeListener()
-    {
-
-        /**
-         * {@inheritDoc}
-         */
-        public void propertyChange( PropertyChangeEvent event )
-        {
-            if ( BrowserUIConstants.PREFERENCE_BROWSER_LINK_WITH_EDITOR.equals( event.getProperty() ) )
-            {
-                run();
-            }
-        }
-    };
-
 
     /**
      * Creates a new instance of LinkWithEditorAction.
@@ -145,47 +54,9 @@ public class LinkWithEditorAction extend
      */
     public LinkWithEditorAction( ConnectionView connectionView )
     {
-        super( Messages.getString( "LinkWithEditorAction.LinkWithEditor" ), AS_CHECK_BOX ); //$NON-NLS-1$
-
-        super.setImageDescriptor( BrowserUIPlugin.getDefault().getImageDescriptor(
-            BrowserUIConstants.IMG_LINK_WITH_EDITOR ) );
-        super.setEnabled( true );
+        super( connectionView, Messages.getString( "LinkWithEditorAction.LinkWithEditor" ) ); //$NON-NLS-1$
         this.connectionView = connectionView;
-
-        super.setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
-            BrowserUIConstants.PREFERENCE_BROWSER_LINK_WITH_EDITOR ) );
-
-        // enable the listeners
-        BrowserUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( propertyChangeListener );
-        if ( isChecked() )
-        {
-            connectionView.getSite().getWorkbenchWindow().getPartService().addPartListener( editorListener );
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public void run()
-    {
-        setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
-            BrowserUIConstants.PREFERENCE_BROWSER_LINK_WITH_EDITOR ) );
-
-        if ( isChecked() )
-        {
-            // enable the listeners
-            connectionView.getSite().getWorkbenchWindow().getPartService().addPartListener( editorListener );
-
-            // link
-            IEditorPart activeEditor = connectionView.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
-            linkViewWithEditor( activeEditor );
-        }
-        else
-        {
-            // dsable the listeners
-            connectionView.getSite().getWorkbenchWindow().getPartService().removePartListener( editorListener );
-        }
+        super.init();
     }
 
 
@@ -194,7 +65,7 @@ public class LinkWithEditorAction extend
      *
      * @param partRef the part
      */
-    private void linkViewWithEditor( IWorkbenchPart part )
+    protected void linkViewWithEditor( IWorkbenchPart part )
     {
         if ( part != null && connectionView != null
             && part.getSite().getWorkbenchWindow() == connectionView.getSite().getWorkbenchWindow() )
@@ -239,20 +110,4 @@ public class LinkWithEditorAction extend
         }
     }
 
-
-    /**
-     * Disposes this action.
-     */
-    public void dispose()
-    {
-        if ( editorListener != null )
-        {
-            connectionView.getSite().getWorkbenchWindow().getPartService().removePartListener( editorListener );
-            BrowserUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( propertyChangeListener );
-            editorListener = null;
-        }
-
-        connectionView = null;
-    }
-
 }

Modified: directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportModificationLogsWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportModificationLogsWizard.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportModificationLogsWizard.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportModificationLogsWizard.java Fri Aug  4 08:59:15 2017
@@ -25,6 +25,8 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 
 import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.util.IOUtils;
@@ -79,7 +81,7 @@ public class ExportModificationLogsWizar
             try
             {
                 File targetFile = new File( exportFilename );
-                FileOutputStream os = FileUtils.openOutputStream( targetFile );
+                OutputStream os = FileUtils.openOutputStream( targetFile );
 
                 LdifModificationLogger modificationLogger = ConnectionCorePlugin.getDefault()
                     .getLdifModificationLogger();
@@ -90,7 +92,7 @@ public class ExportModificationLogsWizar
                     File file = files[i];
                     if ( file != null && file.exists() && file.canRead() )
                     {
-                        FileInputStream is = FileUtils.openInputStream( file );
+                        InputStream is = FileUtils.openInputStream( file );
                         IOUtils.copy( is, os );
                         is.close();
                     }

Modified: directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportSearchLogsWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportSearchLogsWizard.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportSearchLogsWizard.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/ExportSearchLogsWizard.java Fri Aug  4 08:59:15 2017
@@ -25,6 +25,8 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 
 import org.apache.directory.api.util.FileUtils;
 import org.apache.directory.api.util.IOUtils;
@@ -79,7 +81,7 @@ public class ExportSearchLogsWizard exte
             try
             {
                 File targetFile = new File( exportFilename );
-                FileOutputStream os = FileUtils.openOutputStream( targetFile );
+                OutputStream os = FileUtils.openOutputStream( targetFile );
 
                 LdifSearchLogger searchLogger = ConnectionCorePlugin.getDefault().getLdifSearchLogger();
                 File[] files = searchLogger.getFiles( search.getBrowserConnection().getConnection() );
@@ -89,7 +91,7 @@ public class ExportSearchLogsWizard exte
                     File file = files[i];
                     if ( file != null && file.exists() && file.canRead() )
                     {
-                        FileInputStream is = FileUtils.openInputStream( file );
+                        InputStream is = FileUtils.openInputStream( file );
                         IOUtils.copy( is, os );
                         is.close();
                     }

Modified: directory/studio/branches/studio-value/plugins/ldapservers.apacheds/plugin.properties
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers.apacheds/plugin.properties?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers.apacheds/plugin.properties (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers.apacheds/plugin.properties Fri Aug  4 08:59:15 2017
@@ -23,4 +23,6 @@ LdapServerAdapter_vendor=Apache Software
 LdapServerAdapter_version=2.0.0
 
 ActionCreateConnection_id=org.apache.directory.studio.ldapservers.apacheds.CreateConnectionAction
-ActionCreateConnection_label=Create a Connection
\ No newline at end of file
+ActionCreateConnection_label=Create a Connection
+ActionRepair_id=org.apache.directory.studio.ldapservers.apacheds.RepairAction
+ActionRepair_label=Repair
\ No newline at end of file

Modified: directory/studio/branches/studio-value/plugins/ldapservers.apacheds/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers.apacheds/plugin.xml?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers.apacheds/plugin.xml (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers.apacheds/plugin.xml Fri Aug  4 08:59:15 2017
@@ -42,6 +42,12 @@
                label="%ActionCreateConnection_label"
                icon="resources/icons/connection_new.gif">
          </action>
+         <action
+               class="org.apache.directory.studio.ldapservers.apacheds.RepairAction"
+               enablesFor="1"
+               id="%ActionRepair_id"
+               label="%ActionRepair_label">
+         </action>
          <visibility>
             <and>
                <objectState

Modified: directory/studio/branches/studio-value/plugins/ldapservers.apacheds/resources/conf/log4j.properties
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers.apacheds/resources/conf/log4j.properties?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers.apacheds/resources/conf/log4j.properties (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers.apacheds/resources/conf/log4j.properties Fri Aug  4 08:59:15 2017
@@ -26,3 +26,5 @@ log4j.logger.org.apache.directory.api.ld
 log4j.logger.org.springframework=WARN
 log4j.logger.org.apache.directory.api.codec=WARN
 log4j.logger.org.apache.directory.api.asn1=WARN
+
+log4j.logger.org.apache.directory.server.UberjarMain=INFO

Modified: directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS200LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS200LdapServerAdapter.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS200LdapServerAdapter.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS200LdapServerAdapter.java Fri Aug  4 08:59:15 2017
@@ -44,6 +44,7 @@ import org.apache.directory.studio.ldaps
 import org.apache.directory.studio.ldapservers.LdapServersUtils;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
+import org.apache.directory.studio.ldapservers.model.LdapServerStatus;
 import org.apache.mina.util.AvailablePortFinder;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.NullProgressMonitor;
@@ -83,6 +84,9 @@ public class ApacheDS200LdapServerAdapte
     private static final String[] libraries = new String[]
         { "apacheds-service.jar" }; //$NON-NLS-1$
 
+    private enum Action {
+        START, REPAIR, STOP;
+    }
 
     /**
      * {@inheritDoc}
@@ -163,6 +167,47 @@ public class ApacheDS200LdapServerAdapte
      */
     public void start( LdapServer server, StudioProgressMonitor monitor ) throws Exception
     {
+        ILaunch launch = startOrRepair( server, monitor, Action.START );
+
+        // Storing the launch configuration as a custom object in the LDAP Server for later use
+        server.putCustomObject( LdapServersUtils.LAUNCH_CONFIGURATION_CUSTOM_OBJECT, launch );
+
+        // Running the startup listener watchdog
+        LdapServersUtils.runStartupListenerWatchdog( server, getTestingPort( server ) );
+    }
+
+
+    /**
+     * Starts the ApacheDS in "repair" mode
+     *
+     * @param server
+     *      the server
+     * @param monitor
+     *      the progress monitor
+     * @throws Exception
+     *      if an error occurs when starting the server
+     */
+    public void repair( LdapServer server, StudioProgressMonitor monitor ) throws Exception
+    {
+        // repair
+        startOrRepair( server, monitor, Action.REPAIR );
+
+        // Await termination of the repair action
+        long startTime = System.currentTimeMillis();
+        final long watchDog = startTime + ( 1000 * 60 * 3 ); // 3 minutes
+        do
+        {
+            Thread.sleep( 1000 );
+        }
+        while ( ( System.currentTimeMillis() < watchDog ) && ( LdapServerStatus.REPAIRING == server.getStatus() ) );
+
+        // stop the console printer thread
+        LdapServersUtils.stopConsolePrinterThread( server );
+    }
+
+    
+    private ILaunch startOrRepair( LdapServer server, StudioProgressMonitor monitor, Action action ) throws Exception
+    {
         // Getting the bundle associated with the plugin
         Bundle bundle = ApacheDS200Plugin.getDefault().getBundle();
 
@@ -172,28 +217,27 @@ public class ApacheDS200LdapServerAdapte
             Messages.getString( "ApacheDS200LdapServerAdapter.VerifyingAndCopyingLibraries" ) ); //$NON-NLS-1$
 
         // Starting the console printer thread
-        LdapServersUtils.startConsolePrinterThread( server );
+        LdapServersUtils.startConsolePrinterThread( server, LdapServersManager.getServerFolder( server )
+            .append( "log" ) //$NON-NLS-1$
+            .append( "apacheds.log" ).toFile() );//$NON-NLS-1$
 
         // Launching ApacheDS
-        ILaunch launch = launchApacheDS( server );
-
-        // Starting the "terminate" listener thread
-        LdapServersUtils.startTerminateListenerThread( server, launch );
+        ILaunch launch = launchApacheDS( server, action );
 
-        // Running the startup listener watchdog
-        LdapServersUtils.runStartupListenerWatchdog( server, getTestingPort( server ) );
+        return launch;
     }
-
-
+    
     /**
      * Launches ApacheDS using a launch configuration.
      *
      * @param server
      *      the server
+     * @param repair
+     *      true to launch ApacheDS in repair mode
      * @return
      *      the associated launch
      */
-    public static ILaunch launchApacheDS( LdapServer server )
+    private static ILaunch launchApacheDS( LdapServer server, Action action )
         throws Exception
     {
         // Getting the default VM installation
@@ -232,9 +276,23 @@ public class ApacheDS200LdapServerAdapte
         // The server folder path
         IPath serverFolderPath = LdapServersManager.getServerFolder( server );
 
+        // Creating the program arguments string
+        StringBuffer programArguments = new StringBuffer();
+        programArguments.append( "\"" + serverFolderPath.toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$
+        if ( action == Action.REPAIR )
+        {
+            programArguments.append( " " );
+            programArguments.append( "\"repair\"" );
+        }
+        else if ( action == Action.STOP )
+        {
+            programArguments.append( " " );
+            programArguments.append( "\"stop\"" );
+        }
+
         // Setting the program arguments attribute
-        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "\"" //$NON-NLS-1$
-            + serverFolderPath.toOSString() + "\"" ); //$NON-NLS-1$
+        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
+            programArguments.toString() );
 
         // Creating the VM arguments string
         StringBuffer vmArguments = new StringBuffer();
@@ -287,8 +345,8 @@ public class ApacheDS200LdapServerAdapte
         // Launching the launch configuration
         ILaunch launch = configuration.launch( ILaunchManager.RUN_MODE, new NullProgressMonitor() );
 
-        // Storing the launch configuration as a custom object in the LDAP Server for later use
-        server.putCustomObject( LdapServersUtils.LAUNCH_CONFIGURATION_CUSTOM_OBJECT, launch );
+        // Starting the "terminate" listener thread
+        LdapServersUtils.startTerminateListenerThread( server, launch );
 
         return launch;
     }
@@ -299,6 +357,18 @@ public class ApacheDS200LdapServerAdapte
      */
     public void stop( LdapServer server, StudioProgressMonitor monitor ) throws Exception
     {
+        // Graceful stop ApacheDS
+        launchApacheDS( server, Action.STOP );
+
+        // Await termination of the server
+        long startTime = System.currentTimeMillis();
+        final long watchDog = startTime + ( 1000 * 60 * 3 ); // 3 minutes
+        do
+        {
+            Thread.sleep( 1000 );
+        }
+        while ( ( System.currentTimeMillis() < watchDog ) && ( LdapServerStatus.STOPPING == server.getStatus() ) );
+
         // Stopping the console printer thread
         LdapServersUtils.stopConsolePrinterThread( server );
 

Modified: directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/CreateConnectionAction.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/CreateConnectionAction.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/CreateConnectionAction.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/CreateConnectionAction.java Fri Aug  4 08:59:15 2017
@@ -50,8 +50,6 @@ import org.eclipse.ui.IWorkbenchPart;
  */
 public class CreateConnectionAction implements IObjectActionDelegate
 {
-    private static final String EXTENSION_ID = "org.apache.directory.server.2.0.0"; //$NON-NLS-1$
-
     /** The {@link ServersView} */
     private ServersView view;
 
@@ -71,13 +69,7 @@ public class CreateConnectionAction impl
                 LdapServer server = ( LdapServer ) selection.getFirstElement();
 
                 // Checking that the server is really an ApacheDS 2.0.0 server
-                if ( !EXTENSION_ID.equalsIgnoreCase( server.getLdapServerAdapterExtension().getId() ) )
-                {
-                    String message = Messages.getString( "CreateConnectionAction.UnableReadServerConfiguration" ) //$NON-NLS-1$
-                        + "\n\n" //$NON-NLS-1$
-                        + Messages.getString( "CreateConnectionAction.NotA200Server" ); //$NON-NLS-1$
-
-                    reportErrorReadingServerConfiguration( view, message );
+                if(!ExtensionUtils.verifyApacheDs200OrPrintError( server, view )) {
                     return;
                 }
 

Modified: directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/messages.properties?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/messages.properties (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers.apacheds/src/main/java/org/apache/directory/studio/ldapservers/apacheds/messages.properties Fri Aug  4 08:59:15 2017
@@ -32,3 +32,6 @@ CreateConnectionAction.LDAPAndLDAPSDisab
 CreateConnectionAction.NotA200Server=This server is not an ApacheDS 2.0.0 server.
 CreateConnectionAction.UnableCreateConnection=Unable to create a connection
 CreateConnectionAction.UnableReadServerConfiguration=Unable to read the server configuration.
+
+RepairRunnable.UnableToRepair=Unable to repair {0}
+RepairRunnable.Repair=Repair {0}
\ No newline at end of file

Modified: directory/studio/branches/studio-value/plugins/ldapservers/pom-first.xml
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers/pom-first.xml?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers/pom-first.xml (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers/pom-first.xml Fri Aug  4 08:59:15 2017
@@ -50,6 +50,7 @@
             <Export-Package>org.apache.directory.studio.ldapservers,
  org.apache.directory.studio.ldapservers.model,
  org.apache.directory.studio.ldapservers.views,
+ org.apache.directory.studio.ldapservers.jobs,
  org.apache.directory.studio.ldapservers.actions</Export-Package>
  
             <Import-Package>

Modified: directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java Fri Aug  4 08:59:15 2017
@@ -27,8 +27,6 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
 
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.common.ui.CommonUIUtils;
@@ -37,21 +35,11 @@ import org.apache.directory.studio.ldaps
 import org.apache.mina.util.AvailablePortFinder;
 import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.debug.core.DebugEvent;
 import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.IDebugEventSetListener;
 import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.debug.core.ILaunchManager;
 import org.eclipse.debug.core.model.RuntimeProcess;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.ui.console.MessageConsole;
 import org.osgi.framework.Bundle;
@@ -80,6 +68,12 @@ public class LdapServersUtils
      */
     public static void runStartupListenerWatchdog( LdapServer server, int port ) throws Exception
     {
+        // If no protocol is enabled, we pass this and declare the server as started
+        if ( port == 0 )
+        {
+            return;
+        }
+
         // Getting the current time
         long startTime = System.currentTimeMillis();
 
@@ -89,37 +83,12 @@ public class LdapServersUtils
         // Looping until the end of the watchdog if the server is still 'starting'
         while ( ( System.currentTimeMillis() < watchDog ) && ( LdapServerStatus.STARTING == server.getStatus() ) )
         {
-            // Getting the port to test
-            try
-            {
-                // If no protocol is enabled, we pass this and 
-                // declare the server as started
-                if ( port != 0 )
-                {
-                    // Trying to see if the port is available
-                    if ( AvailablePortFinder.available( port ) )
-                    {
-                        // The port is still available
-                        throw new Exception();
-                    }
-                }
-
-                // If we pass the creation of the context, it means
-                // the server is correctly started
-
-                // We set the state of the server to 'started'...
-                server.setStatus( LdapServerStatus.STARTED );
-
-                // ... and we exit the thread
-                return;
-            }
-            catch ( Exception e )
+            // Trying to see if the port is available
+            if ( AvailablePortFinder.available( port ) )
             {
-                // If we get an exception, it means the server is not 
-                // yet started
+                // The port is still available
 
-                // We just wait one second before starting the test once
-                // again
+                // We just wait one second before starting the test once again
                 try
                 {
                     Thread.sleep( 1000 );
@@ -129,6 +98,15 @@ public class LdapServersUtils
                     // Nothing to do...
                 }
             }
+            else
+            {
+                // We set the state of the server to 'started'...
+                server.setStatus( LdapServerStatus.STARTED );
+
+                // ... and we exit the thread
+                return;
+
+            }
         }
 
         // If, at the end of the watch dog, the state of the server is
@@ -205,20 +183,8 @@ public class LdapServersUtils
      *
      * @param server
      *      the server
-     */
-    public static void startConsolePrinterThread( LdapServer server )
-    {
-        startConsolePrinterThread( server, LdapServersManager.getServerFolder( server )
-            .append( "log" ) //$NON-NLS-1$
-            .append( "apacheds.log" ).toFile() );//$NON-NLS-1$
-    }
-
-
-    /**
-     * Starts the console printer thread.
-     *
-     * @param server
-     *      the server
+     * @param serverLogsFile
+     *       the server logs file
      */
     public static void startConsolePrinterThread( LdapServer server, File serverLogsFile )
     {
@@ -252,96 +218,6 @@ public class LdapServersUtils
 
 
     /**
-     * Launches ApacheDS using a launch configuration.
-     *
-     * @param server
-     *      the server
-     * @param apacheDsLibrariesFolder
-     *      the ApacheDS libraries folder
-     * @param libraries
-     *      the names of the libraries
-     * @return
-     *      the associated launch
-     */
-    public static ILaunch launchApacheDS( LdapServer server, IPath apacheDsLibrariesFolder, String[] libraries )
-        throws Exception
-    {
-        // Getting the default VM installation
-        IVMInstall vmInstall = JavaRuntime.getDefaultVMInstall();
-
-        // Creating a new editable launch configuration
-        ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager()
-            .getLaunchConfigurationType( IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION );
-        ILaunchConfigurationWorkingCopy workingCopy = type.newInstance( null, server.getId() );
-
-        // Setting the JRE container path attribute
-        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, vmInstall
-            .getInstallLocation().toString() );
-
-        // Setting the main type attribute
-        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
-            "org.apache.directory.studio.apacheds.Launcher" ); //$NON-NLS-1$
-
-        // Creating the classpath list
-        List<String> classpath = new ArrayList<String>();
-        for ( String library : libraries )
-        {
-            IRuntimeClasspathEntry libraryClasspathEntry = JavaRuntime
-                .newArchiveRuntimeClasspathEntry( apacheDsLibrariesFolder.append( library ) );
-            libraryClasspathEntry.setClasspathProperty( IRuntimeClasspathEntry.USER_CLASSES );
-
-            classpath.add( libraryClasspathEntry.getMemento() );
-        }
-
-        // Setting the classpath type attribute
-        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_CLASSPATH, classpath );
-
-        // Setting the default classpath type attribute to false
-        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, false );
-
-        // The server folder path
-        IPath serverFolderPath = LdapServersManager.getServerFolder( server );
-
-        // Setting the program arguments attribute
-        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "\"" //$NON-NLS-1$
-            + serverFolderPath.toOSString() + "\"" ); //$NON-NLS-1$
-
-        // Creating the VM arguments string
-        StringBuffer vmArguments = new StringBuffer();
-        vmArguments.append( "-Dlog4j.configuration=file:\"" //$NON-NLS-1$
-            + serverFolderPath.append( "conf" ).append( "log4j.properties" ).toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        vmArguments.append( " " ); //$NON-NLS-1$
-        vmArguments.append( "-Dapacheds.var.dir=\"" + serverFolderPath.toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$
-        vmArguments.append( " " ); //$NON-NLS-1$
-        vmArguments.append( "-Dapacheds.log.dir=\"" + serverFolderPath.append( "log" ).toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        vmArguments.append( " " ); //$NON-NLS-1$
-        vmArguments.append( "-Dapacheds.run.dir=\"" + serverFolderPath.append( "run" ).toOSString() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        vmArguments.append( " " ); //$NON-NLS-1$
-        vmArguments.append( "-Dapacheds.instance=\"" + server.getName() + "\"" ); //$NON-NLS-1$ //$NON-NLS-2$
-
-        // Setting the VM arguments attribute
-        workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArguments.toString() );
-
-        // Setting the launch configuration as private
-        workingCopy.setAttribute( IDebugUIConstants.ATTR_PRIVATE, true );
-
-        // Indicating that we don't want any console to show up
-        workingCopy.setAttribute( DebugPlugin.ATTR_CAPTURE_OUTPUT, false );
-
-        // Saving the launch configuration
-        ILaunchConfiguration configuration = workingCopy.doSave();
-
-        // Launching the launch configuration
-        ILaunch launch = configuration.launch( ILaunchManager.RUN_MODE, new NullProgressMonitor() );
-
-        // Storing the launch configuration as a custom object in the LDAP Server for later use
-        server.putCustomObject( LAUNCH_CONFIGURATION_CUSTOM_OBJECT, launch );
-
-        return launch;
-    }
-
-
-    /**
      * Terminates the launch configuration.
      *
      * @param server
@@ -352,10 +228,13 @@ public class LdapServersUtils
     {
         // Getting the launch
         ILaunch launch = ( ILaunch ) server.removeCustomObject( LdapServersUtils.LAUNCH_CONFIGURATION_CUSTOM_OBJECT );
-        if ( ( launch != null ) && ( !launch.isTerminated() ) )
+        if ( launch != null )
         {
-            // Terminating the launch
-            launch.terminate();
+            if ( ( !launch.isTerminated() ) )
+            {
+                // Terminating the launch
+                launch.terminate();
+            }
         }
         else
         {

Modified: directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StudioLdapServerJob.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StudioLdapServerJob.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StudioLdapServerJob.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StudioLdapServerJob.java Fri Aug  4 08:59:15 2017
@@ -24,7 +24,6 @@ package org.apache.directory.studio.ldap
 import org.apache.directory.studio.common.core.jobs.StudioJob;
 import org.apache.directory.studio.common.core.jobs.StudioRunnableWithProgress;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
-import org.eclipse.core.runtime.jobs.Job;
 
 
 /**
@@ -48,7 +47,8 @@ public class StudioLdapServerJob extends
     /**
     * {@inheritDoc}
     */
-    protected String[] getLockIdentifiers( Object[] objects )
+    @Override
+    protected String[] getLockIdentifiers( Object... objects )
     {
         String[] identifiers = new String[objects.length];
         for ( int i = 0; i < identifiers.length; i++ )

Modified: directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerStatus.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerStatus.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerStatus.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerStatus.java Fri Aug  4 08:59:15 2017
@@ -27,5 +27,5 @@ package org.apache.directory.studio.ldap
  */
 public enum LdapServerStatus
 {
-    STARTED, STARTING, STOPPED, STOPPING, UNKNOWN
+    STARTED, STARTING, STOPPED, STOPPING, UNKNOWN, REPAIRING
 }

Modified: directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersTableViewer.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersTableViewer.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersTableViewer.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersTableViewer.java Fri Aug  4 08:59:15 2017
@@ -155,7 +155,8 @@ public class ServersTableViewer extends
                         // If the state is STARTING or STOPPING, we need to
                         // add the server to the list of servers needing
                         // animation and eventually start the animation thread
-                        if ( ( state == LdapServerStatus.STARTING ) || ( state == LdapServerStatus.STOPPING ) )
+                        if ( ( state == LdapServerStatus.STARTING ) || ( state == LdapServerStatus.STOPPING )
+                            || ( state == LdapServerStatus.REPAIRING ) )
                         {
                             boolean startAnimationThread = false;
 

Modified: directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java Fri Aug  4 08:59:15 2017
@@ -433,6 +433,7 @@ public class ServersView extends ViewPar
                     start.setEnabled( false );
                     stop.setEnabled( true );
                     break;
+                case REPAIRING:
                 case STARTING:
                     start.setEnabled( false );
                     stop.setEnabled( false );

Modified: directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewLabelProvider.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewLabelProvider.java (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewLabelProvider.java Fri Aug  4 08:59:15 2017
@@ -72,6 +72,8 @@ public class ServersViewLabelProvider ex
                         return Messages.getString( "ServersViewLabelProvider.Stopping" ) + getDots(); //$NON-NLS-1$
                     case UNKNOWN:
                         return Messages.getString( "ServersViewLabelProvider.Unknown" ); //$NON-NLS-1$
+                    case REPAIRING:
+                        return Messages.getString( "ServersViewLabelProvider.Repairing" ) + getDots(); //$NON-NLS-1$
                 }
             }
 
@@ -121,6 +123,7 @@ public class ServersViewLabelProvider ex
                 {
                     case STARTED:
                         return LdapServersPlugin.getDefault().getImage( LdapServersPluginConstants.IMG_SERVER_STARTED );
+                    case REPAIRING:
                     case STARTING:
                         switch ( dotsCount )
                         {

Modified: directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/messages.properties?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/messages.properties (original)
+++ directory/studio/branches/studio-value/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/messages.properties Fri Aug  4 08:59:15 2017
@@ -21,6 +21,7 @@ ServersView.state=State
 
 ServersViewLabelProvider.Started=Started
 ServersViewLabelProvider.Starting=Starting
+ServersViewLabelProvider.Repairing=Repairing
 ServersViewLabelProvider.Stopped=Stopped
 ServersViewLabelProvider.Stopping=Stopping
 ServersViewLabelProvider.Unknown=Unknown
\ No newline at end of file

Modified: directory/studio/branches/studio-value/plugins/ldifeditor/about.ini
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/ldifeditor/about.ini?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/ldifeditor/about.ini (original)
+++ directory/studio/branches/studio-value/plugins/ldifeditor/about.ini Fri Aug  4 08:59:15 2017
@@ -1,2 +1,2 @@
 featureImage=studio.png
-aboutText=Apache Directory Studio LDIF Editor - Editor for LDIF (LDAP Data Interchange Format) files.\n\nVersion: ${unqualifiedVersion}.${buildQualifier}\n\nCopyright \u00A9 2006-2015 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.\nVisit http://directory.apache.org/studio
+aboutText=Apache Directory Studio LDIF Editor - Editor for LDIF (LDAP Data Interchange Format) files.\n\nVersion: ${unqualifiedVersion}.${buildQualifier}\n\nCopyright \u00A9 2006-2016 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.\nVisit http://directory.apache.org/studio

Modified: directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/antlr/Acl.g
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/antlr/Acl.g?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/antlr/Acl.g (original)
+++ directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/antlr/Acl.g Fri Aug  4 08:59:15 2017
@@ -25,6 +25,9 @@ package org.apache.directory.studio.open
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.directory.api.ldap.model.name.Dn;
+import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
+
 import java.util.List;
 } 
     
@@ -95,6 +98,7 @@ tokens
     ID_subtree = "subtree";
     ID_to = "to";
     ID_users = "users";
+	ID_val = "val";
     ID_w = "w";
     ID_x = "x";
     ID_write = "write";
@@ -108,7 +112,9 @@ INTEGER : DIGIT | ( LDIGIT ( DIGIT )+ );
 
 DOUBLE_QUOTED_STRING : '"'! ( ~'"' )* '"'!;
         
-ATTR_IDENT : ('a'..'z' | '!' | '@' )  ('a'..'z' | DIGIT | '-' | ';' )*;
+//ATTR_IDENT : ('a'..'z' | '!' | '@' )  ('a'..'z' | DIGIT | '-' | ';' )*;
+
+IDENT : ('a'..'z') ('a'..'z' | DIGIT | '-')*;
 
 OPEN_CURLY : '{';
 
@@ -138,7 +144,7 @@ MINUS : '-';
 
 SLASH : '/';
 
-FILTER : '(' ( ( '&' ( SP )? (FILTER)+ ) | ( '|' (SP)? (FILTER)+ ) | ( '!' (SP)? FILTER ) | FILTER_VALUE ) ')';
+FILTER : '(' (SP)? ( ( '&' (SP)? (FILTER)+ ) | ( '|' (SP)? (FILTER)+ ) | ( '!' (SP)? FILTER ) | FILTER_VALUE ) (SP)? ')';
 
 protected FILTER_VALUE : (options{greedy=true;}: ~( ')' | '(' | '&' | '|' | '!' ) ( ~(')') )* ) ;
 
@@ -165,7 +171,6 @@ options
 // ----------------------------------------------------------------------------
 // parser initialization
 // ----------------------------------------------------------------------------
-
 {
     private static final Logger log = LoggerFactory.getLogger( AntlrAclParser.class );
     
@@ -177,275 +182,574 @@ options
     }
 }
 
+// ----------------------------------------------------------------------------
+// The entry rule :
+// <parse> ::= SP? <aclItem> SP? #
+// ----------------------------------------------------------------------------
 parse
     {
         log.debug( "entered parse()" );
+		System.out.println( "entered parse_init()" );
     }
     :
     ( SP )? aclItem ( SP )? EOF
     ;
     
+// ----------------------------------------------------------------------------
+// The initial ACI :
+// <acl> ::= ('access' SP)? SP? 'to' SP (<what>)? ( SP 'by' SP <who> )+
+// The <what> part hould be seen only once, it can be absent and then is
+// equivalent to '*'
+// the <who> part is seen at least once
+// ----------------------------------------------------------------------------
 aclItem
     {
         log.debug( "entered aclItem()" );
+		System.out.println( "entered aclItem()" );
 
         aclItem = new AclItem();
     }
     :
-    ( ID_access SP )? ID_to ( SP what )+ ( SP ID_by SP who )* 
+    ( ID_access SP)? (SP)? ID_to SP (what SP)? ( ID_by SP who )+
+	{
+		if ( aclItem.getWhatClause() == null )
+		{
+			// The 'what' is equivalent to '*'
+			aclItem.setWhatClause( new AclWhatClauseStar() );
+		}
+	}
     ;
 
+// ----------------------------------------------------------------------------
+// The <what> clause. 
+// <what> ::= 'dn' <what-dn> | <what-filter> | <what-attrs> | <what-star> | e
+// This is just a filtering clause
+// ----------------------------------------------------------------------------
 what
     {
         log.debug( "entered what()" );
+		System.out.println( "entered what()" );
     }
     :
-    ( what_star | what_dn | what_attrs | what_filter )
+    ( ID_dn what_dn | what_filter | what_attrs | what_star )
     ;
 
+// ----------------------------------------------------------------------------
+// The catch all 'what' clause. We store an instance of a
+// AclWhatClauseStar in the ACL
+//
+// <what-star> ::= '*'
+// ----------------------------------------------------------------------------
 what_star
-{
-    log.debug( "entered what_star()" );
-}
+	{
+    	log.debug( "entered what_star()" );
+		System.out.println( "entered what_star()" );
+	}
     :
     STAR
     {
-        if ( aclItem.getWhatClause().getStarClause() == null )
-        {
-            aclItem.getWhatClause().setStarClause( new AclWhatClauseStar() );
-        }
-        else
-        {
-            throw new RecognitionException( "A star (*) what clause already exists in the ACL." );
-        }
+        aclItem.setWhatClause( new AclWhatClauseStar() );
     };
 
+// ----------------------------------------------------------------------------
+// The <what-dn> clause. We have three flavors :
+// - the basic style which takes a regex parameter
+// - the scope style that takes a DN parameter
+// - a simple DN
+//
+// <what-dn> ::= <basic-dn-clause | <scope-dn-clause>| SP? '=' SP? DN
+// ----------------------------------------------------------------------------
 what_dn
-{
-    log.debug( "entered what_dn()" );
-    
-    AclWhatClauseDn whatClauseDn = new AclWhatClauseDn();
-    
-    if ( aclItem.getWhatClause().getDnClause() == null )
-    {
-        aclItem.getWhatClause().setDnClause( whatClauseDn );
-    }
-    else
-    {
-        throw new RecognitionException( "A DN what clause already exists in the ACL." );
-    }
-}
-    :
-    ID_dn ( DOT what_dn_type )? ( SP )? EQUAL ( SP )? token:DOUBLE_QUOTED_STRING
-    {
-        whatClauseDn.setPattern( token.getText() );
-    }
-    ;
-    
-what_dn_type
-{
-    log.debug( "entered what_dn_type()" );
-    
-    AclWhatClause whatClause = aclItem.getWhatClause();
-    AclWhatClauseDn whatClauseDn =  whatClause.getDnClause();
-    
-    if ( whatClauseDn == null )
-    {
-        // Throw an exception ?
-        return;
-    }
-}
-    :
-    ID_regex
-    {
-        whatClauseDn.setType( AclWhatClauseDnTypeEnum.REGEX );
-    }
-    |
-    ID_base
-    {
-        whatClauseDn.setType( AclWhatClauseDnTypeEnum.BASE );
-    }
-    |
-    ID_exact
-    {
-        whatClauseDn.setType( AclWhatClauseDnTypeEnum.EXACT );
-    }
-    |
-    ID_one
-    {
-        whatClauseDn.setType( AclWhatClauseDnTypeEnum.ONE );
-    }
-    |
-    ID_subtree
-    {
-        whatClauseDn.setType( AclWhatClauseDnTypeEnum.SUBTREE );
-    }
-    |
-    ID_children
-    {
-        whatClauseDn.setType( AclWhatClauseDnTypeEnum.CHILDREN );
-    }
+	{
+	    log.debug( "entered what_dn()" );
+		System.out.println( "entered what_dn()" );
+	}
+    :
+	basic_dn_style
+	|
+	scope_dn_clause
+	|
+	(SP)? EQUAL (SP)? 
+	( 
+		{
+			System.out.println( "what-dn default" );
+		}
+		quoted_token:DOUBLE_QUOTED_STRING 
+	    {
+			AclWhatClauseDn whatClauseDn = new AclWhatClauseDn();
+			String dnString = quoted_token.getText();
+
+			try
+			{
+				new Dn( dnString );
+			}
+			catch ( LdapInvalidDnException lide )
+			{
+				throw new  RecognitionException( "The DN is invalid : " + dnString );
+			}
+			
+			whatClauseDn.setPattern( dnString );
+			aclItem.setWhatClause( whatClauseDn );
+	    }
+		| 
+		string_token:STRING 
+	    {
+			AclWhatClauseDn whatClauseDn = new AclWhatClauseDn();
+			String dnString = string_token.getText();
+			
+			try
+			{
+				new Dn( dnString );
+			}
+			catch ( LdapInvalidDnException lide )
+			{
+				throw new  RecognitionException( "The DN is invalid" + dnString );
+			}
+			
+			whatClauseDn.setPattern( dnString );
+			aclItem.setWhatClause( whatClauseDn );
+	    }
+	)
     ;
+	
+// ----------------------------------------------------------------------------
+// The <basic-dn-style> clause.
+//
+// <basic-dn-clause> ::= <exact-basic-dn-style> | <regex-basic-dn-style>
+//
+// ----------------------------------------------------------------------------
+basic_dn_style
+	{
+	    log.debug( "entered basic_dn_style()" );
+		System.out.println( "entered basic_dn_style()" );
+	}
+	:
+	exact_basic_dn_style | regex_basic_dn_style
+	;
+	
+// ----------------------------------------------------------------------------
+// The <exact-basic-dn-style> clause.
+//
+// <exact-basic-dn-clause> ::= '.' 'exact' SP? '=' SP? DN
+//
+// ----------------------------------------------------------------------------
+exact_basic_dn_style
+	{
+	    log.debug( "entered exact_basic_dn_style()" );
+		System.out.println( "entered basic_dn_style()" );
+		AclWhatClauseDn whatClauseDn = new AclWhatClauseDn();
+		whatClauseDn.setType( AclWhatClauseDnTypeEnum.EXACT );
+	}
+	:
+	DOT
+	(
+		ID_exact (SP)? EQUAL (SP)? 
+		( 
+			quoted_token:DOUBLE_QUOTED_STRING 
+			{
+				String dnString = quoted_token.getText();
+
+				try
+				{
+					new Dn( dnString );
+				}
+				catch ( LdapInvalidDnException lide )
+				{
+					throw new  RecognitionException( "The DN is invalid" + dnString );
+				}
+				
+				whatClauseDn.setPattern( dnString );
+			}
+			| 
+			string_token:STRING 
+			{
+				String dnString = string_token.getText();
+				
+				try
+				{
+					new Dn( dnString );
+				}
+				catch ( LdapInvalidDnException lide )
+				{
+					throw new  RecognitionException( "The DN is invalid" + dnString );
+				}
+				
+				whatClauseDn.setPattern( dnString );
+			}
+		)
+	)
+	{
+		aclItem.setWhatClause( whatClauseDn );
+	}
+	;
 
-what_attrs
-{
-    log.debug( "entered what_attrs()" );
-    
-    if ( aclItem.getWhatClause().getAttributesClause() == null )
-    {
-        aclItem.getWhatClause().setAttributesClause( new AclWhatClauseAttributes() );
-    }
-    else
-    {
-        throw new RecognitionException( "A attributes what clause already exists in the ACL." );
-    }
-}
-    :
-    ( ID_attrs | ID_attr ) ( SP )? EQUAL ( SP )? what_attrs_attr_ident ( SEP what_attrs_attr_ident )* ( SP what_attrs_val )?
+// ----------------------------------------------------------------------------
+// The <regex-basic-dn-style> clause.
+//
+// <regex-basic-dn-clause> ::= '.' 'regex' SP? '=' SP? REGEXP
+//
+// ----------------------------------------------------------------------------
+regex_basic_dn_style
+	{
+	    log.debug( "entered regex_basic_dn_style()" );
+		System.out.println( "entered regex_basic_dn_style()" );
+		AclWhatClauseDn whatClauseDn = new AclWhatClauseDn();
+		whatClauseDn.setType( AclWhatClauseDnTypeEnum.REGEX );
+	}
+	:
+	DOT
+	(
+		ID_regex (SP)? EQUAL (SP)? 
+		{
+			System.out.println( "In '='" );
+		}
+		( 
+			quoted_token:DOUBLE_QUOTED_STRING 
+			{
+				whatClauseDn.setPattern( quoted_token.getText() );
+			}
+			| 
+			string_token:STRING 
+			{
+				whatClauseDn.setPattern( string_token.getText() );
+			}
+		)
+	)
+	{
+		aclItem.setWhatClause( whatClauseDn );
+	}
+	;
+
+// ----------------------------------------------------------------------------
+// The <scope-dn-clause> clause.
+//
+// <scope-dn-clause> ::= <scope-dn-style> SP? '=' SP? DN
+// ----------------------------------------------------------------------------
+scope_dn_clause 
+	{
+	    log.debug( "entered scope_dn_clause()" );
+		System.out.println( "entered scope_dn_clause()" );
+		AclWhatClauseDn whatClauseDn = new AclWhatClauseDn();
+	}
+	:
+	scope_dn_style[whatClauseDn]
+	(SP)? EQUAL (SP)? 
+	( 
+		quoted_token:DOUBLE_QUOTED_STRING 
+	    {
+	        whatClauseDn.setPattern( quoted_token.getText() );
+	    }
+		| 
+		string_token:STRING 
+	    {
+	        whatClauseDn.setPattern( string_token.getText() );
+	    }
+	)
+	{
+		aclItem.setWhatClause( whatClauseDn );
+	}
+	;
+
+// ----------------------------------------------------------------------------
+// <scope-dn-style>	::= '.' 'base' | '.' 'baseobject' | '.' 'one' | 
+//						'.' 'onelevel' | '.' 'sub' | '.' 'subtree' | 
+//						'.' 'children'
+// ----------------------------------------------------------------------------
+scope_dn_style [AclWhatClauseDn whatClauseDn]
+	{
+	    log.debug( "entered scope_dn_style()" );
+		System.out.println( "entered scope_dn_style()" );
+	}
+    :
+	DOT
+	(
+		ID_base
+	    {
+	        whatClauseDn.setType( AclWhatClauseDnTypeEnum.BASE );
+	    }
+	    |
+	    ID_base_object
+	    {
+	        whatClauseDn.setType( AclWhatClauseDnTypeEnum.BASE_OBJECT );
+	    }
+	    |
+	    ID_one
+	    {
+	        whatClauseDn.setType( AclWhatClauseDnTypeEnum.ONE );
+	    }
+	    |
+	    ID_one_level
+	    {
+	        whatClauseDn.setType( AclWhatClauseDnTypeEnum.ONE_LEVEL );
+	    }
+	    |
+	    ID_sub
+	    {
+	        whatClauseDn.setType( AclWhatClauseDnTypeEnum.SUB );
+	    }
+	    |
+	    ID_subtree
+	    {
+	        whatClauseDn.setType( AclWhatClauseDnTypeEnum.SUBTREE );
+	    }
+	    |
+	    ID_children
+	    {
+	        whatClauseDn.setType( AclWhatClauseDnTypeEnum.CHILDREN );
+	    }
+	)
     ;
 
-what_attrs_val
-{
-    log.debug( "entered what_attrs_val()" );
-    
-    AclWhatClause whatClause = aclItem.getWhatClause();
-    AclWhatClauseAttributes whatClauseAttributes =  whatClause.getAttributesClause();
+// ----------------------------------------------------------------------------
+// <what-filter> ::= 'filter' SP? '=' SP? <ldapFilter>
+// ----------------------------------------------------------------------------
+what_filter
+	{
+	    log.debug( "entered what_filter()" );
+	    System.out.println( "entered what_filter()" );
     
-    if ( whatClauseAttributes == null )
-    {
-        // Throw an exception ?
-        return;
-    }
-}
+	    AclWhatClauseFilter whatClauseFilter = new AclWhatClauseFilter();
+	}
     :
-    ID_val ( what_attrs_matchingRule )? ( what_attrs_style )? ( SP )? EQUAL ( SP )? token:DOUBLE_QUOTED_STRING 
+    ID_filter ( SP )? EQUAL ( SP )? token:FILTER
     {
-        whatClauseAttributes.setVal( true );
-        whatClauseAttributes.setValue( token.getText() );
-    }
-    ;
+		// TODO : check tah the filter is valid
+        whatClauseFilter.setFilter( token.getText() );
 
-what_attrs_matchingRule
-{
-    log.debug( "entered what_attrs_matchingRule()" );
-    
-    AclWhatClause whatClause = aclItem.getWhatClause();
-    AclWhatClauseAttributes whatClauseAttributes =  whatClause.getAttributesClause();
+        aclItem.setWhatClause( whatClauseFilter );
+    };
     
-    if ( whatClauseAttributes == null )
-    {
-        // Throw an exception ?
-        return;
-    }
-}
+
+// ----------------------------------------------------------------------------
+// <what-attrs> ::= ( 'attrs' | 'attr' ) SP? '=' SP? <what-attrs-list>
+// ----------------------------------------------------------------------------
+what_attrs
+	{
+	    log.debug( "entered what_attrs()" );
+	    System.out.println( "entered what_attrs()" );
+
+	    //AclWhatClauseAttributes whatClauseAttributes = new AclWhatClauseAttributess();
+	}
     :
-    SLASH ID_matchingRule
-    {
-        whatClauseAttributes.setMatchingRule( true );
-    }
+    ( ID_attrs | ID_attr ) ( SP )? EQUAL ( SP )? what_attrs_list
     ;
 
-what_attrs_style
-{
-    log.debug( "entered what_attrs_style()" );
-    
-    AclWhatClause whatClause = aclItem.getWhatClause();
-    AclWhatClauseAttributes whatClauseAttributes =  whatClause.getAttributesClause();
-    
-    if ( whatClauseAttributes == null )
-    {
-        // Throw an exception ?
-        return;
-    }
-}
-    :
+// ----------------------------------------------------------------------------
+// <what-attrs-list>	::= IDENT <attr-val>? | <what_attr> <attr-list>
+// ----------------------------------------------------------------------------
+what_attrs_list
+	{
+	    log.debug( "entered what_attrs_list()" );
+	    System.out.println( "entered what_attrs_list()" );
+		
+	}
+	:
+	(
+		attribute:IDENT ( (attr_val)? | SEP attr_list )
+		{
+			// We are not allowed to have more than one attribute 
+			// if we have a val
+		}
+		|
+		ID_entry
+		|
+		ID_children
+	)
+	;
+
+// ----------------------------------------------------------------------------
+// <attr_val>	::= SP 'val' <matching-rule>? <attr-val-style> SP? '=' SP? REGEX
+// ----------------------------------------------------------------------------
+attr_val
+	{
+	    log.debug( "entered what_attrs_list()" );
+	    System.out.println( "entered what_attrs_list()" );
+	}
+	:
+	SP ID_val (matching_rule)? (attr_val_style)? (SP)? EQUAL (SP)? REGEX
+	;
+
+// ----------------------------------------------------------------------------
+// <matching-rule>	::= '/' IDENT
+// ----------------------------------------------------------------------------
+matching_rule
+	{
+	    log.debug( "entered matching_rule()" );
+	    System.out.println( "entered matching_rule()" );
+	}
+	:
+	SLASH IDENT
+	;
+
+// ----------------------------------------------------------------------------
+// <matching-rule>	::= '/' IDENT
+// ----------------------------------------------------------------------------
+attr_val_style
+	{
+	    log.debug( "entered attr_val_style()" );
+	    System.out.println( "entered attr_val_style()" );
+	}
+	:
     DOT 
     (
         ID_exact
         {
-            whatClauseAttributes.setStyle( AclAttributeStyleEnum.EXACT );
+            //whatClauseAttributes.setStyle( AclAttributeStyleEnum.EXACT );
         }
         |
         ID_base
         {
-            whatClauseAttributes.setStyle( AclAttributeStyleEnum.BASE );
+            //whatClauseAttributes.setStyle( AclAttributeStyleEnum.BASE );
         }
         |
         ID_base_object
         {
-            whatClauseAttributes.setStyle( AclAttributeStyleEnum.BASE_OBJECT );
+            //whatClauseAttributes.setStyle( AclAttributeStyleEnum.BASE_OBJECT );
         }
         |
         ID_regex
         {
-            whatClauseAttributes.setStyle( AclAttributeStyleEnum.REGEX );
-        }
-        |
-        ID_one
-        {
-            whatClauseAttributes.setStyle( AclAttributeStyleEnum.ONE );
-        }
-        |
-        ID_one_level
-        {
-            whatClauseAttributes.setStyle( AclAttributeStyleEnum.ONE_LEVEL );
-        }
-        |
-        ID_sub
-        {
-            whatClauseAttributes.setStyle( AclAttributeStyleEnum.SUB );
-        }
-        |
-        ID_subtree
-        {
-            whatClauseAttributes.setStyle( AclAttributeStyleEnum.SUBTREE );
-        }
-        |
-        ID_children
-        {
-            whatClauseAttributes.setStyle( AclAttributeStyleEnum.CHILDREN );
+            //whatClauseAttributes.setStyle( AclAttributeStyleEnum.REGEX );
         }
     )
-    ;
-    
-what_attrs_attr_ident
-{
-    log.debug( "entered what_attrs_attr_ident()" );
-    
-    AclWhatClause whatClause = aclItem.getWhatClause();
-    AclWhatClauseAttributes whatClauseAttributes =  whatClause.getAttributesClause();
-    
-    if ( whatClauseAttributes == null )
-    {
+	;
+	
+// ----------------------------------------------------------------------------
+// <attr-list> 		::= ( IDENT | 'entry' | 'children' ) ( ',' <attr_list> )*
+// ----------------------------------------------------------------------------
+attr_list
+	{
+	    log.debug( "entered attr_list()" );
+	    System.out.println( "entered attr_list()" );
+	}
+	:
+	(IDENT | ID_entry | ID_children) ( SEP attr_list )*
+	;
+	
+//what_attrs_val
+//{
+//    log.debug( "entered what_attrs_val()" );
+//    
+//    AclWhatClause whatClause = aclItem.getWhatClause();
+//    AclWhatClauseAttributes whatClauseAttributes =  whatClause.getAttributesClause();
+//    
+//    if ( whatClauseAttributes == null )
+//    {
+//        // Throw an exception ?
+//        return;
+//    }
+//}
+//    :
+//    ID_val ( what_attrs_matchingRule )? ( what_attrs_style )? ( SP )? EQUAL ( SP )? token:DOUBLE_QUOTED_STRING 
+//    {
+//        whatClauseAttributes.setVal( true );
+//        whatClauseAttributes.setValue( token.getText() );
+//    }
+//    ;
+
+//what_attrs_matchingRule
+//{
+//    log.debug( "entered what_attrs_matchingRule()" );
+//    
+//    AclWhatClause whatClause = aclItem.getWhatClause();
+//    AclWhatClauseAttributes whatClauseAttributes =  whatClause.getAttributesClause();
+//    
+//    if ( whatClauseAttributes == null )
+//    {
+//        // Throw an exception ?
+//        return;
+//    }
+//}
+//    :
+//    SLASH ID_matchingRule
+//    {
+//        whatClauseAttributes.setMatchingRule( true );
+//    }
+//    ;
+
+//what_attrs_style
+//{
+//    log.debug( "entered what_attrs_style()" );
+//    
+//    AclWhatClause whatClause = aclItem.getWhatClause();
+//    AclWhatClauseAttributes whatClauseAttributes =  whatClause.getAttributesClause();
+//    
+//    if ( whatClauseAttributes == null )
+//    {
         // Throw an exception ?
-        return;
-    }
-}
-    :
-    token:ATTR_IDENT
-    {
-        whatClauseAttributes.addAttribute( token.getText() );
-    }
-    ;
-
-what_filter
-{
-    log.debug( "entered what_filter()" );
-    
-    if ( aclItem.getWhatClause().getFilterClause() != null )
-    {
-        throw new RecognitionException( "A filter what clause already exists in the ACL." );
-    }
-}
-    :
-    ID_filter ( SP )? EQUAL ( SP )? token:FILTER
-    {
-        AclWhatClauseFilter whatClauseFilter = new AclWhatClauseFilter();
-        whatClauseFilter.setFilter( token.getText() );
+//        return;
+//    }
+//}
+//    :
+//    DOT 
+//    (
+//        ID_exact
+//        {
+//            whatClauseAttributes.setStyle( AclAttributeStyleEnum.EXACT );
+//        }
+//        |
+//        ID_base
+//        {
+//            whatClauseAttributes.setStyle( AclAttributeStyleEnum.BASE );
+//        }
+//        |
+//        ID_base_object
+//        {
+//            whatClauseAttributes.setStyle( AclAttributeStyleEnum.BASE_OBJECT );
+//        }
+//        |
+//        ID_regex
+//        {
+//            whatClauseAttributes.setStyle( AclAttributeStyleEnum.REGEX );
+//        }
+//        |
+//        ID_one
+//        {
+//            whatClauseAttributes.setStyle( AclAttributeStyleEnum.ONE );
+//        }
+//        |
+//        ID_one_level
+//        {
+//            whatClauseAttributes.setStyle( AclAttributeStyleEnum.ONE_LEVEL );
+//        }
+//        |
+//        ID_sub
+//        {
+//            whatClauseAttributes.setStyle( AclAttributeStyleEnum.SUB );
+//        }
+//        |
+//        ID_subtree
+//        {
+//            whatClauseAttributes.setStyle( AclAttributeStyleEnum.SUBTREE );
+//        }
+//        |
+//        ID_children
+//        {
+//            whatClauseAttributes.setStyle( AclAttributeStyleEnum.CHILDREN );
+//        }
+//    )
+//    ;
+    
+//what_attrs_attr_ident
+//{
+//    log.debug( "entered what_attrs_attr_ident()" );
+//    
+//    AclWhatClause whatClause = aclItem.getWhatClause();
+//    AclWhatClauseAttributes whatClauseAttributes =  whatClause.getAttributesClause();
+//    
+//    if ( whatClauseAttributes == null )
+//    {
+//        // Throw an exception ?
+//        return;
+//    }
+//}
+//    :
+//    token:IDENT
+//    {
+//        whatClauseAttributes.addAttribute( token.getText() );
+//    }
+//    ;
 
-        aclItem.getWhatClause().setFilterClause( whatClauseFilter );
-    };
-    
 who
 {
     log.debug( "entered who()" );
@@ -502,7 +806,7 @@ who_dnattr
     aclItem.addWhoClause( whoClauseDnAttr ); 
 }
     :
-    ID_dnattr ( SP )? EQUAL ( SP )? token:ATTR_IDENT
+    ID_dnattr ( SP )? EQUAL ( SP )? token:IDENT
     {
         whoClauseDnAttr.setAttribute( token.getText() );
     };
@@ -515,7 +819,7 @@ who_group
     aclItem.addWhoClause( whoClauseGroup ); 
 }
     :
-    ID_group ( SLASH objectclass:ATTR_IDENT ( SLASH attrname:ATTR_IDENT )? )? ( DOT who_group_type )? EQUAL pattern:DOUBLE_QUOTED_STRING
+    ID_group ( SLASH objectclass:IDENT ( SLASH attrname:IDENT )? )? ( DOT who_group_type )? EQUAL pattern:DOUBLE_QUOTED_STRING
     {
         if ( objectclass != null )
         {

Modified: directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttribute.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttribute.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttribute.java (original)
+++ directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttribute.java Fri Aug  4 08:59:15 2017
@@ -28,7 +28,7 @@ import org.apache.directory.studio.openl
 
 /**
  * A class used to store the WhatClause attributes with a qualifier (either '!' or '@').
- * We store either an AttributeType, or an ObjectClass (prefixed with '@' or '¬'), or one
+ * We store either an AttributeType, or an ObjectClass (prefixed with '@' or '!'), or one
  * of the two special values : 'entry' and 'children'
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>

Modified: directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttributeStyleEnum.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttributeStyleEnum.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttributeStyleEnum.java (original)
+++ directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttributeStyleEnum.java Fri Aug  4 08:59:15 2017
@@ -30,11 +30,6 @@ public enum AclAttributeStyleEnum
     BASE( "base" ),
     BASE_OBJECT( "baseobject" ),
     REGEX( "regex" ),
-    ONE( "one" ),
-    ONE_LEVEL( "onelevel" ),
-    SUB( "sub" ),
-    SUBTREE( "subtree" ),
-    CHILDREN( "children" ),
     NONE( "---" );
 
     /** The interned name */

Modified: directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttributeVal.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttributeVal.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttributeVal.java (original)
+++ directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclAttributeVal.java Fri Aug  4 08:59:15 2017
@@ -43,9 +43,10 @@ public class AclAttributeVal
     /** The MatchingRule flag */
     private boolean matchingRule;
     
-    /** The value */
+    /** The regex */
+    private String regex;
     private String value;
-
+    
     /**
      * @return the aclAttributes
      */

Modified: directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclItem.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclItem.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclItem.java (original)
+++ directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclItem.java Fri Aug  4 08:59:15 2017
@@ -46,7 +46,6 @@ public class AclItem
      */
     public AclItem()
     {
-        whatClause = new AclWhatClause();
     }
 
 
@@ -175,6 +174,7 @@ public class AclItem
                 {
                     sb.append( " " );
                 }
+                
                 sb.append( "by " );
                 sb.append( whoClause.toString() );
             }

Modified: directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClause.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClause.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClause.java (original)
+++ directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClause.java Fri Aug  4 08:59:15 2017
@@ -26,12 +26,6 @@ package org.apache.directory.studio.open
  */
 public class AclWhatClause
 {
-    /** The star (*) clause */
-    private AclWhatClauseStar starClause;
-
-    /** The DN clause */
-    private AclWhatClauseDn dnClause;
-
     /** The filter clause */
     private AclWhatClauseFilter filterClause;
 
@@ -47,25 +41,11 @@ public class AclWhatClause
     public AclWhatClause( AclWhatClauseStar starClause, AclWhatClauseDn dnClause, AclWhatClauseFilter filterClause,
         AclWhatClauseAttributes attributesClause )
     {
-        this.starClause = starClause;
-        this.dnClause = dnClause;
         this.filterClause = filterClause;
         this.attributesClause = attributesClause;
     }
 
 
-    public AclWhatClause( AclWhatClauseStar starClause )
-    {
-        this.starClause = starClause;
-    }
-
-
-    public AclWhatClause( AclWhatClauseDn dnClause )
-    {
-        this.dnClause = dnClause;
-    }
-
-
     public AclWhatClause( AclWhatClauseFilter filterClause )
     {
         this.filterClause = filterClause;
@@ -88,15 +68,6 @@ public class AclWhatClause
 
 
     /**
-     * @return the dnClause
-     */
-    public AclWhatClauseDn getDnClause()
-    {
-        return dnClause;
-    }
-
-
-    /**
      * @return the filterClause
      */
     public AclWhatClauseFilter getFilterClause()
@@ -106,15 +77,6 @@ public class AclWhatClause
 
 
     /**
-     * @return the starClause
-     */
-    public AclWhatClauseStar getStarClause()
-    {
-        return starClause;
-    }
-
-
-    /**
      * @param attributesClause the attributesClause to set
      */
     public void setAttributesClause( AclWhatClauseAttributes attributesClause )
@@ -124,93 +86,10 @@ public class AclWhatClause
 
 
     /**
-     * @param dnClause the dnClause to set
-     */
-    public void setDnClause( AclWhatClauseDn dnClause )
-    {
-        this.dnClause = dnClause;
-    }
-
-
-    /**
      * @param filterClause the filterClause to set
      */
     public void setFilterClause( AclWhatClauseFilter filterClause )
     {
         this.filterClause = filterClause;
     }
-
-
-    /**
-     * @param starClause the starClause to set
-     */
-    public void setStarClause( AclWhatClauseStar starClause )
-    {
-        this.starClause = starClause;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public String toString()
-    {
-        StringBuilder sb = new StringBuilder();
-
-        boolean isFirst = true;
-
-        // Star (*) clause
-        if ( starClause != null )
-        {
-            isFirst = false;
-            sb.append( starClause.toString() );
-        }
-
-        // DN clause
-        if ( dnClause != null )
-        {
-            if ( isFirst )
-            {
-                isFirst = false;
-            }
-            else
-            {
-                sb.append( " " );
-            }
-
-            sb.append( dnClause.toString() );
-        }
-
-        // Filter clause
-        if ( filterClause != null )
-        {
-            if ( isFirst )
-            {
-                isFirst = false;
-            }
-            else
-            {
-                sb.append( " " );
-            }
-
-            sb.append( filterClause.toString() );
-        }
-
-        // Attributes clause
-        if ( attributesClause != null )
-        {
-            if ( isFirst )
-            {
-                isFirst = false;
-            }
-            else
-            {
-                sb.append( " " );
-            }
-
-            sb.append( attributesClause.toString() );
-        }
-
-        return sb.toString();
-    }
 }

Modified: directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseAttributes.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseAttributes.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseAttributes.java (original)
+++ directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseAttributes.java Fri Aug  4 08:59:15 2017
@@ -25,26 +25,25 @@ import java.util.Collection;
 import java.util.List;
 
 /**
- * The Acl what-attrs clause.
+ * The Acl what-attrs clause. We either have an attribute val clause, or an attribute list clause.  
  * 
  * <pre>
- * attrs ::= attrlist val-e
- * attrlist ::= attr attr-e
- * attr-e ::= ',' attr attr-e
- * attr :: attributeType | '!' objectClass | '@' objectClass | 'entry' | 'children'
- * val-e ::= 'val' matchingRule style '=' attrval | e
- * matchingRule ::= '/matchingRule' | e
- * style ::= '.exact' | '.base' | '.baseobject' | '.regex' | '.one' | '.onelevel' | '.sub' | '.subtree' | '.children'
- * attrval ::= STRING 
+ * <what-attrs>		::= ( 'attrs' | 'attr' ) SP '=' SP <attrs>
+ * <attrs>			::= IDENT SP 'val' <mr-e> <attr-val-style> SP? '=' SP? REGEX | <what-attr> <what-attr-list>
+ * <attr-val-style>	::= '.' <basic-style> | e
+ * <basic-style>	::= 'exact' | 'base' | 'baseobject' | 'regex'
+ * <mr-e>			::= '/' IDENT | e
+ * <what-attr-list>	::= ',' <what-attr> <what-attr-list> | e
+ * <what-attr> 		::= IDENT | '@' IDENT | '!' IDENT | 'entry' | 'children'
  * </pre>
+ * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AclWhatClauseAttributes
+public class AclWhatClauseAttributes extends AclWhatClause 
 {
     /** The attributeVal element */
     private AclAttributeVal aclAttributeVal;
     
-    
     /**
      * Creates an instance of AclWhatClauseAttributes
      */

Modified: directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseDn.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseDn.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseDn.java (original)
+++ directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseDn.java Fri Aug  4 08:59:15 2017
@@ -21,13 +21,27 @@ package org.apache.directory.studio.open
 
 
 /**
- * The  Acl what-dn clause.
+ * The  Acl what-dn clause. It has a type and a pattern.
+ * The type is one of :
+ * <ul>
+ *   <li>base : AclWhatClauseDnTypeEnum.BASE</li>
+ *   <li>baseObject : AclWhatClauseDnTypeEnum.BASE_OBJECT</li>
+ *   <li>one : AclWhatClauseDnTypeEnum.ONE</li>
+ *   <li>oneLevel : AclWhatClauseDnTypeEnum.ONE_LEVEL</li>
+ *   <li>sub/subtree : AclWhatClauseDnTypeEnum.SUB</li>
+ *   <li>subtree : AclWhatClauseDnTypeEnum.SUBTREE</li>
+ *   <li>children : AclWhatClauseDnTypeEnum.CHILDREN</li>
+ *   <li>exact : AclWhatClauseDnTypeEnum.EXACT</li>
+ *   <li>regex : AclWhatClauseDnTypeEnum.REGEX</li>
+ * </ul>
+ * 
+ * The pattern can be a DN or a regexp, depending on the type.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AclWhatClauseDn
+public class AclWhatClauseDn extends AclWhatClause
 {
-    /** The type */
+    /** The type, default to BASE */
     private AclWhatClauseDnTypeEnum type;
 
     /** The pattern */

Modified: directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseFilter.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseFilter.java?rev=1804081&r1=1804080&r2=1804081&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseFilter.java (original)
+++ directory/studio/branches/studio-value/plugins/openldap.acl.editor/src/main/java/org/apache/directory/studio/openldap/config/acl/model/AclWhatClauseFilter.java Fri Aug  4 08:59:15 2017
@@ -21,10 +21,11 @@ package org.apache.directory.studio.open
 
 
 /**
+ * The Acl what-filter clause. It stores a Ldap Filter.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AclWhatClauseFilter
+public class AclWhatClauseFilter extends AclWhatClause
 {
     /** The filter */
     private String filter;



Mime
View raw message