fixes #862
authorn.hoffmann <n.hoffmann@localhost>
Fri, 7 Aug 2009 11:32:57 +0000 (11:32 +0000)
committern.hoffmann <n.hoffmann@localhost>
Fri, 7 Aug 2009 11:32:57 +0000 (11:32 +0000)
14 files changed:
.gitattributes
taxeditor-store/META-INF/MANIFEST.MF
taxeditor-store/plugin.xml
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowLoginWindowHandler.java [new file with mode: 0644]
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractExportWizard.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractImportWizard.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/BerlinModelImportWizard.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/ExportToFileDestinationWizardPage.java [moved from taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/JaxbExportDestinationWizardPage.java with 74% similarity]
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/GenericConfiguratorWizardPage.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/ImportFromFileDataSourceWizardPage.java [new file with mode: 0644]
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/JaxbExportWizard.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/TcsExportWizard.java
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/TcsImportWizard.java
taxeditor-store/src/test/resources/eu/etaxonomy/taxeditor/io/TcsXmlImportConfiguratorTest-input.xml [new file with mode: 0644]

index d6cfd162b1cc45348c697227c2fb6d5d7e2523bd..238cb10eb7fba27f1986285f546a5f37de511ff9 100644 (file)
@@ -1031,6 +1031,7 @@ taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/dialogs/SelectionDialogDeta
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/dialogs/SelectionDialogSelectionLabelProvider.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/dialogs/UriDialog.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowDataSourceViewHandler.java -text
+taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowLoginWindowHandler.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowUserManagerViewHandler.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractExcelExportWizard.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractExcelImportWizard.java -text
@@ -1038,8 +1039,9 @@ taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractExportWizard.jav
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/AbstractImportWizard.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/BerlinModelExportWizard.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/BerlinModelImportWizard.java -text
+taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/ExportToFileDestinationWizardPage.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/GenericConfiguratorWizardPage.java -text
-taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/JaxbExportDestinationWizardPage.java -text
+taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/ImportFromFileDataSourceWizardPage.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/JaxbExportWizard.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/JaxbImportSourceWizardPage.java -text
 taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/JaxbImportWizard.java -text
@@ -1152,6 +1154,7 @@ taxeditor-store/src/test/resources/eu/etaxonomy/cdm/cdmfs.xml -text
 taxeditor-store/src/test/resources/eu/etaxonomy/cdm/database/TermsDataSet-with_auditing_info.xml -text
 taxeditor-store/src/test/resources/eu/etaxonomy/cdm/database/TermsDataSet.xml -text
 taxeditor-store/src/test/resources/eu/etaxonomy/cdm/database/dataset.dtd -text
+taxeditor-store/src/test/resources/eu/etaxonomy/taxeditor/io/TcsXmlImportConfiguratorTest-input.xml -text
 taxeditor-store/src/test/resources/eu/etaxonomy/taxeditor/store/CdmStoreTest.xml -text
 taxeditor-store/src/test/resources/eu/etaxonomy/taxeditor/store/ConcurrentSessionTest.xml -text
 taxeditor-store/src/test/resources/log4j.properties -text
index d744e49c5ebe8bc2f14f0b1e21e0eb8f10e4372c..df91822b028bf66581712f298e050b8a91b51ae1 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: EDIT Taxonomic Editor - DataStore Bundle
 Bundle-SymbolicName: eu.etaxonomy.taxeditor.store;singleton:=true
-Bundle-Version: 2.0.0.v20090708-1713
+Bundle-Version: 2.0.0.v20090805-1724
 Bundle-Activator: eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin
 Bundle-Vendor: EDIT
 Export-Package: eu.etaxonomy.taxeditor.datasource,
index d51fa4089fe409e18c91bf55ff8f2a8ff47d8a4f..7958c5d9d136899ef7182e2d5012c81b537b0fee 100644 (file)
                      style="push">
                </command>
             </menu>
+            <command
+                  commandId="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
+                  label="Login"
+                  style="push">
+            </command>
          </menu>
       </menuContribution>
       <menuContribution
             id="eu.etaxonomy.taxeditor.store.operations.showUserManagerView"
             name="Show User Manager View">
       </command>
+      <command
+            defaultHandler="eu.etaxonomy.taxeditor.handler.ShowLoginWindowHandler"
+            id="eu.etaxonomy.taxeditor.store.operations.showLoginWindow"
+            name="Show Login Window">
+      </command>
    </extension>
    <extension
          name="Popup Menu Commands"
                        id="org.eclipse.ui.views.ProgressView">  
                </view>  
        </extension>
