org.eclipse.core.databinding.observable,
org.eclipse.core.databinding.property,
org.eclipse.jface.databinding,
- org.eclipse.jdt.annotation;bundle-version="1.1.100",
+
eu.etaxonomy.taxeditor.workbench,
org.eclipse.e4.core.di.annotations;bundle-version="1.5.0",
org.eclipse.e4.ui.di;bundle-version="1.1.100",
command.label.CHANGE_PASSWORD = Change password\r
wizard.name.22 = Output Model\r
wizard.name.23 = Excel Distribution Data Update\r
+wizard.name.24 = Ris Import\r
command.label.25 = Import Preferences
\ No newline at end of file
command.label.CHANGE_PASSWORD = Kennwort ändern
wizard.name.22 = Output Model
wizard.name.23 = Excel Verbreitungsdaten Update
+wizard.name.24 = Ris Import
command.label.25 = Import Präferenzen
\ No newline at end of file
protected ICdmRepository applicationConfiguration;
public static enum TYPE {
- Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name, SpecimenSearch, Gbif, Excel_Distribution
+ Jaxb, Tcs, Excel_Taxa, Endnote, Sdd, Abcd, SpecimenCdmExcel, Excel_Name, SpecimenSearch, Gbif, Excel_Distribution, Ris
}
/**
import eu.etaxonomy.cdm.io.common.IExportConfigurator;
import eu.etaxonomy.cdm.io.common.IIoConfigurator;
import eu.etaxonomy.cdm.io.common.IoResultBase;
+import eu.etaxonomy.cdm.io.common.IoResultBase.IoInfo;
import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator;
import eu.etaxonomy.cdm.io.outputmodel.OutputModelConfigurator;
import eu.etaxonomy.cdm.io.sdd.out.SDDExportConfigurator;
}
final StringBuilder reportText = new StringBuilder();
if(result!=null){
- List<IoResultBase.Error> reports = result.getErrors();
+ List<IoInfo> reports = result.getErrors();
reportText.append("Errors:\\r");
- for (IoResultBase.Error bs : reports) {
+ for (IoInfo bs : reports) {
reportText.append(bs.getMessage() + " - " +bs.getException().getStackTrace());
}
- List<String> warnings = result.getWarnings();
+ List<IoResultBase.IoInfo> warnings = result.getWarnings();
reportText.append("Warnings:\\r");
- for (String bs : warnings) {
+ for (IoResultBase.IoInfo bs : warnings) {
reportText.append(bs);
}
- List<IoResultBase.Error> exceptions = result.getExceptions();
+ List<IoInfo> exceptions = result.getExceptions();
reportText.append("Exceptions:\\r");
- for (IoResultBase.Error bs : exceptions) {
+ for (IoInfo bs : exceptions) {
reportText.append(bs.getMessage() + " - " +bs.getException().getStackTrace());
}
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
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()){
+ if (!importResult.getReports().isEmpty() && importResult.getReports().get(0) != null){
reportTextTemp = new StringBuffer();
if(importResult!=null){
List<byte[]> reports = importResult.getReports();
for (byte[] bs : reports) {
- reportTextTemp.append(new String(bs));
+ if (bs != null){ 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();
- }
- });
+ 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();
+ }
+ });
}