3 * Copyright (C) 2013 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.io
.wizard
.specimenSearch
;
12 import java
.io
.IOException
;
13 import java
.net
.URISyntaxException
;
14 import java
.util
.ArrayList
;
15 import java
.util
.List
;
17 import org
.apache
.http
.client
.ClientProtocolException
;
18 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
19 import org
.eclipse
.jface
.wizard
.Wizard
;
20 import org
.eclipse
.ui
.IImportWizard
;
21 import org
.eclipse
.ui
.IWorkbench
;
23 import eu
.etaxonomy
.cdm
.ext
.biocase
.BioCaseQuery
;
24 import eu
.etaxonomy
.cdm
.ext
.biocase
.BioCaseQueryServiceWrapper
;
25 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
32 public class SpecimenSearchWizard
extends Wizard
implements IImportWizard
{
34 private BioCaseQueryServiceWrapper bioCaseQueryServiceWrapper
;
35 private BioCaseQuery query
;
36 private List
<SpecimenOrObservationBase
> results
;
41 public SpecimenSearchWizard() {
42 query
= new BioCaseQuery();
43 bioCaseQueryServiceWrapper
= new BioCaseQueryServiceWrapper();
44 this.results
= new ArrayList
<SpecimenOrObservationBase
>();
49 * @see org.eclipse.jface.wizard.Wizard#performFinish()
52 public boolean performFinish() {
57 * @see org.eclipse.jface.wizard.Wizard#addPages()
60 public void addPages() {
61 addPage(new SpecimenSearchWizardPage("Specimen Search", results
));
62 addPage(new SpecimenSearchResultWizardPage("Search Results", results
));
65 public List
<SpecimenOrObservationBase
> getResults(){
67 return bioCaseQueryServiceWrapper
.query(query
);
68 } catch (ClientProtocolException e
) {
69 // TODO Auto-generated catch block
71 } catch (IOException e
) {
72 // TODO Auto-generated catch block
74 } catch (URISyntaxException e
) {
75 // TODO Auto-generated catch block
82 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
85 public void init(IWorkbench workbench
, IStructuredSelection selection
) {
91 public BioCaseQuery
getQuery() {