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