eu.etaxonomy.cdm.api.service
Interface ITaxonService

All Superinterfaces:
IAnnotatableService<TaxonBase>, IIdentifiableEntityService<TaxonBase>, IService<TaxonBase>, IVersionableService<TaxonBase>
All Known Implementing Classes:
TaxonServiceImpl

public interface ITaxonService
extends IIdentifiableEntityService<TaxonBase>


Method Summary
 void changeHomotypicalGroupOfSynonym(Synonym synonym, HomotypicalGroup newHomotypicalGroup, Taxon targetTaxon, boolean removeFromOtherTaxa, boolean setBasionymRelationIfApplicable)
          Changes the homotypic group of a synonym into the new homotypic group.
 Taxon changeSynonymToAcceptedTaxon(Synonym synonym, Taxon acceptedTaxon, boolean deleteSynonym, boolean copyCitationInfo, Reference citation, String microCitation)
          Changes a synonym into an accepted taxon and removes the synonym relationship to the given accepted taxon.
 Taxon changeSynonymToRelatedTaxon(Synonym synonym, Taxon toTaxon, TaxonRelationshipType taxonRelationshipType, Reference reference, String microReference)
          TODO still needed and correct? Change a synonym into a related concept
 int countAllRelationships()
           
 List<Synonym> createAllInferredSynonyms(Taxon taxon, Classification tree, boolean doWithMisappliedNames)
          Creates all inferred synonyms for the taxon in the classification, but do not insert it to the database
 List<Synonym> createInferredSynonyms(Taxon taxon, Classification tree, SynonymRelationshipType type, boolean doWithMisappliedNames)
          Creates the specified inferred synonyms for the taxon in the classification, but do not insert it to the database
 void deleteSynonym(Synonym synonym, Taxon taxon, boolean removeNameIfPossible, boolean newHomotypicGroupIfNeeded)
          Removes a synonym.

In detail it removes all synonym relationship to the given taxon or to all taxa if taxon is null the synonym concept if it is not referenced by any synonym relationship anymore

If removeNameIfPossible is true it also removes the synonym name if it is not used in any other context (part of a concept, in DescriptionElementSource, part of a name relationship, used inline, ...)

If newHomotypicGroupIfNeeded is true and the synonym name is not deleted and the name is homotypic to the taxon the name is moved to a new homotypical group.

