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.key.polytomous.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.CdmChangeEvent.Action;
|
18
|
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
|
19
|
import eu.etaxonomy.cdm.api.service.UpdateResult;
|
20
|
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
|
21
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
22
|
|
23
|
/**
|
24
|
* @author cmathew
|
25
|
* @date 29 Jun 2015
|
26
|
*
|
27
|
*/
|
28
|
public class RemotingPolytomousKeyUpdateAllNodesOperation extends RemotingCdmUpdateOperation {
|
29
|
|
30
|
UUID polytomousKeyUuid;
|
31
|
/**
|
32
|
* @param label
|
33
|
* @param action
|
34
|
* @param source
|
35
|
* @param async
|
36
|
*/
|
37
|
public RemotingPolytomousKeyUpdateAllNodesOperation(Object source,
|
38
|
boolean async,
|
39
|
UUID polytomousKeyUuid) {
|
40
|
super(LABEL, Action.Update, source, async);
|
41
|
this.polytomousKeyUuid = polytomousKeyUuid;
|
42
|
|
43
|
}
|
44
|
|
45
|
private final static String LABEL = "Update All Polytomous Key Nodes operation";
|
46
|
|
47
|
/* (non-Javadoc)
|
48
|
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
|
49
|
*/
|
50
|
@Override
|
51
|
protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
|
52
|
return CdmStore.getService(IPolytomousKeyService.class).updateAllNodeNumberings(polytomousKeyUuid);
|
53
|
}
|
54
|
|
55
|
}
|