Project

General

Profile

Download (30.6 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.api.service;
11

    
12
import java.util.Collection;
13
import java.util.List;
14
import java.util.Map;
15
import java.util.Set;
16
import java.util.UUID;
17

    
18
import eu.etaxonomy.cdm.api.service.dto.DescriptionBaseDto;
19
import eu.etaxonomy.cdm.api.service.dto.TaxonDistributionDTO;
20
import eu.etaxonomy.cdm.api.service.pager.Pager;
21
import eu.etaxonomy.cdm.model.common.Annotation;
22
import eu.etaxonomy.cdm.model.common.Language;
23
import eu.etaxonomy.cdm.model.common.MarkerType;
24
import eu.etaxonomy.cdm.model.description.DescriptionBase;
25
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
26
import eu.etaxonomy.cdm.model.description.DescriptionType;
27
import eu.etaxonomy.cdm.model.description.Distribution;
28
import eu.etaxonomy.cdm.model.description.Feature;
29
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
30
import eu.etaxonomy.cdm.model.description.TaxonDescription;
31
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
32
import eu.etaxonomy.cdm.model.location.NamedArea;
33
import eu.etaxonomy.cdm.model.media.Media;
34
import eu.etaxonomy.cdm.model.name.TaxonName;
35
import eu.etaxonomy.cdm.model.taxon.Taxon;
36
import eu.etaxonomy.cdm.model.term.DefinedTerm;
37
import eu.etaxonomy.cdm.model.term.TermTree;
38
import eu.etaxonomy.cdm.model.term.TermVocabulary;
39
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
40
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
41
import eu.etaxonomy.cdm.persistence.dto.TermDto;
42
import eu.etaxonomy.cdm.persistence.query.OrderHint;
43

    
44
public interface IDescriptionService extends IIdentifiableEntityService<DescriptionBase> {
45

    
46
    /**
47
     * @return
48
     * @deprecated use TermService#getVocabulary(VocabularyType) instead
49
     */
50
    @Deprecated
51
    public TermVocabulary<Feature> getDefaultFeatureVocabulary();
52

    
53
    /**
54
     * @deprecated use TermService#getVocabulary(VocabularyType) instead
55
     */
56
    @Deprecated
57
    public TermVocabulary<Feature> getFeatureVocabulary(UUID uuid);
58

    
59
    /**
60
     * Gets a DescriptionElementBase instance matching the supplied uuid
61
     *
62
     * @param uuid the uuid of the DescriptionElement of interest
63
     * @return a DescriptionElement, or null if the DescriptionElement does not exist
64
     */
65
    public DescriptionElementBase getDescriptionElementByUuid(UUID uuid);
66

    
67
    /**
68
     * Loads and existing DescriptionElementBase instance matching the supplied uuid,
69
     * and recursively initializes all bean properties given in the
70
     * <code>propertyPaths</code> parameter.
71
     * <p>
72
     * For detailed description and examples <b>please refer to:</b>
73
     * {@link IBeanInitializer#initialize(Object, List)}
74
     *
75
     * @param uuid the uuid of the DescriptionElement of interest
76
     * @return a DescriptionElement, or null if the DescriptionElement does not exist
77
     */
78
    public DescriptionElementBase loadDescriptionElement(UUID uuid,List<String> propertyPaths);
79

    
80
    /**
81
     * Persists a <code>DescriptionElementBase</code>
82
     * @param descriptionElement
83
     * @return
84
     */
85
    public UUID saveDescriptionElement(DescriptionElementBase descriptionElement);
86

    
87
    /**
88
     * Persists a collection of <code>DescriptionElementBase</code>
89
     * @param descriptionElements
90
     * @return
91
     */
92
    public Map<UUID, DescriptionElementBase> saveDescriptionElement(Collection<DescriptionElementBase> descriptionElements);
93

    
94
    /**
95
     * Delete an existing description element
96
     *
97
     * @param descriptionElement the description element to be deleted
98
     * @return the unique identifier of the deleted entity
99
     */
100
    public UUID deleteDescriptionElement(DescriptionElementBase descriptionElement);
101

    
102
    public UUID deleteDescriptionElement(UUID descriptionElementUuid);
103

    
104
    /**
105
     * List the descriptions of type <T>, filtered using the following parameters
106
     *
107
     * @param type The type of description returned (Taxon, TaxonName, or Specimen)
108
     * @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)
109
     * @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)
110
     * @param feature Restrict the description to those <i>elements</i> which are scoped by one of the Features passed (can be null or empty)
111
     * @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
112
     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
113
     * @param orderHints may be null
114
     * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
115
     * @return a Pager containing DescriptionBase instances
116
     */
117
    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);
118

    
119
    /**
120
     * Count the descriptions of type <TYPE>, filtered using the following parameters
121
     *
122
     * @param type The type of description returned (Taxon, TaxonName, or Specimen)
123
     * @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)
124
     * @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)
125
     * @param feature Restrict the description to those <i>elements</i> which are scoped by one of the Features passed (can be null or empty)
126
     * @return a count of DescriptionBase instances
127
     */
128
    public long count(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature);
129

    
130
    /**
131
     * Returns description elements of type <TYPE>, belonging to a given
132
     * description, optionally filtered by one or more features
133
     *
134
     * @param description
135
     *            The description which these description elements belong to
136
     *            (can be null to count all description elements)
137
     * @param descriptionType
138
     *            A filter DescriptionElements which belong to of a specific
139
     *            class of Descriptions
140
     * @param features
141
     *            Restrict the results to those description elements which are
142
     *            scoped by one of the Features passed (can be null or empty)
143
     * @param type
144
     *            A filter for DescriptionElements of a specific class
145
     * @param pageSize
146
     *            The maximum number of description elements returned (can be
147
     *            null for all description elements)
148
     * @param pageNumber
149
     *            The offset (in pageSize chunks) from the start of the result
150
     *            set (0 - based)
151
     * @param propertyPaths
152
     *            Properties to initialize in the returned entities, following
153
     *            the syntax described in
154
     *            {@link IBeanInitializer#initialize(Object, List)}
155
     * @return a Pager containing DescriptionElementBase instances
156

    
157
     * @deprecated use
158
     *             {@link #pageDescriptionElements(DescriptionBase, Set, Class, Integer, Integer, List)}
159
     *             instead
160
     */
161
    @Deprecated
162
    public <T extends DescriptionElementBase> Pager<T> getDescriptionElements(DescriptionBase description,Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
163

    
164

    
165
    /**
166
     * Returns description elements of type <TYPE>, belonging to a given
167
     * description, optionally filtered by one or more features
168
     *
169
     * @param description
170
     *            The description which these description elements belong to
171
     *            (can be null to count all description elements)
172
     * @param descriptionType
173
     *            A filter DescriptionElements which belong to of a specific
174
     *            class of Descriptions
175
     * @param features
176
     *            Restrict the results to those description elements which are
177
     *            scoped by one of the Features passed (can be null or empty)
178
     * @param type
179
     *            A filter for DescriptionElements of a specific class
180
     * @param pageSize
181
     *            The maximum number of description elements returned (can be
182
     *            null for all description elements)
183
     * @param pageNumber
184
     *            The offset (in pageSize chunks) from the start of the result
185
     *            set (0 - based)
186
     * @param propertyPaths
187
     *            Properties to initialize in the returned entities, following
188
     *            the syntax described in
189
     *            {@link IBeanInitializer#initialize(Object, List)}
190
     *
191
     * @return a Pager containing DescriptionElementBase instances
192
     */
193
    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);
194

    
195
    /**
196
     * Returns description elements of type <TYPE>, belonging to a given
197
     * description, optionally filtered by one or more features
198
     *
199
     * @param description
200
     *            The description which these description elements belong to
201
     *            (can be null to count all description elements)
202
     * @param features
203
     *            Restrict the results to those description elements which are
204
     *            scoped by one of the Features passed (can be null or empty)
205
     * @param type
206
     *            A filter for DescriptionElements of a specific class
207
     * @param pageSize
208
     *            The maximum number of description elements returned (can be
209
     *            null for all description elements)
210
     * @param pageNumber
211
     *            The offset (in pageSize chunks) from the start of the result
212
     *            set (0 - based)
213
     * @param propertyPaths
214
     *            Properties to initialize in the returned entities, following
215
     *            the syntax described in
216
     *            {@link IBeanInitializer#initialize(Object, List)}
217
     * @return a List of DescriptionElementBase instances
218
     * @deprecated use {@link #listDescriptionElements(DescriptionBase, Class, Set, Class, Integer, Integer, List)} instead
219
     */
220
    @Deprecated
221
    public <T extends DescriptionElementBase> List<T> listDescriptionElements(DescriptionBase description,Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
222

    
223
    /**
224
     * Returns description elements of type <TYPE>, belonging to a given
225
     * description, optionally filtered by one or more features
226
     *
227
     * @param description
228
     *            The description which these description elements belong to
229
     *            (can be null to count all description elements)
230
     * @param features
231
     *            Restrict the results to those description elements which are
232
     *            scoped by one of the Features passed (can be null or empty)
233
     * @param type
234
     *            A filter DescriptionElements of a for specific class
235
     * @param pageSize
236
     *            The maximum number of description elements returned (can be
237
     *            null for all description elements)
238
     * @param pageNumber
239
     *            The offset (in pageSize chunks) from the start of the result
240
     *            set (0 - based)
241
     * @param propertyPaths
242
     *            Properties to initialize in the returned entities, following
243
     *            the syntax described in
244
     *            {@link IBeanInitializer#initialize(Object, List)}
245
     * @return a List of DescriptionElementBase instances
246
     */
247
    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);
248

    
249
    /**
250
     * Return a Pager containing Annotation entities belonging to the DescriptionElementBase instance supplied, optionally filtered by MarkerType
251
     * @param annotatedObj The object that "owns" the annotations returned
252
     * @param status Only return annotations which are marked with a Marker of this type (can be null to return all annotations)
253
     * @param pageSize The maximum number of terms returned (can be null for all annotations)
254
     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
255
     * @param orderHints may be null
256
     * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
257
     * @return a Pager of Annotation entities
258
     */
259
    public Pager<Annotation> getDescriptionElementAnnotations(DescriptionElementBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
260

    
261

    
262
    /**
263
     * Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method
264
     *
265
     * @param taxon The taxon which the description refers to (can be null for all TaxonDescription instances)
266
     * @param scopes Restrict the results to those descriptions which are scoped by one of the Scope instances passed (can be null or empty)
267
     * @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)
268
     * @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
269
     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
270
     * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
271
     * @return a Pager containing TaxonDescription instances
272
     *
273
     * @see #pageMarkedTaxonDescriptions(Taxon, Set, Set, Set, Integer, Integer, List)
274
     */
275
    public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
276

    
277
    /**
278
     * Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method
279
     *
280
     * @param taxon The taxon which the description refers to (can be null for all TaxonDescription instances)
281
     * @param scopes Restrict the results to those descriptions which are scoped by one of the Scope instances passed (can be null or empty)
282
     * @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)
283
     * @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)
284
     * @param descriptionTypes Restrict the results to those descriptions of the given types (can be null or empty)
285
     * @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
286
     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
287
     * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
288
     * @return a Pager containing TaxonDescription instances
289
     */
290
    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);
291

    
292

    
293
    /**
294
     * @see {@link #pageTaxonDescriptions(Taxon, Set, Set, Integer, Integer, List)}
295
     *
296
     * @param taxon
297
     * @param scopes
298
     * @param geographicalScope
299
     * @param pageSize
300
     * @param pageNumber
301
     * @param propertyPaths
302
     * @return
303
     */
304
    public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
305

    
306

    
307

    
308
    /**
309
     * @see {@link #pageMarkedTaxonDescriptions(Taxon, Set, Set, Set, Integer, Integer, List)}
310
     *
311
     * @param taxon
312
     * @param scopes
313
     * @param geographicalScope
314
     * @param pageSize
315
     * @param pageNumber
316
     * @param propertyPaths
317
     * @return
318
     */
319
    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);
