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