directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r568180 - in /directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor: ./ controller/ controller/actions/ view/editors/schema/ view/search/ view/views/ view/wizards/
Date Tue, 21 Aug 2007 16:04:28 GMT
Author: pamarcelot
Date: Tue Aug 21 09:04:26 2007
New Revision: 568180

URL: http://svn.apache.org/viewvc?rev=568180&view=rev
Log:
Added logging methods.
Added logging where needed.

Modified:
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/PluginUtils.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/HierarchyViewController.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenElementAction.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenTypeHierarchyAction.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/schema/SchemaEditorOverviewPage.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/search/SearchPage.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportProjectsWizard.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
    directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/PluginUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/PluginUtils.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/PluginUtils.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/PluginUtils.java
Tue Aug 21 09:04:26 2007
@@ -32,6 +32,8 @@
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.ProjectsExporter;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.ProjectsImportException;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.ProjectsImporter;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
+import org.eclipse.core.runtime.Status;
 
 
 /**
@@ -140,7 +142,9 @@
             }
             catch ( ProjectsImportException e )
             {
-                // TODO Add an error and a log
+                PluginUtils.logError( "An error occured when loading the projects.", e );
+                ViewUtils.displayErrorMessageBox( "Projects Loading Error",
+                    "An error occured when loading the projects." );
             }
 
             for ( Project project : projects )
@@ -167,7 +171,40 @@
         }
         catch ( IOException e )
         {
-            // TODO Add an error and a log
+            PluginUtils.logError( "An error occured when saving the projects.", e );
+            ViewUtils.displayErrorMessageBox( "Projects Saving Error", "An error occured
when saving the projects." );
         }
+    }
+
+
+    /**
+     * Logs the given message and exception with the ERROR status level.
+     * 
+     * @param message
+     *      the message
+     * @param exception
+     *      the exception
+     */
+    public static void logError( String message, Throwable exception )
+    {
+        Activator.getDefault().getLog().log(
+            new Status( Status.ERROR, Activator.getDefault().getBundle().getSymbolicName(),
Status.OK, message,
+                exception ) );
+    }
+
+
+    /**
+     * Logs the given message and exception with the WARNING status level.
+     * 
+     * @param message
+     *      the message
+     * @param exception
+     *      the exception
+     */
+    public static void logWarning( String message, Throwable exception )
+    {
+        Activator.getDefault().getLog().log(
+            new Status( Status.WARNING, Activator.getDefault().getBundle().getSymbolicName(),
Status.OK, message,
+                exception ) );
     }
 }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/HierarchyViewController.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/HierarchyViewController.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/HierarchyViewController.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/HierarchyViewController.java
Tue Aug 21 09:04:26 2007
@@ -26,11 +26,13 @@
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.LinkWithEditorHierarchyViewAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.OpenHierarchyViewPreferencesAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.ShowSubtypeHierarchyAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.ShowSupertypeHierarchyAction;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditor;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditorInput;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.objectclass.ObjectClassEditor;
@@ -129,7 +131,8 @@
                 }
                 catch ( PartInitException e )
                 {
-                    // TODO Add an error and a log
+                    PluginUtils.logError( "An error occured when opening the editor.", e
);
+                    ViewUtils.displayErrorMessageBox( "Error", "An error occured when opening
the editor." );
                 }
             }
         }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/ProblemsViewController.java
Tue Aug 21 09:04:26 2007
@@ -22,11 +22,13 @@
 
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
 import org.apache.directory.studio.apacheds.schemaeditor.model.schemachecker.SchemaChecker;
 import org.apache.directory.studio.apacheds.schemaeditor.model.schemachecker.SchemaCheckerListener;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditor;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditorInput;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.objectclass.ObjectClassEditor;
@@ -241,7 +243,8 @@
                     }
                     catch ( PartInitException e )
                     {
-                        // TODO Add an error and a log
+                        PluginUtils.logError( "An error occured when opening the editor.",
e );
+                        ViewUtils.displayErrorMessageBox( "Error", "An error occured when
opening the editor." );
                     }
                 }
             }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
