Revision abebca79
Added by Cherian Mathew over 8 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/RemotingCreatePolytomousKeyNodeOperation.java | ||
---|---|---|
12 | 12 |
import org.eclipse.core.runtime.IAdaptable; |
13 | 13 |
import org.eclipse.core.runtime.IProgressMonitor; |
14 | 14 |
|
15 |
import eu.etaxonomy.cdm.api.application.CdmApplicationState; |
|
16 | 15 |
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action; |
17 | 16 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
18 | 17 |
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode; |
19 |
import eu.etaxonomy.taxeditor.operation.RemotingCdmMergeOperation;
|
|
18 |
import eu.etaxonomy.taxeditor.operation.RemotingCdmDefaultOperation;
|
|
20 | 19 |
|
21 | 20 |
/** |
22 | 21 |
* @author cmathew |
23 | 22 |
* @date 21 Jul 2015 |
24 | 23 |
* |
25 | 24 |
*/ |
26 |
public class RemotingCreatePolytomousKeyNodeOperation extends RemotingCdmMergeOperation {
|
|
25 |
public class RemotingCreatePolytomousKeyNodeOperation extends RemotingCdmDefaultOperation {
|
|
27 | 26 |
|
28 | 27 |
private final PolytomousKeyNode parentNode; |
29 | 28 |
|
... | ... | |
35 | 34 |
super(LABEL, Action.Create, source, async); |
36 | 35 |
this.parentNode = parentNode; |
37 | 36 |
} |
37 |
|
|
38 | 38 |
/* (non-Javadoc) |
39 |
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmMergeOperation#doMergeExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
|
|
39 |
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmSimpleOperation#doSimpleExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
|
|
40 | 40 |
*/ |
41 | 41 |
@Override |
42 |
protected CdmBase doMergeExecute(IProgressMonitor monitor, IAdaptable info) throws Exception { |
|
43 |
PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance(); |
|
44 |
parentNode.addChild(childNode); |
|
45 |
//childNode.getModifyingText().put(CdmStore.getDefaultLanguage(),LanguageString.NewInstance("",CdmStore.getDefaultLanguage())); |
|
46 |
return CdmApplicationState.getCurrentAppConfig().getPolytomousKeyNodeService().merge(parentNode); |
|
42 |
protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception { |
|
43 |
PolytomousKeyNode childNode = PolytomousKeyNode.NewInstance(); |
|
44 |
parentNode.addChild(childNode); |
|
45 |
return childNode; |
|
47 | 46 |
} |
48 | 47 |
|
49 | 48 |
} |
Also available in: Unified diff
#5247 Fix duplicate entity issue for new entities by using the new merge service method which returns the input transient object