Project

General

Profile

Revision 7de8dccc

ID7de8dccc5e2db1ef95d534253fc4fc9a44035991
Parent e5c27931
Child 59d2eb6d

Added by Katja Luther almost 3 years ago

ref #6799: use the progress monitor of the configurator

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmApplicationAwareDefaultExport.java
228 228
			    String ioName = export.getClass().getSimpleName();
229 229
			    SubProgressMonitor ioMonitor = SubProgressMonitor
230 230
			            .NewStarted(parentMonitor, counts, ioName, counts );
231
			    state.setCurrentMonitor(ioMonitor);
231
			    state.getConfig().setProgressMonitor(ioMonitor);
232 232
			    state.setCurrentIO(export);
233 233
				export.invoke(state);
234 234
				ioMonitor.done();
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/common/CdmIoBase.java
243 243

  
244 244
    @Override
245 245
    public void updateProgress(STATE state, String message, int worked) {
246
        if (state.getCurrentMonitor() == null){
246
        if (state.getConfig().getProgressMonitor() == null){
247 247
            IProgressMonitor progressMonitor = state.getConfig().getProgressMonitor();
248 248
            if(progressMonitor != null){
249 249
                progressMonitor.worked(worked);
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/dwca/out/DwcaTaxExport.java
66 66
	@Override
67 67
	protected void doInvoke(DwcaTaxExportState state){
68 68

  
69
	    IProgressMonitor monitor = state.getCurrentMonitor();
69
	    IProgressMonitor monitor = state.getConfig().getProgressMonitor();
70 70

  
71 71
		List<DwcaDataExportBase> exports =  Arrays.asList(new DwcaDataExportBase[]{
72 72
	        new DwcaTaxonExport(state),
......
79 79
	        new DwcaImageExport(state)
80 80
		});
81 81

  
82

  
82 83
		@SuppressWarnings("unchecked")
83 84
	    TaxonNodeOutStreamPartitioner<XmlExportState> partitioner
84 85
	      = TaxonNodeOutStreamPartitioner.NewInstance(
85 86
                this, state, state.getConfig().getTaxonNodeFilter(),
86 87
                100, monitor, null);
87 88
		try {
89

  
88 90
		    monitor.subTask("Start partitioning");
91

  
89 92
		    TaxonNode node = partitioner.next();
90 93
			while (node != null){
91 94
			    for (DwcaDataExportBase export : exports){
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/dwca/out/DwcaTaxonExport.java
100 100
            state.getResult().addException(e, message);
101 101
        }finally{
102 102
            flushWriter(state, file);
103

  
103 104
        }
104 105
    }
105 106

  
cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/service/IOServiceImpl.java
101 101
            public Serializable doRun(IRemotingProgressMonitor monitor) {
102 102

  
103 103
                configurator.setProgressMonitor(monitor);
104
                monitor.beginTask("Start Export", 100);
104 105
                ExportResult result = export(configurator);
105 106
//                for(byte[] report : result.getReports()) {
106 107
//                    monitor.addReport(new String(report));

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)