29 |
29 |
import eu.etaxonomy.cdm.model.taxon.Classification;
|
30 |
30 |
import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode;
|
31 |
31 |
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
|
|
32 |
import eu.etaxonomy.taxeditor.model.MessagingUtils;
|
32 |
33 |
import eu.etaxonomy.taxeditor.operation.AbstractPersistentPostOperation;
|
33 |
34 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
|
34 |
35 |
import eu.etaxonomy.taxeditor.store.CdmStore;
|
... | ... | |
107 |
108 |
} else if (!result.getExceptions().isEmpty()){
|
108 |
109 |
String separator = ", ";
|
109 |
110 |
String exceptionString = "";
|
|
111 |
int count = 1;
|
110 |
112 |
for (Exception exception : result.getExceptions()) {
|
111 |
|
exceptionString += exception.getLocalizedMessage()+separator;
|
|
113 |
exceptionString += exception.getLocalizedMessage();
|
|
114 |
if (count < result.getExceptions().size()){
|
|
115 |
exceptionString += separator;
|
|
116 |
}
|
112 |
117 |
}
|
113 |
|
MessageDialog.openInformation(null, "Delete of the node was successful but the taxon could not be deleted.", exceptionString);
|
|
118 |
MessagingUtils.informationDialog("Delete of the node was successful but the taxon could not be deleted.", exceptionString);
|
114 |
119 |
}
|
115 |
120 |
|
116 |
121 |
|
... | ... | |
124 |
129 |
|
125 |
130 |
DeleteResult result = CdmStore.getService(IClassificationService.class).delete(taxonomicTree);
|
126 |
131 |
if (result.isError() && !result.getExceptions().isEmpty()){
|
127 |
|
//TODO:Error message!
|
128 |
|
MessageDialog.openError(null, "Delete failed", result.getExceptions().iterator().next().getMessage());
|
|
132 |
String separator = ", ";
|
|
133 |
String exceptionString = "";
|
|
134 |
for (Exception exception : result.getExceptions()) {
|
|
135 |
exceptionString += exception.getLocalizedMessage()+separator;
|
|
136 |
}
|
|
137 |
MessagingUtils.error(null, exceptionString, result.getExceptions().iterator().next());
|
129 |
138 |
}
|
130 |
139 |
|
131 |
140 |
/*}else{
|
... | ... | |
139 |
148 |
|
140 |
149 |
DeleteResult result =service.deleteTaxonNodes(treeNodes, config);
|
141 |
150 |
if (result.isError() && !result.getExceptions().isEmpty()){
|
142 |
|
//TODO:Error message!
|
143 |
|
MessageDialog.openError(null, "Delete failed", result.getExceptions().iterator().next().getMessage());
|
|
151 |
String separator = ", ";
|
|
152 |
String exceptionString = "";
|
|
153 |
for (Exception exception : result.getExceptions()) {
|
|
154 |
exceptionString += exception.getLocalizedMessage()+separator;
|
|
155 |
}
|
|
156 |
MessagingUtils.error(null, exceptionString, result.getExceptions().iterator().next());
|
144 |
157 |
}
|
145 |
158 |
}
|
146 |
159 |
|
error handling in deleteHandler/operation of navigator