3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.navigation
.key
.polytomous
.operation
;
12 import java
.util
.UUID
;
14 import org
.eclipse
.core
.runtime
.IAdaptable
;
15 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
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
;
28 public class RemotingUpdatePolytomousKeyAllNodesOperation
extends RemotingCdmUpdateOperation
{
30 private final UUID polytomousKeyUuid
;
37 public RemotingUpdatePolytomousKeyAllNodesOperation(Object source
,
39 UUID polytomousKeyUuid
) {
40 super(LABEL
, Action
.Update
, source
, async
);
41 this.polytomousKeyUuid
= polytomousKeyUuid
;
45 public RemotingUpdatePolytomousKeyAllNodesOperation(Object source
,
47 super(LABEL
, Action
.Update
, source
, async
);
48 // this implies that we have to update all nodes of all keys
49 this.polytomousKeyUuid
= null;
52 private final static String LABEL
= "Update All Polytomous Key Nodes operation";
55 * @see eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation#doUpdateExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable)
58 protected UpdateResult
doUpdateExecute(IProgressMonitor monitor
, IAdaptable info
) throws Exception
{
59 if(polytomousKeyUuid
== null) {
60 return CdmStore
.getService(IPolytomousKeyService
.class).updateAllNodeNumberings();
62 return CdmStore
.getService(IPolytomousKeyService
.class).updateAllNodeNumberings(polytomousKeyUuid
);