1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2015 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
package eu.etaxonomy.taxeditor.navigation.navigator.operation;
|
11
|
|
12
|
import org.eclipse.core.runtime.IAdaptable;
|
13
|
import org.eclipse.core.runtime.IProgressMonitor;
|
14
|
|
15
|
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
|
16
|
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
|
17
|
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
|
18
|
import eu.etaxonomy.cdm.api.service.UpdateResult;
|
19
|
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
|
20
|
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
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 TaxonNode newAcceptedTaxonNode;
|
32
|
private final ITaxonTreeNode oldTaxonNode;
|
33
|
|
34
|
private final static String LABEL = "ChangeAcceptedTaxonToSynonymOperation";
|
35
|
|
36
|
/**
|
37
|
* @param label
|
38
|
*/
|
39
|
public RemotingChangeAcceptedTaxonToSynonymOperation(Object source,
|
40
|
boolean async,
|
41
|
ITaxonTreeNode oldTaxonNode,
|
42
|
TaxonNode newAcceptedTaxonNode) {
|
43
|
super(LABEL, Action.Update, source, async);
|
44
|
this.oldTaxonNode = oldTaxonNode;
|
45
|
this.newAcceptedTaxonNode = newAcceptedTaxonNode;
|
46
|
}
|
47
|
|
48
|
/* (non-Javadoc)
|
49
|
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
|
50
|
*/
|
51
|
@Override
|
52
|
protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
|
53
|
return CdmApplicationState.getService(ITaxonNodeService.class).makeTaxonNodeASynonymOfAnotherTaxonNode(oldTaxonNode.getUuid(), newAcceptedTaxonNode.getUuid(), null, null, null);
|
54
|
}
|
55
|
|
56
|
}
|