Project

General

Profile

Download (31.1 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.TaxonDistributionDTO;
19
import eu.etaxonomy.cdm.api.service.pager.Pager;
20
import eu.etaxonomy.cdm.api.utility.DescriptionUtility;
21
import eu.etaxonomy.cdm.model.common.Annotation;
22
import eu.etaxonomy.cdm.model.common.DefinedTerm;
23
import eu.etaxonomy.cdm.model.common.Language;
24
import eu.etaxonomy.cdm.model.common.Marker;
25
import eu.etaxonomy.cdm.model.common.MarkerType;
26
import eu.etaxonomy.cdm.model.common.TermVocabulary;
27
import eu.etaxonomy.cdm.model.description.DescriptionBase;
28
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
29
import eu.etaxonomy.cdm.model.description.Distribution;
30
import eu.etaxonomy.cdm.model.description.Feature;
31
import eu.etaxonomy.cdm.model.description.FeatureTree;
32
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
33
import eu.etaxonomy.cdm.model.description.TaxonDescription;
34
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
35
import eu.etaxonomy.cdm.model.location.NamedArea;
36
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
37
import eu.etaxonomy.cdm.model.media.Media;
38
import eu.etaxonomy.cdm.model.name.TaxonName;
39
import eu.etaxonomy.cdm.model.taxon.Taxon;
40
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
41
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
42
import eu.etaxonomy.cdm.persistence.dto.TermDto;
43
import eu.etaxonomy.cdm.persistence.query.OrderHint;
44

    
45
public interface IDescriptionService extends IIdentifiableEntityService<DescriptionBase> {
46

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

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

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

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

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

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

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

    
104
    public UUID deleteDescriptionElement(UUID descriptionElementUuid);
105

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

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

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

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

    
166

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

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

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

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

    
263

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

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

    
293

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

    
307

    
308

    
309
    /**
310
     * @see {@link #pageMarkedTaxonDescriptions(Taxon, Set, Set, Set, Integer, Integer, List)}
311
     *
312
     * @param taxon
313
     * @param scopes
314
     * @param geographicalScope
315
     * @param pageSize
316
     * @param pageNumber
317
     * @param propertyPaths
318
     * @return
319
     */
320
    public List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
321

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

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

    
343

    
344

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

    
358

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

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

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

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

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

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

    
482

    
483
    /**
484
     * @param taxonDescriptions
485
     * @param subAreaPreference
486
     *            enables the <b>Sub area preference rule</b> if set to true,
487
     *            see {@link DescriptionUtility#filterDistributions(Collection,
488
     *            boolean, boolean}
489

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

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

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

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

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

    
568
	public DeleteResult deleteDescription(DescriptionBase description);
569

    
570
	public DeleteResult deleteDescription(UUID descriptionUuid);
571

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

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

    
586

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

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

    
606
    /**
607
     * @param descriptionUUID
608
     * @param targetTaxonUuid
609
     * @return
610
     */
611
    public UpdateResult moveTaxonDescription(UUID descriptionUuid, UUID targetTaxonUuid);
612

    
613
    /**
614
     * @param descriptionElements
615
     * @param returnTransientEntity
616
     * @return
617
     */
618
    public List<MergeResult<DescriptionBase>> mergeDescriptionElements(Collection<TaxonDistributionDTO> descriptionElements,
619
            boolean returnTransientEntity);
620

    
621

    
622

    
623
}
(35-35/103)