Tue Aug 21 09:04:26 2007
@@ -25,6 +25,7 @@
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.CollapseAllAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.ConnectAction;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.DeleteSchemaElementAction;
@@ -45,6 +46,7 @@
 import org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditor;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditorInput;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.objectclass.ObjectClassEditor;
@@ -606,7 +608,8 @@
                     }
                     catch ( PartInitException e )
                     {
-                        // TODO Add an error and a log
+                        PluginUtils.logError( "An error occured when opening the editor.",
e );
+                        ViewUtils.displayErrorMessageBox( "Error", "An error occured when
opening the editor." );
                     }
                 }
             }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenElementAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenElementAction.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenElementAction.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenElementAction.java
Tue Aug 21 09:04:26 2007
@@ -23,6 +23,8 @@
 import java.util.Iterator;
 
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditor;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditorInput;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.objectclass.ObjectClassEditor;
@@ -88,7 +90,8 @@
                 }
                 catch ( PartInitException e )
                 {
-                    // TODO Add an error and a log
+                    PluginUtils.logError( "An error occured when opening the editor.", e
);
+                    ViewUtils.displayErrorMessageBox( "Error", "An error occured when opening
the editor." );
                 }
             }
             else if ( selectedItem instanceof ObjectClassWrapper )
@@ -101,7 +104,8 @@
                 }
                 catch ( PartInitException e )
                 {
-                    // TODO Add an error and a log
+                    PluginUtils.logError( "An error occured when opening the editor.", e
);
+                    ViewUtils.displayErrorMessageBox( "Error", "An error occured when opening
the editor." );
                 }
             }
             else if ( selectedItem instanceof SchemaWrapper )
@@ -113,7 +117,8 @@
                 }
                 catch ( PartInitException e )
                 {
-                    // TODO Add an error and a log
+                    PluginUtils.logError( "An error occured when opening the editor.", e
);
+                    ViewUtils.displayErrorMessageBox( "Error", "An error occured when opening
the editor." );
                 }
             }
             else if ( selectedItem instanceof Folder )

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenTypeHierarchyAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenTypeHierarchyAction.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenTypeHierarchyAction.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/actions/OpenTypeHierarchyAction.java
Tue Aug 21 09:04:26 2007
@@ -22,6 +22,8 @@
 
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditor;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.objectclass.ObjectClassEditor;
 import org.apache.directory.studio.apacheds.schemaeditor.view.views.HierarchyView;
@@ -163,7 +165,8 @@
             }
             catch ( PartInitException e )
             {
-                // TODO Add an error and a log
+                PluginUtils.logError( "An error occured when opening the view.", e );
+                ViewUtils.displayErrorMessageBox( "Error", "An error occured when opening
the view." );
             }
         }
 

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/schema/SchemaEditorOverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/schema/SchemaEditorOverviewPage.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/schema/SchemaEditorOverviewPage.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/editors/schema/SchemaEditorOverviewPage.java
Tue Aug 21 09:04:26 2007
@@ -22,12 +22,14 @@
 
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.SchemaAdapter;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.SchemaHandler;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.SchemaListener;
 import org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditor;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditorInput;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.objectclass.ObjectClassEditor;
@@ -152,7 +154,8 @@
                 }
                 catch ( PartInitException exception )
                 {
-                    // TODO Add an error and a log
+                    PluginUtils.logError( "An error occured when opening the editor.", exception
);
+                    ViewUtils.displayErrorMessageBox( "Error", "An error occured when opening
the editor." );
                 }
             }
         }
@@ -179,7 +182,8 @@
                 }
                 catch ( PartInitException exception )
                 {
-                    // TODO Add an error and a log
+                    PluginUtils.logError( "An error occured when opening the editor.", exception
);
+                    ViewUtils.displayErrorMessageBox( "Error", "An error occured when opening
the editor." );
                 }
             }
         }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/search/SearchPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/search/SearchPage.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/search/SearchPage.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/search/SearchPage.java
Tue Aug 21 09:04:26 2007
@@ -27,6 +27,8 @@
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.view.views.SearchView;
 import org.eclipse.jface.dialogs.DialogPage;
 import org.eclipse.jface.dialogs.IDialogSettings;
