1 |
7e2ccc23
|
Andreas Kohlbecker
|
/**
|
2 |
|
|
* Copyright (C) 2007 EDIT
|
3 |
|
|
* European Distributed Institute of Taxonomy
|
4 |
|
|
* http://www.e-taxonomy.eu
|
5 |
|
|
*
|
6 |
|
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8 |
|
|
*/
|
9 |
|
|
|
10 |
13f56004
|
m.doering
|
package eu.etaxonomy.cdm.remote.service;
|
11 |
8cb10526
|
Andreas Kohlbecker
|
|
12 |
19618e37
|
Andreas Kohlbecker
|
import java.util.Enumeration;
|
13 |
9a76d148
|
n.hoffmann
|
import java.util.Hashtable;
|
14 |
8cb10526
|
Andreas Kohlbecker
|
import java.util.List;
|
15 |
19618e37
|
Andreas Kohlbecker
|
import java.util.Locale;
|
16 |
52b6ddd5
|
m.doering
|
import java.util.Set;
|
17 |
8cb10526
|
Andreas Kohlbecker
|
import java.util.UUID;
|
18 |
|
|
|
19 |
07fe64d3
|
n.hoffmann
|
import eu.etaxonomy.cdm.model.common.Annotation;
|
20 |
3bd5040f
|
Andreas Kohlbecker
|
import eu.etaxonomy.cdm.persistence.dao.common.ITitledDao;
|
21 |
07fe64d3
|
n.hoffmann
|
import eu.etaxonomy.cdm.remote.dto.AnnotationTO;
|
22 |
af8f02e1
|
n.hoffmann
|
import eu.etaxonomy.cdm.remote.dto.FeatureTO;
|
23 |
|
|
import eu.etaxonomy.cdm.remote.dto.FeatureTreeTO;
|
24 |
07e35648
|
Andreas Kohlbecker
|
import eu.etaxonomy.cdm.remote.dto.NameSTO;
|
25 |
13f56004
|
m.doering
|
import eu.etaxonomy.cdm.remote.dto.NameTO;
|
26 |
7e2ccc23
|
Andreas Kohlbecker
|
import eu.etaxonomy.cdm.remote.dto.NameTypeDesignationSTO;
|
27 |
|
|
import eu.etaxonomy.cdm.remote.dto.ReferenceSTO;
|
28 |
|
|
import eu.etaxonomy.cdm.remote.dto.ReferenceTO;
|
29 |
|
|
import eu.etaxonomy.cdm.remote.dto.ReferencedEntityBaseSTO;
|
30 |
52b6ddd5
|
m.doering
|
import eu.etaxonomy.cdm.remote.dto.ResultSetPageSTO;
|
31 |
7e2ccc23
|
Andreas Kohlbecker
|
import eu.etaxonomy.cdm.remote.dto.SpecimenTypeDesignationSTO;
|
32 |
13f56004
|
m.doering
|
import eu.etaxonomy.cdm.remote.dto.TaxonSTO;
|
33 |
|
|
import eu.etaxonomy.cdm.remote.dto.TaxonTO;
|
34 |
52b6ddd5
|
m.doering
|
import eu.etaxonomy.cdm.remote.dto.TreeNode;
|
35 |
8cb10526
|
Andreas Kohlbecker
|
|
36 |
7e2ccc23
|
Andreas Kohlbecker
|
/**
|
37 |
|
|
* Methods adopted from ws_method as found in
|
38 |
|
|
* http://dev.e-taxonomy.eu/svn/trunk/drupal/modules/cdm_dataportal/cdm_api.module
|
39 |
|
|
*
|
40 |
c2da9839
|
m.doering
|
* For URL mappings to these services please see:
|
41 |
|
|
* src/main/webapp/WEB-INF/cdmrest-servlet.xml
|
42 |
|
|
*
|
43 |
7e2ccc23
|
Andreas Kohlbecker
|
* @author m.doering
|
44 |
|
|
* @author a.kohlbecker
|
45 |
|
|
* @version 1.0
|
46 |
|
|
* @created 30.1.2008
|
47 |
8cb10526
|
Andreas Kohlbecker
|
*/
|
48 |
02c32709
|
m.doering
|
public interface ICdmService {
|
49 |
19b0f922
|
m.doering
|
|
50 |
6960ca08
|
m.doering
|
/**
|
51 |
|
|
* @param uuid
|
52 |
b81c6a36
|
Andreas Kohlbecker
|
* @return
|
53 |
6960ca08
|
m.doering
|
* @throws CdmObjectNonExisting
|
54 |
|
|
*/
|
55 |
|
|
public Class whatis(UUID uuid) throws CdmObjectNonExisting;
|
56 |
7e2ccc23
|
Andreas Kohlbecker
|
|
57 |
6960ca08
|
m.doering
|
/**
|
58 |
|
|
* @param uuid
|
59 |
b94248d6
|
Andreas Kohlbecker
|
* @param locales TODO
|
60 |
6960ca08
|
m.doering
|
* @return
|
61 |
|
|
* @throws CdmObjectNonExisting
|
62 |
|
|
*/
|
63 |
b94248d6
|
Andreas Kohlbecker
|
public NameTO getName(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;// throws BusinessLogicException;
|
64 |
07e35648
|
Andreas Kohlbecker
|
|
65 |
|
|
/**
|
66 |
|
|
* @param uuid
|
67 |
|
|
* @return
|
68 |
|
|
* @throws CdmObjectNonExisting
|
69 |
|
|
*/
|
70 |
b94248d6
|
Andreas Kohlbecker
|
public NameSTO getSimpleName(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;// throws BusinessLogicException;
|
71 |
6c376ea1
|
Andreas Kohlbecker
|
|
72 |
|
|
/**
|
73 |
|
|
* @param uuid
|
74 |
|
|
* @return
|
75 |
|
|
* @throws CdmObjectNonExisting
|
76 |
|
|
*/
|
77 |
b94248d6
|
Andreas Kohlbecker
|
public List<NameSTO> getSimpleNames(Set<UUID> uuids, Enumeration<Locale> locales) throws CdmObjectNonExisting;// throws BusinessLogicException;
|
78 |
7e2ccc23
|
Andreas Kohlbecker
|
|
79 |
6960ca08
|
m.doering
|
/**
|
80 |
|
|
* @param uuid
|
81 |
19618e37
|
Andreas Kohlbecker
|
* @param enumeration
|
82 |
6960ca08
|
m.doering
|
* @return
|
83 |
|
|
* @throws CdmObjectNonExisting
|
84 |
|
|
*/
|
85 |
f5b5959a
|
Andreas Müller
|
public TaxonTO getTaxon(UUID taxonUuid, UUID featureTreeUuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
86 |
07e35648
|
Andreas Kohlbecker
|
|
87 |
|
|
/**
|
88 |
|
|
* @param uuid
|
89 |
|
|
* @return
|
90 |
|
|
* @throws CdmObjectNonExisting
|
91 |
|
|
*/
|
92 |
b94248d6
|
Andreas Kohlbecker
|
public TaxonSTO getSimpleTaxon(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
93 |
07e35648
|
Andreas Kohlbecker
|
|
94 |
6c376ea1
|
Andreas Kohlbecker
|
/**
|
95 |
|
|
* @param uuid
|
96 |
|
|
* @return
|
97 |
|
|
* @throws CdmObjectNonExisting
|
98 |
|
|
*/
|
99 |
b94248d6
|
Andreas Kohlbecker
|
public List<TaxonSTO> getSimpleTaxa(Set<UUID> uuids, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
100 |
6c376ea1
|
Andreas Kohlbecker
|
|
101 |
|
|
|
102 |
|
|
/**
|
103 |
|
|
* @param uuid
|
104 |
|
|
* @return
|
105 |
|
|
* @throws CdmObjectNonExisting
|
106 |
|
|
*/
|
107 |
b94248d6
|
Andreas Kohlbecker
|
public ResultSetPageSTO<TaxonSTO> getAternativeTaxa(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
108 |
7e2ccc23
|
Andreas Kohlbecker
|
|
109 |
6960ca08
|
m.doering
|
/**
|
110 |
|
|
* @param uuid
|
111 |
|
|
* @return
|
112 |
bbafe106
|
m.doering
|
* @throws CdmObjectNonExisting
|
113 |
6960ca08
|
m.doering
|
*/
|
114 |
b94248d6
|
Andreas Kohlbecker
|
public ReferenceTO getReference(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
115 |
bbafe106
|
m.doering
|
|
116 |
6c376ea1
|
Andreas Kohlbecker
|
|
117 |
b94248d6
|
Andreas Kohlbecker
|
public ReferenceSTO getSimpleReference(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
118 |
bbafe106
|
m.doering
|
|
119 |
6c376ea1
|
Andreas Kohlbecker
|
/**
|
120 |
|
|
* @param uuid
|
121 |
|
|
* @return
|
122 |
|
|
*/
|
123 |
b94248d6
|
Andreas Kohlbecker
|
public List<ReferenceSTO> getSimpleReferences(Set<UUID> uuids, Enumeration<Locale> locales);
|
124 |
7e2ccc23
|
Andreas Kohlbecker
|
|
125 |
|
|
/**
|
126 |
|
|
* @param uuid
|
127 |
|
|
* the name UUID
|
128 |
652ec178
|
Andreas Kohlbecker
|
* @return a Set of type designation which are assigned to the name given
|
129 |
7e2ccc23
|
Andreas Kohlbecker
|
* as parameter. The Set may contain {@link NameTypeDesignationSTO}
|
130 |
|
|
* and {@link SpecimenTypeDesignationSTO}
|
131 |
|
|
*/
|
132 |
|
|
public Set<ReferencedEntityBaseSTO> getTypes(UUID uuid);
|
133 |
|
|
|
134 |
|
|
/**
|
135 |
|
|
* @param uuid
|
136 |
b7cfab0e
|
m.doering
|
* the UUID of a {@link eu.etaxonomy.model.taxon.TaxonBase}
|
137 |
|
|
* @return the accepted taxon of a synonym given as
|
138 |
|
|
* parameter uuid. If the synonym specified by uuid is itself the
|
139 |
7e2ccc23
|
Andreas Kohlbecker
|
* accepted taxon, this one will be returned.
|
140 |
b7cfab0e
|
m.doering
|
*
|
141 |
|
|
* For pro parte synonyms there might exist more than 1 accepted taxon,
|
142 |
3bd5040f
|
Andreas Kohlbecker
|
* therefore we return a List
|
143 |
6960ca08
|
m.doering
|
* @throws CdmObjectNonExisting
|
144 |
|
|
*/
|
145 |
9a76d148
|
n.hoffmann
|
public Hashtable<String, List<TaxonSTO>> getAcceptedTaxa(Set<UUID> uuids, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
146 |
c582c292
|
m.doering
|
|
147 |
52b6ddd5
|
m.doering
|
/**
|
148 |
7e2ccc23
|
Andreas Kohlbecker
|
* Find taxa matching the query defined by the given parameters.
|
149 |
|
|
*
|
150 |
|
|
* @param q
|
151 |
|
|
* name query string
|
152 |
52b6ddd5
|
m.doering
|
* @param sec
|
153 |
7e2ccc23
|
Andreas Kohlbecker
|
* the UUID of the concept reference
|
154 |
52b6ddd5
|
m.doering
|
* @param higherTaxa
|
155 |
7e2ccc23
|
Andreas Kohlbecker
|
* Set of taxon UUIDs, if higherTaxa are defined only taxa which
|
156 |
|
|
* are included in one of these taxa are taken in to account
|
157 |
3bd5040f
|
Andreas Kohlbecker
|
* @param matchMode
|
158 |
|
|
* TODO ...
|
159 |
52b6ddd5
|
m.doering
|
* @param onlyAccepted
|
160 |
7e2ccc23
|
Andreas Kohlbecker
|
* return only taxa which are accepted in the sence of the
|
161 |
|
|
* concept reference as given by parameter sec
|
162 |
52b6ddd5
|
m.doering
|
* @param pagesize
|
163 |
7e2ccc23
|
Andreas Kohlbecker
|
* maximum number of items per result page
|
164 |
52b6ddd5
|
m.doering
|
* @param page
|
165 |
7e2ccc23
|
Andreas Kohlbecker
|
* the number of the page in request
|
166 |
|
|
* @return a ResultSetPageSTO<TaxonSTO> instance
|
167 |
|
|
*/
|
168 |
502c4174
|
n.hoffmann
|
public ResultSetPageSTO<TaxonSTO> findTaxa(String q, Set<UUID> sec,
|
169 |
3bd5040f
|
Andreas Kohlbecker
|
Set<UUID> higherTaxa, ITitledDao.MATCH_MODE matchMode, boolean onlyAccepted,
|
170 |
b94248d6
|
Andreas Kohlbecker
|
int pagesize, int page, Enumeration<Locale> locales);
|
171 |
7e2ccc23
|
Andreas Kohlbecker
|
|
172 |
|
|
/**
|
173 |
|
|
* Searches the concept taxon tree for all parent taxa by walking the tree
|
174 |
|
|
* from the taxon which is referenced by the parameter uuid down to its
|
175 |
|
|
* root. The reference taxon will also be included into the returned set of
|
176 |
|
|
* {@link TreeNode} instances.
|
177 |
|
|
*
|
178 |
|
|
* @param uuid
|
179 |
|
|
* the UUID of the {@link eu.etaxonomy.model.taxon.Taxon}
|
180 |
|
|
* @return A List of all parent taxa including the one referenced by the
|
181 |
|
|
* parameter uuid. The {@link TreeNode} elements are ordered in the
|
182 |
|
|
* direction from root up to the references taxon.
|
183 |
6960ca08
|
m.doering
|
* @throws CdmObjectNonExisting
|
184 |
7e2ccc23
|
Andreas Kohlbecker
|
*/
|
185 |
6960ca08
|
m.doering
|
public List<TreeNode> getParentTaxa(UUID uuid) throws CdmObjectNonExisting;
|
186 |
7e2ccc23
|
Andreas Kohlbecker
|
|
187 |
|
|
/**
|
188 |
|
|
* Getter to retrieve the children of the taxon referenced by the parameter
|
189 |
|
|
* uuid.
|
190 |
|
|
*
|
191 |
|
|
* @param uuid
|
192 |
|
|
* the UUID of the {@link eu.etaxonomy.model.taxon.Taxon}
|
193 |
|
|
* @return A List of all taxa which are children in of the referenced taxon
|
194 |
|
|
* in the concept tree.
|
195 |
6960ca08
|
m.doering
|
* @throws CdmObjectNonExisting
|
196 |
7e2ccc23
|
Andreas Kohlbecker
|
*/
|
197 |
6960ca08
|
m.doering
|
public List<TreeNode> getChildrenTaxa(UUID uuid) throws CdmObjectNonExisting;
|
198 |
7e2ccc23
|
Andreas Kohlbecker
|
|
199 |
|
|
/**
|
200 |
|
|
* Gets the root nodes of the taxonomic concept tree for the concept
|
201 |
|
|
* reference specified by the uuid parameter.
|
202 |
bbafe106
|
m.doering
|
* If uuid is null return all available root taxa.
|
203 |
7e2ccc23
|
Andreas Kohlbecker
|
*
|
204 |
|
|
* @param uuid
|
205 |
|
|
* the concept reference uuid
|
206 |
|
|
* @return the List of root {@link TreeNode}s
|
207 |
a400a105
|
m.doering
|
* @throws CdmObjectNonExisting for non existing reference UUIDs
|
208 |
52b6ddd5
|
m.doering
|
*/
|
209 |
a400a105
|
m.doering
|
public List<TreeNode> getRootTaxa(UUID uuid) throws CdmObjectNonExisting;
|
210 |
7e2ccc23
|
Andreas Kohlbecker
|
|
211 |
af8f02e1
|
n.hoffmann
|
/**
|
212 |
|
|
*
|
213 |
|
|
* @return
|
214 |
|
|
* @throws CdmObjectNonExisting
|
215 |
|
|
*/
|
216 |
|
|
public List<FeatureTreeTO> getFeatureTrees(Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
217 |
|
|
|
218 |
|
|
/**
|
219 |
|
|
*
|
220 |
|
|
* @return
|
221 |
|
|
* @throws CdmObjectNonExisting
|
222 |
|
|
*/
|
223 |
|
|
public List<FeatureTO> getFeatures(Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
224 |
|
|
|
225 |
07fe64d3
|
n.hoffmann
|
/**
|
226 |
|
|
*
|
227 |
|
|
* @param uuid
|
228 |
|
|
* @return
|
229 |
|
|
* @throws CdmObjectNonExisting
|
230 |
|
|
*/
|
231 |
e25b9767
|
n.hoffmann
|
public AnnotationTO getAnnotation(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
232 |
07fe64d3
|
n.hoffmann
|
|
233 |
|
|
/**
|
234 |
|
|
*
|
235 |
|
|
* @param uuid
|
236 |
|
|
* @param annotation
|
237 |
|
|
* @return
|
238 |
|
|
* @throws CdmObjectNonExisting
|
239 |
|
|
*/
|
240 |
|
|
public UUID saveAnnotation(UUID uuid, Annotation annotation) throws CdmObjectNonExisting;
|
241 |
|
|
|
242 |
8cb10526
|
Andreas Kohlbecker
|
}
|