Revision 26d19e4f
Added by Cherian Mathew over 8 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/JaxbExportWizard.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 | 3 |
* Copyright (C) 2007 EDIT |
4 |
* European Distributed Institute of Taxonomy
|
|
4 |
* European Distributed Institute of Taxonomy |
|
5 | 5 |
* http://www.e-taxonomy.eu |
6 |
*
|
|
6 |
* |
|
7 | 7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
8 | 8 |
* See LICENSE.TXT at the top of this package for the full license terms. |
9 | 9 |
*/ |
... | ... | |
13 | 13 |
import java.io.File; |
14 | 14 |
import java.net.URI; |
15 | 15 |
|
16 |
import org.eclipse.core.runtime.jobs.Job; |
|
16 | 17 |
import org.eclipse.jface.viewers.IStructuredSelection; |
17 | 18 |
import org.eclipse.ui.IWorkbench; |
19 |
import org.eclipse.ui.progress.IProgressConstants; |
|
18 | 20 |
|
19 | 21 |
import eu.etaxonomy.cdm.io.jaxb.JaxbExportConfigurator; |
20 | 22 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
... | ... | |
36 | 38 |
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection) |
37 | 39 |
*/ |
38 | 40 |
/** {@inheritDoc} */ |
39 |
public void init(IWorkbench workbench, IStructuredSelection selection) { |
|
41 |
@Override |
|
42 |
public void init(IWorkbench workbench, IStructuredSelection selection) { |
|
40 | 43 |
this.setWindowTitle("JAXB Export"); |
41 | 44 |
this.configurator = CdmStore.getExportManager().JaxbConfigurator(); |
42 | 45 |
} |
43 |
|
|
46 |
|
|
44 | 47 |
/* (non-Javadoc) |
45 | 48 |
* @see org.eclipse.jface.wizard.Wizard#performFinish() |
46 | 49 |
*/ |
... | ... | |
48 | 51 |
@Override |
49 | 52 |
public boolean performFinish() { |
50 | 53 |
boolean performFinish = false; |
51 |
URI urlString; |
|
52 |
File savePath = new File(page.getFolderText() + File.separator + page.getExportFileName()); |
|
53 |
urlString = savePath.toURI(); |
|
54 |
//orig: urlString = new URI(page.getFolderText() + File.separator + page.getExportFileName()); |
|
54 |
|
|
55 |
File exportFile = new File(page.getFolderText() + File.separator + page.getExportFileName()); |
|
56 |
URI urlString = exportFile.toURI(); |
|
55 | 57 |
configurator.setDestination(urlString); |
56 |
CdmStore.getExportManager().run(configurator); |
|
58 |
if(CdmStore.getCurrentSessionManager().isRemoting()) { |
|
59 |
// create job |
|
60 |
Job job = CdmStore.getExportManager().createIOServiceJob(configurator, exportFile); |
|
61 |
// configure the job |
|
62 |
job.setProperty(IProgressConstants.KEEP_PROPERTY, true); |
|
63 |
job.setUser(true); |
|
64 |
// schedule job |
|
65 |
job.schedule(); |
|
66 |
} else { |
|
67 |
CdmStore.getExportManager().run(configurator); |
|
68 |
} |
|
57 | 69 |
performFinish = true; |
58 | 70 |
return performFinish; |
59 | 71 |
} |
... | ... | |
65 | 77 |
@Override |
66 | 78 |
public void addPages() { |
67 | 79 |
super.addPages(); |
68 |
|
|
80 |
|
|
69 | 81 |
page = ExportToFileDestinationWizardPage.Jaxb(); |
70 | 82 |
addPage(page); |
71 | 83 |
} |
... | ... | |
78 | 90 |
public JaxbExportConfigurator getConfigurator() { |
79 | 91 |
return configurator; |
80 | 92 |
} |
81 |
|
|
93 |
|
|
82 | 94 |
|
83 | 95 |
} |
Also available in: Unified diff
#5129 Extend export ui for remoting