eu.etaxonomy.cdm.api.service
Class DescriptionServiceImpl

java.lang.Object
  extended by eu.etaxonomy.cdm.api.service.ServiceBase<T,DAO>
      extended by eu.etaxonomy.cdm.api.service.VersionableServiceBase<T,DAO>
          extended by eu.etaxonomy.cdm.api.service.AnnotatableServiceBase<T,DAO>
              extended by eu.etaxonomy.cdm.api.service.IdentifiableServiceBase<DescriptionBase,IDescriptionDao>
                  extended by eu.etaxonomy.cdm.api.service.DescriptionServiceImpl
All Implemented Interfaces:
IAnnotatableService<DescriptionBase>, IDescriptionService, IIdentifiableEntityService<DescriptionBase>, IService<DescriptionBase>, IVersionableService<DescriptionBase>, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@Service
@Transactional(readOnly=true)
public class DescriptionServiceImpl
extends IdentifiableServiceBase<DescriptionBase,IDescriptionDao>
implements IDescriptionService

Version:
1.0
Author:
a.mueller

Field Summary
protected  IDefinedTermDao definedTermDao
           
protected  IDescriptionElementDao descriptionElementDao
           
protected  IFeatureDao featureDao
           
protected  IFeatureNodeDao featureNodeDao
           
protected  IFeatureTreeDao featureTreeDao
           
protected  IStatisticalMeasurementValueDao statisticalMeasurementValueDao
           
protected  ITermVocabularyDao vocabularyDao
           
 
Fields inherited from class eu.etaxonomy.cdm.api.service.IdentifiableServiceBase
commonService, UPDATE_TITLE_CACHE_DEFAULT_STEP_SIZE
 
Fields inherited from class eu.etaxonomy.cdm.api.service.ServiceBase
appContext, dao
 
