Project

General

Profile

Download (30.8 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.pager.Pager;
19
import eu.etaxonomy.cdm.api.utility.DescriptionUtility;
20
import eu.etaxonomy.cdm.model.common.Annotation;
21
import eu.etaxonomy.cdm.model.common.DefinedTerm;
22
import eu.etaxonomy.cdm.model.common.Language;
23
import eu.etaxonomy.cdm.model.common.Marker;
24
import eu.etaxonomy.cdm.model.common.MarkerType;
25
import eu.etaxonomy.cdm.model.common.TermVocabulary;
26
import eu.etaxonomy.cdm.model.description.DescriptionBase;
27
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
28
import eu.etaxonomy.cdm.model.description.Distribution;
29
import eu.etaxonomy.cdm.model.description.Feature;
30
import eu.etaxonomy.cdm.model.description.FeatureTree;
31
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
32
import eu.etaxonomy.cdm.model.description.TaxonDescription;
33
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
34
import eu.etaxonomy.cdm.model.location.NamedArea;
35
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
36
import eu.etaxonomy.cdm.model.media.Media;
37
import eu.etaxonomy.cdm.model.name.TaxonName;
38
import eu.etaxonomy.cdm.model.taxon.Taxon;
39
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
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
     *
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 int 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 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, 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, 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 Pager<DescriptionElementBase> searchElements(Class<? extends DescriptionElementBase> 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
    /**
482
     * @param taxonDescriptions
483
     * @param subAreaPreference
484
     *            enables the <b>Sub area preference rule</b> if set to true,
485
     *            see {@link DescriptionUtility#filterDistributions(Collection,
486
     *            boolean, boolean}
487

    
488
     * @param statusOrderPreference
489
     *            enables the <b>Status order preference rule</b> if set to
490
     *            true, see {@link
491
     *            DescriptionUtility#filterDistributions(Collection, boolean,
492
     *            boolean}
493
     * @param hideMarkedAreas
494
     *            distributions where the area has a {@link Marker} with one of
495
     *            the specified {@link MarkerType}s will be skipped, see
496
     *            {@link DescriptionUtility#filterDistributions(Collection, boolean, boolean, Set)}
497
     * @param omitLevels
498
     *            A Set NamedArea levels to omit - optional
499
     * @param propertyPaths
500
     *            the initialization strategy
501
     *
502
     * @return
503
     * @deprecated use {@link IEditGeoService#composeDistributionInfoFor()} instead
504
     */
505
    @Deprecated
506
    public DistributionTree getOrderedDistributions(
507
            Set<TaxonDescription> taxonDescriptions,
508
            boolean subAreaPreference,
509
            boolean statusOrderPreference,
510
            Set<MarkerType> hideMarkedAreas,
511
            Set<NamedAreaLevel> omitLevels, List<String> propertyPaths);
512

    
513
    /**
514
      * Generate a string representation of the structured <code>description</code> supplied in natural language
515
      * The <code>featureTree</code> will be used to structure the NaturalLanguageDescription.
516
      * This method does not require a initialization strategy so there is no <code>propertyPaths</code> parameter.
517
      * @param featureTree
518
      * @param description
519
      * @param preferredLanguages
520
      * @param separator
521
      * @return
522
      */
523
    public String generateNaturalLanguageDescription(FeatureTree featureTree,TaxonDescription description, List<Language> preferredLanguages, String separator);
524

    
525
    /**
526
     * Preliminary method to test whether a description contains structured data.
527
     * @deprecated The means of determining this fact may change soon, so this method is
528
                    annotated as being deprecated.
529
     * @param description
530
     * @return
531
     */
532
    @Deprecated
533
    public boolean hasStructuredData(DescriptionBase<?> description);
534

    
535
    /**
536
     * Add the collection of {@link DescriptionElementBase description elements} to the <code>targetDescription</code>.
537
     * Remove the description elements from the description they are currently associated with.
538
     *
539
     * @param descriptionElements
540
     * @param targetDescription
541
     * @param isPaste if true, the elements are only copied (cloned) and not removed from the
542
     * 	old description
543
     * @return
544
     */
545
    public UpdateResult moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements, DescriptionBase targetDescription, boolean isPaste);
546

    
547
    /**
548
     * Pager method to get all {@link NamedAreas} instances which are currently used
549
     * by {@link Distribution} elements.
550
     *
551
     * @param pageSize
552
     *            The maximum number of description elements returned
553
     * @param pageNumber
554
     *            The offset (in pageSize chunks) from the start of the result
555
     *            set (0 - based)
556
     * @param propertyPaths
557
     *            Properties to initialize in the returned entities, following
558
     *            the syntax described in
559
     *            {@link IBeanInitializer#initialize(Object, List)}
560
     * @return a Pager for all NamedAreas instances which are currently in use.
561
     *
562
     */
563
    public Pager<TermDto> pageNamedAreasInUse(boolean includeAllParents, Integer pageSize,
564
            Integer pageNumber);
565

    
566
	public DeleteResult deleteDescription(DescriptionBase description);
567

    
568
	public DeleteResult deleteDescription(UUID descriptionUuid);
569

    
570
    /**
571
     * @param sourceTaxon
572
     * @param targetTaxon
573
     * @return
574
     */
575
    public UpdateResult moveTaxonDescriptions(Taxon sourceTaxon, Taxon targetTaxon);
576

    
577
    /**
578
     * @param sourceTaxonUuid
579
     * @param targetTaxonUuid
580
     * @return
581
     */
582
    public UpdateResult moveTaxonDescriptions(UUID sourceTaxonUuid, UUID targetTaxonUuid);
583

    
584

    
585
    /**
586
     * @param descriptionElementUUIDs
587
     * @param targetDescriptionUuid
588
     * @param isCopy
589
     * @return
590
     */
591
    public UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs, UUID targetDescriptionUuid,
592
            boolean isCopy);
593

    
594
    /**
595
     * @param descriptionElementUUIDs
596
     * @param targetTaxonUuid
597
     * @param moveMessage
598
     * @param isCopy
599
     * @return
600
     */
601
    public UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs, UUID targetTaxonUuid,
602
            String moveMessage, boolean isCopy);
603

    
604
    /**
605
     * @param descriptionUUID
606
     * @param targetTaxonUuid
607
     * @return
608
     */
609
    public UpdateResult moveTaxonDescription(UUID descriptionUuid, UUID targetTaxonUuid);
610
}
(34-34/101)