- <extension
-       point="org.eclipse.debug.core.launchConfigurationTypes">
-    <launchConfigurationType
-          id="eu.etaxonomy.taxeditor.newInstance"
-          name="NewInstance">
-    </launchConfigurationType>
- </extension>  
        
 </plugin>
diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowLoginWindowHandler.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/handler/ShowLoginWindowHandler.java
new file mode 100644 (file)
index 0000000..41d5f11
--- /dev/null
@@ -0,0 +1,45 @@
+// $Id$
+/**
+* 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.handler;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+import eu.etaxonomy.taxeditor.dialogs.LoginDialog;
+
+/**
+ * @author n.hoffmann
+ * @created Aug 7, 2009
+ * @version 1.0
+ */
+public class ShowLoginWindowHandler extends AbstractHandler implements IHandler{
+       private static final Logger logger = Logger
+                       .getLogger(ShowLoginWindowHandler.class);
+
+       /* (non-Javadoc)
+        * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+        */
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+
+               LoginDialog loginDialog = new LoginDialog(HandlerUtil.getActiveShell(event));
+               loginDialog.open();
+               
+               return null;
+               
+       }
+
+       
+       
+}
index 0756f79a1df1a31359c78263d29cfd4dd9e06b7a..ed06186e06c82ce8e6baed2d8dae62a4b4ae72be 100644 (file)
@@ -59,7 +59,7 @@ public abstract class AbstractExportWizard<CONFIG extends IIoConfigurator> exten
        public void addPages() {
                super.addPages();
                
-               pageConfiguration = new GenericConfiguratorWizardPage(CONFIGURATION_PAGE, getConfigurator());
+               pageConfiguration = GenericConfiguratorWizardPage.Export(CONFIGURATION_PAGE, getConfigurator());
                this.addPage(pageConfiguration);
        }
        
index 33ee33f074ba2a9b686108aebb20059706ea3782..120e49f4ad172c4cd70171c19ef70a08587003a2 100644 (file)
@@ -146,7 +146,7 @@ public abstract class AbstractImportWizard<CONFIG extends IIoConfigurator> exten
        public void addPages() {
                super.addPages();
                
-               pageConfiguration = new GenericConfiguratorWizardPage(CONFIGURATION_PAGE, getConfigurator());
+               pageConfiguration = GenericConfiguratorWizardPage.Import(CONFIGURATION_PAGE, getConfigurator());
                this.addPage(pageConfiguration);
        }
        
index 90e57c2de5838d61aa0268192ea3d46a8bd63263..55e39a2bb4dcc86aac9d60170d610e0950bf9b0c 100644 (file)
@@ -19,7 +19,6 @@ import eu.etaxonomy.cdm.io.berlinModel.in.BerlinModelImportConfigurator;
 import eu.etaxonomy.cdm.io.common.Source;
 import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
 import eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceSQLServerWizardPage;
-import eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceTypeSelectionWizardPage;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
similarity index 74%
rename from taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/JaxbExportDestinationWizardPage.java
rename to taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/ExportToFileDestinationWizardPage.java
index 88895ebeb0cf23e374819182c4b6eabf99411004..c48192c189b8b933db011823f40e76587272f00b 100644 (file)
@@ -33,28 +33,44 @@ import eu.etaxonomy.taxeditor.datasource.CdmDataSourceRepository;
  * @created 15.06.2009
  * @version 1.0
  */
