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
;
14 import java
.io
.FileInputStream
;
15 import java
.io
.FileNotFoundException
;
18 import org
.apache
.log4j
.Logger
;
19 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
20 import org
.eclipse
.ui
.IWorkbench
;
22 import eu
.etaxonomy
.cdm
.database
.DbSchemaValidation
;
23 import eu
.etaxonomy
.cdm
.io
.specimen
.abcd206
.in
.Abcd206ImportConfigurator
;
24 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 * <p>AbcdImportWizard class.</p>
30 * @created Jun 16, 2010
33 public class AbcdImportWizard
extends AbstractImportWizard
<Abcd206ImportConfigurator
> {
35 private static final Logger logger
= Logger
.getLogger(AbcdImportWizard
.class);
37 private Abcd206ImportConfigurator configurator
;
38 private ImportFromFileDataSourceWizardPage dataSourcePage
;
41 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
45 public Abcd206ImportConfigurator
getConfigurator() {
50 * @see org.eclipse.jface.wizard.Wizard#performFinish()
54 public boolean performFinish() {
55 URI source
= dataSourcePage
.getUri();
57 configurator
.setSource(new FileInputStream(new File(source
)));
58 } catch (FileNotFoundException e
) {
59 logger
.error("File not found!", e
);
62 configurator
.setDbSchemaValidation(DbSchemaValidation
.CREATE
);
64 CdmStore
.getImportManager().run(configurator
);
70 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
74 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
75 super.init(workbench
, selection
);
76 configurator
= CdmStore
.getImportManager().AbcdConfigurator();
80 * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
84 public void addPages() {
87 dataSourcePage
= ImportFromFileDataSourceWizardPage
.XML();
88 addPage(dataSourcePage
);