Project

General

Profile

« Previous | Next » 

Revision 298cf041

Added by Katja Luther about 8 years ago

fix jenkins

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/dataimport/SpecimenSearchWizard.java
7 7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8 8
* See LICENSE.TXT at the top of this package for the full license terms.
9 9
*/
10
package eu.etaxonomy.taxeditor.editor.view.dataimport;
10
package eu.etaxonomy.taxeditor.view.dataimport;
11 11

  
12 12
import org.apache.log4j.Logger;
13 13
import org.eclipse.core.runtime.IProgressMonitor;
......
19 19
import org.eclipse.swt.widgets.Display;
20 20
import org.eclipse.ui.IImportWizard;
21 21
import org.eclipse.ui.IWorkbench;
22
import org.eclipse.ui.IWorkbenchPage;
23
import org.eclipse.ui.PartInitException;
24 22

  
23
import eu.etaxonomy.cdm.database.DbSchemaValidation;
25 24
import eu.etaxonomy.cdm.ext.occurrence.OccurenceQuery;
26
import eu.etaxonomy.taxeditor.editor.internal.TaxeditorEditorPlugin;
25
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
27 26
import eu.etaxonomy.taxeditor.store.CdmStore;
28 27

  
29 28
/**
......
61 60

  
62 61
        DataImportView<?> dataImportView = null;
63 62
        query = searchPage.getQuery();
64
        try {
65
            switch (providerSelectionPage.getQueryType()) {
66
            case BIOCASE:
67
                SpecimenImportView specimenImportView = (SpecimenImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
68
                        .showView(SpecimenImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
69
                specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
70
                dataImportView = specimenImportView;
71
                break;
72
            case GBIF:
73
                dataImportView = (GbifResponseImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
74
                .showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
75
                break;
76
            }
77
        } catch ( PartInitException e ) {
78
            logger.error("Could not open import view for query: " + query.toString(), e);
63
        Abcd206ImportConfigurator configurator =  CdmStore.getImportManager().AbcdConfigurator();
64
        configurator.setOccurenceQuery(query);
65
        configurator.setSourceUri(providerSelectionPage.getEndPoint());
66
        configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
67
        if(CdmStore.getCurrentSessionManager().isRemoting()) {
68
            //Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.INPUTSTREAM);
69
            //CdmStore.getImportManager().run(job);
70

  
71
            CdmStore.getImportManager().run(configurator);
79 72
        }
80
        if(dataImportView!=null){
81
            dataImportView.setQuery(query);
82
//            dataImportView.query();
83
//            Display.getDefault().asyncExec(new Runnable() {
84
//
85
//                @Override
86
//                public void run() {
87
//                    CdmStore.getContextManager().notifyContextRefresh();
88
//                }
89
//            });
73
//        try {
74
//            switch (providerSelectionPage.getQueryType()) {
75
//            case BIOCASE:
76
//                SpecimenImportView specimenImportView = (SpecimenImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
77
//                        .showView(SpecimenImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
78
//                specimenImportView.setEndpoint(providerSelectionPage.getEndPoint());
79
//                dataImportView = specimenImportView;
80
//                break;
81
//            case GBIF:
82
//                dataImportView = (GbifResponseImportView) TaxeditorEditorPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
83
//                .showView(GbifResponseImportView.ID, "query_"+query.toString().replaceAll(",", ""),IWorkbenchPage.VIEW_ACTIVATE);
84
//                break;
85
//            }
86
//        } catch ( PartInitException e ) {
87
//            logger.error("Could not open import view for query: " + query.toString(), e);
88
//        }
89
//        if(dataImportView!=null){
90
//            dataImportView.setQuery(query);
91
////            dataImportView.query();
92
////            Display.getDefault().asyncExec(new Runnable() {
93
////
94
////                @Override
95
////                public void run() {
96
////                    CdmStore.getContextManager().notifyContextRefresh();
97
////                }
98
////            });
90 99
            Job queryJob = new QueryJob("Query specimen provider", dataImportView);
91 100
            queryJob.schedule();
92
        }
101

  
93 102
        return true;
94 103
    }
95 104

  

Also available in: Unified diff