@@ -285,7 +287,8 @@
         }
         catch ( PartInitException e )
         {
-            // TODO Add an error and a log
+            PluginUtils.logError( "An error occured when opening the view.", e );
+            ViewUtils.displayErrorMessageBox( "Error", "An error occured when opening the
view." );
         }
 
         return true;

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/views/SearchView.java
Tue Aug 21 09:04:26 2007
@@ -29,10 +29,12 @@
 import org.apache.directory.shared.ldap.schema.SchemaObject;
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
 import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.SchemaHandler;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.SearchViewController;
 import org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditor;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.attributetype.AttributeTypeEditorInput;
 import org.apache.directory.studio.apacheds.schemaeditor.view.editors.objectclass.ObjectClassEditor;
@@ -445,8 +447,8 @@
 
 
     /**
-    * Open the editor associated with the current selection in the table.
-    */
+     * Open the editor associated with the current selection in the table.
+     */
     private void openEditor()
     {
         if ( Activator.getDefault().getSchemaHandler() != null )
@@ -482,7 +484,8 @@
                     }
                     catch ( PartInitException exception )
                     {
-                        // TODO Add an error and a log
+                        PluginUtils.logError( "An error occured when opening the editor.",
exception );
+                        ViewUtils.displayErrorMessageBox( "Error", "An error occured when
opening the editor." );
                     }
                 }
             }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportProjectsWizard.java
Tue Aug 21 09:04:26 2007
@@ -26,8 +26,10 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.ProjectsExporter;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -95,7 +97,10 @@
                         }
                         catch ( IOException e )
                         {
-                            // TODO Add an error and a log
+                            PluginUtils.logError( "An error occured when saving the project
" + project.getName() + ".",
+                                e );
+                            ViewUtils.displayErrorMessageBox( "Error", "An error occured
when saving the project "
+                                + project.getName() + "." );
                         }
                         monitor.worked( 1 );
                     }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsOpenLdapWizard.java
Tue Aug 21 09:04:26 2007
@@ -26,8 +26,10 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.OpenLdapSchemaFileExporter;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -95,7 +97,10 @@
                         }
                         catch ( IOException e )
                         {
-                            // TODO Add an error and a log
+                            PluginUtils.logError( "An error occured when saving the schema
" + schema.getName() + ".",
+                                e );
+                            ViewUtils.displayErrorMessageBox( "Error", "An error occured
when saving the schema "
+                                + schema.getName() + "." );
                         }
                         monitor.worked( 1 );
                     }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasAsXmlWizard.java
Tue Aug 21 09:04:26 2007
@@ -26,8 +26,10 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.XMLSchemaFileExporter;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -98,7 +100,10 @@
                             }
                             catch ( IOException e )
                             {
-                                // TODO Add an error and a log
+                                PluginUtils.logError( "An error occured when saving the schema
" + schema.getName()
+                                    + ".", e );
+                                ViewUtils.displayErrorMessageBox( "Error", "An error occured
when saving the schema "
+                                    + schema.getName() + "." );
                             }
                             monitor.worked( 1 );
                         }
@@ -133,7 +138,8 @@
                         }
                         catch ( IOException e )
                         {
-                            // TODO Add an error and a log
+                            PluginUtils.logError( "An error occured when saving the schemas.",
e );
+                            ViewUtils.displayErrorMessageBox( "Error", "An error occured
when saving the schemas." );
                         }
                         monitor.worked( 1 );
                         monitor.done();

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasForADSWizard.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ExportSchemasForADSWizard.java
Tue Aug 21 09:04:26 2007
@@ -36,10 +36,12 @@
 import org.apache.directory.shared.converter.schema.AttributeTypeHolder;
 import org.apache.directory.shared.converter.schema.ObjectClassHolder;
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.SchemaHandler;
 import org.apache.directory.studio.apacheds.schemaeditor.model.AttributeTypeImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.ObjectClassImpl;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -118,11 +120,17 @@
                             }
                             catch ( IOException e )
                             {
-                                // TODO Add an error and a log
+                                PluginUtils.logError( "An error occured when saving the schema
" + schema.getName()
+                                    + ".", e );
+                                ViewUtils.displayErrorMessageBox( "Error", "An error occured
when saving the schema "
+                                    + schema.getName() + "." );
                             }
                             catch ( NamingException e )
                             {
-                                // TODO Add an error and a log
+                                PluginUtils.logError( "An error occured when saving the schema
" + schema.getName()
+                                    + ".", e );
+                                ViewUtils.displayErrorMessageBox( "Error", "An error occured
when saving the schema "
+                                    + schema.getName() + "." );
                             }
                             monitor.worked( 1 );
                         }
