Add remoting operation / handlers for key list editor
authorCherian Mathew <c.mathew@bgbm.org>
Wed, 22 Jul 2015 07:39:09 +0000 (09:39 +0200)
committerCherian Mathew <c.mathew@bgbm.org>
Wed, 22 Jul 2015 07:39:09 +0000 (09:39 +0200)
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/cache/EntityCacherDebugResult.java
eu.etaxonomy.taxeditor.editor/plugin.xml
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/KeyEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorLabels.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyListEditor.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateChildPolytomousKeyNodeHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateSiblingPolytomousKeyNodeHandler.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreateNodeOperation.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RemotingCreatePolytomousKeyNodeOperation.java [new file with mode: 0644]
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmMergeOperation.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/operation/RemotingCdmOperation.java

index ca7ac3502b6cc8a8ddc23c3732e045f5393335e8..85012f237abb3299fac5a99c9d752d62ec3fa85d 100644 (file)
@@ -123,13 +123,15 @@ public class EntityCacherDebugResult {
                 sb.append(System.getProperty("line.separator"));
                 CdmEntityInfo cei = entry.getKey();
                 CdmBase cb = (CdmBase) cei.getObject();
-                Object cbParent = cei.getParent().getObject();
 
+                sb.append(" - " + cei.getField().getName() + ":" + cb.getUserFriendlyTypeName() + "/" + cb.getId());
+                if(cei.getParent() != null) {
+                    Object cbParent = cei.getParent().getObject();
+                    sb.append("     in entity " + cbParent.getClass().getCanonicalName());
+                    if(cbParent instanceof CdmBase) {
 
-                sb.append(" - " + cei.getField().getName() + ":" + cb.getUserFriendlyTypeName() + "/" + cb.getId() +
-                        " in entity " + cbParent.getClass().getCanonicalName());
-                if(cbParent instanceof CdmBase) {
-                    sb.append(" with id : " + ((CdmBase)cbParent).getId());
+                        sb.append(" with id : " + ((CdmBase)cbParent).getId());
+                    }
                 }
                 sb.append(System.getProperty("line.separator"));
                 sb.append("  -- entity belongs to cache(s) : " + getCachesContainingEntity(cb));
@@ -138,12 +140,18 @@ public class EntityCacherDebugResult {
 
                 CdmEntityInfo dupCei = entry.getValue();
                 CdmBase dupCb = (CdmBase) dupCei.getObject();
-                Object dupCbParent = dupCei.getParent().getObject();
 
-                sb.append(" - " + dupCei.getField().getName() + ":" + dupCb.getUserFriendlyTypeName() + "/" + dupCb.getId() +
-                        " in entity " + dupCbParent.getClass().getCanonicalName());
-                if(dupCbParent instanceof CdmBase) {
-                    sb.append(" with id : " + ((CdmBase)dupCbParent).getId());
+                String dupCeiFieldName = "";
+                if(dupCei.getField() != null) {
+                    dupCeiFieldName = dupCei.getField().getName();
+                }
+                sb.append(" - " + dupCeiFieldName + ":" + dupCb.getUserFriendlyTypeName() + "/" + dupCb.getId());
+                if(dupCei.getParent() != null) {
+                    Object dupCbParent = dupCei.getParent().getObject();
+                    sb.append("      in entity " + dupCbParent.getClass().getCanonicalName());
+                    if(dupCbParent instanceof CdmBase) {
+                        sb.append(" with id : " + ((CdmBase)dupCbParent).getId());
+                    }
                 }
                 sb.append(System.getProperty("line.separator"));
                 sb.append("  -- entity belongs to cache(s) : " + getCachesContainingEntity(dupCb));
@@ -350,18 +358,11 @@ public class EntityCacherDebugResult {
             childCei.setField(field);
 
             if(o != null) {
+                boolean isProxy = ProxyUtils.isProxy(o);
 
-                if(o instanceof HibernateProxy) {
-                    isHibernateProxy = true;
-                }
-
-                if(o instanceof PersistentCollection) {
-                    isPersistentCollection = true;
-                }
-                childCei.setObject(o);
-                childCei.setProxy(isHibernateProxy || isPersistentCollection);
-                if(!isHibernateProxy && !isPersistentCollection) {
-
+                childCei.setProxy(isProxy);
+                if(!isProxy) {
+                    childCei.setObject(ProxyUtils.deproxy(o));
                     if(CdmBase.class.isAssignableFrom(o.getClass())) {
                         logger.info("found initialised cdm entity '" + fieldName + "' in object of type " + clazz.getName() + " with id " + cdmEntity.getId());
                         cdmEntityInSubGraph  = (CdmBase)o;
index d06b782aa811d6b29e2875ed6f37b4a6d63f1d12..2129cf851c6be335f80d1f43e03a404e571a289d 100644 (file)
             class="eu.etaxonomy.taxeditor.editor.view.descriptive.handler.ToggleShowOnlyIndividualAssociationsHandler"
             commandId="eu.etaxonomy.taxeditor.editor.handler.showOnlyIndividualAssociations">
       </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.RemotingCreateChildPolytomousKeyNodeHandler"
+            commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new.child">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
+      <handler
+            class="eu.etaxonomy.taxeditor.editor.key.polytomous.handler.RemotingCreateSiblingPolytomousKeyNodeHandler"
+            commandId="eu.etaxonomy.taxeditor.key.polytomous.command.new.sibling">
+         <activeWhen>
+            <reference
+                  definitionId="isRemoting">
+            </reference>
+         </activeWhen>
+      </handler>
    </extension>
    <extension
          name="%extension.name"
             </test>
          </with>
       </definition>
+      <definition
+            id="isRemoting">
+         <test
+               property="eu.etaxonomy.taxeditor.preference.CdmStorePropertyTester.isRemoting">
+         </test>
+      </definition>
    </extension>
    <extension
          point="org.eclipse.core.expressions.propertyTesters">
index 1edd6539352f12a20df4031fb212a3ce0899f116..2ef447a68037eaf8d271f18bba4ad0d0a29fb335 100644 (file)
@@ -17,8 +17,12 @@ import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.FormEditor;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
+import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.description.PolytomousKey;
 import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
 import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorInput;
@@ -35,7 +39,7 @@ import eu.etaxonomy.taxeditor.model.MessagingUtils;
  * @version 1.0
  */
 public class KeyEditor extends FormEditor implements IConversationEnabled,
-               IDirtyMarkable, IPartContentHasDetails {
+               IDirtyMarkable, IPartContentHasDetails, ICdmChangeListener {
 
        public static final String ID = "eu.etaxonomy.taxeditor.editor.key";
 
@@ -57,6 +61,7 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
     public void init(IEditorSite site, IEditorInput input)
             throws PartInitException {
         polytomousKeyEditorInput = (PolytomousKeyEditorInput)input;
+        CdmApplicationState.getCurrentDataChangeService().register(this);
         super.init(site, input);
     }
 
@@ -201,6 +206,7 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
                conversation.unregisterForDataStoreChanges(this);
                conversation.close();
                polytomousKeyEditorInput.dispose();
+               CdmApplicationState.getCurrentDataChangeService().unregister(this);
                super.dispose();
        }
 
@@ -236,4 +242,18 @@ public class KeyEditor extends FormEditor implements IConversationEnabled,
                PolytomousKey key = polytomousKeyEditorInput.getKey();
                setPartName(key.getTitleCache());
        }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.cdm.api.application.ICdmChangeListener#onChange(eu.etaxonomy.cdm.api.application.CdmChangeEvent)
+     */
+    @Override
+    public void onChange(CdmChangeEvent event) {
+        editorDirtyStateChanged();
+        IEditorPart activeEditor = getActiveEditor();
+        if (activeEditor instanceof IDirtyMarkable) {
+            for(CdmBase cdmBase : event.getChangedObjects()) {
+                ((IDirtyMarkable) activeEditor).changed(cdmBase);
+            }
+        }
+    }
 }
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorLabels.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/PolytomousKeyEditorLabels.java
new file mode 100644 (file)
index 0000000..82ee611
--- /dev/null
@@ -0,0 +1,24 @@
+// $Id$
+/**
+* Copyright (C) 2015 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.editor.key.polytomous;
+
+/**
+ * @author cmathew
+ * @date 21 Jul 2015
+ *
+ */
+public interface PolytomousKeyEditorLabels {
+
+    public static final String CREATE_CHILD_POLYTOMOUS_KEY_NODE_LABEL = "Create Child Polytomous Key Node";
+    public static final String CREATE_SIBLING_POLYTOMOUS_KEY_NODE_LABEL = "Create Sibling Polytomous Key Node";
+
+    public static final String NO_KEY_NODE_FOR_CHILD_SELECTED_MESSAGE = "No Key Node Selected.Please right-click on a specific key node to create a new child key node.";
+    public static final String NO_KEY_NODE_FOR_SIBLING_SELECTED_MESSAGE = "No Key Node Selected.Please right-click on a specific key node to create a new sibling key node.";
+}
index cbbeb8b8b1894c60b595c624efe6ec86ac6d3c7f..ce2d59515fa7ca6b40ce4535da5aa63c7a43af75 100644 (file)
@@ -262,7 +262,7 @@ public class PolytomousKeyListEditor extends EditorPart implements
        }
 
        public PolytomousKey getViewerInputKey() {
-           return (PolytomousKey) viewer.getInput();
+           return ((PolytomousKeyEditorInput) viewer.getInput()).getKey();
        }
        private void createMenu() {
                // register context menu
@@ -325,9 +325,9 @@ public class PolytomousKeyListEditor extends EditorPart implements
                        for (PolytomousKeyNode child : children) {
                                viewer.update(child, null);
                        }
-               }
-
 
+               }
+               viewer.refresh();
        }
 
     /* (non-Javadoc)
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateChildPolytomousKeyNodeHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateChildPolytomousKeyNodeHandler.java
new file mode 100644 (file)
index 0000000..1d679a8
--- /dev/null
@@ -0,0 +1,90 @@
+// $Id$
+/**
+ * Copyright (C) 2015 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.editor.key.polytomous.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.editor.key.KeyEditor;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.IPolytomousKeyEditorPage;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorLabels;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyListEditor;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.RemotingCreatePolytomousKeyNodeOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+
+/**
+ * @author cmathew
+ * @date 21 Jul 2015
+ *
+ */
+public class RemotingCreateChildPolytomousKeyNodeHandler extends RemotingCdmHandler {
+
+    private PolytomousKeyNode parentNode;
+
+    public RemotingCreateChildPolytomousKeyNodeHandler() {
+        super(PolytomousKeyEditorLabels.CREATE_CHILD_POLYTOMOUS_KEY_NODE_LABEL);
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+        IEditorPart editor = HandlerUtil.getActiveEditor(event);
+
+        if (editor instanceof KeyEditor) {
+            IPolytomousKeyEditorPage editorPage = (IPolytomousKeyEditorPage) ((KeyEditor) editor)
+                    .getActiveEditor();
+
+            if (editorPage instanceof PolytomousKeyListEditor) {
+                PolytomousKeyListEditor klEditor = (PolytomousKeyListEditor) editorPage;
+                if(klEditor.getTableItemCount() == 0) {
+                    PolytomousKey pk = klEditor.getViewerInputKey();
+                    parentNode = pk.getRoot();
+
+                } else {
+                    IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+                    if (selection.getFirstElement() instanceof PolytomousKeyNode) {
+                        parentNode = (PolytomousKeyNode) selection.getFirstElement();
+                    } else {
+                        return new Status(IStatus.ERROR,
+                                "unknown",
+                                PolytomousKeyEditorLabels.NO_KEY_NODE_FOR_CHILD_SELECTED_MESSAGE);
+                    }
+                }
+            }
+        }
+        return Status.OK_STATUS;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#prepareOperation(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        return new RemotingCreatePolytomousKeyNodeOperation(event.getTrigger(), false, parentNode);
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete()
+     */
+    @Override
+    public void onComplete() {
+        // TODO Auto-generated method stub
+
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateSiblingPolytomousKeyNodeHandler.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/handler/RemotingCreateSiblingPolytomousKeyNodeHandler.java
new file mode 100644 (file)
index 0000000..7f726a8
--- /dev/null
@@ -0,0 +1,72 @@
+// $Id$
+/**
+* Copyright (C) 2015 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.editor.key.polytomous.handler;
+
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.operations.AbstractOperation;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.PolytomousKeyEditorLabels;
+import eu.etaxonomy.taxeditor.editor.key.polytomous.operation.RemotingCreatePolytomousKeyNodeOperation;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmHandler;
+
+/**
+ * @author cmathew
+ * @date 21 Jul 2015
+ *
+ */
+public class RemotingCreateSiblingPolytomousKeyNodeHandler extends RemotingCdmHandler {
+
+    private PolytomousKeyNode parentNode;
+
+    public RemotingCreateSiblingPolytomousKeyNodeHandler() {
+        super(PolytomousKeyEditorLabels.CREATE_SIBLING_POLYTOMOUS_KEY_NODE_LABEL);
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#allowOperations(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public IStatus allowOperations(ExecutionEvent event) {
+
+        IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
+
+        if (selection.getFirstElement() instanceof PolytomousKeyNode) {
+            parentNode = (PolytomousKeyNode) selection.getFirstElement();
+        } else {
+            return new Status(IStatus.ERROR,
+                    "unknown",
+                    PolytomousKeyEditorLabels.NO_KEY_NODE_FOR_SIBLING_SELECTED_MESSAGE);
+        }
+
+        return Status.OK_STATUS;
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#prepareOperation(org.eclipse.core.commands.ExecutionEvent)
+     */
+    @Override
+    public AbstractOperation prepareOperation(ExecutionEvent event) {
+        return new RemotingCreatePolytomousKeyNodeOperation(event.getTrigger(), false, parentNode.getParent());
+    }
+
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmHandler#onComplete()
+     */
+    @Override
+    public void onComplete() {
+        // TODO Auto-generated method stub
+
+    }
+
+}
index fcf5b9171a2f5aff639ef5fb6743b17a1985dfd1..aa1a363f964e4966947112a26db956c8903fbe07 100644 (file)
@@ -9,7 +9,6 @@ import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 
-import eu.etaxonomy.cdm.api.application.CdmApplicationState;
 import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
 import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
 import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
@@ -39,7 +38,7 @@ public class CreateNodeOperation extends AbstractPostTaxonOperation {
                childNode = PolytomousKeyNode.NewInstance();
 
                parentNode.addChild(childNode);
-               childNode = CdmApplicationState.getCurrentAppConfig().getPolytomousKeyNodeService().merge(childNode);
+
                return postExecute(childNode);
        }
 
diff --git a/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RemotingCreatePolytomousKeyNodeOperation.java b/eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RemotingCreatePolytomousKeyNodeOperation.java
new file mode 100644 (file)
index 0000000..544c89b
--- /dev/null
@@ -0,0 +1,48 @@
+// $Id$
+/**
+* Copyright (C) 2015 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.editor.key.polytomous.operation;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.taxeditor.operation.RemotingCdmMergeOperation;
+
+/**
+ * @author cmathew
+ * @date 21 Jul 2015
+ *
+ */
+public class RemotingCreatePolytomousKeyNodeOperation extends RemotingCdmMergeOperation {
+
+    private final PolytomousKeyNode parentNode;
+
+    private final static String LABEL = "Create new polytomous key node";
+
+    public RemotingCreatePolytomousKeyNodeOperation(Object source,
+            boolean async,
+            PolytomousKeyNode parentNode){
+        super(LABEL, Action.Create, source, async);
+        this.parentNode = parentNode;
+    }
+    /* (non-Javadoc)
+     * @see eu.etaxonomy.taxeditor.operation.RemotingCdmMergeOperation#doMergeExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
+     */
+    @Override
+    protected CdmBase doMergeExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
+        PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance();
+        parentNode.addChild(childNode);
+        return CdmApplicationState.getCurrentAppConfig().getPolytomousKeyNodeService().merge(childNode);
+    }
+
+}
index 004c183126bbcd80022dd9d50b98231c9ecd17b8..b93937e9d3037efbd31b531bc019b8c58f120842 100644 (file)
@@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.operation;
 import org.eclipse.core.runtime.IAdaptable;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 
 import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.model.common.CdmBase;
@@ -55,8 +56,7 @@ public abstract class RemotingCdmMergeOperation extends RemotingCdmOperation {
      */
     @Override
     protected IStatus onComplete(boolean success) {
-        // TODO Auto-generated method stub
-        return null;
+        return Status.OK_STATUS;
     }
 
 }
index 8a856d27ed02fa59929c5728151e13b009430333..7084fa68a3625207669011e36b32ee0b263cad0a 100644 (file)
@@ -71,6 +71,12 @@ public abstract class RemotingCdmOperation extends AbstractOperation {
         }
     }
 
+    protected void fireDataChangeEvent(CdmBase cdmBase) {
+        if(cdmBase != null) {
+            CdmApplicationState.getCurrentDataChangeService().fireChangeEvent(new CdmChangeEvent(action, cdmBase, source.getClass()), async);
+        }
+    }
+
     /* (non-Javadoc)
      * @see org.eclipse.core.commands.operations.AbstractOperation#redo(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
      */