fix jenkins
authorKatja Luther <k.luther@bgbm.org>
Wed, 30 Mar 2016 08:44:40 +0000 (10:44 +0200)
committerKatja Luther <k.luther@bgbm.org>
Wed, 30 Mar 2016 08:44:40 +0000 (10:44 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/BioCaseEditorInput.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/DataImportEditorContextMenu.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenImportView.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizard.java

index 60d1302..17b4251 100644 (file)
@@ -7,7 +7,7 @@
  * 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.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -23,7 +23,6 @@ import eu.etaxonomy.cdm.ext.occurrence.bioCase.BioCaseQueryServiceWrapper;
 import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.transientServices.TransientCdmRepository;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -57,13 +56,13 @@ public class BioCaseEditorInput extends DataImportEditorInput<SpecimenOrObservat
             InputStream resultStream;
             resultStream = new BioCaseQueryServiceWrapper().query(query, endPoint);
             Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(resultStream, null, false);
-            TransientCdmRepository repo =
+           /* TransientCdmRepository repo =
                     new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
             configurator.setCdmAppController(repo);
-
+*/
             CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
             importer.invoke(configurator);
-            results = repo.getUnits();
+           // results = repo.getUnits();
             setResults(results);
         } catch (ClientProtocolException e) {
             logger.error(errorMessage, e);
index 4c2735f..7bd1765 100644 (file)
@@ -1,4 +1,4 @@
-package eu.etaxonomy.taxeditor.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.io.IOException;
 
@@ -19,7 +19,6 @@ import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.MenuItem;
 import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.actions.CompoundContributionItem;
 
@@ -30,7 +29,6 @@ import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifDataSetProtocol;
 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifQueryServiceWrapper;
 import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.EditorUtil;
 import eu.etaxonomy.taxeditor.model.AbstractUtility;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
@@ -92,7 +90,7 @@ public class DataImportEditorContextMenu extends CompoundContributionItem {
                                         try{
                                             DataSetResponse response = new GbifQueryServiceWrapper().queryOriginalDataSet(gbifResponse);
                                             final BioCaseEditorInput input = new BioCaseEditorInput(new OccurenceQuery(response.getUnitId()), response.getEndpoint());
-                                            EditorUtil.open(input);
+                                           // EditorUtil.open(input);
                                             Job queryJob = new Job("Querying for original record...") {
 
                                                 @Override
@@ -106,9 +104,10 @@ public class DataImportEditorContextMenu extends CompoundContributionItem {
                                             logger.error("Query for single record failed.", e);
                                         } catch (IOException e) {
                                             logger.error("Query for single record failed.", e);
-                                        } catch (PartInitException e) {
-                                            logger.error("Could not open editor.", e);
                                         }
+//                                        } catch (PartInitException e) {
+//                                            logger.error("Could not open editor.", e);
+//                                        }
                                     }
                                 });
                             }
index 298b1f4..1c16a6f 100644 (file)
@@ -7,7 +7,7 @@
 * 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.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -23,7 +23,6 @@ import eu.etaxonomy.cdm.io.common.CdmDefaultImport;
 import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
-import eu.etaxonomy.taxeditor.editor.view.dataimport.transientServices.TransientCdmRepository;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -33,7 +32,7 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase<?>> {
 
-    public static final String ID = "eu.etaxonomy.taxeditor.editor.view.dataimport.SpecimenImportView"; //$NON-NLS-1$
+    public static final String ID = "eu.etaxonomy.taxeditor.view.dataimport.SpecimenImportView"; //$NON-NLS-1$
 
     private URI endPoint;
 
@@ -48,7 +47,7 @@ public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase
     }
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
+     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#getTextForTableItem(java.lang.Object)
      */
     @Override
     protected String getTextForTableItem(SpecimenOrObservationBase<?> item) {
@@ -56,7 +55,7 @@ public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase
     }
 
     /* (non-Javadoc)
-     * @see eu.etaxonomy.taxeditor.editor.view.dataimport.DataImportView#query()
+     * @see eu.etaxonomy.taxeditor.view.dataimport.DataImportView#query()
      */
     @Override
     public void query() {
@@ -68,9 +67,9 @@ public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase
             InputStream resultStream;
             resultStream = new BioCaseQueryServiceWrapper().query(query, endPoint);
             Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(null, null);
-            TransientCdmRepository repo =
-                    new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
-            configurator.setCdmAppController(repo);
+//            TransientCdmRepository repo =
+//                    new TransientCdmRepository(CdmStore.getCurrentApplicationConfiguration());
+            //configurator.setCdmAppController(repo);
             configurator.setAddMediaAsMediaSpecimen(true);
             if(CdmStore.getCurrentSessionManager().isRemoting()) {
                 Job job = CdmStore.getImportManager().createIOServiceJob(configurator, resultStream, SOURCE_TYPE.INPUTSTREAM);
@@ -80,7 +79,7 @@ public class SpecimenImportView extends DataImportView<SpecimenOrObservationBase
                 CdmDefaultImport<Abcd206ImportConfigurator> importer = new CdmDefaultImport<Abcd206ImportConfigurator>();
                 importer.invoke(configurator);
             }
-            results = repo.getUnits();
+           // results = repo.getUnits();
             setResults(results);
         } catch (ClientProtocolException e) {
             logger.error(errorMessage, e);
index 239700c..1e91d6c 100644 (file)
@@ -7,7 +7,7 @@
 * 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.editor.view.dataimport;
+package eu.etaxonomy.taxeditor.view.dataimport;
 
 import org.apache.log4j.Logger;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -19,11 +19,10 @@ 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.PartInitException;
 
+import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
-import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
+import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -61,35 +60,45 @@ public class SpecimenSearchWizard extends Wizard implements IImportWizard {
 
         DataImportView<?> dataImportView = null;
         query = searchPage.getQuery();
-        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);
+        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);
+
+            CdmStore.getImportManager().run(configurator);
         }
-        if(dataImportView!=null){
-            dataImportView.setQuery(query);
-//            dataImportView.query();
-//            Display.getDefault().asyncExec(new Runnable() {
-//
-//                @Override
-//                public void run() {
-//                    CdmStore.getContextManager().notifyContextRefresh();
-//                }
-//            });
+//        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;
     }