Add check to ensure merge in editors is performed only in remoting
authorCherian Mathew <c.mathew@bgbm.org>
Wed, 30 Sep 2015 10:49:08 +0000 (12:49 +0200)
committerCherian Mathew <c.mathew@bgbm.org>
Wed, 30 Sep 2015 10:49:08 +0000 (12:49 +0200)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/TaxonEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/group/authority/CdmAuthorityEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/DerivateViewEditorInput.java

index 7fbb22736445c6afed82ae5c2abb5d11b432da8b..fc6951c5cf732d87a2466bb6f66c0b04f41c6971 100644 (file)
@@ -452,7 +452,9 @@ public class TaxonEditorInput  extends CdmEntitySessionInput implements IEditorI
      */
     @Override
     public void merge() {
-        CdmStore.getService(ITaxonNodeService.class).merge(taxonNode);
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            CdmStore.getService(ITaxonNodeService.class).merge(taxonNode, true);
+        }
     }
 
     @Override
index b3b8d6437ddc4f6007e2b79419ab1b00cbca181c..77de015f12235de15deff65670b805486e22df27 100644 (file)
@@ -157,6 +157,8 @@ public class CdmAuthorityEditorInput extends CdmEntitySessionInput implements IE
      */
     @Override
     public void merge() {
-        group = CdmStore.getService(IGroupService.class).merge(group);
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            group = CdmStore.getService(IGroupService.class).merge(group);
+        }
     }
 }
index 3cfc3e3ff962f117ab3ba7423a0400490eda9e6a..e76738ff79a1af2c84b854e183b0e2529b2790f1 100644 (file)
@@ -91,7 +91,9 @@ public class PolytomousKeyEditorInput extends AbstractIdentificationEditorInput<
      */
     @Override
     public void merge() {
-        key = CdmStore.getService(IPolytomousKeyService.class).merge(key,true);
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            key = CdmStore.getService(IPolytomousKeyService.class).merge(key,true);
+        }
     }
 
     @Override
index ced5ad3fa462d63939ba9a608aea09c4879c0663..a2a7982feb3aac5fc414056f13775fc0d424a86d 100644 (file)
@@ -237,7 +237,9 @@ public class DerivateViewEditorInput extends CdmEntitySessionInput implements IE
      */
     @Override
     public void merge() {
-       List<SpecimenOrObservationBase> mergedEntities = CdmApplicationState.getCurrentAppConfig().getOccurrenceService().merge(new ArrayList(getRootEntities()));
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            List<SpecimenOrObservationBase> mergedEntities = CdmApplicationState.getCurrentAppConfig().getOccurrenceService().merge(new ArrayList(getRootEntities()));
+        }
 
     }