-public class JaxbExportDestinationWizardPage extends WizardPage{
+public class ExportToFileDestinationWizardPage extends WizardPage{
 
-       public static final String DATE_FORMAT_NOW = "yyyyMMdd-HHmm";
+       public static final String DATE_FORMAT_NOW = "yyyyMMddHHmm";
+       
+       public static final String JAXB_EXPORT = "JAXB_EXPORT";
+       
+       public static final String TCS_EXPORT = "TCS_EXPORT";
        
        private static final Logger logger = Logger
-                       .getLogger(JaxbExportDestinationWizardPage.class);
+                       .getLogger(ExportToFileDestinationWizardPage.class);
        private DirectoryDialog folderDialog;
        private Text text_exportFileName;
 
        private Text text_folder;
+
+       private String type;
        
        
        /**
         * @param pageName
         * @param selection
         */
-       protected JaxbExportDestinationWizardPage(String pageName) {
+       private ExportToFileDestinationWizardPage(String pageName, String type, String title, String description) {
                super(pageName);
-               this.setTitle("JAXB Export");
                
+               this.type = type;
+               
+               this.setTitle(title);
                this.setDescription("Exports the contents of the currently selected database into the cdm jaxb format.");
        }
+       
+       public static ExportToFileDestinationWizardPage Jaxb(){
+               return new ExportToFileDestinationWizardPage(JAXB_EXPORT, "jaxb",  "JAXB Export", "Exports the contents of the currently selected database into the cdm jaxb format.");
+       }
+       
+       public static ExportToFileDestinationWizardPage Tcs(){
+               return new ExportToFileDestinationWizardPage(TCS_EXPORT, "tcs", "Tcs Export", "Export the contents of the currently selected database into TCS format.");
+       }
 
 
        /* (non-Javadoc)
@@ -110,14 +126,16 @@ public class JaxbExportDestinationWizardPage extends WizardPage{
        
        private String generateFilename(){
                StringBuffer buffer = new StringBuffer();
-               buffer.append("jaxb_export_");
-               buffer.append(CdmDataSourceRepository.getDefault().getCurrentDataSource());
-               buffer.append("-");
                
                Calendar cal = Calendar.getInstance();
            SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
                buffer.append(sdf.format(cal.getTime()));
                
+               buffer.append("-");
+               
+               buffer.append(type + "_export-");
+               buffer.append(CdmDataSourceRepository.getDefault().getCurrentDataSource());
+                               
                buffer.append(".xml");
                
                return buffer.toString();
@@ -127,15 +145,15 @@ public class JaxbExportDestinationWizardPage extends WizardPage{
        /**
         * @return the exportFileName
         */
-       public Text getExportFileName() {
-               return text_exportFileName;
+       public String getExportFileName() {
+               return text_exportFileName.getText();
        }
 
 
        /**
         * @return the folderText
         */
-       public Text getFolderText() {
-               return text_folder;
+       public String getFolderText() {
+               return text_folder.getText();
        }
 }
index ac19b0fe28eea0edbddfcd2b495117a8c8b598cf..a9aa267245e6efb470110c7f2586fff11ab0cd74 100644 (file)
@@ -43,15 +43,24 @@ public class GenericConfiguratorWizardPage extends WizardPage {
         * @param pageName
         * @param configurator 
         */
-       protected GenericConfiguratorWizardPage(String pageName, IIoConfigurator configurator) {
+       private GenericConfiguratorWizardPage(String pageName, IIoConfigurator configurator, String title, String description) {
                super(pageName);
-               this.setTitle("Export Configuration");
+               this.setTitle(title);
                
-               this.setDescription("Configure the export mechanism.");
+               this.setDescription(description);
                
                this.configurator = configurator;
        }
        
+       public static GenericConfiguratorWizardPage Import(String pageName, IIoConfigurator configurator){
+               return new GenericConfiguratorWizardPage(pageName, configurator, "Import Configuration", "Configure the import mechanism.");
+       }
+       
+       public static GenericConfiguratorWizardPage Export(String pageName, IIoConfigurator configurator){
+               return new GenericConfiguratorWizardPage(pageName, configurator, "Export Configuration", "Configure the export mechanism.");
+       }
+       
+       
        /* (non-Javadoc)
         * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
         */
diff --git a/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/ImportFromFileDataSourceWizardPage.java b/taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/ImportFromFileDataSourceWizardPage.java
new file mode 100644 (file)
index 0000000..2460061
--- /dev/null
@@ -0,0 +1,105 @@
+// $Id$
+/**
+* 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;
+
+import org.apache.log4j.Logger;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * @author n.hoffmann
+ * @created 04.08.2009
+ * @version 1.0
+ */
+public class ImportFromFileDataSourceWizardPage extends WizardPage {
+       private static final Logger logger = Logger
+               .getLogger(ImportFromFileDataSourceWizardPage.class);
+       
+       public static final String PAGE_NAME = "CdmXmlDataSourceWizardPage";
+
+       private static final String[] EXTENSIONS = {"xml"};
+
+       private FileDialog fileDialog;
+
+       private Text text_file;
+       
+       
+       /**
+        * @param pageName
+        */
+       protected ImportFromFileDataSourceWizardPage() {
+               super(PAGE_NAME);
+               
+               setTitle("Xml File");
+               
+               setDescription("Select XML file.");
+       }
+
+
+
+       /* (non-Javadoc)
+        * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+        */
+       public void createControl(Composite parent) {
+               final Composite composite = new Composite(parent, SWT.NULL);
+               
+               GridLayout gridLayout = new GridLayout();
+               gridLayout.numColumns = 3;
+               composite.setLayout(gridLayout);
+               
+               Label folderLabel = new Label(composite, SWT.NONE);
+               folderLabel.setText("File");
+               
+               fileDialog = new FileDialog(parent.getShell());
+               
+               fileDialog.setFilterExtensions(EXTENSIONS);
+               
+               text_file = new Text(composite, SWT.BORDER);
+               text_file.setEditable(false);
+               text_file.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+               
+               Button button = new Button(composite, SWT.PUSH);
+               button.setText("Browse...");
+               
+               button.addMouseListener(new MouseAdapter(){
+
+                       /* (non-Javadoc)
+                        * @see org.eclipse.swt.events.MouseAdapter#mouseUp(org.eclipse.swt.events.MouseEvent)
+                        */
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               String path = fileDialog.open();
+                               text_file.setText(path);
+                               setPageComplete(true);
+                       }
+                       
+               });
+               
+               setControl(composite);
+       }
+
+       /**
+        * @return
+        */
+       public String getFile() {
+               return text_file.getText();
+       }
+}
index a15d8b7215462538ac15a3c4764a1cd6ee48b2ce..5e51d88dd847beaaff037f97d888f9620b97034b 100644 (file)
@@ -28,9 +28,7 @@ public class JaxbExportWizard extends AbstractExportWizard<JaxbExportConfigurato
        private static final Logger logger = Logger
                        .getLogger(JaxbExportWizard.class);
 
-       public final String JAXB_EXPORT = "JAXB_EXPORT";
-
-       private JaxbExportDestinationWizardPage page;
+       private ExportToFileDestinationWizardPage page;
 
        private JaxbExportConfigurator configurator;
 
@@ -63,7 +61,7 @@ public class JaxbExportWizard extends AbstractExportWizard<JaxbExportConfigurato
        public void addPages() {
                super.addPages();
                                
-               page = new JaxbExportDestinationWizardPage(JAXB_EXPORT);
+               page = ExportToFileDestinationWizardPage.Jaxb();
                addPage(page);
        }
 
index 6032458c89c667aa1fd3ed8322737851234ce44b..81d1b68699ad1a4caa059cc74472aac7c0830286 100644 (file)
 
 package eu.etaxonomy.taxeditor.io;
 
+import java.io.File;
+
 import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IExportWizard;
 import org.eclipse.ui.IWorkbench;
 
+import eu.etaxonomy.cdm.io.tcsxml.out.TcsXmlExportConfigurator;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
 /**
  * @author n.hoffmann
  * @created 15.06.2009
  * @version 1.0
  */
-public class TcsExportWizard extends Wizard implements IExportWizard {
+public class TcsExportWizard extends AbstractExportWizard<TcsXmlExportConfigurator> {
        private static final Logger logger = Logger
                        .getLogger(TcsExportWizard.class);
+       private static final String TCS_EXPORT = "TCS_EXPORT";
+       private TcsXmlExportConfigurator configurator;
+       private ExportToFileDestinationWizardPage page;
 
        /* (non-Javadoc)
         * @see org.eclipse.jface.wizard.Wizard#performFinish()
         */
        @Override
        public boolean performFinish() {
-               // TODO Auto-generated method stub
-               return false;
+               String urlString = page.getFolderText() + File.separator + page.getExportFileName();
+               
+               configurator.setDestination(new File(urlString));
+               configurator.setCdmAppController(CdmStore.getApplicationController());
+               
+               return doExport(configurator);
        }
 
        /* (non-Javadoc)
         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
         */
        public void init(IWorkbench workbench, IStructuredSelection selection) {
-               // TODO Auto-generated method stub
+               configurator = TcsXmlExportConfigurator.NewInstance(null, null);
+       }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.io.AbstractExportWizard#getConfigurator()
+        */
+       @Override
+       public TcsXmlExportConfigurator getConfigurator() {
+               return configurator;
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.io.AbstractExportWizard#addPages()
+        */
+       @Override
+       public void addPages() {
+               super.addPages();
+               
+               page = ExportToFileDestinationWizardPage.Tcs();
+               addPage(page);
        }
+       
+       
 }
index 7288b42cbf86135d1be69774f03a648f2c01d235..4c8226a6fa6ae6fc20d394ba149526456e61da5d 100644 (file)
@@ -12,33 +12,71 @@ package eu.etaxonomy.taxeditor.io;
 
 import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.IImportWizard;
 import org.eclipse.ui.IWorkbench;
 
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.io.tcsxml.in.TcsXmlImportConfigurator;
+import eu.etaxonomy.taxeditor.datasource.wizard.CdmDataSourceSQLServerWizardPage;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
 /**
  * @author n.hoffmann
  * @created 15.06.2009
  * @version 1.0
  */
-public class TcsImportWizard extends Wizard implements IImportWizard{
+public class TcsImportWizard extends AbstractImportWizard<TcsXmlImportConfigurator>{
        private static final Logger logger = Logger.getLogger(TcsImportWizard.class);
+       
+       private TcsXmlImportConfigurator configurator;
+
+       private ImportFromFileDataSourceWizardPage dataSourcePage;
 
        /* (non-Javadoc)
         * @see org.eclipse.jface.wizard.Wizard#performFinish()
         */
        @Override
        public boolean performFinish() {
-               // TODO Auto-generated method stub
-               return false;
+               
+               String file = dataSourcePage.getFile();
+               
+               // TcsXmlImport expects a string that can be used to instantiate a URL instance
+               // TODO consolidate import and exports regarding what may be passed in as source
+               // will construct a url string for now
+               
+               file = "file://" + file;
+               
+               CdmStore.NewTransactionalConversation();
+               
+               configurator.setSource(file);
+               configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
+               configurator.setCdmAppController(CdmStore.getApplicationController());
+               
+               return doImportInternal(configurator);
        }
 
        /* (non-Javadoc)
         * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
         */
        public void init(IWorkbench workbench, IStructuredSelection selection) {
-               // TODO Auto-generated method stub
-               
+               configurator = TcsXmlImportConfigurator.NewInstance(null, null);
        }
 
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#getConfigurator()
+        */
+       @Override
+       public TcsXmlImportConfigurator getConfigurator() {
+               return configurator;
+       }
+
+       /* (non-Javadoc)
+        * @see eu.etaxonomy.taxeditor.io.AbstractImportWizard#addPages()
+        */
+       @Override
+       public void addPages() {
+               super.addPages();
+               
+               dataSourcePage = new ImportFromFileDataSourceWizardPage();
+               addPage(dataSourcePage);
+       }
 }
diff --git a/taxeditor-store/src/test/resources/eu/etaxonomy/taxeditor/io/TcsXmlImportConfiguratorTest-input.xml b/taxeditor-store/src/test/resources/eu/etaxonomy/taxeditor/io/TcsXmlImportConfiguratorTest-input.xml
new file mode 100644 (file)
index 0000000..545f7c8
--- /dev/null
@@ -0,0 +1,382 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<DataSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tdwg.org/schemas/tcs/1.01     http://tdwg.napier.ac.uk/TCS_1.01/v101.xsd" xmlns="http://www.tdwg.org/schemas/tcs/1.01">
+    <!-- This is an instance document that tests as many different
+    applications of the schema as possible within a single document.
+    It is not meant to a 'realistic' example of a real data set
+    but a illustration of all the different types of data that can 
+    be passed. -->
+    <MetaData>
+        <!-- to be completed -->
+        <Simple/>
+    </MetaData>
+    <Specimens>
+        <Specimen id="2">
+            <Simple/>
+            <Institution identifier=""/>
+            <Collection identifier="LE"/>
+            <SpecimenItem identifier=""/>
+        </Specimen>
+    </Specimens>
+    <Publications>
+        <Publication id="1">
+            <Simple>Fl. SSR</Simple>
+        </Publication>
+        <Publication id="2">
+            <Simple>Copeland, H.F. (1943). A study, anatomical and taxonomic, of the
+                genera of Rhododendroideae. Am. Midl.Nat. 30:533-625</Simple>
+        </Publication>
+        <Publication id="3">
+            <Simple>Wilson, E.H. &amp; Rehder, A. (1921). A monograph of the azaleas.
+                Publication of the Arnold Arboretum No. 9 Harvard University, Cambridge
+            MA.</Simple>
+        </Publication>
+        <Publication id="4">
+            <Simple>Judd, W.S. &amp; Kron, K.A. (1995) A Revision of Rhododendron VI
+                Edinb. J. Bot. 52(1): 1-54</Simple>
+        </Publication>
+        <Publication id="5">
+            <Simple>Maximoxicz, C.J. (1870) Rhododendron schlippenbachii. Mem. Acad. Sci.
+                St Petersbourg. ser.3 15.</Simple>
+        </Publication>
+    </Publications>
+    <TaxonNames>
+        <TaxonName id="0" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron</Simple>
+        </TaxonName>
+        <TaxonName nomenclaturalCode="Botanical" id="1">
+            <Simple>Rhododendron subgenus Pentanthera (G. Don) Poyarkova</Simple>
+            <CanonicalName>
+                <Simple>Rhododedron subgenus Pentanthera</Simple>
+                <Genus>Rhododendron</Genus>
+                <InfragenericEpithet>Pentanthera</InfragenericEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>(G.Don) Poyarkova</Simple>
+                <BasionymAuthorship>
+                    <Simple>G. Don</Simple>
+                    <Authors>
+                        <AgentName>G. Don</AgentName>
+                    </Authors>
+                </BasionymAuthorship>
+                <CombinationAuthorship>
+                    <Simple>Poyarkova</Simple>
+                    <Authors>
+                        <AgentName>Poyarkova</AgentName>
+                    </Authors>
+                </CombinationAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn ref="1">Fl. SSR Vol 18 (1952)</PublishedIn>
+            <MicroReference>Page 57</MicroReference>
+            <Typification>
+                <Simple>Rhododendron flavum G.Don</Simple>
+                    <!--
+                        N.B. This could be linked to a full name entry if
+                        required but no details are in the current monograph so
+                        it isn't
+                    -->
+                <TypeName/>
+            </Typification>
+        </TaxonName>
+        <TaxonName id="2" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron sect. Sciadorhodion Rehder &amp; Wilson</Simple>
+            <CanonicalName>
+                <Simple>Rhododendron sect. Sciadorhodion</Simple>
+                <Genus>Rhododendron</Genus>
+                <InfragenericEpithet>Sciadorhodion</InfragenericEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Rehder &amp; Wilson</Simple>
+                <BasionymAuthorship>
+                    <Simple>Rehder &amp; Wilson</Simple>
+                </BasionymAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn linkType="local" ref="3">Wislon &amp; Rehder Monogr. Azaleas 79 (1921)</PublishedIn>
+            <MicroReference>Page 79</MicroReference>
+            <Typification>
+                <Simple/>
+                <TypeName>
+                    <NameReference linkType="local" ref="3">Rhododendron quinquefolium Bisset
+                        &amp; Moore</NameReference>
+                    <LectotypePublication ref="2">Copeland, H.F.(1943)</LectotypePublication>
+                </TypeName>
+            </Typification>
+            <Basionym>
+                <RelatedName ref="4">Azalea subgen. Sciadorhodion (Rhehder &amp; Wilson)
+                    Copeland</RelatedName>
+            </Basionym>
+        </TaxonName>
+        <TaxonName id="3" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron quinquefolium Bisset &amp; Moore</Simple>
+        </TaxonName>
+        <TaxonName id="4" nomenclaturalCode="Botanical">
+            <!-- for brevity this NameObject isn't fully expanded -->
+            <Simple>Azalea subgen. Sciadorhodion (Rhehder &amp; Wilson) Copeland </Simple>
+            <Basionym>
+                <RelatedName ref="2">Rhododendron sect. Sciadorhodion Rehder &amp;
+                Wilson</RelatedName>
+            </Basionym>
+        </TaxonName>
+        <TaxonName id="5" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron schlippenbachii Maxim.</Simple>
+            <Rank code="sp">Species</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron schlippenbachii</Simple>
+                <Genus>Rhododendron</Genus>
+                <SpecificEpithet>schlippenbachii</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Maxim.</Simple>
+                <BasionymAuthorship>
+                    <Simple>Maxim.</Simple>
+                    <Authors>
+                        <AgentName>Maximoxicz, C.J.</AgentName>
+                    </Authors>
+                </BasionymAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn ref="5">Bull. Acad. Sci. St Petersbourg, ser. 3 15 (1870)</PublishedIn>
+            <MicroReference>Page 226</MicroReference>
+            <Typification>
+                <Simple/>
+                <TypeVouchers>
+                <TypeVoucher typeOfType="lecto">
+                    <VoucherReference linkType="local" ref="1"/>
+                    <LectotypePublication ref="4"/>
+                    <LectotypeMicroReference>Page 15</LectotypeMicroReference>
+                </TypeVoucher>
+                <TypeVoucher typeOfType="isolecto">
+                    <VoucherReference linkType="local" ref="2"/>
+                    <LectotypePublication ref="4"/>
+                    <LectotypeMicroReference>Page 15</LectotypeMicroReference>
+                </TypeVoucher>
+                </TypeVouchers>
+            </Typification>
+        </TaxonName>
+        <TaxonName id="6" nomenclaturalCode="Botanical">
+            <Simple>Azalea schlippenbachii (Maxim.) Kuntze</Simple>
+            <CanonicalName>
+                <Simple>Azalea schlippenbachii</Simple>
+                <Genus>Azalea</Genus>
+                <SpecificEpithet>schlippenbachii</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>(Maxim.) Kuntze</Simple>
+                <BasionymAuthorship>
+                    <Simple>Maxim.</Simple>
+                </BasionymAuthorship>
+                <CombinationAuthorship>
+                    <Simple>Kuntze</Simple>
+                </CombinationAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn>Revis. Gen.Pl. 2:387 (1891)</PublishedIn>
+            <Typification>
+                <Simple/>
+                <TypeVouchers>
+                <TypeVoucher typeOfType="lecto">
+                    <VoucherReference ref="2">[Russia] Manchuria, shores of Possiet Bay, [SW of
+                        Vladivostok], 1860, C. Maximowicz LE</VoucherReference>
+                    <LectotypePublication ref="4"/>
+                    <LectotypeMicroReference>Page 15</LectotypeMicroReference>
+                </TypeVoucher>
+               </TypeVouchers>
+            </Typification>
+        </TaxonName>
+        <TaxonName id="7" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron pentaphyllum Maxim.</Simple>
+            <CanonicalName>
+                <Simple>Rhododendron pentaphyllum</Simple>
+                <Genus>Rhododendron</Genus>
+                <SpecificEpithet>pentaphyllum</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Maxim.</Simple>
+            </CanonicalAuthorship>
+            <PublishedIn>Bull. Acad. Sci. St Petersbourg, ser. 3, 31:65 (1887)</PublishedIn>
+            <Typification>
+                <Simple/>
+                <TypeVouchers>
+                    <TypeVoucher typeOfType="holo">
+                        <VoucherReference>Japan, Kyushiu, prov. Osumi, summit, Mt Taka-kuma, Tashiro
+                            (LE)</VoucherReference>
+                    </TypeVoucher>
+                </TypeVouchers>
+           
+            </Typification>
+        </TaxonName>
+        <TaxonName id="8" nomenclaturalCode="Botanical">
+            <Simple>Azalea pentaphylla (Maxim.) Copeland</Simple>
+            <CanonicalName>
+                <Simple>Azalea pentaphylla</Simple>
+                <Genus>Azalea</Genus>
+                <SpecificEpithet>pentaphylla</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>(Maxim.) Copeland</Simple>
+                <BasionymAuthorship>
+                    <Simple>Maxim.</Simple>
+                </BasionymAuthorship>
+                <CombinationAuthorship>
+                    <Simple>Copeland</Simple>
+                </CombinationAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn>Am.Midl.Nat. 30:595 (1943)</PublishedIn>
+            <Typification>
+                <Simple/>
+                <TypeVouchers>
+                    <TypeVoucher typeOfType="holo">
+                        <VoucherReference>Japan, Kyushiu, prov. Osumi, summit, Mt Taka-kuma, Tashiro
+                            (LE)</VoucherReference>
+                    </TypeVoucher>
+                </TypeVouchers>
+            </Typification>
+        </TaxonName>
+        <TaxonName id="9" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron pentaphyllum var. nikoense Komatsu</Simple>
+            <Rank code="var">variety</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron pentaphyllum var. nikoense</Simple>
+                <Genus ref="0">Rhododendron</Genus>
+                <SpecificEpithet>pentaphyllum</SpecificEpithet>
+                <InfraspecificEpithet>nikoense</InfraspecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Konatsu</Simple>
+            </CanonicalAuthorship>
+            <PublishedIn>Icon. Pl. Koisikav. 3: 45, t 168 (1916)</PublishedIn>
+        </TaxonName>
+        <TaxonName id="10" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron nikoense (Komatsu) Nakai</Simple>
+            <Rank code="sp">Species</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron nikoense</Simple>
+                <Genus ref="0">Rhododendron</Genus>
+                <SpecificEpithet>nikoense</SpecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>(Komatsu) Nakai</Simple>
+                <BasionymAuthorship>
+                    <Simple>Komatsu</Simple>
+                </BasionymAuthorship>
+                <CombinationAuthorship>
+                    <Simple>Nakai</Simple>
+                </CombinationAuthorship>
+            </CanonicalAuthorship>
+            <PublishedIn>Nakai &amp; Koidz. Trees and Shrubs Japan 1: 68 (1922)</PublishedIn>
+            <Basionym>
+                <RelatedName ref="9">Rhododendron pentaphyllum var. nikoense</RelatedName>
+            </Basionym>
+        </TaxonName>
+        <TaxonName id="11" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron quinquefolium Bisset &amp; S. Moore var. roseum Rehder</Simple>
+            <Rank code="var">variety</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron quinquefolium</Simple>
+                <Genus ref="0">Rhododendron</Genus>
+                <SpecificEpithet>quinquefolium</SpecificEpithet>
+                <InfraspecificEpithet>roseum</InfraspecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>Rehder</Simple>
+            </CanonicalAuthorship>
+            <PublishedIn>Bailey, Stand. Cycl. Hort. 5: 2947 (1916)</PublishedIn>
+        </TaxonName>
+        <TaxonName id="12" nomenclaturalCode="Botanical">
+            <Simple>Rhododendron pentaphyllum Maxim. var. shikokianum T. Yamazaki</Simple>
+            <Rank code="sp">species</Rank>
+            <CanonicalName>
+                <Simple>Rhododendron pentaphyllum var. shikokianum</Simple>
+                <Genus ref="0">Rhododendron</Genus>
+                <SpecificEpithet>pentaphyllum</SpecificEpithet>
+                <InfraspecificEpithet>shikokianum</InfraspecificEpithet>
+            </CanonicalName>
+            <CanonicalAuthorship>
+                <Simple>T. Yamazaki</Simple>
+            </CanonicalAuthorship>
+            <PublishedIn>Jap. Bot. 63: 312 (1988)</PublishedIn>
+        </TaxonName>
+    </TaxonNames>
+    <TaxonConcepts>
+        <TaxonConcept id="1">
+            <Name scientific="true" linkType="local" ref="2">Rhododendron sect. Sciadorhodion Rehder
+                &amp; Wilson</Name>
+            <Rank code="sect">Section</Rank>
+            <AccordingTo>
+                <Simple>Judd &amp; Kron (1995)</Simple>
+                <AccordingToDetailed>
+                    <PublishedIn linkType="local" ref="4">Judd &amp; Kron (1995) A Revision of
+                        Rhododendron VI </PublishedIn>
+                    <MicroReference>Page 13-14</MicroReference>
+                </AccordingToDetailed>
+            </AccordingTo>
+            <TaxonRelationships>
+                <TaxonRelationship type="is parent taxon of">
+                    <ToTaxonConcept linkType="local" ref="2"/>
+                </TaxonRelationship>
+            </TaxonRelationships>
+        </TaxonConcept>
+        <TaxonConcept id="2">
+            <Name scientific="true" linkType="local" ref="5">Rhododendron schlippenbachii Maxim.</Name>
+            <AccordingTo>
+                <Simple>Judd &amp; Kron (1995)</Simple>
+                <AccordingToDetailed>
+                    <PublishedIn linkType="local" ref="4"/>
+                    <MicroReference>Page 15</MicroReference>
+                </AccordingToDetailed>
+            </AccordingTo>
+            <TaxonRelationships>
+                <TaxonRelationship type="is child taxon of">
+                    <ToTaxonConcept ref="1">Rhododendron sect. Sciadorhodion Rehder &amp;
+                    Wilson</ToTaxonConcept>
+                </TaxonRelationship>
+            </TaxonRelationships>
+        </TaxonConcept>
+        <TaxonConcept id="3">
+            <Name scientific="true" ref="6">Azalea schlippenbachii (Maxim.) Kuntze</Name>
+            <AccordingTo>
+                <Simple>Kuntze (1891)</Simple>
+            </AccordingTo>
+            <TaxonRelationships>
+                <TaxonRelationship type="is congruent to">
+                    <ToTaxonConcept ref="2"/>
+                </TaxonRelationship>
+            </TaxonRelationships>
+        </TaxonConcept>
+        <TaxonConcept id="4">
+            <Name scientific="true" ref="7">Rhododendron pentaphyllum Maxim.</Name>
+            <AccordingTo>
+                <Simple>Judd &amp; Kron (1995)</Simple>
+            </AccordingTo>
+            <TaxonRelationships>
+                <!-- relationships linking to taxonconcept without any descriptive string -->
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept ref="6"/>
+                </TaxonRelationship>
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept ref="7"/>
+                </TaxonRelationship>
+                <!-- relationship with linking reference to another taxon concept and string description of concept -->
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept ref="8">Rhododendron pentaphyllum var. nikoense
+                    Komatsu</ToTaxonConcept>
+                </TaxonRelationship>
+                <!-- relationships without linking -->
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept>Rhododendron pentaphyllum Maxim. var. shikokianum T.
+                    Yamazaki</ToTaxonConcept>
+                </TaxonRelationship>
+                <TaxonRelationship type="has synonym">
+                    <ToTaxonConcept>Rhododendron quinquefolium Bisset &amp; S. Moore var. roseum
+                        Rehder</ToTaxonConcept>
+                </TaxonRelationship>
+            </TaxonRelationships>
+        </TaxonConcept>
+        <TaxonConcept id="6">
+            <Name scientific="true">Rhododendron nikoense (Komatsu) Nakai</Name>
+        </TaxonConcept>
+        <TaxonConcept id="7">
+            <Name scientific="true" ref="10">Rhododendron nikoense (Komatsu) Nakai</Name>
+        </TaxonConcept>
+        <TaxonConcept id="8">
+            <Name scientific="true" ref="9">Rhododendron pentaphyllum var. nikoense Komatsu</Name>
+        </TaxonConcept>
+    </TaxonConcepts>
+</DataSet>