Project

General

Profile

Download (32.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.DescriptionBaseDto;
19
import eu.etaxonomy.cdm.api.service.dto.TaxonDistributionDTO;
20
import eu.etaxonomy.cdm.api.service.pager.Pager;
21
import eu.etaxonomy.cdm.api.utility.DescriptionUtility;
22
import eu.etaxonomy.cdm.model.common.Annotation;
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.description.DescriptionBase;
27
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
28
import eu.etaxonomy.cdm.model.description.DescriptionType;
29
import eu.etaxonomy.cdm.model.description.Distribution;
30
import eu.etaxonomy.cdm.model.description.Feature;
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.model.term.DefinedTerm;
40
import eu.etaxonomy.cdm.model.term.TermTree;
41
import eu.etaxonomy.cdm.model.term.TermVocabulary;
42
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
43
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
44
import eu.etaxonomy.cdm.persistence.dto.TermDto;
45
import eu.etaxonomy.cdm.persistence.query.OrderHint;
46

    
47
public interface IDescriptionService extends IIdentifiableEntityService<DescriptionBase> {
48

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

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

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

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

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

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

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

    
106
    public UUID deleteDescriptionElement(UUID descriptionElementUuid);
107

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

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

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

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

    
168

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

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

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

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

    
265

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

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

    
296

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

    
310

    
311

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

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

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

    
346

    
347

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

    
361

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

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

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

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

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

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

    
485

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

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

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

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

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

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

    
571
	public DeleteResult deleteDescription(DescriptionBase description);
572

    
573
	public DeleteResult deleteDescription(UUID descriptionUuid);
574

    
575
    /**
576
     * @param sourceTaxon
577
     * @param targetTaxon
578
     * @return
579
     */
580
    public UpdateResult moveTaxonDescriptions(Taxon sourceTaxon, Taxon targetTaxon, boolean setNameInSource);
581

    
582
    /**
583
     * @param sourceTaxonUuid
584
     * @param targetTaxonUuid
585
     * @return
586
     */
587
    public UpdateResult moveTaxonDescriptions(UUID sourceTaxonUuid, UUID targetTaxonUuid, boolean setNameInSource);
588

    
589

    
590
    /**
591
     * @param descriptionElementUUIDs
592
     * @param targetDescriptionUuid
593
     * @param isCopy
594
     * @return
595
     */
596
    public UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs, UUID targetDescriptionUuid,
597
            boolean isCopy, boolean setNameInSource);
598

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

    
609
    /**
610
     * @param descriptionUUID
611
     * @param targetTaxonUuid
612
     * @return
613
     */
614
    public UpdateResult moveTaxonDescription(UUID descriptionUuid, UUID targetTaxonUuid, boolean setNameInSource);
615

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

    
624
    /**
625
     * @param descriptions
626
     * @param returnTransientEntity
627
     * @return
628
     */
629
    public UpdateResult mergeDescriptions(Collection<DescriptionBaseDto> descriptions, UUID descriptiveDataSetUuid);
630

    
631

    
632
    /**
633
     * @param descriptionElementUUIDs
634
     * @param targetDescription
635
     * @param isCopy
636
     * @return
637
     */
638
    UpdateResult moveDescriptionElementsToDescription(Set<UUID> descriptionElementUUIDs,
639
            DescriptionBase targetDescription, boolean isCopy, boolean setNameInSource);
640

    
641
    public DeleteResult isDeletable(UUID descriptionUuid);
642

    
643

    
644

    
645
}
(30-30/100)