private CdmBase load(CdmEntityIdentifier cei, boolean update) {
- return load(CdmBase.deproxy(CdmApplicationState.getCommonService().find(cei.getCdmClass(), cei.getId()),cei.getCdmClass()), update);
+ return CdmApplicationState.getCommonService().findWithUpdate(cei.getCdmClass(), cei.getId());
}
logger.info("Remote invoking : " + currentRemoteInvocation.getMethodName() + "@" + config.getServiceUrl());
rir = super.doExecuteRequest(config, baos);
if(rir.getValue() != null && !rir.hasException()) {
- if("merge".equals(currentRemoteInvocation.getMethodName()) || "save".equals(currentRemoteInvocation.getMethodName())) {
+ if("merge".equals(currentRemoteInvocation.getMethodName()) ||
+ "save".equals(currentRemoteInvocation.getMethodName()) ||
+ "findWithUpdate".equals(currentRemoteInvocation.getMethodName())) {
rir = new RemoteInvocationResult(cdmEntitySessionManager.load(rir.getValue(), true));
} else if(rir.getValue() instanceof UpdateResult){
UpdateResult result = (UpdateResult)rir.getValue();
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;
childNode = PolytomousKeyNode.NewInstance();
parentNode.addChild(childNode);
- childNode = CdmApplicationState.getCurrentAppConfig().getPolytomousKeyNodeService().merge(childNode);
+
return postExecute(childNode);
}
return testService.returnResult(result);
} else if(exception != null) {
return testService.throwException(exception);
+ } else if(cei != null) {
+ return testService.addChild(cei);
}
return null;
}
Bundle-ManifestVersion: 2
Bundle-Name: eu.etaxonomy.taxeditor.test
Bundle-SymbolicName: eu.etaxonomy.taxeditor.test;singleton:=true
-Bundle-Version: 3.6.1.qualifier
+Bundle-Version: 3.8.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-Vendor: EDIT
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
<parent>\r
<groupId>eu.etaxonomy</groupId>\r
<artifactId>taxeditor-parent</artifactId>\r
- <version>3.6.1-SNAPSHOT</version>\r
+ <version>3.8.0-SNAPSHOT</version>\r
</parent>\r
<modelVersion>4.0.0</modelVersion>\r
<artifactId>eu.etaxonomy.taxeditor.test</artifactId>\r
// TO DO : Added tests for Annotations , Markers
}
+
+
@Test
public void readPolytomousKeyDataFromNodes() {
PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
Assert.assertEquals(rootNode.getChildAt(1).getChildAt(0).getChildAt(0).getTaxon().getTitleCache(), "Achillea arabica Kotschy sec. Cyprus");
}
+ @Test
+ public void addGrandChildPolytomousKeyNode() {
+ PolytomousKey pKey = CdmBase.deproxy(polytomousKeyService.find(polytomousKeyUuid),PolytomousKey.class);
+ PolytomousKeyNode rootNode = pKey.getRoot();
+ PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance();
+ rootNode.addChild(childNode);
+
+ polytomousKeyService.merge(pKey);
+
+ PolytomousKeyNode grandChildNode = PolytomousKeyNode.NewInstance();
+ childNode.addChild(grandChildNode);
+
+ polytomousKeyService.merge(pKey);
+ }
@Test
public void savePolytomousKeyNodeData() {