<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry including="**/*.java" kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
- <classpathentry kind="src" path="src/main/resources/"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
+import java.util.Map;
import java.util.UUID;
import org.eclipse.jface.resource.ImageDescriptor;
public List<T> getRootEntities() {
return getModel();
}
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
selectionService.addSelectionListener(this);
}
+
}
Bundle-ManifestVersion: 2
Bundle-Name: CDM Library Dependencies Plugin
Bundle-SymbolicName: eu.etaxonomy.taxeditor.cdmlib;singleton:=true
-Bundle-Version: 3.6.1
+Bundle-Version: 3.6.1.qualifier
Eclipse-BundleShape: dir
Export-Package: com.google.api,
com.google.api.detect,
*/
package eu.etaxonomy.taxeditor.service;
+import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.cdm.api.service.ICommonService;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.taxeditor.remoting.cache.ProxyUtils.CollectionField;
+import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
/**
@Override
public CdmBase find(Class<? extends CdmBase> clazz, int id) {
if(cacheEnabled) {
- CdmBase cdmEntity = CdmBase.deproxy(commonService.find(clazz, id),clazz);
+ CdmBase cdmEntity = CdmBase.deproxy(commonService.find(clazz, id, getPropertyPaths(clazz)),clazz);
if(cdmEntity == null) {
throw new NullPointerException("CDM Entity of type " + clazz.getName() + " with id " + id + " is null.");
}
}
+ private List<String> getPropertyPaths(Object obj) {
+ List<String> propertyPaths = null;
+ ICdmEntitySession cdmEntitySession =
+ ((CdmApplicationRemoteController)CdmApplicationState.getCurrentAppConfig()).getCdmEntitySessionManager().getActiveSession();
+ if(cdmEntitySession != null) {
+ propertyPaths = cdmEntitySession.getPropertyPaths(obj);
+ }
+ return propertyPaths;
+ }
+
@Override
public void updatePersistentCollection(CollectionField colf) {
if(cacheEnabled) {
*/
@Override
public Object initializeCollection(UUID ownerUuid, String fieldName) {
- return commonService.initializeCollection(ownerUuid, fieldName);
+ return commonService.initializeCollection(ownerUuid, fieldName, getPropertyPaths(fieldName));
}
logger.info("Remote invoking : " + currentRemoteInvocation.getMethodName() + "@" + config.getServiceUrl());
rir = super.doExecuteRequest(config, baos);
if(rir.getValue() != null && !rir.hasException()) {
- if(rir.getValue() instanceof UpdateResult){
- UpdateResult result = (UpdateResult)rir.getValue();
- if(result.isOk()){
- rir = new RemoteInvocationResult(cdmEntitySessionManager.load(result, true));
- }
- } else {
- rir = new RemoteInvocationResult(cdmEntitySessionManager.load(rir.getValue(), true));
- }
+ if("merge".equals(currentRemoteInvocation.getMethodName()) || "save".equals(currentRemoteInvocation.getMethodName())) {
+ rir = new RemoteInvocationResult(cdmEntitySessionManager.load(rir.getValue(), true));
+ } else if(rir.getValue() instanceof UpdateResult){
+ UpdateResult result = (UpdateResult)rir.getValue();
+ if(result.isOk()){
+ cdmEntitySessionManager.load(result, true);
+ }
+ } else {
+ rir = new RemoteInvocationResult(cdmEntitySessionManager.load(rir.getValue(), false));
+ }
}
cache(currentRemoteInvocation, rir);
}
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.UUID;
return cdmTransientEntityCacher;
}
-
-
-
-
-
-
-
-
-
-
-
+ @Override
+ public List<String> getPropertyPaths(Object obj) {
+ Map<Object, List<String>> propertyPathsMap = sessionOwner.getPropertyPathsMap();
+ if(propertyPathsMap == null || propertyPathsMap.isEmpty()) {
+ return null;
+ }
+ return propertyPathsMap.get(obj);
+ }
}
public <T extends CdmBase> void update();
-
+ /**
+ * @param obj
+ * @return
+ */
+ public List<String> getPropertyPaths(Object obj);
}
\ No newline at end of file
package eu.etaxonomy.taxeditor.session;
import java.util.Collection;
+import java.util.List;
+import java.util.Map;
import eu.etaxonomy.cdm.model.common.CdmBase;
public <T extends CdmBase> Collection<T> getRootEntities();
+ public Map<Object, List<String>> getPropertyPathsMap();
+
}
return updateResult;
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySession#getPropertyPath(java.lang.Class)
+ */
+ @Override
+ public List<String> getPropertyPaths(Object obj) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.UUID;
*/
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.");
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;
+ }
+
}
throws ExecutionException {
try {
- newTaxon = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym, element, true, true, null, null);
+ newTaxon = CdmStore.getService(ITaxonService.class).changeSynonymToAcceptedTaxon(synonym.getUuid(), element.getUuid(), true, true, null, null);
} catch (HomotypicalGroupChangeException e) {
MessagingUtils.warningDialog("Operation may lead to inconsistent data", getClass(), e.getMessage());
return postExecute(null);
public DeleteResult deleteSynonym(UUID arg0, SynonymDeletionConfigurator arg1) {
return defaultService.deleteSynonym(arg0, arg1);
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.ITaxonService#changeSynonymToAcceptedTaxon(java.util.UUID, java.util.UUID, boolean, boolean, eu.etaxonomy.cdm.model.reference.Reference, java.lang.String)
+ */
+ @Override
+ public Taxon changeSynonymToAcceptedTaxon(UUID arg0, UUID arg1, boolean arg2, boolean arg3, Reference arg4,
+ String arg5) throws HomotypicalGroupChangeException {
+ return defaultService.changeSynonymToAcceptedTaxon(arg0, arg1, arg2, arg3, arg4, arg5);
+ }
}
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.UUID;
return contentProvider.getRootElements();
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
package eu.etaxonomy.taxeditor.navigation.key.polytomous;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.common.NotDefinedException;
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
package eu.etaxonomy.taxeditor.navigation.navigator;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Comparator;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Observable;
import java.util.Observer;
import java.util.Set;
}
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ Map<Object, List<String>> propertyPathsMap = new HashMap<Object, List<String>>();
+ List<String> taxonNodePropertyPaths = Arrays.asList(new String[] {
+ "taxon.name"
+ });
+ propertyPathsMap.put("childNodes", taxonNodePropertyPaths);
+ return propertyPathsMap;
+ }
}
*/
package eu.etaxonomy.taxeditor.editor;
+import java.util.List;
+import java.util.Map;
+
import eu.etaxonomy.taxeditor.session.ICdmEntitySession;
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
import eu.etaxonomy.taxeditor.store.CdmStore;
public abstract void merge();
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
package eu.etaxonomy.taxeditor.editor.definedterm;\r
\r
import java.util.ArrayList;\r
+import java.util.List;\r
+import java.util.Map;\r
import java.util.Set;\r
\r
import org.eclipse.core.runtime.IProgressMonitor;\r
return getDefinedTermEditorInput().getVocabularies();\r
}\r
\r
+ /* (non-Javadoc)\r
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()\r
+ */\r
+ @Override\r
+ public Map<Object, List<String>> getPropertyPathsMap() {\r
+ // TODO Auto-generated method stub\r
+ return null;\r
+ }\r
+\r
\r
}
\ No newline at end of file
import java.util.Arrays;
import java.util.List;
+import java.util.Map;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
public void forceDirty() {
changed(null);
}
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
package eu.etaxonomy.taxeditor.view.derivateSearch;
import java.util.Collection;
+import java.util.List;
+import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.MenuManager;
// TODO Auto-generated method stub
return null;
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
import java.util.HashSet;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.apache.log4j.Logger;
}
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}