commit e38554be014b0d65a19e3f0d79d43e0f12cddc5f
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Tue Jul 26 15:44:19 2016 +0200

    line endings

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizard.java
index 03aa92c07..9ba538987 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizard.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizard.java
@@ -1,217 +1,217 @@
-// $Id$
-/**
-* Copyright (C) 2013 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.view.dataimport;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-
-import org.apache.log4j.Logger;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IImportWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.w3c.dom.NodeList;
-
-import eu.etaxonomy.cdm.database.DbSchemaValidation;
-import eu.etaxonomy.cdm.ext.common.ServiceWrapperBase;
-import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
-import eu.etaxonomy.cdm.ext.occurrence.bioCase.BioCaseQueryServiceWrapper;
-import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
-
-import eu.etaxonomy.cdm.io.specimen.abcd206.in.AbcdParseUtility;
-import eu.etaxonomy.cdm.io.specimen.abcd206.in.SpecimenImportReport;
-import eu.etaxonomy.cdm.io.specimen.abcd206.in.UnitAssociationWrapper;
-import eu.etaxonomy.taxeditor.store.CdmStore;
-
-/**
- * Wizard for querying specimen provider.
- * @author pplitzner
- * @date 11.09.2013
- *
- */
-public class SpecimenSearchWizard extends Wizard implements IImportWizard {
-    private static final Logger logger = Logger.getLogger(SpecimenSearchWizard.class);
-
-    private OccurenceQuery query = null;
-    private SpecimenProviderSelectionWizardPage providerSelectionPage;
-    private SpecimenSearchWizardPage searchPage;
-
-    /**
-     * Creates a new SpecimenSearchWizard
-     */
-    public SpecimenSearchWizard() {
-        //default constructor needed for RCP extension points
-
-        //check if connected to a data source. If not this will open an error dialog
-        CdmStore.getCurrentApplicationConfiguration();
-        this.setWindowTitle("Search Specimens");
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.wizard.Wizard#performFinish()
-     */
-    @Override
-    public boolean performFinish() {
-        searchPage.getController().saveLastSate();
-        providerSelectionPage.getController().saveLastState();
-        ServiceWrapperBase serviceWrapper;
-        DataImportView<?> dataImportView = null;
-        query = searchPage.getQuery();
-        Abcd206ImportConfigurator configurator =  CdmStore.getImportManager().AbcdConfigurator();
-        configurator.setOccurenceQuery(query);
-        configurator.setSourceUri(providerSelectionPage.getEndPoint());
-        configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
-        if(CdmStore.getCurrentSessionManager().isRemoting() ) {
-            //Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.INPUTSTREAM);
-            //CdmStore.getImportManager().run(job);
-            try {
-                serviceWrapper = providerSelectionPage.getQueryServiceWrapper();
-                InputStream stream = null;
-
-                final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
-                IWorkbenchPage activePart = window.getActivePage();
-                if (providerSelectionPage.getQueryType().equals(QueryType.BIOCASE)){
-                    stream =((BioCaseQueryServiceWrapper) serviceWrapper).query(query, configurator.getSourceUri());
-                    SpecimenImportReport report = new SpecimenImportReport();
-                    UnitAssociationWrapper unitNodesList = AbcdParseUtility.parseUnitsNodeList(stream, report);
-                    NodeList nodeList = unitNodesList.getAssociatedUnits();
-                    String prefix = unitNodesList.getPrefix();
-                    String associationType = unitNodesList.getAssociationType();
-                    URI uri =AbcdParseUtility.parseFirstUri(nodeList, report);
-                    String content = AbcdParseUtility.parseFirstTextContent(nodeList);
-                    System.out.println(content);
-
-
-                    SpecimenImportView specimenImportView = new SpecimenImportView();
-                    try {
-                        specimenImportView = (SpecimenImportView) activePart.showView(SpecimenImportView.ID);
-                        specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
-                        specimenImportView.setQuery(query);
-                        dataImportView = specimenImportView;
-                    } catch (PartInitException e) {
-                        // TODO Auto-generated catch block
-                        e.printStackTrace();
-
-                    }
-
-                } else{
-                    try {
-                    	
-                        dataImportView = (GbifResponseImportView) activePart.showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""), IWorkbenchPage.VIEW_ACTIVATE);
-                        dataImportView.setQuery(query);		
-                        	//	(GbifResponseImportView) activePart.showView(GbifResponseImportView.ID);getWorkbench().getActiveWorkbenchWindow().getActivePage()
-                             // .showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
-
-                    } catch (PartInitException e) {
-                        // TODO Auto-generated catch block
-                        e.printStackTrace();
-                    }
-
-                }
-
-
-            } catch (IOException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-           // CdmStore.getImportManager().run(configurator);
-        }
-//        try {
-//            switch (providerSelectionPage.getQueryType()) {
-//            case BIOCASE:
-//                SpecimenImportView specimenImportView = (SpecimenImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
-//                        .showView(SpecimenImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
-//                specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
-//                dataImportView = specimenImportView;
-//                break;
-//            case GBIF:
-//                dataImportView = (GbifResponseImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
-//                .showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
-//                break;
-//            }
-//        } catch ( PartInitException e ) {
-//            logger.error("Could not open import view for query: " + query.toString(), e);
-//        }
-//        if(dataImportView!=null){
-//            dataImportView.setQuery(query);
-////            dataImportView.query();
-////            Display.getDefault().asyncExec(new Runnable() {
-////
-////                @Override
-////                public void run() {
-////                    CdmStore.getContextManager().notifyContextRefresh();
-////                }
-////            });
-            Job queryJob = new QueryJob("Query specimen provider", dataImportView);
-            queryJob.schedule();
-
-        return true;
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.jface.wizard.Wizard#addPages()
-     */
-    @Override
-    public void addPages() {
-        addPage(providerSelectionPage);
-        addPage(searchPage);
-    }
-
-    /* (non-Javadoc)
-     * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
-     */
-    @Override
-    public void init(IWorkbench workbench, IStructuredSelection selection) {
-        providerSelectionPage = new SpecimenProviderSelectionWizardPage("Select specimen provider");
-        searchPage = new SpecimenSearchWizardPage("Specimen Search");
-    }
-
-    private class QueryJob extends Job{
-
-        private final DataImportView<?> view;
-
-        /**
-         * @param name
-         */
-        public QueryJob(String name, DataImportView<?> view) {
-            super(name);
-            this.view = view;
-        }
-
-        /* (non-Javadoc)
-         * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
-         */
-        @Override
-        protected IStatus run(IProgressMonitor monitor) {
-            view.getConversationHolder().bind();
-            view.query();
-            Display.getDefault().asyncExec(new Runnable() {
-
-                @Override
-                public void run() {
-                    CdmStore.getContextManager().notifyContextRefresh();
-                }
-            });
-            return Status.OK_STATUS;
-        }
-
-    }
-}
+// $Id$
+/**
+* Copyright (C) 2013 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.view.dataimport;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IImportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.w3c.dom.NodeList;
+
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
+import eu.etaxonomy.cdm.ext.common.ServiceWrapperBase;
+import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
+import eu.etaxonomy.cdm.ext.occurrence.bioCase.BioCaseQueryServiceWrapper;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
+
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.AbcdParseUtility;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.SpecimenImportReport;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.UnitAssociationWrapper;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * Wizard for querying specimen provider.
+ * @author pplitzner
+ * @date 11.09.2013
+ *
+ */
+public class SpecimenSearchWizard extends Wizard implements IImportWizard {
+    private static final Logger logger = Logger.getLogger(SpecimenSearchWizard.class);
+
+    private OccurenceQuery query = null;
+    private SpecimenProviderSelectionWizardPage providerSelectionPage;
+    private SpecimenSearchWizardPage searchPage;
+
+    /**
+     * Creates a new SpecimenSearchWizard
+     */
+    public SpecimenSearchWizard() {
+        //default constructor needed for RCP extension points
+
+        //check if connected to a data source. If not this will open an error dialog
+        CdmStore.getCurrentApplicationConfiguration();
+        this.setWindowTitle("Search Specimens");
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.wizard.Wizard#performFinish()
+     */
+    @Override
+    public boolean performFinish() {
+        searchPage.getController().saveLastSate();
+        providerSelectionPage.getController().saveLastState();
+        ServiceWrapperBase serviceWrapper;
+        DataImportView<?> dataImportView = null;
+        query = searchPage.getQuery();
+        Abcd206ImportConfigurator configurator =  CdmStore.getImportManager().AbcdConfigurator();
+        configurator.setOccurenceQuery(query);
+        configurator.setSourceUri(providerSelectionPage.getEndPoint());
+        configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
+        if(CdmStore.getCurrentSessionManager().isRemoting() ) {
+            //Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.INPUTSTREAM);
+            //CdmStore.getImportManager().run(job);
+            try {
+                serviceWrapper = providerSelectionPage.getQueryServiceWrapper();
+                InputStream stream = null;
+
+                final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+                IWorkbenchPage activePart = window.getActivePage();
+                if (providerSelectionPage.getQueryType().equals(QueryType.BIOCASE)){
+                    stream =((BioCaseQueryServiceWrapper) serviceWrapper).query(query, configurator.getSourceUri());
+                    SpecimenImportReport report = new SpecimenImportReport();
+                    UnitAssociationWrapper unitNodesList = AbcdParseUtility.parseUnitsNodeList(stream, report);
+                    NodeList nodeList = unitNodesList.getAssociatedUnits();
+                    String prefix = unitNodesList.getPrefix();
+                    String associationType = unitNodesList.getAssociationType();
+                    URI uri =AbcdParseUtility.parseFirstUri(nodeList, report);
+                    String content = AbcdParseUtility.parseFirstTextContent(nodeList);
+                    System.out.println(content);
+
+
+                    SpecimenImportView specimenImportView = new SpecimenImportView();
+                    try {
+                        specimenImportView = (SpecimenImportView) activePart.showView(SpecimenImportView.ID);
+                        specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
+                        specimenImportView.setQuery(query);
+                        dataImportView = specimenImportView;
+                    } catch (PartInitException e) {
+                        // TODO Auto-generated catch block
+                        e.printStackTrace();
+
+                    }
+
+                } else{
+                    try {
+                    	
+                        dataImportView = (GbifResponseImportView) activePart.showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""), IWorkbenchPage.VIEW_ACTIVATE);
+                        dataImportView.setQuery(query);		
+                        	//	(GbifResponseImportView) activePart.showView(GbifResponseImportView.ID);getWorkbench().getActiveWorkbenchWindow().getActivePage()
+                             // .showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
+
+                    } catch (PartInitException e) {
+                        // TODO Auto-generated catch block
+                        e.printStackTrace();
+                    }
+
+                }
+
+
+            } catch (IOException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+           // CdmStore.getImportManager().run(configurator);
+        }
+//        try {
+//            switch (providerSelectionPage.getQueryType()) {
+//            case BIOCASE:
+//                SpecimenImportView specimenImportView = (SpecimenImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+//                        .showView(SpecimenImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
+//                specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
+//                dataImportView = specimenImportView;
+//                break;
+//            case GBIF:
+//                dataImportView = (GbifResponseImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
+//                .showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
+//                break;
+//            }
+//        } catch ( PartInitException e ) {
+//            logger.error("Could not open import view for query: " + query.toString(), e);
+//        }
+//        if(dataImportView!=null){
+//            dataImportView.setQuery(query);
+////            dataImportView.query();
+////            Display.getDefault().asyncExec(new Runnable() {
+////
+////                @Override
+////                public void run() {
+////                    CdmStore.getContextManager().notifyContextRefresh();
+////                }
+////            });
+            Job queryJob = new QueryJob("Query specimen provider", dataImportView);
+            queryJob.schedule();
+
+        return true;
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.wizard.Wizard#addPages()
+     */
+    @Override
+    public void addPages() {
+        addPage(providerSelectionPage);
+        addPage(searchPage);
+    }
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+     */
+    @Override
+    public void init(IWorkbench workbench, IStructuredSelection selection) {
+        providerSelectionPage = new SpecimenProviderSelectionWizardPage("Select specimen provider");
+        searchPage = new SpecimenSearchWizardPage("Specimen Search");
+    }
+
+    private class QueryJob extends Job{
+
+        private final DataImportView<?> view;
+
+        /**
+         * @param name
+         */
+        public QueryJob(String name, DataImportView<?> view) {
+            super(name);
+            this.view = view;
+        }
+
+        /* (non-Javadoc)
+         * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+         */
+        @Override
+        protected IStatus run(IProgressMonitor monitor) {
+            view.getConversationHolder().bind();
+            view.query();
+            Display.getDefault().asyncExec(new Runnable() {
+
+                @Override
+                public void run() {
+                    CdmStore.getContextManager().notifyContextRefresh();
+                }
+            });
+            return Status.OK_STATUS;
+        }
+
+    }
+}
