Path path = Paths.get(importFile.toURI());
try {
runMoniteredOperation(configurator, Files.readAllBytes(path), type);
+
} catch (Exception e) {
MessagingUtils.errorDialog("Error importing input stream",
this,
return DwcaImportConfigurator.NewInstance(null, null);
case Excel_Distribution:
return ExcelDistributionUpdateConfigurator.NewInstance(null, null, null);
+
default:
MessagingUtils.notImplementedMessage(this);
throw new IllegalArgumentException("Import not supported yet");
return (ExcelDistributionUpdateConfigurator) getConfigurator(TYPE.Excel_Distribution);
}
- /**
- * @param configurator
- * @param display
- * @param importResult
- */
- private void showResult(String importName, final Display display,
- ImportResult importResult) {
- StringBuffer reportTextTemp = importResult.createReport();
- final StringBuffer reportText;
- if (StringUtils.isBlank(reportTextTemp.toString())){
- reportTextTemp.append("No update result available");
- //TODO: this is a workaround because the abcd import writes the report in the report part...
- if (!importResult.getReports().isEmpty()){
- reportTextTemp = new StringBuffer();
- if(importResult!=null){
- List<byte[]> reports = importResult.getReports();
- for (byte[] bs : reports) {
- reportTextTemp.append(new String(bs));
- }
- }
- }
- }
- reportText = reportTextTemp;
- display.asyncExec(new Runnable() {
-
- @Override
- public void run() {
- // display reports with possibility to save
- ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
- dialog.setTitle(importName+" Report");
- dialog.setReportText(reportText.toString());
- dialog.open();
- CdmStore.getContextManager().notifyContextRefresh();
- }
- });
- }
+
+
+