If synonym is null the method has no effect.
 long deleteSynonymRelationships(Synonym syn)
           
 long deleteSynonymRelationships(Synonym syn, Taxon taxon)
          Deletes all synonym relationships of a given synonym.
 void deleteTaxon(Taxon taxon, TaxonDeletionConfigurator config)
          Deletes a taxon from the underlying database according to the given configurator.
 Synonym findBestMatchingSynonym(String taxonName)
           
 Taxon findBestMatchingTaxon(MatchingTaxonConfigurator config)
           
 Taxon findBestMatchingTaxon(String taxonName)
           
 Pager<SearchResult<TaxonBase>> findByDescriptionElementFullText(Class<? extends DescriptionElementBase> clazz, String queryString, Classification classification, List<Feature> features, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          This is an experimental feature, it may be moved, modified, or even removed in future releases!!!
 Pager<SearchResult<TaxonBase>> findByEverythingFullText(String queryString, Classification classification, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
           
 Pager<SearchResult<TaxonBase>> findByFullText(Class<? extends TaxonBase> clazz, String queryString, Classification classification, List<Language> languages, boolean highlightFragments, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
           
 List<TaxonNameBase> findIdenticalTaxonNameIds(List<String> propertyPath)
           
 List<TaxonNameBase> findIdenticalTaxonNames(List<String> propertyPath)
           
 Pager<IdentifiableEntity> findTaxaAndNames(IFindTaxaAndNamesConfigurator configurator)
          Returns a list of IdentifiableEntity instances (in particular, TaxonNameBase and TaxonBase instances) that match the properties specified in the configurator.
 List<UuidAndTitleCache<TaxonBase>> findTaxaAndNamesForEditor(IFindTaxaAndNamesConfigurator configurator)
           
 List<TaxonBase> findTaxaByID(Set<Integer> listOfIDs)
           
 Pager<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber)
          Returns a list of TaxonBase instances where the taxon.name properties match the parameters passed.
 TaxonBase findTaxonByUuid(UUID uuid, List<String> propertyPaths)
          Returns the TaxonBase with the given UUID using the given match mode and initialization strategy
 List<MediaRepresentation> getAllMedia(Taxon taxon, int size, int height, int widthOrDuration, String[] mimeTypes)
          Deprecated. use #listMedia(Taxon, Set, boolean, boolean, List) instead
 List<RelationshipBase> getAllRelationships(int limit, int start)
          Computes all relationships.
 List<Synonym> getAllSynonyms(int limit, int start)
          Computes all taxon bases.
 List<Taxon> getAllTaxa(int limit, int start)
          Computes all taxon bases.
 List<List<Synonym>> getHeterotypicSynonymyGroups(Taxon taxon, List<String> propertyPaths)
          Returns the ordered list of all homotypical groups that contain synonyms that are heterotypic to the given taxon.
 List<Synonym> getHomotypicSynonymsByHomotypicGroup(Taxon taxon, List<String> propertyPaths)
          Returns the list of all synonyms that share the same homotypical group with the given taxon.
 String getPhylumName(TaxonNameBase name)
           
 List<Taxon> getRootTaxa(Rank rank, Reference sec, boolean onlyWithChildren, boolean withMisapplications, List<String> propertyPaths)
          Deprecated. obsolete when using classification
 List<Taxon> getRootTaxa(Reference sec, CdmFetch cdmFetch, boolean onlyWithChildren)
          Deprecated. obsolete when using classification
 Pager<SynonymRelationship> getSynonyms(Synonym synonym, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns the SynonymRelationships (of where relationship.type == type, if this argument is supplied) where the supplied synonym is relatedFrom.
 Pager<SynonymRelationship> getSynonyms(Taxon taxon, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns the SynonymRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon is relatedTo.
 OrderedTermVocabulary<TaxonRelationshipType> getTaxonRelationshipTypeVocabulary()
          Deprecated. use TermService#getVocabulary(VocabularyType) instead
 List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheSynonym()
           
 List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheTaxon()
           
 List<Classification> listClassifications(TaxonBase taxonBase, Integer limit, Integer start, List<String> propertyPaths)
          lists all accepted taxa for the given Synonym
 List<TaxonRelationship> listFromTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon is relatedFrom.
 List<Media> listMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, Boolean limitToGalleries, Boolean includeTaxonDescriptions, Boolean includeOccurrences, Boolean includeTaxonNameDescriptions, List<String> propertyPath)
          Lists all Media found in an any TaxonDescription, NameDescription, SpecimenOrObservationBase, DnaSample Chromatograms, etc.
 Set<Taxon> listRelatedTaxa(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, Integer maxDepth, Integer limit, Integer start, List<String> propertyPaths)
          lists all taxa which are related to the taxon given as parameter.
 List<SynonymRelationship> listSynonymRelationships(TaxonBase taxonBase, SynonymRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths, RelationshipBase.Direction direction)
          Returns the SynonymRelationships (of where relationship.type == type, if this argument is supplied) depending on direction, where the supplied taxon is relatedTo or the supplied synonym is relatedFrom.
 List<TaxonBase> listTaxaByName(Class<? extends TaxonBase> clazz, String uninomial, String infragenericEpithet, String specificEpithet, String infraspecificEpithet, Rank rank, Integer pageSize, Integer pageNumber)
          Returns a list of TaxonBase instances where the taxon.name properties match the parameters passed.
 List<Media> listTaxonDescriptionMedia(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships, boolean limitToGalleries, List<String> propertyPath)
          Deprecated. use #listMedia(Taxon, Set, boolean, boolean, List) instead
 List<TaxonRelationship> listToTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon is relatedTo.
 SynonymRelationship moveSynonymToAnotherTaxon(SynonymRelationship oldSynonymRelation, Taxon newTaxon, boolean moveHomotypicGroup, SynonymRelationshipType newSynonymRelationshipType, Reference newReference, String newReferenceDetail, boolean keepReference)
          Moves a synonym to another taxon and removes the old synonym relationship.
 Pager<TaxonRelationship> pageFromTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon is relatedFrom.
 Pager<TaxonRelationship> pageToTaxonRelationships(Taxon taxon, TaxonRelationshipType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns the TaxonRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied taxon is relatedTo.
 Pager<TaxonBase> search(Class<? extends TaxonBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns a Paged List of TaxonBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)
 List<TaxonBase> searchTaxaByName(String name, Reference sec)
          Returns a list of taxa that matches the name string and the sec reference
 void swapSynonymAndAcceptedTaxon(Synonym synonym, Taxon acceptedTaxon)
          Swaps given synonym and accepted taxon.
 
Methods inherited from interface eu.etaxonomy.cdm.api.service.IIdentifiableEntityService
countByTitle, countByTitle, deduplicate, find, findByTitle, findByTitle, findTitleCache, getRights, getSourcedObjectByIdInSource, getSources, getUuidAndTitleCache, listByReferenceTitle, listByTitle, replace, updateTitleCache, 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
 

Method Detail

getAllSynonyms

List<Synonym> getAllSynonyms(int limit,
                             int start)
Computes all taxon bases.

Parameters:
limit -
start -
Returns:
FIXME could substitute with list(Synonym.class, limit, start)

getAllTaxa

List<Taxon> getAllTaxa(int limit,
                       int start)
Computes all taxon bases.

Parameters:
limit -
start -
Returns:
FIXME could substitute with list(Taxon.class, limit,start)

getRootTaxa

@Deprecated
List<Taxon> getRootTaxa(Reference sec,
                                   CdmFetch cdmFetch,
                                   boolean onlyWithChildren)
Deprecated. obsolete when using classification

Computes all Taxon instances that do not have a taxonomic parent.

Parameters:
sec - The concept reference that the taxon belongs to
onlyWithChildren - if true only taxa are returned that have taxonomic children.
Default: true.
Returns:
The List of root taxa.

getRootTaxa

@Deprecated
List<Taxon> getRootTaxa(Rank rank,
                                   Reference sec,
                                   boolean onlyWithChildren,
                                   boolean withMisapplications,
                                   List<String> propertyPaths)
Deprecated. obsolete when using classification

Computes all Taxon instances which name is of a certain Rank.

Parameters:
rank - The rank of the taxon name
sec - The concept reference that the taxon belongs to
onlyWithChildren - if true only taxa are returned that have taxonomic children.
Default: true.
withMisapplications - if false taxa that have at least one misapplied name relationship in which they are the misapplied name are not returned.
Default: true.
propertyPaths - properties to be initialized, For detailed description and examples please refer to: IBeanInitializer.initialize(Object, List).
Default: true.
Returns:
The List of root taxa.

getAllRelationships

List<RelationshipBase> getAllRelationships(int limit,
                                           int start)
Computes all relationships.

Parameters:
limit -
start -
Returns:
FIXME candidate for harmonization - rename to listRelationships

getTaxonRelationshipTypeVocabulary

@Deprecated
OrderedTermVocabulary<TaxonRelationshipType> getTaxonRelationshipTypeVocabulary()
Deprecated. use TermService#getVocabulary(VocabularyType) instead

Returns TaxonRelationshipType vocabulary

Returns:

searchTaxaByName

List<TaxonBase> searchTaxaByName(String name,
                                 Reference sec)
Returns a list of taxa that matches the name string and the sec reference

Parameters:
name - the name string to search for
sec - the taxons sec reference
Returns:
a list of taxa matching the name and the sec reference

swapSynonymAndAcceptedTaxon

void swapSynonymAndAcceptedTaxon(Synonym synonym,
                                 Taxon acceptedTaxon)
Swaps given synonym and accepted taxon. In particular:

Parameters:
synonym -
acceptedTaxon -
synonymRelationshipType - the relationship type the newly created synonym will have. Defaults to SYNONYM_OF

changeSynonymToAcceptedTaxon

Taxon changeSynonymToAcceptedTaxon(Synonym synonym,
                                   Taxon acceptedTaxon,
                                   boolean deleteSynonym,
                                   boolean copyCitationInfo,
                                   Reference citation,
                                   String microCitation)
                                   throws HomotypicalGroupChangeException
Changes a synonym into an accepted taxon and removes the synonym relationship to the given accepted taxon. Other synonyms homotypic to the synonym to change are moved to the same new accepted taxon as homotypic synonyms. The new accepted taxon has the same name and the same sec reference as the old synonym.
If the given accepted taxon and the synonym are homotypic to each other an exception may be thrown as taxonomically it doesn't make sense to have two accepted taxa in the same homotypic group but also it is than difficult to decide how to handle other names in the homotypic group. It is up to the implementing class to handle this situation via an exception or in another way. TODO Open issue: does the old synonym need to be deleted from the database?

Parameters:
synonym - the synonym to change into an accepted taxon
acceptedTaxon - an accepted taxon, the synonym had a relationship to
deleteSynonym - if true the method tries to delete the old synonym from the database
copyCitationInfo - if true the citation and the microcitation of newly created synonyms is taken from the old synonym relationships.
citation - if given this citation is added to the newly created synonym relationships as citation. Only used if copyCitationInfo is false
microCitation - if given this microCitation is added to the newly created synonym relationships as microCitation.Only used if copyCitationInfo is false
Returns:
the newly created accepted taxon
Throws:
IllegalArgumentException - if the given accepted taxon and the synonym are homotypic to each other an exception may be thrown as taxonomically it doesn't make sense to have two accepted taxa in the same homotypic group but also it is than difficult to decide how to handle other names in the homotypic group. It is up to the implementing class to handle this situation via an exception or in another way.
HomotypicalGroupChangeException

changeSynonymToRelatedTaxon

Taxon changeSynonymToRelatedTaxon(Synonym synonym,
                                  Taxon toTaxon,
                                  TaxonRelationshipType taxonRelationshipType,
                                  Reference reference,
                                  String microReference)
TODO still needed and correct? Change a synonym into a related concept

Parameters:
synonym - the synonym to change into the concept taxon
toTaxon - the taxon the newly created concept should be related to
taxonRelationshipType - the type of relationship
reference -
microReference -
Returns:
the newly created concept

deleteSynonymRelationships

long deleteSynonymRelationships(Synonym syn,
                                Taxon taxon)
Deletes all synonym relationships of a given synonym. If taxon is given only those relationships to the taxon are deleted.

Parameters:
syn - the synonym
taxon -
Returns:

deleteTaxon

void deleteTaxon(Taxon taxon,
                 TaxonDeletionConfigurator config)
                 throws ReferencedObjectUndeletableException
Deletes a taxon from the underlying database according to the given configurator.

Parameters:
taxon -
config -
Throws:
ReferencedObjectUndeletableException

changeHomotypicalGroupOfSynonym

void changeHomotypicalGroupOfSynonym(Synonym synonym,
                                     HomotypicalGroup newHomotypicalGroup,
                                     Taxon targetTaxon,
                                     boolean removeFromOtherTaxa,
                                     boolean setBasionymRelationIfApplicable)
Changes the homotypic group of a synonym into the new homotypic group. All relations to taxa are updated correctly depending on the homotypic group of the accepted taxon.
All existing basionym relationships to and from this name are removed.
If the parameter targetTaxon is defined, the synonym is added to this taxon irrespctive of if it has been related to this taxon before.
If removeFromOtherTaxa is true and targetTaxon is defined all relationships to other taxa are deleted.
If setBasionymRelationIfApplicable is true a basionym relationship between the existing basionym(s) of the new homotypic group and the synonyms name is added.

Parameters:
synonym -
newHomotypicalGroup -
taxon -
setBasionymRelationIfApplicable -

moveSynonymToAnotherTaxon

SynonymRelationship moveSynonymToAnotherTaxon(SynonymRelationship oldSynonymRelation,
                                              Taxon newTaxon,
                                              boolean moveHomotypicGroup,
                                              SynonymRelationshipType newSynonymRelationshipType,
                                              Reference newReference,
                                              String newReferenceDetail,
                                              boolean keepReference)
                                              throws HomotypicalGroupChangeException
Moves a synonym to another taxon and removes the old synonym relationship.

Parameters:
oldSynonymRelation - the old synonym relationship defining the synonym to move and the old accepted taxon.
newTaxon - the taxon the synonym will be moved to
moveHomotypicGroup - if the synonym belongs to a homotypical group with other synonyms and moveHomotypicGroup is true all these synonyms are moved to the new taxon, if false a HomotypicalGroupChangeException is thrown. MoveHomotypicGroup has no effect if the synonym is the only synonym in it's homotypic group.
newSynonymRelationshipType - the synonym relationship type of the new synonym relations. Default is heterotypic.
newReference - The reference for the new synonym relation(s).
newReferenceDetail - The reference detail for the new synonym relation(s).
keepReference - if no newReference and/or no newReferenceDetail is defined they are taken from the old synonym relation(s) if keepReference is true. If false the reference and the reference detail will be taken only from the newReference and newReferenceDetail.
Returns:
The new synonym relationship. If moveHomotypicGroup is true additionally created new synonym relationships must be retrieved separately from the new taxon.
Throws:
HomotypicalGroupChangeException - Exception is thrown if (1) synonym is homotypic to the old accepted taxon or (2) synonym is in homotypic group with other synonyms and moveHomotypicGroup is false

listToTaxonRelationships

List<TaxonRelationship> listToTaxonRelationships(Taxon taxon,
                                                 TaxonRelationshipType type,
                                                 Integer pageSize,
                                                 Integer pageNumber,
                                                 List<OrderHint> orderHints,
                                                 List<String> propertyPaths)
Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon is relatedTo.

Parameters:
taxon - The taxon that is relatedTo
type - The type of TaxonRelationship (can be null)
pageSize - The maximum number of relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - Properties to order by
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a List of TaxonRelationship instances

pageToTaxonRelationships

Pager<TaxonRelationship> pageToTaxonRelationships(Taxon taxon,
                                                  TaxonRelationshipType type,
                                                  Integer pageSize,
                                                  Integer pageNumber,
                                                  List<OrderHint> orderHints,
                                                  List<String> propertyPaths)
Returns the TaxonRelationships (of where relationship.type == type, if this arguement is supplied) where the supplied taxon is relatedTo.

Parameters:
taxon - The taxon that is relatedTo
type - The type of TaxonRelationship (can be null)
pageSize - The maximum number of relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - Properties to order by
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a Pager of TaxonRelationship instances

listFromTaxonRelationships

List<TaxonRelationship> listFromTaxonRelationships(Taxon taxon,
                                                   TaxonRelationshipType type,
                                                   Integer pageSize,
                                                   Integer pageNumber,
                                                   List<OrderHint> orderHints,
                                                   List<String> propertyPaths)
Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon is relatedFrom.

Parameters:
taxon - The taxon that is relatedFrom
type - The type of TaxonRelationship (can be null)
pageSize - The maximum number of relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - Properties to order by
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a List of TaxonRelationship instances

pageFromTaxonRelationships

Pager<TaxonRelationship> pageFromTaxonRelationships(Taxon taxon,
                                                    TaxonRelationshipType type,
                                                    Integer pageSize,
                                                    Integer pageNumber,
                                                    List<OrderHint> orderHints,
                                                    List<String> propertyPaths)
Returns the TaxonRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon is relatedFrom.

Parameters:
taxon - The taxon that is relatedFrom
type - The type of TaxonRelationship (can be null)
pageSize - The maximum number of relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - Properties to order by
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a Pager of TaxonRelationship instances

listRelatedTaxa

Set<Taxon> listRelatedTaxa(Taxon taxon,
                           Set<TaxonRelationshipEdge> includeRelationships,
                           Integer maxDepth,
                           Integer limit,
                           Integer start,
                           List<String> propertyPaths)
lists all taxa which are related to the taxon given as parameter.

Parameters:
taxon -
includeRelationships -
maxDepth - 1 for one level, null for infinite depth, 0 will completely omit collecting related taxa.
limit -
start -
propertyPaths -
Returns:

listClassifications

List<Classification> listClassifications(TaxonBase taxonBase,
                                         Integer limit,
                                         Integer start,
                                         List<String> propertyPaths)
lists all accepted taxa for the given Synonym

Parameters:
taxonBase -
limit -
start -
propertyPaths -
Returns:

getSynonyms

Pager<SynonymRelationship> getSynonyms(Synonym synonym,
                                       SynonymRelationshipType type,
                                       Integer pageSize,
                                       Integer pageNumber,
                                       List<OrderHint> orderHints,
                                       List<String> propertyPaths)
Returns the SynonymRelationships (of where relationship.type == type, if this argument is supplied) where the supplied synonym is relatedFrom.

Parameters:
taxon - The synonym that is relatedFrom
type - The type of SynonymRelationship (can be null)
pageSize - The maximum number of relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based) * @param orderHints Properties to order by
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a Pager of SynonymRelationship instances

getSynonyms

Pager<SynonymRelationship> getSynonyms(Taxon taxon,
                                       SynonymRelationshipType type,
                                       Integer pageSize,
                                       Integer pageNumber,
                                       List<OrderHint> orderHints,
                                       List<String> propertyPaths)
Returns the SynonymRelationships (of where relationship.type == type, if this argument is supplied) where the supplied taxon is relatedTo.

Parameters:
taxon - The taxon that is relatedTo
type - The type of SynonymRelationship (can be null)
pageSize - The maximum number of relationships returned (can be null for all relationships)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based) * @param orderHints Properties to order by
propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
Returns:
a Pager of SynonymRelationship instances

getHomotypicSynonymsByHomotypicGroup

List<Synonym> getHomotypicSynonymsByHomotypicGroup(Taxon taxon,
                                                   List<String> propertyPaths)
Returns the list of all synonyms that share the same homotypical group with the given taxon. Only those homotypic synonyms are returned that do have a synonym relationship with the accepted taxon.

Parameters:
taxon -
propertyPaths -
Returns:

getHeterotypicSynonymyGroups

List<List<Synonym>> getHeterotypicSynonymyGroups(Taxon taxon,
                                                 List<String> propertyPaths)
Returns the ordered list of all homotypical groups that contain synonyms that are heterotypic to the given taxon. Taxon names of heterotypic synonyms belong to a homotypical group which cannot be the homotypical group to which the taxon name of the given taxon belongs. This method does not return the homotypic group the given taxon belongs to.
This method does neglect the type of synonym relationship that is defined between the given taxon and the synonym. So the synonym relationship may be homotypic however a synonym is returned in one of the result lists as long as the synonym does not belong to the same homotypic group as the given taxon.
The list returned is ordered according to the date of publication of the first published name within each homotypical group.

Parameters:
taxon -
propertyPaths -
Returns:
See Also:
#getHeterotypicSynonymyGroups(), #getSynonyms(), SynonymRelationshipType.HETEROTYPIC_SYNONYM_OF(), HomotypicalGroup

search

Pager<TaxonBase> search(Class<? extends TaxonBase> clazz,
                        String queryString,
                        Integer pageSize,
                        Integer pageNumber,
                        List<OrderHint> orderHints,
                        List<String> propertyPaths)
Returns a Paged List of TaxonBase instances where the default field matches the String queryString (as interpreted by the Lucene QueryParser)

Specified by:
search in interface IIdentifiableEntityService<TaxonBase>
Parameters:
clazz - filter the results by class (or pass null to return all TaxonBase instances)
queryString -
pageSize - The maximum number of taxa returned (can be null for all matching taxa)
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 Taxon instances
See Also:
Apache Lucene - Query Parser Syntax

findTaxaByName

Pager<TaxonBase> findTaxaByName(Class<? extends TaxonBase> clazz,
                                String uninomial,
                                String infragenericEpithet,
                                String specificEpithet,
                                String infraspecificEpithet,
                                Rank rank,
                                Integer pageSize,
                                Integer pageNumber)
Returns a list of TaxonBase instances where the taxon.name properties match the parameters passed. In order to search for any string value, pass '*', passing the string value of null will search for those taxa with a value of null in that field

Parameters:
clazz - optionally filter by class (can be null to return all taxa)
uninomial -
infragenericEpithet -
specificEpithet -
infraspecificEpithet -
rank -
pageSize - The maximum number of taxa returned (can be null for all matching taxa)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
Returns:
a list of TaxonBase instances

listTaxaByName

List<TaxonBase> listTaxaByName(Class<? extends TaxonBase> clazz,
                               String uninomial,
                               String infragenericEpithet,
                               String specificEpithet,
                               String infraspecificEpithet,
                               Rank rank,
                               Integer pageSize,
                               Integer pageNumber)
Returns a list of TaxonBase instances where the taxon.name properties match the parameters passed. In order to search for any string value, pass '*', passing the string value of null will search for those taxa with a value of null in that field

Parameters:
clazz - optionally filter by class
uninomial -
infragenericEpithet -
specificEpithet -
infraspecificEpithet -
rank -
pageSize - The maximum number of taxa returned (can be null for all matching taxa)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
Returns:
a List of TaxonBase instances

findTaxaAndNames

Pager<IdentifiableEntity> findTaxaAndNames(IFindTaxaAndNamesConfigurator configurator)
Returns a list of IdentifiableEntity instances (in particular, TaxonNameBase and TaxonBase instances) that match the properties specified in the configurator.

Parameters:
configurator -
Returns:

findByDescriptionElementFullText

Pager<SearchResult<TaxonBase>> findByDescriptionElementFullText(Class<? extends DescriptionElementBase> clazz,
                                                                String queryString,
                                                                Classification classification,
                                                                List<Feature> features,
                                                                List<Language> languages,
                                                                boolean highlightFragments,
                                                                Integer pageSize,
                                                                Integer pageNumber,
                                                                List<OrderHint> orderHints,
                                                                List<String> propertyPaths)
                                                                throws org.apache.lucene.index.CorruptIndexException,
                                                                       IOException,
                                                                       org.apache.lucene.queryParser.ParseException

This is an experimental feature, it may be moved, modified, or even removed in future releases!!!

Parameters:
clazz -
queryString - the query string to filter by
classification - If a taxonomic classification three is specified here the result set will only contain taxa of the given classification
features - TODO
languages - Search only in these languages. Not all text fields in the cdm model are multilingual, thus this setting will only apply to the multilingiual fields. Other fields are searched nevertheless if this parameter is set or not.
highlightFragments - TODO
pageSize - The maximum number of objects returned (can be null for all objects)
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 initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a paged list of instances of type T matching the queryString
Throws:
IOException
org.apache.lucene.index.CorruptIndexException
org.apache.lucene.queryParser.ParseException

getAllMedia

@Deprecated
List<MediaRepresentation> getAllMedia(Taxon taxon,
                                                 int size,
                                                 int height,
                                                 int widthOrDuration,
                                                 String[] mimeTypes)
Deprecated. use #listMedia(Taxon, Set, boolean, boolean, List) instead

Parameters:
taxon -
size -
height -
widthOrDuration -
mimeTypes -
Returns:

listTaxonDescriptionMedia

@Deprecated
List<Media> listTaxonDescriptionMedia(Taxon taxon,
                                                 Set<TaxonRelationshipEdge> includeRelationships,
                                                 boolean limitToGalleries,
                                                 List<String> propertyPath)
Deprecated. use #listMedia(Taxon, Set, boolean, boolean, List) instead

Lists all Media found in an any TaxonDescription associated with this taxon.

Parameters:
taxon -
includeRelationships - the given list of TaxonRelationshipEdges will be taken into account when retrieving media associated with the given taxon. Can be NULL.
limitToGalleries - whether to take only TaxonDescription into account which are marked as gallery
Returns:

listMedia

List<Media> listMedia(Taxon taxon,
                      Set<TaxonRelationshipEdge> includeRelationships,
                      Boolean limitToGalleries,
                      Boolean includeTaxonDescriptions,
                      Boolean includeOccurrences,
                      Boolean includeTaxonNameDescriptions,
                      List<String> propertyPath)
Lists all Media found in an any TaxonDescription, NameDescription, SpecimenOrObservationBase, DnaSample Chromatograms, etc. associated with this taxon.

Parameters:
taxon -
includeRelationships - the given list of TaxonRelationshipEdges will be taken into account when retrieving media associated with the given taxon. Can be NULL.
limitToGalleries - whether to take only descriptions into account which are marked as gallery, can be NULL
includeTaxonDescriptions - whether to take TaxonDescriptions into account, can be NULL
includeOccurrences - whether to take TaxonDescriptions into account, can be NULL
includeTaxonNameDescriptions - whether to take TaxonNameDescriptions into account, can be NULL
propertyPath -
Returns:

findTaxaByID

List<TaxonBase> findTaxaByID(Set<Integer> listOfIDs)

findTaxonByUuid

TaxonBase findTaxonByUuid(UUID uuid,
                          List<String> propertyPaths)
Returns the TaxonBase with the given UUID using the given match mode and initialization strategy

Parameters:
uuid -
propertyPaths -
Returns:

countAllRelationships

int countAllRelationships()

findIdenticalTaxonNames

List<TaxonNameBase> findIdenticalTaxonNames(List<String> propertyPath)

findIdenticalTaxonNameIds

List<TaxonNameBase> findIdenticalTaxonNameIds(List<String> propertyPath)

getPhylumName

String getPhylumName(TaxonNameBase name)

deleteSynonymRelationships

long deleteSynonymRelationships(Synonym syn)

deleteSynonym

void deleteSynonym(Synonym synonym,
                   Taxon taxon,
                   boolean removeNameIfPossible,
                   boolean newHomotypicGroupIfNeeded)
Removes a synonym.

In detail it removes
  • all synonym relationship to the given taxon or to all taxa if taxon is null
  • the synonym concept if it is not referenced by any synonym relationship anymore


  • If removeNameIfPossible is true it also removes the synonym name if it is not used in any other context (part of a concept, in DescriptionElementSource, part of a name relationship, used inline, ...)

    If newHomotypicGroupIfNeeded is true and the synonym name is not deleted and the name is homotypic to the taxon the name is moved to a new homotypical group.

    If synonym is null the method has no effect.

    Parameters:
    taxon -
    synonym -
    removeNameIfPossible -
    Throws:
    DataChangeNoRollbackException

    listSynonymRelationships

    List<SynonymRelationship> listSynonymRelationships(TaxonBase taxonBase,
                                                       SynonymRelationshipType type,
                                                       Integer pageSize,
                                                       Integer pageNumber,
                                                       List<OrderHint> orderHints,
                                                       List<String> propertyPaths,
                                                       RelationshipBase.Direction direction)
    Returns the SynonymRelationships (of where relationship.type == type, if this argument is supplied) depending on direction, where the supplied taxon is relatedTo or the supplied synonym is relatedFrom.

    Parameters:
    taxonBase - The taxon or synonym that is relatedTo or relatedFrom
    type - The type of SynonymRelationship (can be null)
    pageSize - The maximum number of relationships returned (can be null for all relationships)
    pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
    orderHints - Properties to order by
    propertyPaths - Properties to initialize in the returned entities, following the syntax described in IBeanInitializer.initialize(Object, List)
    direction - The direction of the relationship
    Returns:
    a List of SynonymRelationship instances

    findBestMatchingTaxon

    Taxon findBestMatchingTaxon(String taxonName)
    Parameters:
    tnb -
    Returns:

    findBestMatchingTaxon

    Taxon findBestMatchingTaxon(MatchingTaxonConfigurator config)

    findBestMatchingSynonym

    Synonym findBestMatchingSynonym(String taxonName)

    getUuidAndTitleCacheTaxon

    List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheTaxon()

    getUuidAndTitleCacheSynonym

    List<UuidAndTitleCache<TaxonBase>> getUuidAndTitleCacheSynonym()

    findTaxaAndNamesForEditor

    List<UuidAndTitleCache<TaxonBase>> findTaxaAndNamesForEditor(IFindTaxaAndNamesConfigurator configurator)

    createInferredSynonyms

    List<Synonym> createInferredSynonyms(Taxon taxon,
                                         Classification tree,
                                         SynonymRelationshipType type,
                                         boolean doWithMisappliedNames)
    Creates the specified inferred synonyms for the taxon in the classification, but do not insert it to the database

    Parameters:
    taxon -
    tree -
    Returns:
    list of inferred synonyms

    createAllInferredSynonyms

    List<Synonym> createAllInferredSynonyms(Taxon taxon,
                                            Classification tree,
                                            boolean doWithMisappliedNames)
    Creates all inferred synonyms for the taxon in the classification, but do not insert it to the database

    Parameters:
    taxon -
    tree -
    iDatabase -
    Returns:
    list of inferred synonyms

    findByFullText

    Pager<SearchResult<TaxonBase>> findByFullText(Class<? extends TaxonBase> clazz,
                                                  String queryString,
                                                  Classification classification,
                                                  List<Language> languages,
                                                  boolean highlightFragments,
                                                  Integer pageSize,
                                                  Integer pageNumber,
                                                  List<OrderHint> orderHints,
                                                  List<String> propertyPaths)
                                                  throws org.apache.lucene.index.CorruptIndexException,
                                                         IOException,
                                                         org.apache.lucene.queryParser.ParseException
    Throws:
    org.apache.lucene.index.CorruptIndexException
    IOException
    org.apache.lucene.queryParser.ParseException

    findByEverythingFullText

    Pager<SearchResult<TaxonBase>> findByEverythingFullText(String queryString,
                                                            Classification classification,
                                                            List<Language> languages,
                                                            boolean highlightFragments,
                                                            Integer pageSize,
                                                            Integer pageNumber,
                                                            List<OrderHint> orderHints,
                                                            List<String> propertyPaths)
                                                            throws org.apache.lucene.index.CorruptIndexException,
                                                                   IOException,
                                                                   org.apache.lucene.queryParser.ParseException
    Throws:
    org.apache.lucene.index.CorruptIndexException
    IOException
    org.apache.lucene.queryParser.ParseException


    Copyright © 2007-2013 EDIT. All Rights Reserved.