1
|
/**
|
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
|
package eu.etaxonomy.cdm.remote.service;
|
11
|
|
12
|
import java.util.Enumeration;
|
13
|
import java.util.Hashtable;
|
14
|
import java.util.List;
|
15
|
import java.util.Locale;
|
16
|
import java.util.Set;
|
17
|
import java.util.UUID;
|
18
|
|
19
|
import eu.etaxonomy.cdm.model.common.Annotation;
|
20
|
import eu.etaxonomy.cdm.persistence.dao.common.ITitledDao;
|
21
|
import eu.etaxonomy.cdm.remote.dto.AnnotationTO;
|
22
|
import eu.etaxonomy.cdm.remote.dto.FeatureTO;
|
23
|
import eu.etaxonomy.cdm.remote.dto.FeatureTreeTO;
|
24
|
import eu.etaxonomy.cdm.remote.dto.NameSTO;
|
25
|
import eu.etaxonomy.cdm.remote.dto.NameTO;
|
26
|
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
|
import eu.etaxonomy.cdm.remote.dto.ResultSetPageSTO;
|
31
|
import eu.etaxonomy.cdm.remote.dto.SpecimenTypeDesignationSTO;
|
32
|
import eu.etaxonomy.cdm.remote.dto.TaxonSTO;
|
33
|
import eu.etaxonomy.cdm.remote.dto.TaxonTO;
|
34
|
import eu.etaxonomy.cdm.remote.dto.TreeNode;
|
35
|
|
36
|
/**
|
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
|
* For URL mappings to these services please see:
|
41
|
* src/main/webapp/WEB-INF/cdmrest-servlet.xml
|
42
|
*
|
43
|
* @author m.doering
|
44
|
* @author a.kohlbecker
|
45
|
* @version 1.0
|
46
|
* @created 30.1.2008
|
47
|
*/
|
48
|
public interface ICdmService {
|
49
|
|
50
|
/**
|
51
|
* @param uuid
|
52
|
* @return
|
53
|
* @throws CdmObjectNonExisting
|
54
|
*/
|
55
|
public Class whatis(UUID uuid) throws CdmObjectNonExisting;
|
56
|
|
57
|
/**
|
58
|
* @param uuid
|
59
|
* @param locales TODO
|
60
|
* @return
|
61
|
* @throws CdmObjectNonExisting
|
62
|
*/
|
63
|
public NameTO getName(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;// throws BusinessLogicException;
|
64
|
|
65
|
/**
|
66
|
* @param uuid
|
67
|
* @return
|
68
|
* @throws CdmObjectNonExisting
|
69
|
*/
|
70
|
public NameSTO getSimpleName(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;// throws BusinessLogicException;
|
71
|
|
72
|
/**
|
73
|
* @param uuid
|
74
|
* @return
|
75
|
* @throws CdmObjectNonExisting
|
76
|
*/
|
77
|
public List<NameSTO> getSimpleNames(Set<UUID> uuids, Enumeration<Locale> locales) throws CdmObjectNonExisting;// throws BusinessLogicException;
|
78
|
|
79
|
/**
|
80
|
* @param uuid
|
81
|
* @param enumeration
|
82
|
* @return
|
83
|
* @throws CdmObjectNonExisting
|
84
|
*/
|
85
|
public TaxonTO getTaxon(UUID taxonUuid, UUID featureTreeUuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
86
|
|
87
|
/**
|
88
|
* @param uuid
|
89
|
* @return
|
90
|
* @throws CdmObjectNonExisting
|
91
|
*/
|
92
|
public TaxonSTO getSimpleTaxon(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
93
|
|
94
|
/**
|
95
|
* @param uuid
|
96
|
* @return
|
97
|
* @throws CdmObjectNonExisting
|
98
|
*/
|
99
|
public List<TaxonSTO> getSimpleTaxa(Set<UUID> uuids, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
100
|
|
101
|
|
102
|
/**
|
103
|
* @param uuid
|
104
|
* @return
|
105
|
* @throws CdmObjectNonExisting
|
106
|
*/
|
107
|
public ResultSetPageSTO<TaxonSTO> getAternativeTaxa(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
108
|
|
109
|
/**
|
110
|
* @param uuid
|
111
|
* @return
|
112
|
* @throws CdmObjectNonExisting
|
113
|
*/
|
114
|
public ReferenceTO getReference(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
115
|
|
116
|
|
117
|
public ReferenceSTO getSimpleReference(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
118
|
|
119
|
/**
|
120
|
* @param uuid
|
121
|
* @return
|
122
|
*/
|
123
|
public List<ReferenceSTO> getSimpleReferences(Set<UUID> uuids, Enumeration<Locale> locales);
|
124
|
|
125
|
/**
|
126
|
* @param uuid
|
127
|
* the name UUID
|
128
|
* @return a Set of type designation which are assigned to the name given
|
129
|
* 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
|
* 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
|
* accepted taxon, this one will be returned.
|
140
|
*
|
141
|
* For pro parte synonyms there might exist more than 1 accepted taxon,
|
142
|
* therefore we return a List
|
143
|
* @throws CdmObjectNonExisting
|
144
|
*/
|
145
|
public Hashtable<String, List<TaxonSTO>> getAcceptedTaxa(Set<UUID> uuids, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
146
|
|
147
|
/**
|
148
|
* Find taxa matching the query defined by the given parameters.
|
149
|
*
|
150
|
* @param q
|
151
|
* name query string
|
152
|
* @param sec
|
153
|
* the UUID of the concept reference
|
154
|
* @param higherTaxa
|
155
|
* 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
|
* @param matchMode
|
158
|
* TODO ...
|
159
|
* @param onlyAccepted
|
160
|
* return only taxa which are accepted in the sence of the
|
161
|
* concept reference as given by parameter sec
|
162
|
* @param pagesize
|
163
|
* maximum number of items per result page
|
164
|
* @param page
|
165
|
* the number of the page in request
|
166
|
* @return a ResultSetPageSTO<TaxonSTO> instance
|
167
|
*/
|
168
|
public ResultSetPageSTO<TaxonSTO> findTaxa(String q, Set<UUID> sec,
|
169
|
Set<UUID> higherTaxa, ITitledDao.MATCH_MODE matchMode, boolean onlyAccepted,
|
170
|
int pagesize, int page, Enumeration<Locale> locales);
|
171
|
|
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
|
* @throws CdmObjectNonExisting
|
184
|
*/
|
185
|
public List<TreeNode> getParentTaxa(UUID uuid) throws CdmObjectNonExisting;
|
186
|
|
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
|
* @throws CdmObjectNonExisting
|
196
|
*/
|
197
|
public List<TreeNode> getChildrenTaxa(UUID uuid) throws CdmObjectNonExisting;
|
198
|
|
199
|
/**
|
200
|
* Gets the root nodes of the taxonomic concept tree for the concept
|
201
|
* reference specified by the uuid parameter.
|
202
|
* If uuid is null return all available root taxa.
|
203
|
*
|
204
|
* @param uuid
|
205
|
* the concept reference uuid
|
206
|
* @return the List of root {@link TreeNode}s
|
207
|
* @throws CdmObjectNonExisting for non existing reference UUIDs
|
208
|
*/
|
209
|
public List<TreeNode> getRootTaxa(UUID uuid) throws CdmObjectNonExisting;
|
210
|
|
211
|
/**
|
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
|
/**
|
226
|
*
|
227
|
* @param uuid
|
228
|
* @return
|
229
|
* @throws CdmObjectNonExisting
|
230
|
*/
|
231
|
public AnnotationTO getAnnotation(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
|
232
|
|
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
|
}
|