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.
9 package eu
.etaxonomy
.taxeditor
.io
.e4
.in
.abcd
;
13 import javax
.inject
.Inject
;
15 import org
.eclipse
.e4
.core
.contexts
.ContextInjectionFactory
;
16 import org
.eclipse
.e4
.core
.contexts
.IEclipseContext
;
17 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
;
19 import eu
.etaxonomy
.cdm
.common
.URI
;
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
.io
.e4
.in
.AbstractImportWizardE4
;
24 import eu
.etaxonomy
.taxeditor
.io
.e4
.in
.ImportFromFileDataSourceWithReferenceWizardPage
;
25 import eu
.etaxonomy
.taxeditor
.io
.wizard
.AbcdImportConfiguratorWizardPage
;
26 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
27 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
33 public class AbcdImportWizardE4
extends AbstractImportWizardE4
<Abcd206ImportConfigurator
> {
35 private Abcd206ImportConfigurator configurator
;
36 private ImportFromFileDataSourceWithReferenceWizardPage dataSourcePage
;
37 private ClassificationChooserWizardPageE4 classificationChooserWizardPage
;
40 public AbcdImportWizardE4(IEclipseContext context
, EPartService partService
) {
41 super(context
, partService
);
45 public Abcd206ImportConfigurator
getConfigurator() {
50 public boolean performFinish() {
51 URI source
= dataSourcePage
.getUri();
52 configurator
.setDbSchemaValidation(DbSchemaValidation
.CREATE
);
54 if(classificationChooserWizardPage
.getClassification()!=null){
55 configurator
.setClassificationUuid(classificationChooserWizardPage
.getClassification().getUuid());
58 CdmStore
.getImportManager().runMoniteredOperation(configurator
, new File(source
), SOURCE_TYPE
.INPUTSTREAM
);
65 configurator
= PreferencesUtil
.getLocalAbcdImportConfigurator(false);
69 protected void addConfiguratorPage() {
70 AbcdImportConfiguratorWizardPage configuratorWizardPage
= AbcdImportConfiguratorWizardPage
.createFileImportPage(configurator
);//AbcdImportConfiguratorWizardPage.createPage(configurator);
71 //configuratorWizardPage.setConfigurator(configurator);
72 addPage(configuratorWizardPage
);
76 public void addPages() {
78 classificationChooserWizardPage
= ContextInjectionFactory
.make(ClassificationChooserWizardPageE4
.class, context
);
80 dataSourcePage
= ContextInjectionFactory
.make(ImportFromFileDataSourceWithReferenceWizardPage
.class, context
);
82 addPage(classificationChooserWizardPage
);
83 addPage(dataSourcePage
);
84 addConfiguratorPage();