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
.apache
.log4j
.Logger
;
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
.specimen
.abcd206
.in
.Abcd206ImportConfigurator
;
22 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
27 * @created Jun 16, 2010
30 public class AbcdImportWizard
extends AbstractImportWizard
<Abcd206ImportConfigurator
> {
32 private static final Logger logger
= Logger
.getLogger(AbcdImportWizard
.class);
34 private Abcd206ImportConfigurator configurator
;
35 private AbcdSourceSelectionPage dataSourcePage
;
36 private ClassificationChooserWizardPage classificationChooserWizardPage
;
40 public Abcd206ImportConfigurator
getConfigurator() {
46 public boolean performFinish() {
47 URI source
= dataSourcePage
.getUri();
48 configurator
.setDbSchemaValidation(DbSchemaValidation
.CREATE
);
50 if(classificationChooserWizardPage
.getClassification()!=null){
51 configurator
.setClassificationUuid(classificationChooserWizardPage
.getClassification().getUuid());
54 CdmStore
.getImportManager().runMoniteredOperation(configurator
, new File(source
), SOURCE_TYPE
.INPUTSTREAM
);
62 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
63 super.init(workbench
, selection
);
64 configurator
= CdmStore
.getImportManager().AbcdConfigurator();
68 protected void addConfiguratorPage() {
69 AbcdImportConfiguratorWizardPage configuratorWizardPage
= AbcdImportConfiguratorWizardPage
.createPage(configurator
);
70 addPage(configuratorWizardPage
);
75 public void addPages() {
78 classificationChooserWizardPage
= ClassificationChooserWizardPage
.createPage();
80 dataSourcePage
= ImportFromFileDataSourceWizardPage
.XML();
82 addPage(classificationChooserWizardPage
);
83 addPage(dataSourcePage
);