Revision 3f8e87ed
Added by Katja Luther almost 10 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/operation/DeleteOperation.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
package eu.etaxonomy.taxeditor.navigation.navigator.operation; |
12 | 12 |
|
13 |
import java.util.List; |
|
13 | 14 |
import java.util.Set; |
15 |
import java.util.UUID; |
|
14 | 16 |
|
15 | 17 |
import org.eclipse.core.commands.ExecutionException; |
16 | 18 |
import org.eclipse.core.commands.operations.IUndoContext; |
... | ... | |
99 | 101 |
//((TaxonNode) treeNode).delete(); |
100 | 102 |
|
101 | 103 |
element = ((TaxonNode)taxonNode).getTaxon(); |
102 |
try { |
|
103 |
service.deleteTaxonNode((TaxonNode)taxonNode, config); |
|
104 |
} catch (DataChangeNoRollbackException e) { |
|
105 |
|
|
106 |
throw new ExecutionException(e.getMessage()); |
|
107 |
|
|
108 |
} |
|
104 |
|
|
105 |
String result = service.deleteTaxonNode((TaxonNode)taxonNode, config); |
|
106 |
//TODO:if result is not a UUIDstring then pop up a message box |
|
109 | 107 |
|
110 | 108 |
}else if(taxonNode != null && taxonNode instanceof Classification){ |
111 | 109 |
Classification taxonomicTree = (Classification) taxonNode; |
... | ... | |
114 | 112 |
return null; |
115 | 113 |
} |
116 | 114 |
}*/ |
117 |
try{ |
|
118 |
CdmStore.getService(IClassificationService.class).delete(taxonomicTree); |
|
119 |
}catch(ReferencedObjectUndeletableException e){ |
|
120 |
throw new ExecutionException(e.getMessage()); |
|
121 |
} |
|
122 |
|
|
115 |
|
|
116 |
String result = CdmStore.getService(IClassificationService.class).delete(taxonomicTree); |
|
117 |
|
|
123 | 118 |
|
124 | 119 |
/*}else{ |
125 | 120 |
try{ |
... | ... | |
129 | 124 |
} |
130 | 125 |
}*/ |
131 | 126 |
} else { |
132 |
try { |
|
133 |
service.deleteTaxonNodes(treeNodes, config); |
|
134 |
} catch (DataChangeNoRollbackException e) { |
|
135 |
throw new ExecutionException(e.getMessage()); |
|
136 |
} |
|
127 |
|
|
128 |
List<UUID> result =service.deleteTaxonNodes(treeNodes, config); |
|
129 |
|
|
137 | 130 |
} |
138 | 131 |
|
139 | 132 |
monitor.worked(40); |
Also available in: Unified diff
adding a taxon bulk editor and changes because the delete methods does not throw exceptions anymore