3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.io
.wizard
;
16 import org
.eclipse
.core
.runtime
.jobs
.Job
;
17 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
18 import org
.eclipse
.ui
.IWorkbench
;
20 import eu
.etaxonomy
.cdm
.database
.DbSchemaValidation
;
21 import eu
.etaxonomy
.cdm
.io
.common
.IImportConfigurator
.SOURCE_TYPE
;
22 import eu
.etaxonomy
.cdm
.io
.tcsxml
.in
.TcsXmlImportConfigurator
;
23 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
26 * <p>TcsImportWizard class.</p>
32 public class TcsImportWizard
extends AbstractImportWizard
<TcsXmlImportConfigurator
> {
34 private TcsXmlImportConfigurator configurator
;
36 private ImportFromFileDataSourceWizardPage dataSourcePage
;
39 * @see org.eclipse.jface.wizard.Wizard#performFinish()
43 public boolean performFinish() {
44 URI source
= dataSourcePage
.getUri();
45 configurator
.setSource(source
);
46 configurator
.setDbSchemaValidation(DbSchemaValidation
.CREATE
);
48 if(CdmStore
.getCurrentSessionManager().isRemoting()) {
49 Job job
= CdmStore
.getImportManager().createIOServiceJob(configurator
, new File(source
), SOURCE_TYPE
.URI
);
50 CdmStore
.getImportManager().run(job
);
52 CdmStore
.getImportManager().run(configurator
);
59 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
63 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
64 super.init(workbench
, selection
);
65 configurator
= CdmStore
.getImportManager().TcsConfigurator();
69 * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#getConfigurator()
73 public TcsXmlImportConfigurator
getConfigurator() {
78 * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
82 public void addPages() {
85 dataSourcePage
= ImportFromFileDataSourceWizardPage
.XML();
86 addPage(dataSourcePage
);