Project

General

Profile

« Previous | Next » 

Revision da948591

Added by Katja Luther almost 7 years ago

add abcd import configuration to preferences

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
11 11

  
12 12
import java.io.File;
13 13
import java.io.FileOutputStream;
14
import java.util.List;
14 15
import java.util.Map;
15 16
import java.util.Set;
16 17

  
......
22 23
import org.eclipse.core.runtime.jobs.Job;
23 24
import org.eclipse.swt.widgets.Display;
24 25
import org.eclipse.ui.IWorkbenchPart;
26
import org.eclipse.ui.PlatformUI;
25 27

  
26 28
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
27 29
import eu.etaxonomy.cdm.api.application.ICdmRepository;
......
38 40
import eu.etaxonomy.cdm.io.service.IIOService;
39 41
import eu.etaxonomy.taxeditor.model.CdmProgressMonitorAdapter;
40 42
import eu.etaxonomy.taxeditor.model.MessagingUtils;
43
import eu.etaxonomy.taxeditor.store.CdmStore;
41 44
import eu.etaxonomy.taxeditor.store.StoreUtil;
42 45
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
46
import eu.etaxonomy.taxeditor.ui.dialog.ReportTextDialog;
43 47

  
44 48
/**
45 49
 * <p>
......
317 321
                     } catch(Exception e){
318 322
                         logger.error(e.getStackTrace());
319 323
                     }
324
                     final StringBuilder reportText = new StringBuilder();
325
                     if(result!=null){
326
                         List<byte[]> reports = result.getErrors();
327
                         reportText.append("Errors:\\r");
328
                         for (byte[] bs : reports) {
329
                             reportText.append(new String(bs));
330
                         }
331
                         List<byte[]> warnings = result.getWarnings();
332
                         reportText.append("Warnings:\\r");
333
                         for (byte[] bs : warnings) {
334
                             reportText.append(new String(bs));
335
                         }
336
                         List<Exception> exceptions = result.getExceptions();
337
                         reportText.append("Exceptions:\\r");
338
                         for (Exception ex : exceptions) {
339
                             reportText.append(ex.getStackTrace());
340
                         }
320 341

  
321 342

  
343
                     }
344
                     final Display display = Display.getDefault();
345
                     display.asyncExec(new Runnable() {
346

  
347
                         @Override
348
                         public void run() {
349
                             // display reports with possibility to save
350
                             ReportTextDialog dialog = new ReportTextDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
351
                             dialog.setTitle(configurator.getClass().getSimpleName()+" Report");
352
                             dialog.setReportText(reportText.toString());
353
                             dialog.open();
354
                             CdmStore.getContextManager().notifyContextRefresh();
355
                         }
356
                     });
357

  
322 358

  
323 359

  
324 360
                 } catch (Exception e) {
......
329 365
                             e,
330 366
                             true);
331 367
                 }
368

  
332 369
                 return Status.OK_STATUS;
333 370
             }
334 371
         };

Also available in: Unified diff