320

    
321
    /**
322
     * Returns all {@link Media} attached to a taxon via TaxonDescription.elements.media.
323
     * @param taxonUuid the taxons uuid, if null media for all taxa are returned
324
     * @param limitToGalleries if true only media in TaxonDescriptions with imageGallery flag=true are returned
325
     * @param markerTypes only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
326
     * @param pageSize
327
     * @param pageNumber
328
     * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
329
     * @return
330
     */
331
    public List<Media> listTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
332

    
333
    /**
334
     * Returns count for all {@link Media} attached to a taxon via TaxonDescription.elements.media.
335
     * @param taxonUuid the taxons uuid, if null media for all taxa are returned
336
     * @param limitToGalleries if true only media in TaxonDescriptions with imageGallery flag=true are returned
337
     * @param markerTypes only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
338
     * @return
339
     */
340
    public int countTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes);
341

    
342

    
343

    
344
    /**
345
     * Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to
346
     *
347
     * @param name Restrict the results to those descriptions that refer to a specific name (can be null for all TaxonNameDescription instances)
348
     * @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
349
     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
350
     * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
351
     * @return a Pager containing TaxonName instances
352
     *
353
     * FIXME candidate for harmonization - rename to pageTaxonNameDescriptions
354
     */
355
    public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonName name, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
