1
|
/**
|
2
|
* Copyright (C) 2015 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.navigation.navigator.operation;
|
10
|
|
11
|
import java.util.UUID;
|
12
|
|
13
|
import org.eclipse.core.runtime.IAdaptable;
|
14
|
import org.eclipse.core.runtime.IProgressMonitor;
|
15
|
|
16
|
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
|
17
|
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
|
18
|
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
|
19
|
import eu.etaxonomy.cdm.api.service.UpdateResult;
|
20
|
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
|
21
|
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
|
22
|
|
23
|
|
24
|
/**
|
25
|
* @author cmathew
|
26
|
* @date 17 Jun 2015
|
27
|
*
|
28
|
*/
|
29
|
public class RemotingChangeAcceptedTaxonToSynonymOperation extends RemotingCdmUpdateOperation {
|
30
|
|
31
|
private final UUID oldTaxonNodeUuid;
|
32
|
private final UUID newAcceptedTaxonNodeUuid;
|
33
|
|
34
|
|
35
|
private final static String LABEL = Messages.RemotingChangeAcceptedTaxonToSynonymOperation_CHANGE_OP;
|
36
|
|
37
|
/**
|
38
|
* @param label
|
39
|
*/
|
40
|
public RemotingChangeAcceptedTaxonToSynonymOperation(Object source,
|
41
|
boolean async,
|
42
|
UUID oldTaxonNodeUuid,
|
43
|
UUID newAcceptedTaxonNodeUuid) {
|
44
|
super(LABEL, Action.Update, source, async);
|
45
|
this.oldTaxonNodeUuid = oldTaxonNodeUuid;
|
46
|
this.newAcceptedTaxonNodeUuid = newAcceptedTaxonNodeUuid;
|
47
|
}
|
48
|
|
49
|
/* (non-Javadoc)
|
50
|
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
|
51
|
*/
|
52
|
@Override
|
53
|
protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
|
54
|
return CdmApplicationState.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(oldTaxonNodeUuid,
|
55
|
newAcceptedTaxonNodeUuid,
|
56
|
null,
|
57
|
null,
|
58
|
null);
|
59
|
}
|
60
|
|
61
|
}
|