Revision eb140397
Added by Katja Luther about 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/RemotingDeleteTaxonNodeOperation.java | ||
---|---|---|
16 | 16 |
import org.eclipse.core.runtime.IProgressMonitor; |
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.api.application.CdmApplicationState; |
19 |
import eu.etaxonomy.cdm.api.application.CdmChangeEvent; |
|
19 | 20 |
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action; |
20 | 21 |
import eu.etaxonomy.cdm.api.service.DeleteResult; |
21 | 22 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
... | ... | |
59 | 60 |
*/ |
60 | 61 |
@Override |
61 | 62 |
protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception { |
62 |
|
|
63 |
DeleteResult result = new DeleteResult(); |
|
63 | 64 |
|
64 | 65 |
if(treeNodes.size() == 1) { |
65 | 66 |
// when single node this is either a taxon or a classification |
66 | 67 |
TaxonNodeDto node = treeNodes.iterator().next(); |
67 | 68 |
if(node.getTaxonUuid() == null) { |
68 |
return CdmApplicationState.getCurrentAppConfig().getClassificationService().delete(node.getClassificationUUID()); |
|
69 |
result = CdmApplicationState.getCurrentAppConfig().getClassificationService().delete(node.getClassificationUUID()); |
|
70 |
}else{ |
|
71 |
result = CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().deleteTaxonNode((node).getUuid(), config); |
|
69 | 72 |
} |
70 |
return CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().deleteTaxonNode((node).getUuid(), config); |
|
71 | 73 |
// } else if(node.getType().equals( Classification.class)) { |
72 | 74 |
// entityType = Classification.class; |
73 | 75 |
// return CdmApplicationState.getCurrentAppConfig().getClassificationService().delete(node.getUuid()); |
... | ... | |
86 | 88 |
classificationsUuids.add(treeNode.getClassificationUUID()); |
87 | 89 |
} |
88 | 90 |
} |
89 |
DeleteResult result = new DeleteResult(); |
|
91 |
|
|
90 | 92 |
if (!treeNodeUuids.isEmpty()){ |
91 | 93 |
result.includeResult(CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().deleteTaxonNodes(treeNodeUuids, new TaxonDeletionConfigurator())); |
92 | 94 |
} |
... | ... | |
96 | 98 |
} |
97 | 99 |
} |
98 | 100 |
|
99 |
return result; |
|
100 |
} |
|
101 | 101 |
|
102 |
|
|
103 |
} |
|
104 |
CdmApplicationState.getCurrentDataChangeService() |
|
105 |
.fireChangeEvent(new CdmChangeEvent(Action.Delete, result.getDeletedObjects(), this), true); |
|
106 |
return result; |
|
102 | 107 |
} |
103 | 108 |
|
104 | 109 |
} |
Also available in: Unified diff
fix refresh after classification delete in taxon navigator