Constructor Summary
DescriptionServiceImpl()
           
 
Method Summary
 void aggregateDistributions(List<NamedArea> superAreas, Rank lowerRank, Rank upperRank)
           
 int count(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature)
          Count the descriptions of type , filtered using the following parameters
 int countTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes)
          Returns count for all Media attached to a taxon via TaxonDescription.elements.media.
 UUID deleteDescriptionElement(DescriptionElementBase descriptionElement)
          FIXME Candidate for harmonization descriptionElementService.delete
 String generateNaturalLanguageDescription(FeatureTree featureTree, TaxonDescription description, List<Language> preferredLanguages, String separator)
          Generate a string representation of the structured description supplied in natural language The featureTree will be used to structure the NaturalLanguageDescription.
 TermVocabulary<Feature> getDefaultFeatureVocabulary()
           
 Pager<Annotation> getDescriptionElementAnnotations(DescriptionElementBase annotatedObj, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Return a Pager containing Annotation entities belonging to the DescriptionElementBase instance supplied, optionally filtered by MarkerType
 DescriptionElementBase getDescriptionElementByUuid(UUID uuid)
          FIXME Candidate for harmonization descriptionElementService.find
 Pager<DescriptionElementBase> getDescriptionElements(DescriptionBase description, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          FIXME Candidate for harmonization rename -> getElements
<T extends DescriptionElementBase>
List<T>
getDescriptionElementsForTaxon(Taxon taxon, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          FIXME Candidate for harmonization descriptionElementService.listDescriptionElementsForTaxon
 TermVocabulary<Feature> getFeatureVocabulary(UUID uuid)
           
 Pager<Media> getMedia(DescriptionElementBase descriptionElement, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Returns a List of Media that are associated with a given description element
 DistributionTree getOrderedDistributions(Set<TaxonDescription> taxonDescriptions, Set<NamedAreaLevel> omitLevels, List<String> propertyPaths)
           
 Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonNameBase name, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to
 boolean hasStructuredData(DescriptionBase<?> description)
          Preliminary method to test whether a description contains structured data.
 List<DescriptionElementBase> listDescriptionElements(DescriptionBase description, Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Returns description elements of type , belonging to a given description, optionally filtered by one or more features
 List<Media> listTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Returns all Media attached to a taxon via TaxonDescription.elements.media.
 List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
           
 List<TaxonDescription> listTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
           
 DescriptionElementBase loadDescriptionElement(UUID uuid, List<String> propertyPaths)
          FIXME Candidate for harmonization descriptionElementService.load
 void moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements, DescriptionBase targetDescription, boolean isCopy)
          Add the collection of description elements to the targetDescription.
 Pager<DescriptionBase> page(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          List the descriptions of type , filtered using the following parameters
 Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method
 Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<Scope> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method
 Map<UUID,DescriptionElementBase> saveDescriptionElement(Collection<DescriptionElementBase> descriptionElements)
          FIXME Candidate for harmonization descriptionElementService.save
 UUID saveDescriptionElement(DescriptionElementBase descriptionElement)
          FIXME Candidate for harmonization descriptionElementService.save
 Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase presence, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          FIXME Candidate for harmonization Rename: searchByDistribution
 Pager<DescriptionElementBase> searchElements(Class<? extends DescriptionElementBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          FIXME Candidate for harmonization move: descriptionElementService.search
protected  void setDao(IDescriptionDao dao)
           
protected  void setDefinedTermDao(IDefinedTermDao definedTermDao)
           
protected  void setDescriptionElementDao(IDescriptionElementDao descriptionElementDao)
           
protected  void setFeatureDao(IFeatureDao featureDao)
           
protected  void setFeatureNodeDao(IFeatureNodeDao featureNodeDao)
           
protected  void setFeatureTreeDao(IFeatureTreeDao featureTreeDao)
           
protected  void setNaturalLanguageGenerator(NaturalLanguageGenerator naturalLanguageGenerator)
           
protected  void setVocabularyDao(ITermVocabularyDao vocabularyDao)
           
protected  void statisticalMeasurementValueDao(IStatisticalMeasurementValueDao statisticalMeasurementValueDao)
           
 void updateTitleCache(Class<? extends DescriptionBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<DescriptionBase> cacheStrategy, IProgressMonitor monitor)
          (Re-)generate the title caches for all objects of this concrete IdentifiableEntity class
 
Methods inherited from class eu.etaxonomy.cdm.api.service.IdentifiableServiceBase
countByTitle, countByTitle, deduplicate, find, findByTitle, findByTitle, findCdmObjectsByTitle, findCdmObjectsByTitle, findCdmObjectsByTitle, findTitleCache, getRights, getSourcedObjectByIdInSource, getSources, getUuidAndTitleCache, listByReferenceTitle, listByTitle, replace, search, setOtherCachesNull, updateTitleCache, updateTitleCacheImpl
 
Methods inherited from class eu.etaxonomy.cdm.api.service.AnnotatableServiceBase
countMarkers, getAnnotations, getMarkers, groupMarkers
 
Methods inherited from class eu.etaxonomy.cdm.api.service.VersionableServiceBase
getNextAuditEvent, getPreviousAuditEvent, pageAuditEvents, pageAuditEvents
 
Methods inherited from class eu.etaxonomy.cdm.api.service.ServiceBase
clear, count, delete, exists, find, find, find, findById, getSession, group, list, list, load, load, lock, merge, page, refresh, refresh, rows, save, save, saveOrUpdate, saveOrUpdate, setApplicationContext, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IIdentifiableEntityService
countByTitle, countByTitle, deduplicate, find, findByTitle, findByTitle, findTitleCache, getRights, getSourcedObjectByIdInSource, getSources, getUuidAndTitleCache, listByReferenceTitle, listByTitle, replace, search, updateTitleCache
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IAnnotatableService
countMarkers, getAnnotations, getMarkers, groupMarkers
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IVersionableService
getNextAuditEvent, getPreviousAuditEvent, pageAuditEvents, pageAuditEvents
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IService
clear, count, delete, exists, find, find, find, findById, getSession, group, list, list, load, load, lock, merge, page, refresh, refresh, rows, save, save, saveOrUpdate, saveOrUpdate, update
 

Field Detail

descriptionElementDao

protected IDescriptionElementDao descriptionElementDao

featureTreeDao

protected IFeatureTreeDao featureTreeDao

featureNodeDao

protected IFeatureNodeDao featureNodeDao

featureDao

protected IFeatureDao featureDao

vocabularyDao

protected ITermVocabularyDao vocabularyDao

definedTermDao

protected IDefinedTermDao definedTermDao

statisticalMeasurementValueDao

protected IStatisticalMeasurementValueDao statisticalMeasurementValueDao
Constructor Detail

DescriptionServiceImpl

public DescriptionServiceImpl()
Method Detail

setFeatureTreeDao

@Autowired
protected void setFeatureTreeDao(IFeatureTreeDao featureTreeDao)

setFeatureNodeDao

@Autowired
protected void setFeatureNodeDao(IFeatureNodeDao featureNodeDao)

setFeatureDao

@Autowired
protected void setFeatureDao(IFeatureDao featureDao)

setVocabularyDao

@Autowired
protected void setVocabularyDao(ITermVocabularyDao vocabularyDao)

setDefinedTermDao

@Autowired
protected void setDefinedTermDao(IDefinedTermDao definedTermDao)

statisticalMeasurementValueDao

@Autowired
protected void statisticalMeasurementValueDao(IStatisticalMeasurementValueDao statisticalMeasurementValueDao)

setDescriptionElementDao

@Autowired
protected void setDescriptionElementDao(IDescriptionElementDao descriptionElementDao)

setNaturalLanguageGenerator

@Autowired
protected void setNaturalLanguageGenerator(NaturalLanguageGenerator naturalLanguageGenerator)

updateTitleCache

@Transactional(readOnly=false)
public void updateTitleCache(Class<? extends DescriptionBase> clazz,
                                           Integer stepSize,
                                           IIdentifiableEntityCacheStrategy<DescriptionBase> cacheStrategy,
                                           IProgressMonitor monitor)
Description copied from interface: IIdentifiableEntityService
(Re-)generate the title caches for all objects of this concrete IdentifiableEntity class

Specified by:
updateTitleCache in interface IIdentifiableEntityService<DescriptionBase>
Parameters:
clazz - class of objects to be updated
stepSize - number of objects loaded per step. If null use default.
cacheStrategy - cachestrategy used for title cache. If null use default.
monitor - progress monitor. If null use default.

getDefaultFeatureVocabulary

public TermVocabulary<Feature> getDefaultFeatureVocabulary()
Specified by:
getDefaultFeatureVocabulary in interface IDescriptionService
Returns:

setDao

@Autowired
protected void setDao(IDescriptionDao dao)
Specified by:
setDao in class ServiceBase<DescriptionBase,IDescriptionDao>

count

public int count(Class<? extends DescriptionBase> type,
                 Boolean hasImages,
                 Boolean hasText,
                 Set<Feature> feature)
Description copied from interface: IDescriptionService
Count the descriptions of type , filtered using the following parameters

Specified by:
count in interface IDescriptionService
Parameters:
type - The type of description returned (Taxon, TaxonName, or Specimen)
hasText - Restrict the description to those that do (true) or don't (false) contain TextData elements that have some textual content (can be null)
feature - Restrict the description to those elements which are scoped by one of the Features passed (can be null or empty)
Returns:
a count of DescriptionBase instances

getDescriptionElements

public Pager<DescriptionElementBase> getDescriptionElements(DescriptionBase description,
                                                            Set<Feature> features,
                                                            Class<? extends DescriptionElementBase> type,
                                                            Integer pageSize,
                                                            Integer pageNumber,
                                                            List<String> propertyPaths)
FIXME Candidate for harmonization rename -> getElements

Specified by:
getDescriptionElements in interface IDescriptionService
Parameters:
description - The description which these description elements belong to (can be null to count all description elements)
features - Restrict the results to those description elements which are scoped by one of the Features passed (can be null or empty)
type - The type of description
pageSize - The maximum number of description elements returned (can be null for all description elements)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a Pager containing DescriptionElementBase instances FIXME candidate for harmonization - rename to pageDescriptionElements

listDescriptionElements

public List<DescriptionElementBase> listDescriptionElements(DescriptionBase description,
                                                            Set<Feature> features,
                                                            Class<? extends DescriptionElementBase> type,
                                                            Integer pageSize,
                                                            Integer pageNumber,
                                                            List<String> propertyPaths)
Description copied from interface: IDescriptionService
Returns description elements of type , belonging to a given description, optionally filtered by one or more features

Specified by:
listDescriptionElements in interface IDescriptionService
Parameters:
description - The description which these description elements belong to (can be null to count all description elements)
features - Restrict the results to those description elements which are scoped by one of the Features passed (can be null or empty)
type - The type of description
pageSize - The maximum number of description elements returned (can be null for all description elements)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a List containing DescriptionElementBase instances

getDescriptionElementAnnotations

public Pager<Annotation> getDescriptionElementAnnotations(DescriptionElementBase annotatedObj,
                                                          MarkerType status,
                                                          Integer pageSize,
                                                          Integer pageNumber,
                                                          List<OrderHint> orderHints,
                                                          List<String> propertyPaths)
Description copied from interface: IDescriptionService
Return a Pager containing Annotation entities belonging to the DescriptionElementBase instance supplied, optionally filtered by MarkerType

Specified by:
getDescriptionElementAnnotations in interface IDescriptionService
Parameters:
annotatedObj - The object that "owns" the annotations returned
status - Only return annotations which are marked with a Marker of this type (can be null to return all annotations)
pageSize - The maximum number of terms returned (can be null for all annotations)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager of Annotation entities

getMedia

public Pager<Media> getMedia(DescriptionElementBase descriptionElement,
                             Integer pageSize,
                             Integer pageNumber,
                             List<String> propertyPaths)
Description copied from interface: IDescriptionService
Returns a List of Media that are associated with a given description element

Specified by:
getMedia in interface IDescriptionService
Parameters:
descriptionElement - the description element associated with these media
pageSize - The maximum number of media returned (can be null for all related media)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager containing media instances FIXME candidate for harmonization - rename to pageMedia

pageTaxonDescriptions

public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon,
                                                     Set<Scope> scopes,
                                                     Set<NamedArea> geographicalScope,
                                                     Integer pageSize,
                                                     Integer pageNumber,
                                                     List<String> propertyPaths)
Description copied from interface: IDescriptionService
Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method

Specified by:
pageTaxonDescriptions in interface IDescriptionService
Parameters:
taxon - The taxon which the description refers to (can be null for all TaxonDescription instances)
scopes - Restrict the results to those descriptions which are scoped by one of the Scope instances passed (can be null or empty)
geographicalScope - Restrict the results to those descriptions which have a geographical scope that overlaps with the NamedArea instances passed (can be null or empty)
pageSize - The maximum number of descriptions returned (can be null for all descriptions)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a Pager containing TaxonDescription instances
See Also:
#pageMarkedTaxonDescriptions(Taxon, Set, Set, Set, Integer, Integer, List)

listTaxonDescriptions

public List<TaxonDescription> listTaxonDescriptions(Taxon taxon,
                                                    Set<Scope> scopes,
                                                    Set<NamedArea> geographicalScope,
                                                    Integer pageSize,
                                                    Integer pageNumber,
                                                    List<String> propertyPaths)
Specified by:
listTaxonDescriptions in interface IDescriptionService
Returns:
See Also:
#pageTaxonDescriptions(Taxon, Set, Set, Integer, Integer, List)}

pageTaxonDescriptions

public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon,
                                                     Set<Scope> scopes,
                                                     Set<NamedArea> geographicalScope,
                                                     Set<MarkerType> markerTypes,
                                                     Integer pageSize,
                                                     Integer pageNumber,
                                                     List<String> propertyPaths)
Description copied from interface: IDescriptionService
Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method

Specified by:
pageTaxonDescriptions in interface IDescriptionService
Parameters:
taxon - The taxon which the description refers to (can be null for all TaxonDescription instances)
scopes - Restrict the results to those descriptions which are scoped by one of the Scope instances passed (can be null or empty)
geographicalScope - Restrict the results to those descriptions which have a geographical scope that overlaps with the NamedArea instances passed (can be null or empty)
pageSize - The maximum number of descriptions returned (can be null for all descriptions)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a Pager containing TaxonDescription instances

listTaxonDescriptions

public List<TaxonDescription> listTaxonDescriptions(Taxon taxon,
                                                    Set<Scope> scopes,
                                                    Set<NamedArea> geographicalScope,
                                                    Set<MarkerType> markerTypes,
                                                    Integer pageSize,
                                                    Integer pageNumber,
                                                    List<String> propertyPaths)
Specified by:
listTaxonDescriptions in interface IDescriptionService
Returns:
See Also:
#pageMarkedTaxonDescriptions(Taxon, Set, Set, Set, Integer, Integer, List)}

listTaxonDescriptionMedia

public List<Media> listTaxonDescriptionMedia(UUID taxonUuid,
                                             boolean limitToGalleries,
                                             Set<MarkerType> markerTypes,
                                             Integer pageSize,
                                             Integer pageNumber,
                                             List<String> propertyPaths)
Description copied from interface: IDescriptionService
Returns all Media attached to a taxon via TaxonDescription.elements.media.

Specified by:
listTaxonDescriptionMedia in interface IDescriptionService
Parameters:
taxonUuid - the taxons uuid, if null media for all taxa are returned
limitToGalleries - if true only media in TaxonDescriptions with imageGallery flag=true are returned
markerTypes - only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:

countTaxonDescriptionMedia

public int countTaxonDescriptionMedia(UUID taxonUuid,
                                      boolean limitToGalleries,
                                      Set<MarkerType> markerTypes)
Description copied from interface: IDescriptionService
Returns count for all Media attached to a taxon via TaxonDescription.elements.media.

Specified by:
countTaxonDescriptionMedia in interface IDescriptionService
Parameters:
taxonUuid - the taxons uuid, if null media for all taxa are returned
limitToGalleries - if true only media in TaxonDescriptions with imageGallery flag=true are returned
markerTypes - only media for TaxonDescriptions with marker of type markerType and marker.flag=true are returned, one matching marker type is sufficient
Returns:

getOrderedDistributions

public DistributionTree getOrderedDistributions(Set<TaxonDescription> taxonDescriptions,
                                                Set<NamedAreaLevel> omitLevels,
                                                List<String> propertyPaths)
Specified by:
getOrderedDistributions in interface IDescriptionService

getTaxonNameDescriptions

public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonNameBase name,
                                                            Integer pageSize,
                                                            Integer pageNumber,
                                                            List<String> propertyPaths)
Description copied from interface: IDescriptionService
Returns a List of TaxonNameDescription instances, optionally filtered by the name which they refer to

Specified by:
getTaxonNameDescriptions in interface IDescriptionService
Parameters:
name - Restrict the results to those descriptions that refer to a specific name (can be null for all TaxonNameDescription instances)
pageSize - The maximum number of descriptions returned (can be null for all descriptions)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a Pager containing TaxonNameBase instances FIXME candidate for harmonization - rename to pageTaxonNameDescriptions

page

public Pager<DescriptionBase> page(Class<? extends DescriptionBase> type,
                                   Boolean hasImages,
                                   Boolean hasText,
                                   Set<Feature> feature,
                                   Integer pageSize,
                                   Integer pageNumber,
                                   List<OrderHint> orderHints,
                                   List<String> propertyPaths)
Description copied from interface: IDescriptionService
List the descriptions of type , filtered using the following parameters

Specified by:
page in interface IDescriptionService
Parameters:
type - The type of description returned (Taxon, TaxonName, or Specimen)
hasImages - Restrict the description to those that do (true) or don't (false) contain elements that have one or more media (can be null)
hasText - Restrict the description to those that do (true) or don't (false) contain TextData elements that have some textual content (can be null)
feature - Restrict the description to those elements which are scoped by one of the Features passed (can be null or empty)
pageSize - The maximum number of descriptions returned (can be null for all descriptions)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a Pager containing DescriptionBase instances

searchDescriptionByDistribution

public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas,
                                                               PresenceAbsenceTermBase presence,
                                                               Integer pageSize,
                                                               Integer pageNumber,
                                                               List<OrderHint> orderHints,
                                                               List<String> propertyPaths)
FIXME Candidate for harmonization Rename: searchByDistribution

Specified by:
searchDescriptionByDistribution in interface IDescriptionService
Parameters:
namedAreas - The set of NamedArea instances
presence - Restrict the descriptions to those which have Distribution elements are of this status (can be null)
pageSize - The maximum number of descriptions returned (can be null for all descriptions)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a Pager containing TaxonDescription instances

searchElements

public Pager<DescriptionElementBase> searchElements(Class<? extends DescriptionElementBase> clazz,
                                                    String queryString,
                                                    Integer pageSize,
                                                    Integer pageNumber,
                                                    List<OrderHint> orderHints,
                                                    List<String> propertyPaths)
FIXME Candidate for harmonization move: descriptionElementService.search

Specified by:
searchElements in interface IDescriptionService
Parameters:
clazz - filter the results by class (or pass null to return all DescriptionElementBase instances)
pageSize - The maximum number of descriptionElements returned (can be null for all matching descriptionElements)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - Supports path like orderHints.propertyNames which include *-to-one properties like createdBy.username or authorTeam.persistentTitleCache
propertyPaths - properties to be initialized
Returns:
a Pager DescriptionElementBase instances
See Also:
Apache Lucene - Query Parser Syntax

getDescriptionElementByUuid

public DescriptionElementBase getDescriptionElementByUuid(UUID uuid)
FIXME Candidate for harmonization descriptionElementService.find

Specified by:
getDescriptionElementByUuid in interface IDescriptionService
Parameters:
uuid - the uuid of the DescriptionElement of interest
Returns:
a DescriptionElement, or null if the DescriptionElement does not exist

loadDescriptionElement

public DescriptionElementBase loadDescriptionElement(UUID uuid,
                                                     List<String> propertyPaths)
FIXME Candidate for harmonization descriptionElementService.load

Specified by:
loadDescriptionElement in interface IDescriptionService
Parameters:
uuid - the uuid of the DescriptionElement of interest
Returns:
a DescriptionElement, or null if the DescriptionElement does not exist

saveDescriptionElement

@Transactional(readOnly=false)
public UUID saveDescriptionElement(DescriptionElementBase descriptionElement)
FIXME Candidate for harmonization descriptionElementService.save

Specified by:
saveDescriptionElement in interface IDescriptionService
Returns:

saveDescriptionElement

@Transactional(readOnly=false)
public Map<UUID,DescriptionElementBase> saveDescriptionElement(Collection<DescriptionElementBase> descriptionElements)
FIXME Candidate for harmonization descriptionElementService.save

Specified by:
saveDescriptionElement in interface IDescriptionService
Returns:

deleteDescriptionElement

public UUID deleteDescriptionElement(DescriptionElementBase descriptionElement)
FIXME Candidate for harmonization descriptionElementService.delete

Specified by:
deleteDescriptionElement in interface IDescriptionService
Parameters:
descriptionElement - the description element to be deleted
Returns:
the unique identifier of the deleted entity

getFeatureVocabulary

public TermVocabulary<Feature> getFeatureVocabulary(UUID uuid)
Specified by:
getFeatureVocabulary in interface IDescriptionService

getDescriptionElementsForTaxon

public <T extends DescriptionElementBase> List<T> getDescriptionElementsForTaxon(Taxon taxon,
                                                                                 Set<Feature> features,
                                                                                 Class<T> type,
                                                                                 Integer pageSize,
                                                                                 Integer pageNumber,
                                                                                 List<String> propertyPaths)
FIXME Candidate for harmonization descriptionElementService.listDescriptionElementsForTaxon

Specified by:
getDescriptionElementsForTaxon in interface IDescriptionService

generateNaturalLanguageDescription

public String generateNaturalLanguageDescription(FeatureTree featureTree,
                                                 TaxonDescription description,
                                                 List<Language> preferredLanguages,
                                                 String separator)
Description copied from interface: IDescriptionService
Generate a string representation of the structured description supplied in natural language The featureTree will be used to structure the NaturalLanguageDescription. This method does not require a initialization strategy so there is no propertyPaths parameter.

Specified by:
generateNaturalLanguageDescription in interface IDescriptionService
Returns:

hasStructuredData

public boolean hasStructuredData(DescriptionBase<?> description)
Description copied from interface: IDescriptionService
Preliminary method to test whether a description contains structured data.

Specified by:
hasStructuredData in interface IDescriptionService
Returns:

moveDescriptionElementsToDescription

public void moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements,
                                                 DescriptionBase targetDescription,
                                                 boolean isCopy)
Description copied from interface: IDescriptionService
Add the collection of description elements to the targetDescription. Remove the description elements from the description they are currently associated with.

Specified by:
moveDescriptionElementsToDescription in interface IDescriptionService
isCopy - if true, the elements are only copied (cloned) and not removed from the old description

aggregateDistributions

public void aggregateDistributions(List<NamedArea> superAreas,
                                   Rank lowerRank,
                                   Rank upperRank)


Copyright © 2007-2013 EDIT. All Rights Reserved.