2 * Copyright (C) 2015 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.navigation
.key
.polytomous
.operation
;
11 import java
.util
.UUID
;
13 import org
.eclipse
.core
.runtime
.IAdaptable
;
14 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
16 import eu
.etaxonomy
.cdm
.api
.application
.CdmChangeEvent
.Action
;
17 import eu
.etaxonomy
.cdm
.api
.service
.IPolytomousKeyService
;
18 import eu
.etaxonomy
.cdm
.api
.service
.UpdateResult
;
19 import eu
.etaxonomy
.taxeditor
.operation
.RemotingCdmUpdateOperation
;
20 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 public class RemotingUpdatePolytomousKeyAllNodesOperation
extends RemotingCdmUpdateOperation
{
29 private final UUID polytomousKeyUuid
;
36 public RemotingUpdatePolytomousKeyAllNodesOperation(Object source
,
38 UUID polytomousKeyUuid
) {
39 super(LABEL
, Action
.Update
, source
, async
);
40 this.polytomousKeyUuid
= polytomousKeyUuid
;
44 public RemotingUpdatePolytomousKeyAllNodesOperation(Object source
,
46 super(LABEL
, Action
.Update
, source
, async
);
47 // this implies that we have to update all nodes of all keys
48 this.polytomousKeyUuid
= null;
51 private final static String LABEL
= "Update All Polytomous Key Nodes operation";
54 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
57 protected UpdateResult
doUpdateExecute(IProgressMonitor monitor
, IAdaptable info
) throws Exception
{
58 if(polytomousKeyUuid
== null) {
59 return CdmStore
.getService(IPolytomousKeyService
.class).updateAllNodeNumberings();
61 return CdmStore
.getService(IPolytomousKeyService
.class).updateAllNodeNumberings(polytomousKeyUuid
);