Project

General

Profile

Download (7.79 KB) Statistics
| Branch: | Tag: | Revision:
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.model.reference.ReferenceBase;
21
import eu.etaxonomy.cdm.persistence.dao.common.ITitledDao;
22
import eu.etaxonomy.cdm.remote.dto.AnnotationTO;
23
import eu.etaxonomy.cdm.remote.dto.FeatureTO;
24
import eu.etaxonomy.cdm.remote.dto.FeatureTreeTO;
25
import eu.etaxonomy.cdm.remote.dto.NameSTO;
26
import eu.etaxonomy.cdm.remote.dto.NameTO;
27
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
import eu.etaxonomy.cdm.remote.dto.ResultSetPageSTO;
32
import eu.etaxonomy.cdm.remote.dto.SpecimenTypeDesignationSTO;
33
import eu.etaxonomy.cdm.remote.dto.TaxonSTO;
34
import eu.etaxonomy.cdm.remote.dto.TaxonTO;
35
import eu.etaxonomy.cdm.remote.dto.TreeNode;
36

    
37
/**
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
 * For URL mappings to these services please see:
42
 * src/main/webapp/WEB-INF/cdmrest-servlet.xml
43
 * 
44
 * @author m.doering
45
 * @author a.kohlbecker
46
 * @version 1.0
47
 * @created 30.1.2008
48
 */
49
public interface ICdmService {
50

    
51
	/**
52
	 * @param uuid
53
	 * @return 
54
	 * @throws CdmObjectNonExisting
55
	 */
56
	public Class whatis(UUID uuid) throws CdmObjectNonExisting;
57

    
58
	/**
59
	 * @param uuid
60
	 * @param locales TODO
61
	 * @return
62
	 * @throws CdmObjectNonExisting
63
	 */
64
	public NameTO getName(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;// throws BusinessLogicException;
65
	
66
	/**
67
	 * @param uuid
68
	 * @return
69
	 * @throws CdmObjectNonExisting
70
	 */
71
	public NameSTO getSimpleName(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;// throws BusinessLogicException;
72
	
73
	/**
74
	 * @param uuid
75
	 * @return
76
	 * @throws CdmObjectNonExisting
77
	 */
78
	public List<NameSTO> getSimpleNames(Set<UUID> uuids, Enumeration<Locale> locales) throws CdmObjectNonExisting;// throws BusinessLogicException;
79

    
80
	/**
81
	 * @param uuid
82
	 * @param enumeration 
83
	 * @return
84
	 * @throws CdmObjectNonExisting
85
	 */
86
	public TaxonTO getTaxon(UUID taxonUuid, UUID featureTreeUuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
87
	
88
	/**
89
	 * @param uuid
90
	 * @return 
91
	 * @throws CdmObjectNonExisting
92
	 */
93
	public TaxonSTO getSimpleTaxon(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
94
	
95
	/**
96
	 * @param uuid
97
	 * @return 
98
	 * @throws CdmObjectNonExisting
99
	 */
100
	public List<TaxonSTO> getSimpleTaxa(Set<UUID> uuids, Enumeration<Locale> locales) throws CdmObjectNonExisting;
101
	
102
	
103
	/**
104
	 * @param uuid
105
	 * @return
106
	 * @throws CdmObjectNonExisting
107
	 */
108
	public ResultSetPageSTO<TaxonSTO> getAternativeTaxa(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
109

    
110
	/**
111
	 * @param uuid
112
	 * @return
113
	 * @throws CdmObjectNonExisting 
114
	 */
115
	public ReferenceBase getReference(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
116
	
117
	
118
	public ReferenceSTO getSimpleReference(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
119

    
120
	/**
121
	 * @param uuid
122
	 * @return
123
	 */
124
	public List<ReferenceSTO> getSimpleReferences(Set<UUID> uuids, Enumeration<Locale> locales);
125

    
126
	/**
127
	 * @param uuid
128
	 *            the name UUID
129
	 * @return a Set of type designation which are assigned to the name given
130
	 *         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
	 *            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
	 *         accepted taxon, this one will be returned.
141
	 *         
142
	 *         For pro parte synonyms there might exist more than 1 accepted taxon,
143
	 *         therefore we return a List
144
	 * @throws CdmObjectNonExisting 
145
	 */
146
	public Hashtable<String, List<TaxonSTO>> getAcceptedTaxa(Set<UUID> uuids, Enumeration<Locale> locales) throws CdmObjectNonExisting;
147

    
148
	/**
149
	 * Find taxa matching the query defined by the given parameters.
150
	 * 
151
	 * @param q
152
	 *            name query string
153
	 * @param sec
154
	 *            the UUID of the concept reference
155
	 * @param higherTaxa
156
	 *            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
	 * @param matchMode
159
	 *            TODO ...
160
	 * @param onlyAccepted
161
	 *            return only taxa which are accepted in the sence of the
162
	 *            concept reference as given by parameter sec
163
	 * @param pagesize
164
	 *            maximum number of items per result page
165
	 * @param page
166
	 *            the number of the page in request
167
	 * @return a ResultSetPageSTO<TaxonSTO> instance
168
	 */
169
	public ResultSetPageSTO<TaxonSTO> findTaxa(String q, Set<UUID> sec,
170
			Set<UUID> higherTaxa, ITitledDao.MATCH_MODE matchMode, boolean onlyAccepted,
171
			int pagesize, int page, Enumeration<Locale> locales);
172

    
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
	 * @throws CdmObjectNonExisting 
185
	 */
186
	public List<TreeNode> getParentTaxa(UUID uuid) throws CdmObjectNonExisting;
187

    
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
	 * @throws CdmObjectNonExisting 
197
	 */
198
	public List<TreeNode> getChildTaxa(UUID uuid) throws CdmObjectNonExisting;
199

    
200
	/**
201
	 * Gets the root nodes of the taxonomic concept tree for the concept
202
	 * reference specified by the uuid parameter.
203
	 * If uuid is null return all available root taxa.
204
	 * 
205
	 * @param uuid
206
	 *            the concept reference uuid
207
	 * @return the List of root {@link TreeNode}s
208
	 * @throws CdmObjectNonExisting for non existing reference UUIDs
209
	 */
210
	public List<TreeNode> getRootTaxa(UUID uuid) throws CdmObjectNonExisting;
211

    
212
	/**
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
	/**
227
	 * 
228
	 * @param uuid
229
	 * @return
230
	 * @throws CdmObjectNonExisting
231
	 */
232
	public AnnotationTO getAnnotation(UUID uuid, Enumeration<Locale> locales) throws CdmObjectNonExisting;
233
	
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
}
(3-3/5)