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
.apache
.log4j
.Logger
;
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
.specimen
.abcd206
.in
.Abcd206ImportConfigurator
;
23 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
28 * @created Jun 16, 2010
31 public class AbcdImportWizard
extends AbstractImportWizard
<Abcd206ImportConfigurator
> {
33 private static final Logger logger
= Logger
.getLogger(AbcdImportWizard
.class);
35 private Abcd206ImportConfigurator configurator
;
36 private AbcdSourceSelectionPage dataSourcePage
;
37 private ClassificationChooserWizardPage classificationChooserWizardPage
;
41 public Abcd206ImportConfigurator
getConfigurator() {
47 public boolean performFinish() {
48 URI source
= dataSourcePage
.getUri();
49 configurator
.setDbSchemaValidation(DbSchemaValidation
.CREATE
);
51 if(classificationChooserWizardPage
.getClassification()!=null){
52 configurator
.setClassificationUuid(classificationChooserWizardPage
.getClassification().getUuid());
55 CdmStore
.getImportManager().runMoniteredOperation(configurator
, new File(source
), SOURCE_TYPE
.INPUTSTREAM
);
63 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
64 super.init(workbench
, selection
);
65 configurator
= CdmStore
.getImportManager().AbcdConfigurator();
69 protected void addConfiguratorPage() {
70 AbcdImportConfiguratorWizardPage configuratorWizardPage
= AbcdImportConfiguratorWizardPage
.createPage(configurator
);
71 addPage(configuratorWizardPage
);
76 public void addPages() {
79 classificationChooserWizardPage
= ClassificationChooserWizardPage
.createPage();
81 dataSourcePage
= ImportFromFileDataSourceWizardPage
.XML();
83 addPage(classificationChooserWizardPage
);
84 addPage(dataSourcePage
);