commit 434b59e11ff2ce13d082742e90eeda3b0bd4482e
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Thu Oct 5 13:56:21 2017 +0200

    ref #7005 Migrate Tcs import

diff --git a/eu.etaxonomy.taxeditor.store/fragment.e4xmi b/eu.etaxonomy.taxeditor.store/fragment.e4xmi
index f46b58063..1570dafb8 100644
--- a/eu.etaxonomy.taxeditor.store/fragment.e4xmi
+++ b/eu.etaxonomy.taxeditor.store/fragment.e4xmi
@@ -112,6 +112,7 @@
     <elements xsi:type="commands:Command" xmi:id="_tBCr8KmsEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importRisReference" commandName="%wizard.name.24"/>
     <elements xsi:type="commands:Command" xmi:id="_bLGTMKmuEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importSdd" commandName="%wizard.name.4"/>
     <elements xsi:type="commands:Command" xmi:id="_2JV9IKnAEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importExcelSpecimen" commandName="%wizard.name.5"/>
+    <elements xsi:type="commands:Command" xmi:id="_OQ9n8KnCEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.command.importTcs" commandName="%wizard.name"/>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_swGH0GhvEee3K4uKJljEYg" featurename="handlers" parentElementId="org.eclipse.e4.legacy.ide.application">
     <elements xsi:type="commands:Handler" xmi:id="_rVEdIGcjEee0qLTtA2ZpVQ" elementId="eu.etaxonomy.taxeditor.featuretree.e4.handler.RemoveFeatureHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.featuretree.e4.handler.RemoveFeatureHandler" command="_fNBtQGcjEee0qLTtA2ZpVQ"/>
@@ -126,6 +127,7 @@
     <elements xsi:type="commands:Handler" xmi:id="_96ANIKmsEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.io.e4.ris.OpenRisImportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.ris.OpenRisImportWizard" command="_tBCr8KmsEeeTAPHmaMLwQQ"/>
     <elements xsi:type="commands:Handler" xmi:id="_do2IAKmuEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.io.e4.sdd.OpenSddImportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.sdd.OpenSddImportWizard" command="_bLGTMKmuEeeTAPHmaMLwQQ"/>
     <elements xsi:type="commands:Handler" xmi:id="_6BmBEKnAEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.io.e4.excel.specimen.OpenExcelSpecimenImportWizard" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.excel.specimen.OpenExcelSpecimenImportWizard" command="_2JV9IKnAEeeTAPHmaMLwQQ"/>
+    <elements xsi:type="commands:Handler" xmi:id="_Q8Z6gKnCEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.io.e4.tcs.TcsImportWizardE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.store/eu.etaxonomy.taxeditor.io.e4.tcs.TcsImportWizardE4" command="_OQ9n8KnCEeeTAPHmaMLwQQ"/>
   </fragments>
   <fragments xsi:type="fragment:StringModelFragment" xmi:id="_qT4hgIfTEeecZ4F2Y9Z0Og" featurename="children" parentElementId="eu.etaxonomy.taxeditor.workbench.menu.window" positionInList="before:eu.etaxonomy.taxeditor.application.windowMenu.last">
     <elements xsi:type="menu:Menu" xmi:id="_LT3P8IfcEeecZ4F2Y9Z0Og" elementId="eu.etaxonomy.taxeditor.store.menu.termeditor" label="Term Editor">
@@ -152,6 +154,7 @@
       <children xsi:type="menu:HandledMenuItem" xmi:id="_0z1o8KmjEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.importExcelSpecimen" label="%wizard.name.5" command="_2JV9IKnAEeeTAPHmaMLwQQ"/>
       <children xsi:type="menu:HandledMenuItem" xmi:id="_pQNeoKmsEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.importRisReference" label="%wizard.name.24" command="_tBCr8KmsEeeTAPHmaMLwQQ"/>
       <children xsi:type="menu:HandledMenuItem" xmi:id="_hXY2UKmuEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.importSdd" label="%wizard.name.4" command="_bLGTMKmuEeeTAPHmaMLwQQ"/>
+      <children xsi:type="menu:HandledMenuItem" xmi:id="_X2Xb8KnCEeeTAPHmaMLwQQ" elementId="eu.etaxonomy.taxeditor.store.handledmenuitem.importTcs" label="%wizard.name" command="_OQ9n8KnCEeeTAPHmaMLwQQ"/>
     </elements>
   </fragments>
 </fragment:ModelFragments>
