Revision bda4bda9
Added by Katja Luther over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractIOManager.java | ||
---|---|---|
96 | 96 |
* @param importResult |
97 | 97 |
*/ |
98 | 98 |
protected void showResult(String importName, final Display display, |
99 |
IoResultBase ioResult) { |
|
99 |
IoResultBase ioResult, String successMessage) {
|
|
100 | 100 |
StringBuffer reportTextTemp = ioResult.createReport(); |
101 | 101 |
final StringBuffer reportText; |
102 | 102 |
if (StringUtils.isBlank(reportTextTemp.toString()) && ioResult instanceof ImportResult){ |
103 |
reportTextTemp.append("The import was successfull.");
|
|
103 |
reportTextTemp.append(successMessage);
|
|
104 | 104 |
//TODO: this is a workaround because the abcd import writes the report in the report part... |
105 | 105 |
ImportResult importResult = (ImportResult)ioResult; |
106 | 106 |
if (!importResult.getReports().isEmpty() && importResult.getReports().get(0) != null){ |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java | ||
---|---|---|
67 | 67 |
* @version 1.0 |
68 | 68 |
*/ |
69 | 69 |
public class ImportManager extends AbstractIOManager<IImportConfigurator> implements IPostMoniteredOperationEnabled { |
70 |
|
|
71 |
String importSuccessMessage = "The import was successfull."; |
|
72 |
String updateSuccessMessage = "The update was successfull."; |
|
70 | 73 |
|
71 | 74 |
/** |
72 | 75 |
* @param applicationConfiguration |
... | ... | |
217 | 220 |
CdmStore.getContextManager().notifyContextRefresh(); |
218 | 221 |
} |
219 | 222 |
}); |
220 |
showResult(configurator.getClass().getSimpleName(), display, result); |
|
223 |
showResult(configurator.getClass().getSimpleName(), display, result, importSuccessMessage);
|
|
221 | 224 |
return Status.OK_STATUS; |
222 | 225 |
} |
223 | 226 |
}; |
... | ... | |
440 | 443 |
// CdmStore.getContextManager().notifyContextRefresh(); |
441 | 444 |
// } |
442 | 445 |
// }); |
443 |
showResult("Gbif Import", display, result); |
|
446 |
showResult("Gbif Import", display, result, importSuccessMessage);
|
|
444 | 447 |
return Status.OK_STATUS; |
445 | 448 |
} |
446 | 449 |
}; |
... | ... | |
469 | 472 |
CdmStore.getContextManager().notifyContextRefresh(); |
470 | 473 |
} |
471 | 474 |
}); |
472 |
showResult("Abcd Import", display, result); |
|
475 |
showResult("Abcd Import", display, result, importSuccessMessage);
|
|
473 | 476 |
return Status.OK_STATUS; |
474 | 477 |
} |
475 | 478 |
}; |
... | ... | |
499 | 502 |
CdmStore.getContextManager().notifyContextRefresh(); |
500 | 503 |
} |
501 | 504 |
}); |
502 |
showResult("Abcd Import", display, result); |
|
505 |
showResult("Abcd Import", display, result, importSuccessMessage);
|
|
503 | 506 |
|
504 | 507 |
|
505 | 508 |
|
... | ... | |
540 | 543 |
// CdmStore.getContextManager().notifyContextRefresh(); |
541 | 544 |
// } |
542 | 545 |
// }); |
543 |
showResult(configurator.getClass().getSimpleName(), display, importResult); |
|
546 |
showResult(configurator.getClass().getSimpleName(), display, importResult, updateSuccessMessage);
|
|
544 | 547 |
|
545 | 548 |
|
546 | 549 |
return Status.OK_STATUS; |
Also available in: Unified diff
minor