BGBM BDI Projects
/
taxeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ref #8385: adapt local and db preference pages
[taxeditor.git]
/
eu.etaxonomy.taxeditor.store
/
src
/
main
/
java
/
eu
/
etaxonomy
/
taxeditor
/
io
/
ExportManager.java
diff --git
a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
index 6f318a392bb7cb24c5e40ae340afa7a4995374d3..854ea00994fea65fa61c2d053cf3219d3eb5fb89 100644
(file)
--- a/
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
+++ b/
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/ExportManager.java
@@
-25,13
+25,13
@@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.apache.log4j.Logger;
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.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
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;
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.cdm.api.application.ICdmRepository;
@@
-68,7
+68,7
@@
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
*/
public class ExportManager extends AbstractIOManager<IExportConfigurator> implements IPostMoniteredOperationEnabled {
*/
public class ExportManager extends AbstractIOManager<IExportConfigurator> implements IPostMoniteredOperationEnabled {
- private final String successMessage = "The export was successful
l
";
+ private final String successMessage = "The export was successful";
private static final Logger logger = Logger.getLogger(ExportManager.class);
/** Constant <code>DATE_FORMAT_NOW="yyyyMMddHHmm"</code> */
private static final Logger logger = Logger.getLogger(ExportManager.class);
/** Constant <code>DATE_FORMAT_NOW="yyyyMMddHHmm"</code> */
@@
-147,7
+147,7
@@
public class ExportManager extends AbstractIOManager<IExportConfigurator> implem
monitor.worked(60);
} catch (RuntimeException e) {
MessagingUtils.messageDialog("Error exporting data", this,
monitor.worked(60);
} catch (RuntimeException e) {
MessagingUtils.messageDialog("Error exporting data", this,
- "An error occured while"
+ "An error occur
r
ed while"
+ "exporting to destination '"
+ configurator.getDestinationNameString()
+ "'.\n"
+ "exporting to destination '"
+ configurator.getDestinationNameString()
+ "'.\n"
@@
-185,7
+185,7
@@
public class ExportManager extends AbstractIOManager<IExportConfigurator> implem
return Status.OK_STATUS;
}
return Status.OK_STATUS;
}
-
+
};
return job;
};
return job;
@@
-199,7
+199,8
@@
public class ExportManager extends AbstractIOManager<IExportConfigurator> implem
Job job = new Job("Export: " + configurator.getClass().getSimpleName()) { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
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);
try {
IIOService ioService = CdmApplicationState.getIOService();
UUID uuid = ioService.monitExportData(configurator);
@@
-211,7
+212,7
@@
public class ExportManager extends AbstractIOManager<IExportConfigurator> implem
1000,
ExportManager.this,
feedBackGeneratorList,
1000,
ExportManager.this,
feedBackGeneratorList,
-
m
onitor);
+
subM
onitor);
} catch (Exception ex) {
return new Status(Status.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Operation Interrupted", ex);
} catch (Exception ex) {
return new Status(Status.ERROR, TaxeditorStorePlugin.PLUGIN_ID, "Operation Interrupted", ex);
@@
-347,7
+348,11
@@
public class ExportManager extends AbstractIOManager<IExportConfigurator> implem
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.", 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{
ExportResult result = ioService.export(configurator);
ExportDataWrapper data = result.getExportData();
try{
@@
-428,7
+433,7
@@
public class ExportManager extends AbstractIOManager<IExportConfigurator> implem
if (configurator instanceof CdmLightExportConfigurator){
isZip = ((CdmLightExportConfigurator)configurator).isCreateZipFile();
}
if (configurator instanceof CdmLightExportConfigurator){
isZip = ((CdmLightExportConfigurator)configurator).isCreateZipFile();
}
- AbstractUtility.executeMoniteredExport(
"Export: " + configurator.getClass().getSimple
Name(),
+ AbstractUtility.executeMoniteredExport(
configurator.getUserFriendlyIO
Name(),
uuid,
1000,
true,
uuid,
1000,
true,
@@
-436,6
+441,7
@@
public class ExportManager extends AbstractIOManager<IExportConfigurator> implem
null,
urlString,
isZip);
null,
urlString,
isZip);
+
}
});
}
});