356

    
357

    
358
    /**
359
     * Returns a List of distinct TaxonDescription instances which have Distribution elements that refer to one of the NamedArea instances passed (optionally
360
     * filtered by a type of PresenceAbsenceTerm e.g. PRESENT / ABSENT / NATIVE / CULTIVATED etc)
361
     *
362
     * @param namedAreas The set of NamedArea instances
363
     * @param presence Restrict the descriptions to those which have Distribution elements are of this status (can be null)
364
     * @param pageSize The maximum number of descriptions returned (can be null for all descriptions)
365
     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
366
     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
367
     * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link IBeanInitializer#initialize(Object, List)}
368
     * @return a Pager containing TaxonDescription instances
369
     */
370
    public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTerm presence, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
371

    
372
    /**
373
     * Returns a Paged List of DescriptionElementBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
374
     *
375
     * @param clazz filter the results by class (or pass null to return all DescriptionElementBase instances)
376
     * @param queryString
377
     * @param pageSize The maximum number of descriptionElements returned (can be null for all matching descriptionElements)
378
     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
379
     * @param orderHints
380
     *            Supports path like <code>orderHints.propertyNames</code> which
381
     *            include *-to-one properties like createdBy.username or
382
     *            authorTeam.persistentTitleCache
383
     * @param propertyPaths properties to be initialized
384
     * @return a Pager DescriptionElementBase instances
385
     * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>
386
     */
