2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.io
.wizard
;
15 import org
.eclipse
.core
.runtime
.jobs
.Job
;
16 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
17 import org
.eclipse
.ui
.IWorkbench
;
19 import eu
.etaxonomy
.cdm
.database
.DbSchemaValidation
;
20 import eu
.etaxonomy
.cdm
.io
.common
.IImportConfigurator
.SOURCE_TYPE
;
21 import eu
.etaxonomy
.cdm
.io
.tcsxml
.in
.TcsXmlImportConfigurator
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
25 * <p>TcsImportWizard class.</p>
31 public class TcsImportWizard
extends AbstractImportWizard
<TcsXmlImportConfigurator
> {
33 private TcsXmlImportConfigurator configurator
;
35 private ImportFromFileDataSourceWizardPage dataSourcePage
;
38 * @see org.eclipse.jface.wizard.Wizard#performFinish()
42 public boolean performFinish() {
43 URI source
= dataSourcePage
.getUri();
44 configurator
.setSource(source
);
45 configurator
.setDbSchemaValidation(DbSchemaValidation
.CREATE
);
47 Job job
= CdmStore
.getImportManager().createIOServiceJob(configurator
, new File(source
), SOURCE_TYPE
.URI
);
48 CdmStore
.getImportManager().run(job
);
54 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
58 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
59 super.init(workbench
, selection
);
60 configurator
= CdmStore
.getImportManager().TcsConfigurator();
64 * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#getConfigurator()
68 public TcsXmlImportConfigurator
getConfigurator() {
73 * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
77 public void addPages() {
80 dataSourcePage
= ImportFromFileDataSourceWizardPage
.XML();
81 addPage(dataSourcePage
);