diff --git a/eu.etaxonomy.taxeditor.store/plugin.xml b/eu.etaxonomy.taxeditor.store/plugin.xml
index e5a66976c..2c9479edc 100755
--- a/eu.etaxonomy.taxeditor.store/plugin.xml
+++ b/eu.etaxonomy.taxeditor.store/plugin.xml
@@ -409,34 +409,6 @@
             type="java.util.List">
       </commandParameterType>
    </extension>
-   <extension
-         point="org.eclipse.ui.importWizards">
-      <wizard
-            category="eu.etaxonomy.taxeditor.import.category.cdm"
-            class="eu.etaxonomy.taxeditor.io.wizard.TcsImportWizard"
-            id="eu.etaxonomy.taxeditor.io.import.tcs"
-            name="%wizard.name">
-      </wizard>
-   
-   <!--   <wizard
-            category="eu.etaxonomy.taxeditor.import.category.cdm"
-            class="eu.etaxonomy.taxeditor.io.wizard.JaxbImportWizard"
-            id="eu.etaxonomy.taxeditor.io.import.jaxb"
-            name="JAXB">
-      </wizard> -->
-   <!--   <wizard
-            category="eu.etaxonomy.taxeditor.import.category.cdm"
-            class="eu.etaxonomy.taxeditor.io.wizard.BerlinModelImportWizard"
-            id="eu.etaxonomy.taxeditor.io.import.berlinModel"
-            name="%wizard.name.0">
-      </wizard>
-      <wizard
-            category="eu.etaxonomy.taxeditor.import.category.cdm"
-            class="eu.etaxonomy.taxeditor.io.wizard.EndnoteImportWizard"
-            id="eu.etaxonomy.taxeditor.io.import.endnote"
-            name="%wizard.name.1">
-      </wizard>-->
-   </extension>
    <extension
          point="org.eclipse.ui.exportWizards">
       <category
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/tcs/OpenTcsImportWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/tcs/OpenTcsImportWizard.java
new file mode 100644
index 000000000..fe4b2f617
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/tcs/OpenTcsImportWizard.java
@@ -0,0 +1,29 @@
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.taxeditor.io.e4.tcs;
+
+import eu.etaxonomy.taxeditor.io.e4.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.AbstractOpenImportWizard;
+
+/**
+ * @author pplitzner
+ * @since Oct 5, 2017
+ *
+ */
+public class OpenTcsImportWizard extends AbstractOpenImportWizard {
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected Class<? extends AbstractImportWizardE4> getImportWizardClass() {
+        return TcsImportWizardE4.class;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/tcs/TcsImportWizardE4.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/tcs/TcsImportWizardE4.java
new file mode 100644
index 000000000..32221c889
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/e4/tcs/TcsImportWizardE4.java
@@ -0,0 +1,79 @@
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.taxeditor.io.e4.tcs;
+
+import java.io.File;
+import java.net.URI;
+
+import javax.inject.Inject;
+
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.ui.workbench.modeling.EPartService;
+
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
+import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
+import eu.etaxonomy.taxeditor.io.e4.AbstractImportWizardE4;
+import eu.etaxonomy.taxeditor.io.e4.ImportFromFileDataSourceWizardPageE4;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ *
+ * @author pplitzner
+ * @since Oct 5, 2017
+ *
+ */
+public class TcsImportWizardE4 extends AbstractImportWizardE4<TcsXmlImportConfigurator> {
+
+
+    private TcsXmlImportConfigurator configurator;
+
+	private ImportFromFileDataSourceWizardPageE4 dataSourcePage;
+
+	@Inject
+	public TcsImportWizardE4(IEclipseContext context, EPartService partService) {
+	    super(context, partService);
+	}
+
+	/** {@inheritDoc} */
+	@Override
+	public boolean performFinish() {
+	    URI source = dataSourcePage.getUri();
+	    configurator.setSource(source);
+	    configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
+
+	    Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.URI);
+	    CdmStore.getImportManager().run(job);
+
+	    return true;
+	}
+
+	/** {@inheritDoc} */
+	@Override
+    public void init() {
+		configurator = CdmStore.getImportManager().TcsConfigurator();
+	}
+
+	/** {@inheritDoc} */
+	@Override
+	public TcsXmlImportConfigurator getConfigurator() {
+		return configurator;
+	}
+
+	/** {@inheritDoc} */
+	@Override
+	public void addPages() {
+		super.addPages();
+		dataSourcePage = ContextInjectionFactory.make(ImportFromFileDataSourceWizardPageE4.class, context);
+		addPage(dataSourcePage);
+	}
+}
