Revision 86f370cc
Added by Katja Luther almost 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ImportManager.java | ||
---|---|---|
260 | 260 |
Path path = Paths.get(importFile.toURI()); |
261 | 261 |
try { |
262 | 262 |
runMoniteredOperation(configurator, Files.readAllBytes(path), type); |
263 |
|
|
263 | 264 |
} catch (Exception e) { |
264 | 265 |
MessagingUtils.errorDialog("Error importing input stream", |
265 | 266 |
this, |
... | ... | |
313 | 314 |
return DwcaImportConfigurator.NewInstance(null, null); |
314 | 315 |
case Excel_Distribution: |
315 | 316 |
return ExcelDistributionUpdateConfigurator.NewInstance(null, null, null); |
317 |
|
|
316 | 318 |
default: |
317 | 319 |
MessagingUtils.notImplementedMessage(this); |
318 | 320 |
throw new IllegalArgumentException("Import not supported yet"); |
... | ... | |
558 | 560 |
return (ExcelDistributionUpdateConfigurator) getConfigurator(TYPE.Excel_Distribution); |
559 | 561 |
} |
560 | 562 |
|
563 |
|
|
564 |
|
|
561 | 565 |
/** |
562 | 566 |
* @param configurator |
563 | 567 |
* @param display |
... | ... | |
570 | 574 |
if (StringUtils.isBlank(reportTextTemp.toString())){ |
571 | 575 |
reportTextTemp.append("No update result available"); |
572 | 576 |
//TODO: this is a workaround because the abcd import writes the report in the report part... |
573 |
if (!importResult.getReports().isEmpty()){ |
|
577 |
if (!importResult.getReports().isEmpty() && importResult.getReports().get(0) != null){
|
|
574 | 578 |
reportTextTemp = new StringBuffer(); |
575 | 579 |
if(importResult!=null){ |
576 | 580 |
List<byte[]> reports = importResult.getReports(); |
577 | 581 |
for (byte[] bs : reports) { |
578 |
reportTextTemp.append(new String(bs));
|
|
582 |
if (bs != null){ reportTextTemp.append(new String(bs));}
|
|
579 | 583 |
} |
580 | 584 |
} |
581 | 585 |
} |
582 | 586 |
} |
583 | 587 |
reportText = reportTextTemp; |
584 |
display.asyncExec(new Runnable() {
|
|
585 |
|
|
586 |
@Override
|
|
587 |
public void run() {
|
|
588 |
// display reports with possibility to save
|
|
589 |
ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
|
|
590 |
dialog.setTitle(importName+" Report");
|
|
591 |
dialog.setReportText(reportText.toString());
|
|
592 |
dialog.open();
|
|
593 |
CdmStore.getContextManager().notifyContextRefresh();
|
|
594 |
}
|
|
595 |
});
|
|
588 |
display.asyncExec(new Runnable() { |
|
589 |
|
|
590 |
@Override |
|
591 |
public void run() { |
|
592 |
// display reports with possibility to save |
|
593 |
ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()); |
|
594 |
dialog.setTitle(importName+" Report"); |
|
595 |
dialog.setReportText(reportText.toString()); |
|
596 |
dialog.open(); |
|
597 |
CdmStore.getContextManager().notifyContextRefresh(); |
|
598 |
} |
|
599 |
}); |
|
596 | 600 |
} |
597 | 601 |
|
598 | 602 |
|
Also available in: Unified diff
adapt import and export manager to changes in IOResult