directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1060738 - in /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2: actions/ jobs/
Date Wed, 19 Jan 2011 10:08:45 GMT
Author: pamarcelot
Date: Wed Jan 19 10:08:44 2011
New Revision: 1060738

URL: http://svn.apache.org/viewvc?rev=1060738&view=rev
Log:
Better handling of exceptions occuring during the loading of the configuration.

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java?rev=1060738&r1=1060737&r2=1060738&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/EditorExportConfigurationAction.java
Wed Jan 19 10:08:44 2011
@@ -31,7 +31,6 @@ import org.eclipse.core.runtime.IProgres
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
 
 
 /**
@@ -89,13 +88,12 @@ public class EditorExportConfigurationAc
                 {
                     try
                     {
-                        // Saving the configuration as a new file and getting the associated
new editor input
-                        IEditorInput newInput = ServerConfigurationEditorUtils.doSaveAs(
monitor, editor.getSite()
-                            .getShell(),
-                            editor.getEditorInput(), editor.getConfigWriter() );
+                        ServerConfigurationEditorUtils.doSaveAs( monitor, editor.getSite()
+                            .getShell(), editor.getEditorInput(), editor.getConfigWriter()
);
                     }
                     catch ( Exception e )
                     {
+
                         // TODO handle the exception
                     }
                 }

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java?rev=1060738&r1=1060737&r2=1060738&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/actions/OpenConfigurationAction.java
Wed Jan 19 10:08:44 2011
@@ -21,23 +21,8 @@
 package org.apache.directory.studio.apacheds.configuration.v2.actions;
 
 
-import java.io.File;
-import java.util.List;
-
-import org.apache.directory.server.config.ConfigPartitionReader;
-import org.apache.directory.server.config.beans.ConfigBean;
-import org.apache.directory.server.core.partition.ldif.SingleFileLdifPartition;
-import org.apache.directory.shared.ldap.name.DN;
-import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
-import org.apache.directory.shared.ldap.schemaloader.LdifSchemaLoader;
-import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
-import org.apache.directory.shared.ldap.util.LdapExceptionUtils;
-import org.apache.directory.studio.apacheds.configuration.v2.ApacheDS2ConfigurationPlugin;
 import org.apache.directory.studio.apacheds.configuration.v2.editor.ConnectionServerConfigurationInput;
-import org.apache.directory.studio.apacheds.configuration.v2.editor.NewServerConfigurationInput;
 import org.apache.directory.studio.apacheds.configuration.v2.editor.ServerConfigurationEditor;
-import org.apache.directory.studio.apacheds.configuration.v2.editor.ServerConfigurationInput;
 import org.apache.directory.studio.connection.core.Connection;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.viewers.ISelection;

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java?rev=1060738&r1=1060737&r2=1060738&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/jobs/LoadConfigurationRunnable.java
Wed Jan 19 10:08:44 2011
@@ -133,14 +133,17 @@ public class LoadConfigurationRunnable i
         }
         catch ( Exception e )
         {
+            // Reporting the error to the monitor
+            monitor.reportError( e );
+            
             // Reporting the error to the editor
             final Exception exception = e;
             Display.getDefault().asyncExec( new Runnable()
             {
                 public void run()
-            {
-                editor.configurationLoadFailed( exception );
-            }
+                {
+                    editor.configurationLoadFailed( exception );
+                }
             } );
         }
     }
@@ -291,7 +294,7 @@ public class LoadConfigurationRunnable i
             // Checking if an error occurred
             if ( monitor.errorsReported() )
             {
-                return null;
+                throw monitor.getException();
             }
 
             // Getting the entry
@@ -348,7 +351,7 @@ public class LoadConfigurationRunnable i
                 // Checking if an error occurred
                 if ( monitor.errorsReported() )
                 {
-                    return null;
+                    throw monitor.getException();
                 }
 
                 while ( childrenEnumeration.hasMore() )



Mime
View raw message