387
    public <S extends DescriptionElementBase> Pager<S> searchElements(Class<S> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
388

    
389
    /**
390
     * Returns a List of Media that are associated with a given description element
391
     *
392
     * @param descriptionElement the description element associated with these media
393
     * @param pageSize The maximum number of media returned (can be null for all related media)
394
     * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
395
     * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
396
     * @return a Pager containing media instances
397
     *
398
     * FIXME candidate for harmonization - rename to pageMedia
399
     */
400
    public Pager<Media> getMedia(DescriptionElementBase descriptionElement, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
401

    
402
    /**
403
     * Provides access to all DescriptionElements associated with the given Taxon
404
     * via a TaxonDescrition.
405
     *
406
     * @param taxon
407
     *            The Taxon to return Description elements for
408
     * @param features
409
     *            Restrict the results to those description elements which are
410
     *            scoped by one of the Features passed (can be null or empty)
411
     * @param type
412
     *            A filter for DescriptionElements of a specific class
413
     * @param pageSize
414
     *            The maximum number of description elements returned (can be
415
     *            null for all description elements)
416
     * @param pageNumber
417
     *            The offset (in pageSize chunks) from the start of the result
418
     *            set (0 - based)
419
     * @param propertyPaths
420
     *            Properties to initialize in the returned entities, following
421
     *            the syntax described in
422
     *            {@link IBeanInitializer#initialize(Object, List)}
423
     * @return a List containing all matching DescriptionElementBase instances
424
     *
425
     * @deprecated use {@link #listDescriptionElementsForTaxon(Taxon, Set, Class, Integer, Integer, List)} instead
426
     */
427
    @Deprecated
428
    public <T extends DescriptionElementBase> List<T>  getDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
429

    
430
    /**
431
     * Provides access to all DescriptionElements associated with the given Taxon
432
     * via a TaxonDescrition.
433
     *
434
     * @param taxon
435
     *            The Taxon to return Description elements for
436
     * @param features
437
     *            Restrict the results to those description elements which are
438
     *            scoped by one of the Features passed (can be null or empty)
439
     * @param type
440
     *            A filter for DescriptionElements of a specific class
441
     * @param pageSize
442
     *            The maximum number of description elements returned (can be
443
     *            null for all description elements)
444
     * @param pageNumber
445
     *            The offset (in pageSize chunks) from the start of the result
446
     *            set (0 - based)
447
     * @param propertyPaths
448
     *            Properties to initialize in the returned entities, following
449
     *            the syntax described in
450
     *            {@link IBeanInitializer#initialize(Object, List)}
451
     * @return a List containing all matching DescriptionElementBase instances
452
     *
453
     */
454
    public <T extends DescriptionElementBase> List<T>  listDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
455

    
456
    /**
457
     * Provides access to all DescriptionElements associated with the given Taxon
458
     * via a TaxonDescrition.
459
     *
460
     * @param taxon
461
     *            The Taxon to return Description elements for
462
     * @param features
463
     *            Restrict the results to those description elements which are
464
     *            scoped by one of the Features passed (can be null or empty)
465
     * @param type
466
     *            A filter for DescriptionElements of a specific class
467
     * @param pageSize
468
     *            The maximum number of description elements returned
469
     * @param pageNumber
470
     *            The offset (in pageSize chunks) from the start of the result
471
     *            set (0 - based)
472
     * @param propertyPaths
473
     *            Properties to initialize in the returned entities, following
474
     *            the syntax described in
475
     *            {@link IBeanInitializer#initialize(Object, List)}
476
     * @return a Pager for all matching DescriptionElementBase instances
477
     *
478
     */
479
    public <T extends DescriptionElementBase> Pager<T>  pageDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
480

    
481
    /**
482
      * Generate a string representation of the structured <code>description</code> supplied in natural language
483
      * The <code>featureTree</code> will be used to structure the NaturalLanguageDescription.
484
      * This method does not require a initialization strategy so there is no <code>propertyPaths</code> parameter.
485
      * @param featureTree
486
      * @param description
487
      * @param preferredLanguages
488
      * @param separator
489
      * @return
490
      */
491
    public String generateNaturalLanguageDescription(TermTree featureTree,TaxonDescription description, List<Language> preferredLanguages, String separator);
492

    
493
    /**
494
     * Preliminary method to test whether a description contains structured data.
495
     * @deprecated The means of determining this fact may change soon, so this method is
496
                    annotated as being deprecated.
497
     * @param description
498
     * @return
499
     */
500
    @Deprecated
501
    public boolean hasStructuredData(DescriptionBase<?> description);
502

    
503
    /**
504
     * Add the collection of {@link DescriptionElementBase description elements} to the <code>targetDescription</code>.
505
     * Remove the description elements from the description they are currently associated with.
506
     *
507
     * @param descriptionElements
508
     * @param targetDescription
509
     * @param isPaste if true, the elements are only copied (cloned) and not removed from the
510
     * 	old description
511
     * @return
512
     */
513
    public UpdateResult moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements, DescriptionBase targetDescription, boolean isPaste, boolean setNameInSource);
514

    
515
    /**
516
     * Pager method to get all {@link NamedAreas} instances which are currently used
517
     * by {@link Distribution} elements.
518
     *
519
     * @param pageSize
520
     *            The maximum number of description elements returned
521
     * @param pageNumber
522
     *            The offset (in pageSize chunks) from the start of the result
523
     *            set (0 - based)
524
     * @param propertyPaths
525
     *            Properties to initialize in the returned entities, following
526
     *            the syntax described in
527
     *            {@link IBeanInitializer#initialize(Object, List)}
528
     * @return a Pager for all NamedAreas instances which are currently in use.
529
     *
530
     */
531
    public Pager<TermDto> pageNamedAreasInUse(boolean includeAllParents, Integer pageSize,
532
            Integer pageNumber);
533

    
534
	public DeleteResult deleteDescription(DescriptionBase description);
535

    
536
	public DeleteResult deleteDescription(UUID descriptionUuid);
537

    
538
    /**
539
     * @param sourceTaxon
540
     * @param targetTaxon
541
     * @return
542
     */
543
    public UpdateResult moveTaxonDescriptions(Taxon sourceTaxon, Taxon targetTaxon, boolean setNameInSource);
544

    
545
    /**
546
     * @param sourceTaxonUuid
547
     * @param targetTaxonUuid
548
     * @return
549
     */
550
    public UpdateResult moveTaxonDescriptions(UUID sourceTaxonUuid, UUID targetTaxonUuid, boolean setNameInSource);
551

    
552

    
553
    /**
554
     * @param descriptionElementUUIDs
555
     * @param targetDescriptionUuid
556
     * @param isCopy
557
     * @return
558
     */
559
    public UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs, UUID targetDescriptionUuid,
560
            boolean isCopy, boolean setNameInSource);
