merge-update from trunk
authorPatric Plitzner <p.plitzner@bgbm.org>
Wed, 17 Sep 2014 12:39:35 +0000 (12:39 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Wed, 17 Sep 2014 12:39:35 +0000 (12:39 +0000)
21 files changed:
.gitattributes
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/update/P2Util.java
eu.etaxonomy.taxeditor.bulkeditor/plugin.xml
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/BulkEditor.java
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AbstractAddDerivedUnitFacadeMediaHandler.java [deleted file]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddDerivedUnitMediaHandler.java [deleted file]
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddFieldObjectMediaHandler.java [deleted file]
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DescriptionsMenuPropertyTester.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/AddDerivedUnitFacadeMediaOperation.java [moved from eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/operation/AddDerivedUnitFacadeMediaOperation.java with 65% similarity]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/handler/AddImageGalleryHandler.java
eu.etaxonomy.taxeditor.feature.platform/feature.xml
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/key/polytomous/operation/DeleteOperation.java
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/CdmErrorDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasMedia.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/derivateSearch/DerivateLabelProvider.java
eu.etaxonomy.taxeditor/pom.xml
pom.xml

index 9dc7404e21d3d8eee028d14cc40b5df93cb84f8f..d0074abc6023627745cb94d697dc906735c986be 100644 (file)
@@ -86,10 +86,6 @@ eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkedito
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicMarkerTypeEditingMenu.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/DynamicNewObjectMenu.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AbstractAddDerivedUnitFacadeMediaHandler.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddDerivedUnitMediaHandler.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddFieldObjectMediaHandler.java -text
-eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/operation/AddDerivedUnitFacadeMediaOperation.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/MergeGroupHandler.java -text
 eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/OpenBulkEditorHandler.java -text
@@ -560,6 +556,7 @@ eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/d
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/DynamicFeatureMenu.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionElementsHandler.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/handler/MoveDescriptionToOtherTaxonHandler.java -text
+eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/AddDerivedUnitFacadeMediaOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateDescriptionElementOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateSpecimenDescriptionOperation.java -text
 eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/operation/CreateTaxonDescriptionOperation.java -text
@@ -1273,6 +1270,7 @@ eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IElement
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartChangeListener.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasDetails.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasFactualData.java -text
+eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasMedia.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasSupplementalData.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java -text
 eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/LineSelection.java -text
index 13ecaafddcb8f446724c29be4e815bb979201cbb..f73213854e72a1acd50b58567735a5a93e2038e2 100644 (file)
@@ -44,8 +44,9 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  */
 public class P2Util {
 
-    //private static String LOCAL_UPDATE_SITE = "file:///home/cmathew/Development/EDIT/taxeditor/eu.etaxonomy.taxeditor/target/repository/";
+    //private static String LOCAL_UPDATE_SITE = "file:///path/.../to/Development/EDIT/taxeditor/eu.etaxonomy.taxeditor/target/repository/";
     private static String EDIT_NIGHTLY_UPDATE_SITE = "http://cybertaxonomy.eu/download/taxeditor/update/nightly/";
+    private static String EDIT_SNAPSHOT_UPDATE_SITE = "http://cybertaxonomy.eu/download/taxeditor/update/snapshot/";
     private static String EDIT_STABLE_UPDATE_SITE = "http://cybertaxonomy.eu/download/taxeditor/update/stable/";
 
     public static void setUpdateRepositories(UpdateOperation operation) throws URISyntaxException {
index bfc5ed5f163ca32edfe835a1b6157ebf019accc4..7d069767e433d913a04255aa971e2cb8ef3f84ea 100644 (file)
                style="push">\r
          </command>\r
       </menuContribution>\r
-      <menuContribution\r
-            allPopups="false"\r
-            locationURI="popup:eu.etaxonomy.taxeditor.editor.view.media">\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addDerivedUnitMedia"\r
-               label="Add Derived Unit Media"\r
-               style="push">\r
-            <visibleWhen>\r
-               <not>\r
-                  <reference\r
-                        definitionId="isTaxonEditor">\r
-                  </reference>\r
-               </not>\r
-            </visibleWhen>\r
-         </command>\r
-         <command\r
-               commandId="eu.etaxonomy.taxeditor.bulkeditor.command.derivedunit.addFieldObjectMedia"\r
-               label="Add Field Object Media"\r
-               style="push">\r
-            <visibleWhen>\r
-               <not>\r
-                  <reference\r
-                        definitionId="isTaxonEditor">\r
-                  </reference>\r
-               </not>\r
-            </visibleWhen>\r
-         </command>\r
-      </menuContribution>\r
       <menuContribution\r
             allPopups="false"\r
             locationURI="popup:#DataImportEditorContext">\r
             properties="isMergingEnabled"\r
             type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
       </propertyTester>\r
+      <propertyTester\r
+            class="eu.etaxonomy.taxeditor.bulkeditor.PropertyTester"\r
+            id="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
+            namespace="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
+            properties="isDerivedUnitEditor"\r
+            type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
+      </propertyTester>\r
    </extension>\r
    <extension\r
          point="org.eclipse.ui.handlers">\r
             name="%page.name.0">\r
       </page>\r
    </extension>\r
-   <extension\r
-         point="org.eclipse.core.expressions.propertyTesters">\r
-      <propertyTester\r
-            class="eu.etaxonomy.taxeditor.bulkeditor.PropertyTester"\r
-            id="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
-            namespace="eu.etaxonomy.taxeditor.bulkeditor.propertyTester"\r
-            properties="isDerivedUnitEditor"\r
-            type="eu.etaxonomy.taxeditor.bulkeditor.BulkEditor">\r
-      </propertyTester>\r
-   </extension>\r
    <extension\r
          point="org.eclipse.ui.perspectiveExtensions">\r
       <perspectiveExtension\r
index d68d48c1cc80273784a6778da3b02cbc6de3d168..73bf55b4539c60bd16f84dcfbdb85d191291f4a3 100644 (file)
@@ -44,17 +44,21 @@ import eu.etaxonomy.taxeditor.annotatedlineeditor.LineAnnotationModel;
 import eu.etaxonomy.taxeditor.bulkeditor.input.AbstractBulkEditorInput;
 import eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
 import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
- * <p>BulkEditor class.</p>
+ * <p>
+ * BulkEditor class.
+ * </p>
  *
  * @author p.ciardelli
  * @created 07.07.2009
  * @version 1.0
  */
-public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDetails, IDirtyMarkableSelectionProvider{
+public class BulkEditor extends AnnotatedLineEditor implements IPartContentHasDetails, IPartContentHasMedia,
+        IDirtyMarkableSelectionProvider {
 
        /** Constant <code>ID="bulkeditor.editor"</code> */
        public static final String ID = "bulkeditor.editor";
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AbstractAddDerivedUnitFacadeMediaHandler.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AbstractAddDerivedUnitFacadeMediaHandler.java
deleted file mode 100644 (file)
index 4402368..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.common.NotDefinedException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
-import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
-import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
-import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
-
-/**
- * @author n.hoffmann
- * @created Feb 11, 2011
- * @version 1.0
- */
-public abstract class AbstractAddDerivedUnitFacadeMediaHandler extends AbstractHandler {
-
-       /* (non-Javadoc)
-        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-        */
-       @Override
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               IWorkbenchPart part = HandlerUtil.getActivePart(event);
-               IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
-               
-               
-               IEditorPart editor = HandlerUtil.getActiveEditor(event);
-               IEditorInput input = editor.getEditorInput();
-               
-               
-               if(input instanceof OccurrenceEditorInput){
-                       BulkEditor bulkEditor = (BulkEditor) editor;
-                       ISelection selection = bulkEditor.getSelectionProvider().getSelection();
-                       
-                       if(selection instanceof IStructuredSelection){
-                               Object element = ((IStructuredSelection) selection).getFirstElement();
-                               if(element instanceof DerivedUnit){
-                                       
-                                       try{
-                                               AbstractPostOperation operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(), BulkEditorUtil.getUndoContext(), (DerivedUnit) element, getMode(), postOperationEnabled);
-                                               BulkEditorUtil.executeOperation(operation);
-                                       } catch (NotDefinedException e) {
-                                               MessagingUtils.warn(getClass(), "Command name not set.");
-                                       }                                       
-                               }
-                       }
-               }
-               return null;
-       }
-
-       /**
-        * @return
-        */
-       protected abstract int getMode();
-
-}
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddDerivedUnitMediaHandler.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddDerivedUnitMediaHandler.java
deleted file mode 100644 (file)
index 21fa66c..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler;
-
-import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
-
-
-/**
- * @author n.hoffmann
- * @created Feb 7, 2011
- * @version 1.0
- */
-public class AddDerivedUnitMediaHandler extends AbstractAddDerivedUnitFacadeMediaHandler {
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AbstractAddDerivedUnitFacadeMediaHandler#getMode()
-        */
-       @Override
-       protected int getMode() {
-               return AddDerivedUnitFacadeMediaOperation.DERIVED_UNIT_MEDIA;
-       }
-
-       
-}
diff --git a/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddFieldObjectMediaHandler.java b/eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/derivedunit/handler/AddFieldObjectMediaHandler.java
deleted file mode 100644 (file)
index 2d19d11..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-// $Id$
-/**
-* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
-* http://www.e-taxonomy.eu
-* 
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-
-package eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler;
-
-import eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation.AddDerivedUnitFacadeMediaOperation;
-
-/**
- * @author n.hoffmann
- * @created Feb 11, 2011
- * @version 1.0
- */
-public class AddFieldObjectMediaHandler extends
-               AbstractAddDerivedUnitFacadeMediaHandler {
-
-       /* (non-Javadoc)
-        * @see eu.etaxonomy.taxeditor.bulkeditor.derivedunit.handler.AbstractAddDerivedUnitFacadeMediaHandler#getMode()
-        */
-       @Override
-       protected int getMode() {
-               return AddDerivedUnitFacadeMediaOperation.FIELD_OBJECT_MEDIA;
-       }
-
-}
index 2a87bfa75c18754d6231e1c0b44aff4fb7e3d03b..85830b21f62e07e66cbf8712eac30375d6993efa 100644 (file)
                commandId="taxeditor-editor.command.newimagegallery"
                label="%command.label.37"
                style="push">
+            <visibleWhen>
+               <or>
+                  <reference
+                        definitionId="isBulkEditor">
+                  </reference>
+                  <reference
+                        definitionId="isTaxonEditor">
+                  </reference>
+                  <reference
+                        definitionId="isDerivateEditor">
+                  </reference>
+               </or>
+            </visibleWhen>
          </command>
          <separator
                name="taxeditor-editor.separator1"
             </test>
          </with>
       </definition>
+      <definition
+            id="isBulkEditor">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isBulkEditor">
+            </test>
+         </with>
+      </definition>
+      <definition
+            id="isDerivateEditor">
+         <with
+               variable="selection">
+            <test
+                  property="eu.etaxonomy.taxeditor.descriptions.propertyTester.isDerivateEditor">
+            </test>
+         </with>
+      </definition>
       <definition
             id="isDescription">
          <with
             class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.DescriptionsMenuPropertyTester"
             id="eu.etaxonomy.taxeditor.descriptions.PropertyTester"
             namespace="eu.etaxonomy.taxeditor.descriptions.propertyTester"
-            properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor"
+            properties="isMedia,isDescription,isDescriptionElement,isDeletable,isFeatureNodeContainer,isImageGallery,isTaxonEditor,isBulkEditor,isDerivateEditor"
             type="org.eclipse.jface.viewers.TreeSelection">
       </propertyTester>
       <propertyTester
index eca1a544c2622af60a7bb3df6b454d1cb165cb8b..1e0ad222c922106be512f45ab8d5f531177e7a94 100644 (file)
@@ -9,7 +9,9 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import eu.etaxonomy.cdm.model.description.DescriptionBase;
 import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
 import eu.etaxonomy.cdm.model.media.Media;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
+import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
 
@@ -29,6 +31,8 @@ public class DescriptionsMenuPropertyTester extends PropertyTester {
        private static final String DELETABLE = "isDeletable";
        private static final String IMAGE_GALLERY = "isImageGallery";
        private static final String TAXON_EDITOR = "isTaxonEditor";
+       private static final String BULK_EDITOR = "isBulkEditor";
+       private static final String DERIVATE_EDITOR = "isDerivateEditor";
 
        /* (non-Javadoc)
         * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
@@ -41,6 +45,12 @@ public class DescriptionsMenuPropertyTester extends PropertyTester {
            if(TAXON_EDITOR.equals(property)){
                return isTaxonEditor();
            }
+           else if(BULK_EDITOR.equals(property)){
+               return isBulkEditor();
+           }
+           else if(DERIVATE_EDITOR.equals(property)){
+               return isDerivateEditor();
+           }
 
            Object[] selectedElements = ((IStructuredSelection) receiver).toArray();
 
@@ -141,4 +151,18 @@ public class DescriptionsMenuPropertyTester extends PropertyTester {
            }
            return false;
        }
+
+       private boolean isBulkEditor() {
+           if(AbstractUtility.getActiveEditor() instanceof BulkEditor){
+               return true;
+           }
+           return false;
+       }
+
+       private boolean isDerivateEditor() {
+           if(AbstractUtility.getActiveEditor() instanceof DerivateView){
+               return true;
+           }
+           return false;
+       }
 }
@@ -1,14 +1,14 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
-package eu.etaxonomy.taxeditor.bulkeditor.derivedunit.operation;
+package eu.etaxonomy.taxeditor.editor.view.descriptive.operation;
 
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.IUndoContext;
@@ -18,9 +18,10 @@ import org.eclipse.core.runtime.IStatus;
 
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
 import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException;
-import eu.etaxonomy.cdm.model.description.DescriptionBase;
-import eu.etaxonomy.cdm.model.description.SpecimenDescription;
 import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
+import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationType;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -30,64 +31,45 @@ import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
  * @created Feb 11, 2011
  * @version 1.0
  */
-public class AddDerivedUnitFacadeMediaOperation extends
-               AbstractPostTaxonOperation {
+public class AddDerivedUnitFacadeMediaOperation extends AbstractPostTaxonOperation {
+
+       private final SpecimenOrObservationBase<?> specimen;
 
-       public static final int DERIVED_UNIT_MEDIA = 0;
-       public static final int FIELD_OBJECT_MEDIA = 1;
-       
-       private DerivedUnit derivedUnit;
-       private int mode;
-       
        /**
         * @param label
         * @param undoContext
         * @param postOperationEnabled
         */
-       public AddDerivedUnitFacadeMediaOperation(String label, IUndoContext undoContext, DerivedUnit derivedUnit,
-                       int mode, IPostOperationEnabled postOperationEnabled) {
+       public AddDerivedUnitFacadeMediaOperation(String label, IUndoContext undoContext, SpecimenOrObservationBase<?> specimen,
+               IPostOperationEnabled postOperationEnabled) {
                super(label, undoContext, postOperationEnabled);
-               
-               this.derivedUnit = derivedUnit;
-               this.mode = mode;
+
+               this.specimen = specimen;
        }
-       
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
         */
        @Override
-       public IStatus execute(IProgressMonitor monitor, IAdaptable info)
-                       throws ExecutionException {
+       public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
                DerivedUnitFacade facade;
                try {
-                       facade = DerivedUnitFacade.NewInstance(derivedUnit);
-
-                       createImageGallery(facade);
+                   if(specimen instanceof FieldUnit){
+                       facade = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) specimen);
+                       facade.getFieldObjectImageGallery(true);
+                   }
+                   else if(specimen instanceof DerivedUnit){
+                       facade = DerivedUnitFacade.NewInstance((DerivedUnit)specimen);
+                       facade.getDerivedUnitImageGallery(true);
+                   }
                } catch (DerivedUnitFacadeNotSupportedException e) {
                        MessagingUtils.error(getClass(), e);
                }
-               
-               return postExecute(derivedUnit);
-       }
 
-       
-       
-       /**
-        * @param facade
-        * @return
-        */
-       protected void createImageGallery(DerivedUnitFacade facade){
-               if(mode == DERIVED_UNIT_MEDIA){
-                       facade.getDerivedUnitImageGallery(true);
-               }
-               else if(mode == FIELD_OBJECT_MEDIA){
-                       facade.getFieldObjectImageGallery(true);
-               }
-               else{
-                       throw new IllegalArgumentException("Mode not supported: " + mode);
-               }
+               return postExecute(specimen);
        }
 
+
        /* (non-Javadoc)
         * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
         */
index a93272a31a03c0dc4708c9e2d2f048481e11a755..43bf658bf86934c03bdaa488ba26a20200a924f2 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.jface.action.MenuManager;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeNode;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.swt.SWT;
@@ -30,11 +29,10 @@ import org.eclipse.ui.IWorkbenchPart;
 
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor;
-import eu.etaxonomy.taxeditor.editor.view.derivate.DerivateView;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
+import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
 import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
 import eu.etaxonomy.taxeditor.view.AbstractCdmEditorViewPart;
 
@@ -107,16 +105,9 @@ public class MediaViewPart extends AbstractCdmEditorViewPart implements IPartCon
                        showViewer(part, new StructuredSelection(input));
                }
 
-               else if(part instanceof BulkEditor && selection instanceof IStructuredSelection){
+               else if(part instanceof IPartContentHasMedia && selection instanceof IStructuredSelection){
                        showViewer(part, (IStructuredSelection) selection);
                }
-
-               else if(part instanceof DerivateView){
-                   TreeNode treeNode = EditorUtil.getTreeNodeOfSelection(selection);
-                   if(treeNode!=null){
-                       showViewer(part, new StructuredSelection(treeNode.getValue()));
-                   }
-        }
        }
 
        /** {@inheritDoc} */
index 2739b337ea410875b7f351fa4ee4b118988dfcf9..a1e79087daaf5154b786cb63730ecdaf582754c7 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * 
+ *
  */
 package eu.etaxonomy.taxeditor.editor.view.media.handler;
 
@@ -7,15 +7,23 @@ import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.common.NotDefinedException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 
+import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
 import eu.etaxonomy.cdm.model.taxon.Taxon;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditor;
+import eu.etaxonomy.taxeditor.bulkeditor.BulkEditorUtil;
+import eu.etaxonomy.taxeditor.bulkeditor.input.OccurrenceEditorInput;
 import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.editor.TaxonEditorInput;
+import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.AddDerivedUnitFacadeMediaOperation;
 import eu.etaxonomy.taxeditor.editor.view.descriptive.operation.CreateTaxonDescriptionOperation;
+import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.operation.AbstractPostOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -32,26 +40,45 @@ public class AddImageGalleryHandler extends AbstractHandler {
         * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
         */
        /** {@inheritDoc} */
-       public Object execute(ExecutionEvent event) throws ExecutionException {
+       @Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
 
                IWorkbenchPart part = HandlerUtil.getActivePart(event);
                IPostOperationEnabled postOperationEnabled = (part instanceof IPostOperationEnabled) ? (IPostOperationEnabled) part : null;
-               
-               
+
+
                IEditorPart editor = HandlerUtil.getActiveEditor(event);
                IEditorInput input = editor.getEditorInput();
+
                if (input instanceof TaxonEditorInput) {
-                       Taxon taxon = ((TaxonEditorInput) input).getTaxon();    
-                       AbstractPostOperation operation;
+                       Taxon taxon = ((TaxonEditorInput) input).getTaxon();
+                       AbstractPostOperation<?> operation;
                        try {
                                // TODO use undo context specific to editor
-                               operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(), 
+                               operation = new CreateTaxonDescriptionOperation(event.getCommand().getName(),
                                                EditorUtil.getUndoContext(), taxon, postOperationEnabled, true);
-                               EditorUtil.executeOperation(operation);
+                               AbstractUtility.executeOperation(operation);
                        } catch (NotDefinedException e) {
                                MessagingUtils.warn(getClass(), "Command name not set.");
                        }
-               } 
+               }
+               else if(input instanceof OccurrenceEditorInput){
+                   BulkEditor bulkEditor = (BulkEditor) editor;
+                   ISelection selection = bulkEditor.getSelectionProvider().getSelection();
+
+                   if(selection instanceof IStructuredSelection){
+                       Object element = ((IStructuredSelection) selection).getFirstElement();
+                       if(element instanceof SpecimenOrObservationBase<?>){
+                           try {
+                               AbstractPostOperation<?> operation = new AddDerivedUnitFacadeMediaOperation(event.getCommand().getName(),
+                                       BulkEditorUtil.getUndoContext(), (SpecimenOrObservationBase<?>)element, postOperationEnabled);
+                               AbstractUtility.executeOperation(operation);
+                           } catch (NotDefinedException e) {
+                               MessagingUtils.warn(getClass(), "Command name not set.");
+                           }
+                       }
+                   }
+               }
                return null;
        }
 
index 99be545557e7f8e1a45def13210b8c2665ca9767..c9e4f2148fa6a47993c2ec2b79b196c52ffd877a 100644 (file)
@@ -300,13 +300,6 @@ Software distributed under the License is distributed on an &quot;AS IS&quot; ba
          version="0.0.0"
          unpack="false"/>
 
-   <plugin
-         id="org.eclipse.update.configurator"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
    <plugin
          id="org.eclipse.update.core"
          download-size="0"
index 59001c82a44e2a50680d99f55e81b19c31a1f027..7c8b588be75036e4012655907dba6e5ff7cb158b 100644 (file)
@@ -58,8 +58,8 @@ public class DeleteOperation extends AbstractPersistentPostOperation {
                if (result.isError()){
                        MessageDialog.openError(null, "Delete failed", result.getExceptions().get(0).getMessage());
                        
-               }else if(!result.getExceptions().isEmpty()){
-                       //TODO:Warning!
+               }else if(result.isAbort()){
+                       MessageDialog.openWarning(null, "Delete abort", "The object could not be deleted, maybe there was no object selected.");
                }
                
                return postExecute(null);
index 16bdd88787c12e5c748f4b49487505fcf949c728..743cb775ea135bb417ec3f06e82937935740295a 100644 (file)
@@ -10,9 +10,7 @@
 
 package eu.etaxonomy.taxeditor.navigation.navigator.operation;
 
-import java.util.List;
 import java.util.Set;
-import java.util.UUID;
 
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.commands.operations.IUndoContext;
@@ -132,8 +130,11 @@ public class DeleteOperation extends AbstractPersistentPostOperation{
                                }*/
                        } else {
                                
-                               List<UUID> result =service.deleteTaxonNodes(treeNodes, config);
-                               
+                               DeleteResult result =service.deleteTaxonNodes(treeNodes, config);
+                               if (result.isError()){
+                                       //TODO:Error message!
+                                       MessageDialog.openError(null, "Delete failed", result.getExceptions().get(0).getMessage());
+                               }
                        }
 
                monitor.worked(40);
index 792386b585b7ef11ad73b42bc7cdf0651b3dcbb3..9d33e2a124d598eae1deb25ccde3a9571b38e96b 100644 (file)
@@ -5,7 +5,13 @@ import org.eclipse.jface.dialogs.ErrorDialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.List;
 import org.eclipse.swt.widgets.Shell;
@@ -22,14 +28,49 @@ public      class CdmErrorDialog extends ErrorDialog {
 
        private static final int DIALOG_MAX_HEIGHT = 500;
 
-       public CdmErrorDialog(Shell parentShell, String dialogTitle,
-                       String message, IStatus status) {
-               super(parentShell,
-                               dialogTitle,
-                               message, status,
-                               IStatus.OK| IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
-       }
+       private Button copyButton;
+       private final String stackTrace;
+
+        /**
+     * The current clipboard. To be disposed when closing the dialog.
+     */
+    private Clipboard clipboard;
+
+    /**
+     * @param parentShell
+     * @param dialogTitle
+     * @param message
+     * @param status
+     * @param stackTrace
+     */
+    public CdmErrorDialog(Shell parentShell,
+            String dialogTitle,
+            String message,
+            IStatus status,
+            String stackTrace) {
+        super(parentShell,
+                dialogTitle,
+                message, status,
+                IStatus.OK| IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
+        this.stackTrace = stackTrace;
+    }
 
+    /**
+     * @param parentShell
+     * @param dialogTitle
+     * @param message
+     * @param status
+     */
+    public CdmErrorDialog(Shell parentShell,
+            String dialogTitle,
+            String message,
+            IStatus status) {
+        this(parentShell, dialogTitle, message, status, "");
+    }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.dialogs.ErrorDialog#buttonPressed(int)
+        */
        @Override
        protected void buttonPressed(int id) {
                super.buttonPressed(id);
@@ -45,10 +86,54 @@ public      class CdmErrorDialog extends ErrorDialog {
 
        }
 
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.dialogs.ErrorDialog#createDropDownList(org.eclipse.swt.widgets.Composite)
+        */
        @Override
        protected List createDropDownList(Composite parent) {
            List list = super.createDropDownList(parent);
            list.getMenu().getItem(0).setText(JFaceResources.getString("copy all"));
            return list;
        }
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.dialogs.ErrorDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+        */
+       @Override
+       protected void createButtonsForButtonBar(Composite parent) {
+           copyButton = createButton(parent, 2000,"Copy Error", false);
+           copyButton.addSelectionListener(new SelectionListener() {
+               /*
+                * @see SelectionListener.widgetSelected (SelectionEvent)
+                */
+               @Override
+            public void widgetSelected(SelectionEvent e) {
+                   copyStackTraceToClipboard();
+               }
+               /*
+                * @see SelectionListener.widgetDefaultSelected(SelectionEvent)
+                */
+               @Override
+            public void widgetDefaultSelected(SelectionEvent e) {
+                   copyStackTraceToClipboard();
+               }
+           });
+           super.createButtonsForButtonBar(parent);
+       }
+
+
+       /**
+        * Copies the stack trace to the clipboard
+        *
+        */
+       private void copyStackTraceToClipboard() {
+           if(stackTrace != null && !stackTrace.isEmpty()) {
+               if (clipboard != null) {
+                   clipboard.dispose();
+               }
+               clipboard = new Clipboard(copyButton.getDisplay());
+               clipboard.setContents(new Object[] { stackTrace },
+                       new Transfer[] { TextTransfer.getInstance() });
+           }
+       }
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasMedia.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/IPartContentHasMedia.java
new file mode 100644 (file)
index 0000000..3b6997e
--- /dev/null
@@ -0,0 +1,25 @@
+// $Id$
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.model;
+
+
+/**
+ *
+ * Clients implementing this interface indicate, that the data they present is suitable for the media view
+ * and that the media view should handle selection from the implementing part.
+ *
+ * @author pplitzner
+ * @date Sep 16, 2014
+ *
+ */
+public interface IPartContentHasMedia {
+
+}
index 3fbc5123655c9dd0be5314ae360fd72b5b887c4b..959e49d92df4715109cbf5ca0e329b6139c91b6e 100644 (file)
@@ -8,11 +8,13 @@ import java.util.List;
 import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Display;
 
 import eu.etaxonomy.cdm.persistence.hibernate.permission.SecurityExceptionUtils;
+import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
@@ -154,36 +156,74 @@ public class MessagingUtils {
         error(source.getClass(), t.getMessage(), t);
     }
 
+
+
     /**
-     * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+     * Returns a list of strings, providing info on,
+     *  - login
+     *  - editor version
+     *  - server (address + source name)
+     *  - db schema version
      *
-     * @param title
-     *            a {@link java.lang.String} object.
-     * @param source
-     *            a {@link java.lang.Object} object.
-     * @param status
-     *            a {@link org.eclipse.core.runtime.IStatus} object.
+     * @return
      */
-    private static void errorDialog(final String title,
-            final Object source,
-            final String message,
-            final IStatus status) {
+    public static List<String> getContextInfo() {
+        List<String> contextInfo = new ArrayList<String>();
+        String name = "";
+        String schemaVersion = "";
+        String server = "";
+        String version = "";
+        String login = "";
+        try {
+            version = Platform.getBundle("eu.etaxonomy.taxeditor.application").getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
+
+            if(CdmStore.getActiveCdmSource() != null ) {
+                login = CdmStore.getLoginManager().getAuthenticatedUser().getUsername();
+                name = CdmStore.getActiveCdmSource().getName();
+                schemaVersion = CdmStore.getActiveCdmSource().getDbSchemaVersion();
+                server = CdmStore.getActiveCdmSource().getServer();
+            }
 
-        Display.getDefault().asyncExec(new Runnable() {
+        } catch (Exception e) {
+            // Nothing to do
+        }
+        contextInfo.add("login : " + login);
+        contextInfo.add("editor version : " + version);
+        contextInfo.add("server : " + server + " / " + name);
+        contextInfo.add("schema version : " + schemaVersion);
 
-            @Override
-            public void run() {
-                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status);
-                ced.open();
-                Class<? extends Object> clazz = source != null ? source.getClass() : this.getClass();
-                error(clazz, status);
-            }
-        });
+        return contextInfo;
+    }
+
+    public static String getStackTraceAndContextInfo(Throwable t, List<String> contextInfo)  {
+        StringBuffer stackTraceAndContextInfo = new StringBuffer();
+
+        for(String infoItem : contextInfo) {
+            stackTraceAndContextInfo.append(infoItem + System.getProperty("line.separator"));
+        }
+
+        StringWriter sw = new StringWriter();
+        t.printStackTrace(new PrintWriter(sw));
+
+        stackTraceAndContextInfo.append(sw.toString());
+
+        return stackTraceAndContextInfo.toString();
     }
 
+    /**
+     * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+     *
+     * @param title
+     * @param source
+     * @param t
+     * @param contextInfo
+     * @param message
+     * @param status
+     */
     private static void errorDialog(final String title,
             final Object source,
             final Throwable t,
+            final List<String> contextInfo,
             final String message,
             final MultiStatus status) {
 
@@ -191,19 +231,16 @@ public class MessagingUtils {
 
             @Override
             public void run() {
-                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status);
+                String stackTraceWithContext = getStackTraceAndContextInfo(t, contextInfo);
+                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status, stackTraceWithContext);
                 ced.open();
                 Class<? extends Object> clazz = source != null ? source.getClass() : this.getClass();
 
-                // Usually the status contains only the first line of the stack trace.
-                // For the unexpected messages we need the entire stack trace so we
-                // create a new status with the entire stacktrace
-                StringWriter sw = new StringWriter();
-                t.printStackTrace(new PrintWriter(sw));
+
                 IStatus singleStatus = new Status(IStatus.ERROR,
                         status.getPlugin(),
                         message,
-                        new Exception(sw.toString()));
+                        new Exception(stackTraceWithContext));
 
                 error(clazz, singleStatus);
             }
@@ -233,11 +270,19 @@ public class MessagingUtils {
         // idea of writing out the stack trace as a single string
         // leads to a single line on windows
         List<Status> childStatuses = new ArrayList<Status>();
+
+        // add context info
+        List<String> contextInfo = getContextInfo();
+        for(String infoItem : contextInfo) {
+            childStatuses.add(new Status(IStatus.ERROR, pluginId, infoItem));
+        }
+
+        // add main execption
         for (StackTraceElement ste : t.getStackTrace()) {
-            // build & add status
             childStatuses.add(new Status(IStatus.ERROR, pluginId, "at " + ste.toString()));
         }
 
+        // add cause
         if(t.getCause() != null) {
             childStatuses.add(new Status(IStatus.ERROR, pluginId, ""));
             childStatuses.add(new Status(IStatus.ERROR, pluginId, "Caused by : " + t.getCause().toString()));
@@ -247,7 +292,6 @@ public class MessagingUtils {
             }
         }
 
-        // build message with contact info
         String finalMessage = message;
 
         if(finalMessage == null || finalMessage.isEmpty()) {
@@ -255,6 +299,7 @@ public class MessagingUtils {
         }
 
         if(addContactMesg) {
+            // add edit support contact info to message
             finalMessage += MessagingUtils.CONTACT_MESSAGE;
         }
 
@@ -264,9 +309,35 @@ public class MessagingUtils {
                 t.toString(),
                 t);
 
-        errorDialog(title, source, t, finalMessage, ms);
+        errorDialog(title, source, t, contextInfo, finalMessage, ms);
     }
 
+    /**
+     * Displays a {@link eu.etaxonomy.taxeditor.model.CdmErrorDialog}.
+     *
+     * @param title
+     *            a {@link java.lang.String} object.
+     * @param source
+     *            a {@link java.lang.Object} object.
+     * @param status
+     *            a {@link org.eclipse.core.runtime.IStatus} object.
+     */
+    private static void errorDialog(final String title,
+            final Object source,
+            final String message,
+            final IStatus status) {
+
+        Display.getDefault().asyncExec(new Runnable() {
+
+            @Override
+            public void run() {
+                CdmErrorDialog ced = new CdmErrorDialog(AbstractUtility.getShell(), title, message, status);
+                ced.open();
+                Class<? extends Object> clazz = source != null ? source.getClass() : this.getClass();
+                error(clazz, status);
+            }
+        });
+    }
 
     /**
      * Displays a dialog for an exception occurring in an operation.
index 6ea97d966a9dda6a98b0a0e2239d29afd379fefd..e7e014a1be012519800d0b078e1e6536a1c22e09 100644 (file)
@@ -152,8 +152,10 @@ public class DerivateLabelProvider extends ColumnLabelProvider {
         }
         else if(element instanceof MediaSpecimen){
             MediaSpecimen mediaSpecimen = (MediaSpecimen)element;
-            label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+", ":"[no motif]";
-            label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+", ":"";
+            if(mediaSpecimen.getMediaSpecimen()!=null){
+                label += mediaSpecimen.getMediaSpecimen().getTitle()!=null?mediaSpecimen.getMediaSpecimen().getTitle().getText()+", ":"[no motif]";
+                label += mediaSpecimen.getMediaSpecimen().getArtist()!=null?mediaSpecimen.getMediaSpecimen().getArtist()+", ":"";
+            }
             eu.etaxonomy.cdm.model.occurrence.Collection collection = mediaSpecimen.getCollection();
             if(collection!=null){
                 label += collection.getName()!=null?collection.getName()+" ":"";
index 9f1dcc88e0c518d2e3f5ffd836b6c2a1d4daeff4..18f4117a3923e3a7399badf0a550f5629476128a 100644 (file)
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-       <parent>
-               <groupId>eu.etaxonomy</groupId>
-               <artifactId>taxeditor-parent</artifactId>
-               <version>3.3.8-SNAPSHOT</version>
-       </parent>
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <groupId>eu.etaxonomy</groupId>
+    <artifactId>taxeditor-parent</artifactId>
+    <version>3.3.8-SNAPSHOT</version>
+  </parent>
 
-       <modelVersion>4.0.0</modelVersion>
-       <artifactId>eu.etaxonomy.taxeditor</artifactId>
-       <packaging>eclipse-repository</packaging>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>eu.etaxonomy.taxeditor</artifactId>
+  <packaging>eclipse-repository</packaging>
 
-       <name>EDIT Taxonomic Editor Product</name>
-       <description>The EDIT Taxonomic Desktop Editor</description>
-       <url>http://wp5.e-taxonomy.eu/taxeditor</url>
+  <name>EDIT Taxonomic Editor Product</name>
+  <description>The EDIT Taxonomic Desktop Editor</description>
+  <url>http://wp5.e-taxonomy.eu/taxeditor</url>
 
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.eclipse.tycho</groupId>
-                               <artifactId>tycho-p2-director-plugin</artifactId>
-                               <version>${tycho.version}</version>
-                               <executions>
-                                       <execution>
-                                               <id>materialize-products</id>
-                                               <goals>
-                                                       <goal>materialize-products</goal>
-                                               </goals>
-                                       </execution>
-                                       <execution>
-                                               <id>archive-products</id>
-                                               <goals>
-                                                       <goal>archive-products</goal>
-                                               </goals>
-                                       </execution>
-                               </executions>
-                               <configuration>
-                                       <products>
-                                               <product>
-                                                       <id>eu.etaxonomy.taxeditor.product</id>
-                                                       <rootFolder>EDIT Taxonomic Editor</rootFolder>
-                                               </product>
-                                       </products>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.eclipse.tycho</groupId>
+        <artifactId>tycho-p2-director-plugin</artifactId>
+        <version>${tycho.version}</version>
+        <executions>
+          <execution>
+            <id>materialize-products</id>
+            <goals>
+              <goal>materialize-products</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>archive-products</id>
+            <goals>
+              <goal>archive-products</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <products>
+            <product>
+              <id>eu.etaxonomy.taxeditor.product</id>
+              <rootFolder>EDIT Taxonomic Editor</rootFolder>
+            </product>
+          </products>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+  <profiles>
+    <profile>
+      <id>signJars</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-jarsigner-plugin</artifactId>
+            <version>1.3.2</version>
+            <configuration>
+              <alias>editor</alias>
+              <removeExistingSignatures>true</removeExistingSignatures>
+              <!-- keystore properties should be set in the ~/.m2/settings.xml -->
+              <keystore>${keystore.path}</keystore>
+              <storepass>${keystore.store.password}</storepass>
+              <keypass>${keystore.key.password}</keypass>
+
+              <archiveDirectory>${project.build.directory}/repository</archiveDirectory>
+              <!-- Following two settings are to ensure that the product 
+                .zip files are not signed -->
+              <processMainArtifact>false</processMainArtifact>
+              <processAttachedArtifacts>false</processAttachedArtifacts>
+              <includes>
+                <include>plugins/eu.etaxonomy.taxeditor*.jar</include>
+                <include>features/eu.etaxonomy.taxeditor*.jar</include>
+              </includes>
+              <arguments>
+                <!-- Due to bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=378155 
+                  we need to force the signature / digest algorithm to SHA1 since this is the 
+                  only one which plays well with Eclipse 3.x -->
+                <argument>-sigalg</argument>
+                <argument>SHA1withDSA</argument>
+                <argument>-digestalg</argument>
+                <argument>SHA1</argument>
+              </arguments>
+            </configuration>
+            <executions>
+              <execution>
+                <id>sign</id>
+                <goals>
+                  <goal>sign</goal>
+                </goals>
+              </execution>
+            </executions>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+    <profile>
+      <!-- Upload the repo to the server -->
+      <id>uploadRepo</id>
+      <build>
+        <plugins>
+          <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>wagon-maven-plugin</artifactId>
+            <version>1.0-beta-3</version>
+            <!-- Problems with the wagon-maven-plugin have been encounterd 
+              on Windows, it should work properly on linux though. -->
+            <executions>
+              <execution>
+                <phase>package</phase>
+                <goals>
+                  <goal>upload</goal>
+                </goals>
+              </execution>
+            </executions>
+            <configuration>
+              <fromDir>${project.build.directory}/repository</fromDir>
+              <url>scpexe://wp5.e-taxonomy.eu/var/www/download/taxeditor/update/${update.dir}</url>
+              <includes>binary/*,content.jar,artifacts.jar,**/eu.etaxonomy.*.jar</includes>
+              <!-- Comment out the above and uncomment the below to upload 
+                all jars -->
+              <!-- <includes>**/*</includes> -->
+              <serverId>wp5.e-taxonomy.eu</serverId>
+            </configuration>
+          </plugin>
+        </plugins>
+      </build>
+    </profile>
+  </profiles>
 
 </project>
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 269207f56dd22b2adaaf3f9f99e8e6c6c4905fe1..9103e3837464203a53ffc3b0171fcfc98c8690c1 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,8 @@
   <artifactId>taxeditor-parent</artifactId>
   <version>3.3.8-SNAPSHOT</version>
   <name>EDIT Taxonomic Editor</name>
-  <description>The Taxonomic Editor for EDIT's platform for cybertaxonomy</description>
+  <description>The Taxonomic Editor for EDIT's platform for
+    cybertaxonomy</description>
   <url>http://cybertaxonomy.eu/taxeditor//taxeditor//taxeditor//taxeditor//taxeditor//taxeditor//taxeditor/</url>
   <inceptionYear>2007</inceptionYear>
   <packaging>pom</packaging>
     <mailingList>
       <name>EDIT Taxonomic Editor</name>
       <subscribe>
-                               edit-taxonomic-editor+subscribe@googlegroups.com
-                       </subscribe>
+        edit-taxonomic-editor+subscribe@googlegroups.com
+      </subscribe>
       <unsubscribe>
-                               edit-taxonomic-editor+unsubscribe@googlegroups.com
-                       </unsubscribe>
+        edit-taxonomic-editor+unsubscribe@googlegroups.com
+      </unsubscribe>
       <post>edit-taxonomic-editor@googlegroups.com</post>
       <archive>http://groups.google.com/group/edit-taxonomic-editor/topics</archive>
     </mailingList>
       <!-- your SVN account id please! -->
       <id>a.kohlbecker</id>
       <name>
-                       Andreas Kohlbecker
-                       </name>
+        Andreas Kohlbecker
+      </name>
       <email>a.kohlbecker [at] bgbm.org</email>
       <organization>
-                               Botanic Garden Botanical Museum Berlin
-                       </organization>
+        Botanic Garden Botanical Museum Berlin
+      </organization>
       <organizationUrl>http://www.bgbm.org/BioDivInf/</organizationUrl>
       <timezone>+1</timezone>
       <roles>
       <!-- your SVN account id please! -->
       <id>a.mueller</id>
       <name>
-                               Andreas Müller
-                       </name>
+        Andreas Müller
+      </name>
       <email>a.mueller [at] bgbm.org</email>
       <organization>
-                               Botanic Garden Botanical Museum Berlin
-                       </organization>
+        Botanic Garden Botanical Museum Berlin
+      </organization>
       <organizationUrl>http://www.bgbm.org/BioDivInf/</organizationUrl>
       <timezone>+1</timezone>
       <roles>
         </repository>
       </repositories>
     </profile>
-    <profile>
-      <!-- Upload the repo to the server -->
-      <id>uploadRepo</id>
-      <build>
-        <plugins>
-          <plugin>
-            <groupId>org.codehaus.mojo</groupId>
-            <artifactId>wagon-maven-plugin</artifactId>
-            <version>1.0-beta-3</version>
-            <!-- Problems with the wagon-maven-plugin have been encounterd 
-              on Windows, it should work properly on linux though. -->
-            <executions>
-              <execution>
-                <phase>package</phase>
-                <goals>
-                  <goal>upload</goal>
-                </goals>
-              </execution>
-            </executions>
-            <configuration>
-              <fromDir>eu.etaxonomy.taxeditor/target/repository</fromDir>
-              <url>scpexe://wp5.e-taxonomy.eu/var/www/download/taxeditor/update/${update.dir}</url>
-              <includes>binary/*,content.jar,artifacts.jar,**/eu.etaxonomy.*.jar</includes>
-              <!-- Comment out the above and uncomment the below to upload 
-                all jars -->
-              <!-- <includes>**/*</includes> -->
-              <serverId>wp5.e-taxonomy.eu</serverId>
-            </configuration>
-          </plugin>
-        </plugins>
-      </build>
-    </profile>
   </profiles>
   <repositories>
     <!-- the cdm internal repository -->