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
|
package eu.etaxonomy.cdm.api.service;
|
10
|
|
11
|
import java.util.Collection;
|
12
|
import java.util.List;
|
13
|
import java.util.Map;
|
14
|
import java.util.Set;
|
15
|
import java.util.UUID;
|
16
|
|
17
|
import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
|
18
|
import eu.etaxonomy.cdm.api.service.dto.TaxonDistributionDTO;
|
19
|
import eu.etaxonomy.cdm.api.service.pager.Pager;
|
20
|
import eu.etaxonomy.cdm.model.common.Annotation;
|
21
|
import eu.etaxonomy.cdm.model.common.Language;
|
22
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
23
|
import eu.etaxonomy.cdm.model.description.DescriptionBase;
|
24
|
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
|
25
|
import eu.etaxonomy.cdm.model.description.DescriptionType;
|
26
|
import eu.etaxonomy.cdm.model.description.Distribution;
|
27
|
import eu.etaxonomy.cdm.model.description.Feature;
|
28
|
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
|
29
|
import eu.etaxonomy.cdm.model.description.TaxonDescription;
|
30
|
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
|
31
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
32
|
import eu.etaxonomy.cdm.model.media.Media;
|
33
|
import eu.etaxonomy.cdm.model.name.TaxonName;
|
34
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
35
|
import eu.etaxonomy.cdm.model.term.DefinedTerm;
|
36
|
import eu.etaxonomy.cdm.model.term.TermTree;
|
37
|
import eu.etaxonomy.cdm.model.term.TermVocabulary;
|
38
|
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
|
39
|
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
|
40
|
import eu.etaxonomy.cdm.persistence.dto.TermDto;
|
41
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
42
|
|
43
|
public interface IDescriptionService extends IIdentifiableEntityService<DescriptionBase> {
|
44
|
|
45
|
/**
|
46
|
* @return
|
47
|
* @deprecated use TermService#getVocabulary(VocabularyType) instead
|
48
|
*/
|
49
|
@Deprecated
|
50
|
public TermVocabulary<Feature> getDefaultFeatureVocabulary();
|
51
|
|
52
|
/**
|
53
|
* @deprecated use TermService#getVocabulary(VocabularyType) instead
|
54
|
*/
|
55
|
@Deprecated
|
56
|
public TermVocabulary<Feature> getFeatureVocabulary(UUID uuid);
|
57
|
|
58
|
/**
|
59
|
* Gets a DescriptionElementBase instance matching the supplied uuid
|
60
|
*
|
61
|
* @param uuid the uuid of the DescriptionElement of interest
|
62
|
* @return a DescriptionElement, or null if the DescriptionElement does not exist
|
63
|
*/
|
64
|
public DescriptionElementBase getDescriptionElementByUuid(UUID uuid);
|
65
|
|
66
|
/**
|
67
|
* Loads and existing DescriptionElementBase instance matching the supplied uuid,
|
68
|
* and recursively initializes all bean properties given in the
|
69
|
* <code>propertyPaths</code> parameter.
|
70
|
* <p>
|
71
|
* For detailed description and examples <b>please refer to:</b>
|
72
|
* {@link IBeanInitializer#initialize(Object, List)}
|
73
|
*
|
74
|
* @param uuid the uuid of the DescriptionElement of interest
|
75
|
* @return a DescriptionElement, or null if the DescriptionElement does not exist
|
76
|
*/
|
77
|
public DescriptionElementBase loadDescriptionElement(UUID uuid,List<String> propertyPaths);
|
78
|
|
79
|
/**
|
80
|
* Persists a <code>DescriptionElementBase</code>
|
81
|
* @param descriptionElement
|
82
|
* @return
|
83
|
*/
|
84
|
public UUID saveDescriptionElement(DescriptionElementBase descriptionElement);
|
85
|
|
86
|
/**
|
87
|
* Persists a collection of <code>DescriptionElementBase</code>
|
88
|
* @param descriptionElements
|
89
|
* @return
|
90
|
*/
|
91
|
public Map<UUID, DescriptionElementBase> saveDescriptionElement(Collection<DescriptionElementBase> descriptionElements);
|
92
|
|
93
|
/**
|
94
|
* Delete an existing description element
|
95
|
*
|
96
|
* @param descriptionElement the description element to be deleted
|
97
|
* @return the unique identifier of the deleted entity
|
98
|
*/
|
99
|
public UUID deleteDescriptionElement(DescriptionElementBase descriptionElement);
|
100
|
|
101
|
public UUID deleteDescriptionElement(UUID descriptionElementUuid);
|
102
|
|
103
|
/**
|
104
|
* List the descriptions of type <T>, filtered using the following parameters
|
105
|
*
|
106
|
* @param type The type of description returned (Taxon, TaxonName, or Specimen)
|
107
|
* @param hasMedia Restrict the description to those that do (true) or don't (false) contain <i>elements</i> that have one or more media (can be null)
|
108
|
* @param hasText Restrict the description to those that do (true) or don't (false) contain TextData <i>elements</i> that have some textual content (can be null)
|
109
|
* @param feature Restrict the description to those <i>elements</i> which are scoped by one of the Features passed (can be null or empty)
|
110
|
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
|
111
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
112
|
* @param orderHints may be null
|
113
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
114
|
* @return a Pager containing DescriptionBase instances
|
115
|
*/
|
116
|
public Pager<DescriptionBase> page(Class<? extends DescriptionBase> type, Boolean hasMedia, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
117
|
|
118
|
/**
|
119
|
* Count the descriptions of type <TYPE>, filtered using the following parameters
|
120
|
*
|
121
|
* @param type The type of description returned (Taxon, TaxonName, or Specimen)
|
122
|
* @param hasMedia Restrict the description to those that do (true) or don't (false) contain <i>elements</i> that have one or more media (can be null)
|
123
|
* @param hasText Restrict the description to those that do (true) or don't (false) contain TextData <i>elements</i> that have some textual content (can be null)
|
124
|
* @param feature Restrict the description to those <i>elements</i> which are scoped by one of the Features passed (can be null or empty)
|
125
|
* @return a count of DescriptionBase instances
|
126
|
*/
|
127
|
public long count(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature);
|
128
|
|
129
|
/**
|
130
|
* Returns description elements of type <TYPE>, belonging to a given
|
131
|
* description, optionally filtered by one or more features
|
132
|
*
|
133
|
* @param description
|
134
|
* The description which these description elements belong to
|
135
|
* (can be null to count all description elements)
|
136
|
* @param descriptionType
|
137
|
* A filter DescriptionElements which belong to of a specific
|
138
|
* class of Descriptions
|
139
|
* @param features
|
140
|
* Restrict the results to those description elements which are
|
141
|
* scoped by one of the Features passed (can be null or empty)
|
142
|
* @param type
|
143
|
* A filter for DescriptionElements of a specific class
|
144
|
* @param pageSize
|
145
|
* The maximum number of description elements returned (can be
|
146
|
* null for all description elements)
|
147
|
* @param pageNumber
|
148
|
* The offset (in pageSize chunks) from the start of the result
|
149
|
* set (0 - based)
|
150
|
* @param propertyPaths
|
151
|
* Properties to initialize in the returned entities, following
|
152
|
* the syntax described in
|
153
|
* {@link IBeanInitializer#initialize(Object, List)}
|
154
|
* @return a Pager containing DescriptionElementBase instances
|
155
|
|
156
|
* @deprecated use
|
157
|
* {@link #pageDescriptionElements(DescriptionBase, Set, Class, Integer, Integer, List)}
|
158
|
* instead
|
159
|
*/
|
160
|
@Deprecated
|
161
|
public <T extends DescriptionElementBase> Pager<T> getDescriptionElements(DescriptionBase description,Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
162
|
|
163
|
|
164
|
/**
|
165
|
* Returns description elements of type <TYPE>, belonging to a given
|
166
|
* description, optionally filtered by one or more features
|
167
|
*
|
168
|
* @param description
|
169
|
* The description which these description elements belong to
|
170
|
* (can be null to count all description elements)
|
171
|
* @param descriptionType
|
172
|
* A filter DescriptionElements which belong to of a specific
|
173
|
* class of Descriptions
|
174
|
* @param features
|
175
|
* Restrict the results to those description elements which are
|
176
|
* scoped by one of the Features passed (can be null or empty)
|
177
|
* @param type
|
178
|
* A filter for DescriptionElements of a specific class
|
179
|
* @param pageSize
|
180
|
* The maximum number of description elements returned (can be
|
181
|
* null for all description elements)
|
182
|
* @param pageNumber
|
183
|
* The offset (in pageSize chunks) from the start of the result
|
184
|
* set (0 - based)
|
185
|
* @param propertyPaths
|
186
|
* Properties to initialize in the returned entities, following
|
187
|
* the syntax described in
|
188
|
* {@link IBeanInitializer#initialize(Object, List)}
|
189
|
*
|
190
|
* @return a Pager containing DescriptionElementBase instances
|
191
|
*/
|
192
|
public <T extends DescriptionElementBase> Pager<T> pageDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
193
|
|
194
|
/**
|
195
|
* Returns description elements of type <TYPE>, belonging to a given
|
196
|
* description, optionally filtered by one or more features
|
197
|
*
|
198
|
* @param description
|
199
|
* The description which these description elements belong to
|
200
|
* (can be null to count all description elements)
|
201
|
* @param features
|
202
|
* Restrict the results to those description elements which are
|
203
|
* scoped by one of the Features passed (can be null or empty)
|
204
|
* @param type
|
205
|
* A filter for DescriptionElements of a specific class
|
206
|
* @param pageSize
|
207
|
* The maximum number of description elements returned (can be
|
208
|
* null for all description elements)
|
209
|
* @param pageNumber
|
210
|
* The offset (in pageSize chunks) from the start of the result
|
211
|
* set (0 - based)
|
212
|
* @param propertyPaths
|
213
|
* Properties to initialize in the returned entities, following
|
214
|
* the syntax described in
|
215
|
* {@link IBeanInitializer#initialize(Object, List)}
|
216
|
* @return a List of DescriptionElementBase instances
|
217
|
* @deprecated use {@link #listDescriptionElements(DescriptionBase, Class, Set, Class, Integer, Integer, List)} instead
|
218
|
*/
|
219
|
@Deprecated
|
220
|
public <T extends DescriptionElementBase> List<T> listDescriptionElements(DescriptionBase description,Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
221
|
|
222
|
/**
|
223
|
* Returns description elements of type <TYPE>, belonging to a given
|
224
|
* description, optionally filtered by one or more features
|
225
|
*
|
226
|
* @param description
|
227
|
* The description which these description elements belong to
|
228
|
* (can be null to count all description elements)
|
229
|
* @param features
|
230
|
* Restrict the results to those description elements which are
|
231
|
* scoped by one of the Features passed (can be null or empty)
|
232
|
* @param type
|
233
|
* A filter DescriptionElements of a for specific class
|
234
|
* @param pageSize
|
235
|
* The maximum number of description elements returned (can be
|
236
|
* null for all description elements)
|
237
|
* @param pageNumber
|
238
|
* The offset (in pageSize chunks) from the start of the result
|
239
|
* set (0 - based)
|
240
|
* @param propertyPaths
|
241
|
* Properties to initialize in the returned entities, following
|
242
|
* the syntax described in
|
243
|
* {@link IBeanInitializer#initialize(Object, List)}
|
244
|
* @return a List of DescriptionElementBase instances
|
245
|
*/
|
246
|
public <T extends DescriptionElementBase> List<T> listDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
247
|
|
248
|
/**
|
249
|
* Return a Pager containing Annotation entities belonging to the DescriptionElementBase instance supplied, optionally filtered by MarkerType
|
250
|
* @param annotatedObj The object that "owns" the annotations returned
|
251
|
* @param status Only return annotations which are marked with a Marker of this type (can be null to return all annotations)
|
252
|
* @param pageSize The maximum number of terms returned (can be null for all annotations)
|
253
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
254
|
* @param orderHints may be null
|
255
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
256
|
* @return a Pager of Annotation entities
|
257
|
*/
|
258
|
public Pager<Annotation> getDescriptionElementAnnotations(DescriptionElementBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
259
|
|
260
|
|
261
|
/**
|
262
|
* Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method
|
263
|
*
|
264
|
* @param taxon The taxon which the description refers to (can be null for all TaxonDescription instances)
|
265
|
* @param scopes Restrict the results to those descriptions which are scoped by one of the Scope instances passed (can be null or empty)
|
266
|
* @param geographicalScope Restrict the results to those descriptions which have a geographical scope that overlaps with the NamedArea instances passed (can be null or empty)
|
267
|
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
|
268
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
269
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
270
|
* @return a Pager containing TaxonDescription instances
|
271
|
*
|
272
|
* @see #pageMarkedTaxonDescriptions(Taxon, Set, Set, Set, Integer, Integer, List)
|
273
|
*/
|
274
|
public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
275
|
|
276
|
/**
|
277
|
* Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method
|
278
|
*
|
279
|
* @param taxon The taxon which the description refers to (can be null for all TaxonDescription instances)
|
280
|
* @param scopes Restrict the results to those descriptions which are scoped by one of the Scope instances passed (can be null or empty)
|
281
|
* @param geographicalScope Restrict the results to those descriptions which have a geographical scope that overlaps with the NamedArea instances passed (can be null or empty)
|
282
|
* @param markerType Restrict the results to those descriptions which are marked as true by one of the given marker types (can be null or empty)
|
283
|
* @param descriptionTypes Restrict the results to those descriptions of the given types (can be null or empty)
|
284
|
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
|
285
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
286
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
287
|
* @return a Pager containing TaxonDescription instances
|
288
|
*/
|
289
|
public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Set<DescriptionType> descriptionTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
290
|
|
291
|
|
292
|
/**
|
293
|
* @see {@link #pageTaxonDescriptions(Taxon, Set, Set, Integer, Integer, List)}
|
294
|
*
|
295
|
* @param taxon
|
296
|
* @param scopes
|
297
|
* @param geographicalScope
|
298
|
* @param pageSize
|
299
|
* @param pageNumber
|
300
|
* @param propertyPaths
|
301
|
* @return
|
302
|
*/
|
303
|
public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
304
|
|
305
|
|
306
|
|
307
|
/**
|
308
|
* @see {@link #pageMarkedTaxonDescriptions(Taxon, Set, Set, Set, Integer, Integer, List)}
|
309
|
*
|
310
|
* @param taxon
|
311
|
* @param scopes
|
312
|
* @param geographicalScope
|
313
|
* @param pageSize
|
314
|
* @param pageNumber
|
315
|
* @param propertyPaths
|
316
|
* @return
|
317
|
*/
|
318
|
public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Set<DescriptionType> descriptionTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
319
|
|
320
|
/**
|
321
|
* Returns all {@link Media} attached to a taxon via TaxonDescription.elements.media.
|
322
|
* @param taxonUuid the taxons uuid, if null media for all taxa are returned
|
323
|
* @param limitToGalleries if true only media in TaxonDescriptions with imageGallery flag=true are returned
|
324
|
* @param markerTypes only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
|
325
|
* @param pageSize
|
326
|
* @param pageNumber
|
327
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
328
|
* @return
|
329
|
*/
|
330
|
public List<Media> listTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
331
|
|
332
|
/**
|
333
|
* Returns count for all {@link Media} attached to a taxon via TaxonDescription.elements.media.
|
334
|
* @param taxonUuid the taxons uuid, if null media for all taxa are returned
|
335
|
* @param limitToGalleries if true only media in TaxonDescriptions with imageGallery flag=true are returned
|
336
|
* @param markerTypes only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
|
337
|
* @return
|
338
|
*/
|
339
|
public int countTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes);
|
340
|
|
341
|
|
342
|
|
343
|
/**
|
344
|
* Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to
|
345
|
*
|
346
|
* @param name Restrict the results to those descriptions that refer to a specific name (can be null for all TaxonNameDescription instances)
|
347
|
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
|
348
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
349
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
350
|
* @return a Pager containing TaxonName instances
|
351
|
*
|
352
|
* FIXME candidate for harmonization - rename to pageTaxonNameDescriptions
|
353
|
*/
|
354
|
public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonName name, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
355
|
|
356
|
|
357
|
/**
|
358
|
* Returns a List of distinct TaxonDescription instances which have Distribution elements that refer to one of the NamedArea instances passed (optionally
|
359
|
* filtered by a type of PresenceAbsenceTerm e.g. PRESENT / ABSENT / NATIVE / CULTIVATED etc)
|
360
|
*
|
361
|
* @param namedAreas The set of NamedArea instances
|
362
|
* @param presence Restrict the descriptions to those which have Distribution elements are of this status (can be null)
|
363
|
* @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
|
364
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
365
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
366
|
* @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
|
367
|
* @return a Pager containing TaxonDescription instances
|
368
|
*/
|
369
|
public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTerm presence, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
370
|
|
371
|
/**
|
372
|
* Returns a Paged List of DescriptionElementBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
|
373
|
*
|
374
|
* @param clazz filter the results by class (or pass null to return all DescriptionElementBase instances)
|
375
|
* @param queryString
|
376
|
* @param pageSize The maximum number of descriptionElements returned (can be null for all matching descriptionElements)
|
377
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
378
|
* @param orderHints
|
379
|
* Supports path like <code>orderHints.propertyNames</code> which
|
380
|
* include *-to-one properties like createdBy.username or
|
381
|
* authorTeam.persistentTitleCache
|
382
|
* @param propertyPaths properties to be initialized
|
383
|
* @return a Pager DescriptionElementBase instances
|
384
|
* @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
|
385
|
*/
|
386
|
public <S extends DescriptionElementBase> Pager<S> searchElements(Class<S> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
387
|
|
388
|
/**
|
389
|
* Returns a List of Media that are associated with a given description element
|
390
|
*
|
391
|
* @param descriptionElement the description element associated with these media
|
392
|
* @param pageSize The maximum number of media returned (can be null for all related media)
|
393
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
394
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
395
|
* @return a Pager containing media instances
|
396
|
*
|
397
|
* FIXME candidate for harmonization - rename to pageMedia
|
398
|
*/
|
399
|
public Pager<Media> getMedia(DescriptionElementBase descriptionElement, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
400
|
|
401
|
/**
|
402
|
* Provides access to all DescriptionElements associated with the given Taxon
|
403
|
* via a TaxonDescrition.
|
404
|
*
|
405
|
* @param taxon
|
406
|
* The Taxon to return Description elements for
|
407
|
* @param features
|
408
|
* Restrict the results to those description elements which are
|
409
|
* scoped by one of the Features passed (can be null or empty)
|
410
|
* @param type
|
411
|
* A filter for DescriptionElements of a specific class
|
412
|
* @param pageSize
|
413
|
* The maximum number of description elements returned (can be
|
414
|
* null for all description elements)
|
415
|
* @param pageNumber
|
416
|
* The offset (in pageSize chunks) from the start of the result
|
417
|
* set (0 - based)
|
418
|
* @param propertyPaths
|
419
|
* Properties to initialize in the returned entities, following
|
420
|
* the syntax described in
|
421
|
* {@link IBeanInitializer#initialize(Object, List)}
|
422
|
* @return a List containing all matching DescriptionElementBase instances
|
423
|
*
|
424
|
* @deprecated use {@link #listDescriptionElementsForTaxon(Taxon, Set, Class, Integer, Integer, List)} instead
|
425
|
*/
|
426
|
@Deprecated
|
427
|
public <T extends DescriptionElementBase> List<T> getDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
428
|
|
429
|
/**
|
430
|
* Provides access to all DescriptionElements associated with the given Taxon
|
431
|
* via a TaxonDescrition.
|
432
|
*
|
433
|
* @param taxon
|
434
|
* The Taxon to return Description elements for
|
435
|
* @param features
|
436
|
* Restrict the results to those description elements which are
|
437
|
* scoped by one of the Features passed (can be null or empty)
|
438
|
* @param type
|
439
|
* A filter for DescriptionElements of a specific class
|
440
|
* @param pageSize
|
441
|
* The maximum number of description elements returned (can be
|
442
|
* null for all description elements)
|
443
|
* @param pageNumber
|
444
|
* The offset (in pageSize chunks) from the start of the result
|
445
|
* set (0 - based)
|
446
|
* @param propertyPaths
|
447
|
* Properties to initialize in the returned entities, following
|
448
|
* the syntax described in
|
449
|
* {@link IBeanInitializer#initialize(Object, List)}
|
450
|
* @return a List containing all matching DescriptionElementBase instances
|
451
|
*
|
452
|
*/
|
453
|
public <T extends DescriptionElementBase> List<T> listDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
454
|
|
455
|
/**
|
456
|
* Provides access to all DescriptionElements associated with the given Taxon
|
457
|
* via a TaxonDescrition.
|
458
|
*
|
459
|
* @param taxon
|
460
|
* The Taxon to return Description elements for
|
461
|
* @param features
|
462
|
* Restrict the results to those description elements which are
|
463
|
* scoped by one of the Features passed (can be null or empty)
|
464
|
* @param type
|
465
|
* A filter for DescriptionElements of a specific class
|
466
|
* @param pageSize
|
467
|
* The maximum number of description elements returned
|
468
|
* @param pageNumber
|
469
|
* The offset (in pageSize chunks) from the start of the result
|
470
|
* set (0 - based)
|
471
|
* @param propertyPaths
|
472
|
* Properties to initialize in the returned entities, following
|
473
|
* the syntax described in
|
474
|
* {@link IBeanInitializer#initialize(Object, List)}
|
475
|
* @return a Pager for all matching DescriptionElementBase instances
|
476
|
*
|
477
|
*/
|
478
|
public <T extends DescriptionElementBase> Pager<T> pageDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
479
|
|
480
|
/**
|
481
|
* Generate a string representation of the structured <code>description</code> supplied in natural language
|
482
|
* The <code>featureTree</code> will be used to structure the NaturalLanguageDescription.
|
483
|
* This method does not require a initialization strategy so there is no <code>propertyPaths</code> parameter.
|
484
|
* @param featureTree
|
485
|
* @param description
|
486
|
* @param preferredLanguages
|
487
|
* @param separator
|
488
|
* @return
|
489
|
*/
|
490
|
public String generateNaturalLanguageDescription(TermTree featureTree,TaxonDescription description, List<Language> preferredLanguages, String separator);
|
491
|
|
492
|
/**
|
493
|
* Preliminary method to test whether a description contains structured data.
|
494
|
* @deprecated The means of determining this fact may change soon, so this method is
|
495
|
annotated as being deprecated.
|
496
|
* @param description
|
497
|
* @return
|
498
|
*/
|
499
|
@Deprecated
|
500
|
public boolean hasStructuredData(DescriptionBase<?> description);
|
501
|
|
502
|
/**
|
503
|
* Add the collection of {@link DescriptionElementBase description elements} to the <code>targetDescription</code>.
|
504
|
* Remove the description elements from the description they are currently associated with.
|
505
|
*
|
506
|
* @param descriptionElements
|
507
|
* @param targetDescription
|
508
|
* @param isPaste if true, the elements are only copied (cloned) and not removed from the
|
509
|
* old description
|
510
|
* @return
|
511
|
*/
|
512
|
public UpdateResult moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements, DescriptionBase targetDescription, boolean isPaste, boolean setNameInSource);
|
513
|
|
514
|
/**
|
515
|
* Pager method to get all {@link NamedAreas} instances which are currently used
|
516
|
* by {@link Distribution} elements.
|
517
|
*
|
518
|
* @param pageSize
|
519
|
* The maximum number of description elements returned
|
520
|
* @param pageNumber
|
521
|
* The offset (in pageSize chunks) from the start of the result
|
522
|
* set (0 - based)
|
523
|
* @param propertyPaths
|
524
|
* Properties to initialize in the returned entities, following
|
525
|
* the syntax described in
|
526
|
* {@link IBeanInitializer#initialize(Object, List)}
|
527
|
* @return a Pager for all NamedAreas instances which are currently in use.
|
528
|
*
|
529
|
*/
|
530
|
public Pager<TermDto> pageNamedAreasInUse(boolean includeAllParents, Integer pageSize,
|
531
|
Integer pageNumber);
|
532
|
|
533
|
/**
|
534
|
* Deletes the description and prior removes it from taxon, specimen or descriptive dataset.
|
535
|
*/
|
536
|
public DeleteResult deleteDescription(DescriptionBase<?> description);
|
537
|
|
538
|
public DeleteResult deleteDescription(UUID descriptionUuid);
|
539
|
|
540
|
public UpdateResult moveTaxonDescriptions(Taxon sourceTaxon, Taxon targetTaxon, boolean setNameInSource);
|
541
|
|
542
|
public UpdateResult moveTaxonDescriptions(UUID sourceTaxonUuid, UUID targetTaxonUuid, boolean setNameInSource);
|
543
|
|
544
|
public UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs, UUID targetDescriptionUuid,
|
545
|
boolean isCopy, boolean setNameInSource);
|
546
|
|
547
|
public UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs, UUID targetTaxonUuid,
|
548
|
String moveMessage, boolean isCopy, boolean setNameInSource);
|
549
|
|
550
|
public UpdateResult moveTaxonDescription(UUID descriptionUuid, UUID targetTaxonUuid, boolean setNameInSource);
|
551
|
|
552
|
public List<MergeResult<DescriptionBase>> mergeDescriptionElements(Collection<TaxonDistributionDTO> descriptionElements,
|
553
|
boolean returnTransientEntity);
|
554
|
|
555
|
public UpdateResult mergeDescriptions(Collection<DescriptionBaseDto> descriptions, UUID descriptiveDataSetUuid);
|
556
|
|
557
|
public UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs,
|
558
|
DescriptionBase targetDescription, boolean isCopy, boolean setNameInSource);
|
559
|
|
560
|
public DeleteResult isDeletable(UUID descriptionUuid);
|
561
|
|
562
|
public DescriptionBaseDto loadDto(UUID descriptionUuid);
|
563
|
|
564
|
public List<DescriptionBaseDto> loadDtosForTaxon(UUID taxonUuid);
|
565
|
}
|