561

    
562
    /**
563
     * @param descriptionElementUUIDs
564
     * @param targetTaxonUuid
565
     * @param moveMessage
566
     * @param isCopy
567
     * @return
568
     */
569
    public UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs, UUID targetTaxonUuid,
570
            String moveMessage, boolean isCopy, boolean setNameInSource);
571

    
572
    /**
573
     * @param descriptionUUID
574
     * @param targetTaxonUuid
575
     * @return
576
     */
577
    public UpdateResult moveTaxonDescription(UUID descriptionUuid, UUID targetTaxonUuid, boolean setNameInSource);
578

    
579
    /**
580
     * @param descriptionElements
581
     * @param returnTransientEntity
582
     * @return
583
     */
584
    public List<MergeResult<DescriptionBase>> mergeDescriptionElements(Collection<TaxonDistributionDTO> descriptionElements,
585
            boolean returnTransientEntity);
586

    
587
    /**
588
     * @param descriptions
589
     * @param returnTransientEntity
590
     * @return
591
     */
592
    public UpdateResult mergeDescriptions(Collection<DescriptionBaseDto> descriptions, UUID descriptiveDataSetUuid);
593

    
594

    
595
    /**
596
     * @param descriptionElementUUIDs
597
     * @param targetDescription
598
     * @param isCopy
599
     * @return
600
     */
601
    UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs,
602
            DescriptionBase targetDescription, boolean isCopy, boolean setNameInSource);
603

    
604
    public DeleteResult isDeletable(UUID descriptionUuid);
605

    
606

    
607

    
608
}
(28-28/97)