Add method to sessionOwner objects to fine tune performance using property paths
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / TaxonEditorInput.java
index b8742e3dafe892ee1fb92bab8d0f4822fca410bf..8540c7d34bf30503d1b03d66f4196acadb7c96f8 100644 (file)
@@ -12,6 +12,7 @@ package eu.etaxonomy.taxeditor.editor;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
@@ -93,8 +94,28 @@ public class TaxonEditorInput  extends CdmEntitySessionInput implements IEditorI
      */
     private void initForTaxonNode(UUID taxonNodeUuid) {
 
-
-        TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid);
+        List<String> taxonNodePropertyPaths = Arrays.asList(new String[] {
+                "taxon.annotations",
+                "taxon.markers",
+                "taxon.credits",
+                "taxon.extensions",
+                "taxon.rights",
+                "taxon.sources",
+                "taxon.descriptions",
+                "taxon.synonymRelations",
+                "taxon.relationsToThisTaxon",
+                "taxon.relationsFromThisTaxon",
+                "taxon.taxonNodes",
+                "taxon.name.status",
+                "taxon.name.homotypicalGroup.typifiedNames",
+                "taxon.name.taxonBases",
+                "taxon.name.descriptions.descriptionElements",
+                "taxon.name.descriptions.markers"
+
+
+        });
+
+        TaxonNode taxonNode = CdmStore.getService(ITaxonNodeService.class).load(taxonNodeUuid, taxonNodePropertyPaths);
 
         if(taxonNode == null){
             MessagingUtils.warningDialog("Not yet implemented", TaxonEditorInput.class, "Selected element is not type TaxonBase.");
@@ -453,4 +474,31 @@ public class TaxonEditorInput  extends CdmEntitySessionInput implements IEditorI
         CdmStore.getService(ITaxonNodeService.class).merge(taxonNode);
     }
 
+    @Override
+    public Map<Object, List<String>> getPropertyPathsMap() {
+//        Map<Object, List<String>> propertyPathsMap = new HashMap<Object, List<String>>();
+//        List<String> taxonNameBasePropertyPaths = Arrays.asList(new String[] {
+//                "status",
+//                "taxonBases.taxonNodes",
+//                "homotypicalGroup.typifiedNames.taxonBases.synonymRelations",
+//                "taxonBases.relationsToThisTaxon",
+//                "taxonBases.relationsFromThisTaxon",
+//                "descriptions"
+//        });
+//         propertyPathsMap.put(TaxonNameBase.class, taxonNameBasePropertyPaths);
+//
+//         List<String> taxonBasePropertyPaths = Arrays.asList(new String[] {
+//                 "taxon.annotations",
+//                 "taxon.markers",
+//                 "taxon.credits",
+//                 "taxon.extensions",
+//                 "taxon.rights",
+//                 "taxon.sources",
+//                 "taxon.descriptions"
+//         });
+//        propertyPathsMap.put(TaxonNode.class, taxonBasePropertyPaths);
+//        return propertyPathsMap;
+        return null;
+    }
+
 }