Merge branch 'develop' into remoting-4.0
[taxeditor.git] / eu.etaxonomy.taxeditor.navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / navigator / operation / RemotingChangeAcceptedTaxonToSynonymOperation.java
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 java.util.UUID;
13
14 import org.eclipse.core.runtime.IAdaptable;
15 import org.eclipse.core.runtime.IProgressMonitor;
16
17 import eu.etaxonomy.cdm.api.application.CdmApplicationState;
18 import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
19 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
20 import eu.etaxonomy.cdm.api.service.UpdateResult;
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 = "Change Accepted Taxon to Synonym operation";
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 }