import java.util.zip.ZipOutputStream;
import org.apache.log4j.Logger;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-
+import org.eclipse.core.runtime.SubMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.swt.widgets.Display;
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.cdm.api.application.ICdmRepository;
*/
public class ExportManager extends AbstractIOManager<IExportConfigurator> implements IPostMoniteredOperationEnabled {
- private final String successMessage = "The export was successfull";
+ private final String successMessage = "The export was successful";
private static final Logger logger = Logger.getLogger(ExportManager.class);
/** Constant <code>DATE_FORMAT_NOW="yyyyMMddHHmm"</code> */
monitor.worked(60);
} catch (RuntimeException e) {
MessagingUtils.messageDialog("Error exporting data", this,
- "An error occured while"
+ "An error occurred while"
+ "exporting to destination '"
+ configurator.getDestinationNameString()
+ "'.\n"
return Status.OK_STATUS;
}
-
+
};
return job;
Job job = new Job("Export: " + configurator.getClass().getSimpleName()) { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
- monitor.beginTask("Exporting database. This will take some time.", IProgressMonitor.UNKNOWN);
+ SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
+ subMonitor.beginTask("Exporting database. This will take some time.", IProgressMonitor.UNKNOWN);
try {
IIOService ioService = CdmApplicationState.getIOService();
UUID uuid = ioService.monitExportData(configurator);
1000,
ExportManager.this,
feedBackGeneratorList,
- monitor);
+ subMonitor);
} catch (Exception ex) {
return new Status(Status.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Operation Interrupted", ex);
monitor.beginTask("Exporting database. This will take some time.", IProgressMonitor.UNKNOWN);
try {
IIOService ioService = CdmApplicationState.getIOService();
-
+ monitor.beginTask(
+ "Exporting database. This will take some time.", 100);
+ monitor.worked(10);
+ configurator.setProgressMonitor(CdmProgressMonitorAdapter
+ .CreateSubMonitor(monitor, 80));
ExportResult result = ioService.export(configurator);
ExportDataWrapper data = result.getExportData();
try{
if (configurator instanceof CdmLightExportConfigurator){
isZip = ((CdmLightExportConfigurator)configurator).isCreateZipFile();
}
- AbstractUtility.executeMoniteredExport("Export: " + configurator.getClass().getSimpleName(),
+ AbstractUtility.executeMoniteredExport(configurator.getUserFriendlyIOName(),
uuid,
1000,
true,
null,
urlString,
isZip);
+
}
});