- moved query class variable to super class DataImportEditorInput
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 2 Jun 2014 09:43:18 +0000 (09:43 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 2 Jun 2014 09:43:18 +0000 (09:43 +0000)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/BioCaseEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/DataImportEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/GbifImportEditorInput.java
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/dataimport/QueryOriginalRecordCommand.java

index a7ceb09d61ffdc2ddbf6afc54f42c130ffd5fc97..b98f89760b9d05d55df186ac14d01219815b7e88 100644 (file)
@@ -33,8 +33,6 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class BioCaseEditorInput extends DataImportEditorInput<SpecimenOrObservationBase<?>> {
 
-    private final OccurenceQuery query;
-
     /**
      * @param results
      */
@@ -49,6 +47,7 @@ public class BioCaseEditorInput extends DataImportEditorInput<SpecimenOrObservat
 
         Collection<SpecimenOrObservationBase<?>> results = new ArrayList<SpecimenOrObservationBase<?>>();
         try {
+            //FIXME move ABCD import to cdmlib -> this will also get rid of the transient services
             InputStream resultStream;
             resultStream = new BioCaseQueryServiceWrapper().query(query);
             Abcd206ImportConfigurator configurator = Abcd206ImportConfigurator.NewInstance(resultStream, null, false);
index 1d7c52ef32da0be99b05bc5aba98701b0b86d0d6..a74d15d44c56ca2ddcb11d95df5fc740297d1631 100644 (file)
@@ -17,6 +17,7 @@ import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IPersistableElement;
 
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -32,6 +33,8 @@ public abstract class DataImportEditorInput<T> implements IEditorInput {
 
     private final ConversationHolder conversationHolder;
 
+    protected OccurenceQuery query;
+
     /**
      * @param results
      */
index 4b984c09197353a383bf05f93fd0efd9f3db6a30..ed7c89cc0cf3313004d0ee90754c186585ec99ec 100644 (file)
@@ -26,8 +26,6 @@ import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
  */
 public class GbifImportEditorInput extends DataImportEditorInput<GbifResponse> {
 
-    private final OccurenceQuery query;
-
     /**
      * @param query
      */
@@ -93,7 +91,7 @@ public class GbifImportEditorInput extends DataImportEditorInput<GbifResponse> {
         if (getClass() != obj.getClass()) {
             return false;
         }
-        GbifImportEditorInput other = (GbifImportEditorInput) obj;
+        DataImportEditorInput<GbifResponse> other = (DataImportEditorInput<GbifResponse>) obj;
         if (query == null) {
             if (other.query != null) {
                 return false;
index 75c99dfb65286c9d2c8124c46356403580d333d2..9580c5cbabcb2e425dd28a0403fc784ad70b0cdd 100644 (file)
@@ -1,7 +1,5 @@
 package eu.etaxonomy.taxeditor.editor.view.dataimport;
 
-import java.net.URI;
-
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
@@ -10,8 +8,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.PlatformUI;
 
-import eu.etaxonomy.cdm.ext.occurrence.gbif.GbifResponse;
-
 public class QueryOriginalRecordCommand extends AbstractHandler {
 
     /* (non-Javadoc)
@@ -25,9 +21,10 @@ public class QueryOriginalRecordCommand extends AbstractHandler {
             StructuredSelection structuredSelection = (StructuredSelection)selection;
             if(structuredSelection.size()==1){
                 Object next = structuredSelection.iterator().next();
-                if(next instanceof GbifResponse){
-                    URI endPoint = ((GbifResponse) next).getDataSetUri();
-                }
+//                if(next instanceof GbifResponse){
+//                    InputStream inputStream = new GbifQueryServiceWrapper().queryForOriginalRecord((GbifResponse)next);
+//                    BioCaseEditorInput input = new BioCaseEditorInput(query);
+//                }
             }
         }
         return null;