ref #6190 removing svn property place holder in first line of code - java files
[taxeditor.git] / eu.etaxonomy.taxeditor.navigation / src / main / java / eu / etaxonomy / taxeditor / navigation / navigator / operation / RemotingChangeAcceptedTaxonToSynonymOperation.java
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.operation.RemotingCdmUpdateOperation;
21
22
23 /**
24 * @author cmathew
25 * @date 17 Jun 2015
26 *
27 */
28 public class RemotingChangeAcceptedTaxonToSynonymOperation extends RemotingCdmUpdateOperation {
29
30 private final UUID oldTaxonNodeUuid;
31 private final UUID newAcceptedTaxonNodeUuid;
32
33
34 private final static String LABEL = "Change Accepted Taxon to Synonym operation";
35
36 /**
37 * @param label
38 */
39 public RemotingChangeAcceptedTaxonToSynonymOperation(Object source,
40 boolean async,
41 UUID oldTaxonNodeUuid,
42 UUID newAcceptedTaxonNodeUuid) {
43 super(LABEL, Action.Update, source, async);
44 this.oldTaxonNodeUuid = oldTaxonNodeUuid;
45 this.newAcceptedTaxonNodeUuid = newAcceptedTaxonNodeUuid;
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(oldTaxonNodeUuid,
54 newAcceptedTaxonNodeUuid,
55 null,
56 null,
57 null);
58 }
59
60 }