merge
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / key / polytomous / PolytomousKeyEditorInput.java
index 8165f0b8cc9aad187143ad6ccc29010c1a19b7e6..e76738ff79a1af2c84b854e183b0e2529b2790f1 100644 (file)
@@ -4,7 +4,9 @@
 package eu.etaxonomy.taxeditor.editor.key.polytomous;
 
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.UUID;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
@@ -32,11 +34,11 @@ public class PolytomousKeyEditorInput extends AbstractIdentificationEditorInput<
         this.name = key.getTitleCache();
     }
 
-    public PolytomousKeyEditorInput(UUID polytomousKeyUuid, String name) {
-        super(CdmStore.createConversation());
-        this.keyUuid = polytomousKeyUuid;
-        this.name = name;
-    }
+//    public PolytomousKeyEditorInput(UUID polytomousKeyUuid, String name) {
+//        super(CdmStore.createConversation());
+//        this.keyUuid = polytomousKeyUuid;
+//        this.name = name;
+//    }
 
 
     public static PolytomousKeyEditorInput NewInstance(UUID polytomousKeyUuid) throws Exception{
@@ -89,7 +91,20 @@ public class PolytomousKeyEditorInput extends AbstractIdentificationEditorInput<
      */
     @Override
     public void merge() {
-        CdmStore.getService(IPolytomousKeyService.class).merge(key);
+        if(CdmStore.getCurrentSessionManager().isRemoting()) {
+            key = CdmStore.getService(IPolytomousKeyService.class).merge(key,true);
+        }
+    }
+
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+        Map<Object,List<String>> propertyPathsMap = new HashMap<Object,List<String>>();
+
+        List<String> polytomousKeyNodePropertyPaths = Arrays.asList(new String[] {
+                "statement"
+        });
+         propertyPathsMap.put("children", polytomousKeyNodePropertyPaths);
+         return propertyPathsMap;
     }
 
 }