@@ -165,7 +173,10 @@
                             }
                             catch ( NamingException e )
                             {
-                                // TODO Add an error and a log
+                                PluginUtils.logError( "An error occured when saving the schema
" + schema.getName()
+                                    + ".", e );
+                                ViewUtils.displayErrorMessageBox( "Error", "An error occured
when saving the schema "
+                                    + schema.getName() + "." );
                             }
                         }
 
@@ -177,7 +188,9 @@
                         }
                         catch ( IOException e )
                         {
-                            // TODO Add an error and a log
+                            PluginUtils.logError( "An error occured when saving the schemas.",
+                                e );
+                            ViewUtils.displayErrorMessageBox( "Error", "An error occured
when saving the schemas." );
                         }
                         monitor.worked( 1 );
                         monitor.done();

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportProjectsWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportProjectsWizard.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportProjectsWizard.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportProjectsWizard.java
Tue Aug 21 09:04:26 2007
@@ -24,10 +24,12 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.ProjectsHandler;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.ProjectsImportException;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.ProjectsImporter;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -91,7 +93,10 @@
                         }
                         catch ( ProjectsImportException e )
                         {
-                            // TODO Add an error and a log
+                            PluginUtils.logError( "An error occured when importing project
" + projectFile.getName()
+                                + ".", e );
+                            ViewUtils.displayErrorMessageBox( "Import Error",
+                                "An error occured when importing project " + projectFile.getName()
+ "." );
                         }
                         monitor.worked( 1 );
                     }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromOpenLdapWizard.java
Tue Aug 21 09:04:26 2007
@@ -24,11 +24,13 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.SchemaHandler;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.OpenLdapSchemaFileImportException;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.OpenLdapSchemaFileImporter;
 import org.apache.directory.studio.apacheds.schemaeditor.model.schemachecker.SchemaChecker;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -97,7 +99,10 @@
                         }
                         catch ( OpenLdapSchemaFileImportException e )
                         {
-                            // TODO Add an error and a log
+                            PluginUtils.logError( "An error occured when importing the schema
" + schemaFile.getName()
+                                + ".", e );
+                            ViewUtils.displayErrorMessageBox( "Error", "An error occured
when importing the schema "
+                                + schemaFile.getName() + "." );
                         }
                         monitor.worked( 1 );
                     }

Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java?rev=568180&r1=568179&r2=568180&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
(original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/ImportSchemasFromXmlWizard.java
Tue Aug 21 09:04:26 2007
@@ -24,12 +24,14 @@
 import java.lang.reflect.InvocationTargetException;
 
 import org.apache.directory.studio.apacheds.schemaeditor.Activator;
+import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
 import org.apache.directory.studio.apacheds.schemaeditor.controller.SchemaHandler;
 import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.XMLSchemaFileImportException;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.XMLSchemaFileImporter;
 import org.apache.directory.studio.apacheds.schemaeditor.model.io.XMLSchemaFileImporter.SchemaFileType;
 import org.apache.directory.studio.apacheds.schemaeditor.model.schemachecker.SchemaChecker;
+import org.apache.directory.studio.apacheds.schemaeditor.view.ViewUtils;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -111,7 +113,9 @@
                         }
                         catch ( XMLSchemaFileImportException e )
                         {
-                            // TODO Add an error and a log
+                            PluginUtils.logError( "An error occured when importing  the schema
" + schemaFile + ".", e );
+                            ViewUtils.displayErrorMessageBox( "Error", "An error occured
when saving the schema "
+                                + schemaFile + "." );
                         }
                         monitor.worked( 1 );
                     }



Mime
View raw message