X-Git-Url: https://dev.e-taxonomy.eu/gitweb/cdmlib.git/blobdiff_plain/1251ffedf90e912fddf37d03b070a3ff252e53b6..4c525123433fbc5a7d36e2445302650bddc39307:/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IClassificationService.java diff --git a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IClassificationService.java b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IClassificationService.java index 205318a7f6..2ce702aee9 100644 --- a/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IClassificationService.java +++ b/cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IClassificationService.java @@ -19,18 +19,18 @@ import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator; import eu.etaxonomy.cdm.api.service.dto.GroupedTaxonDTO; import eu.etaxonomy.cdm.api.service.dto.TaxonInContextDTO; import eu.etaxonomy.cdm.api.service.pager.Pager; +import eu.etaxonomy.cdm.compare.taxon.TaxonNodeSortMode; import eu.etaxonomy.cdm.exception.FilterException; import eu.etaxonomy.cdm.exception.UnpublishedException; import eu.etaxonomy.cdm.model.common.MarkerType; import eu.etaxonomy.cdm.model.media.MediaRepresentation; import eu.etaxonomy.cdm.model.name.Rank; -import eu.etaxonomy.cdm.model.reference.Reference; import eu.etaxonomy.cdm.model.taxon.Classification; import eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode; import eu.etaxonomy.cdm.model.taxon.Taxon; import eu.etaxonomy.cdm.model.taxon.TaxonNode; -import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType; import eu.etaxonomy.cdm.persistence.dto.ClassificationLookupDTO; +import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto; import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; import eu.etaxonomy.cdm.persistence.query.OrderHint; @@ -41,15 +41,9 @@ import eu.etaxonomy.cdm.persistence.query.OrderHint; */ public interface IClassificationService extends IIdentifiableEntityService { - /** - * - * @param uuid - * @return - */ public ITaxonTreeNode getTreeNodeByUuid(UUID uuid); /** - * * Returns the root node of the the given classification (specified by its UUID) * @param classificationUuid the uuid of the classification * @return the root node of the classification @@ -58,23 +52,6 @@ public interface IClassificationService extends IIdentifiableEntityService listClassifications(Integer limit, Integer start, List orderHints, List propertyPaths); /** @@ -106,20 +83,34 @@ public interface IClassificationService extends IIdentifiableEntityService listRankSpecificRootNodes(Classification classification, TaxonNode subtree, Rank rank, boolean includeUnpublished, Integer pageSize, Integer pageIndex, List propertyPaths); - /** - * @see #listRankSpecificRootNodes(Classification, TaxonNode, Rank, boolean, Integer, Integer, List) - * @deprecated keep this for compatibility to older versions, might be removed in versions >5.3 + * Loads all TaxonNodes of the specified classification for a given Rank or lower. + * If a branch of the classification tree is not containing a TaxonNode with a Taxon at the given + * Rank the according node associated with the next lower Rank is taken as root node in this case. + * So the nodes returned may reference Taxa with different Ranks. + * + * If the rank is null the absolute root nodes will be returned. + + * @param classification may be null for all classifications + * @param subtree filter on a taxonomic subtree + * @param rank the set to null for to get the root nodes of classifications + * @param includeUnpublished if true unpublished taxa are also exported + * @param pageSize The maximum number of relationships returned (can be null for all relationships) + * @param pageIndex The offset (in pageSize chunks) from the start of the result set (0 - based) + * @param propertyPaths + * @return + * @see #pageRankSpecificRootNodes(Classification, TaxonNode, Rank, boolean, Integer, Integer, List) + * */ - @Deprecated - public List listRankSpecificRootNodes(Classification classification, - Rank rank, boolean includeUnpublished, Integer pageSize, Integer pageIndex, + public List listRankSpecificRootNodeDtos(Classification classification, TaxonNode subtree, + Rank rank, boolean includeUnpublished, Integer pageSize, Integer pageIndex, TaxonNodeDtoSortMode sortMode, List propertyPaths); @@ -204,6 +195,35 @@ public interface IClassificationService extends IIdentifiableEntityService loadTreeBranchToTaxon(Taxon taxon, Classification classification, TaxonNode subtree, Rank baseRank, boolean includeUnpublished, List propertyPaths) throws UnpublishedException; + + /** + * Although this method seems to be a redundant alternative to {@link #loadChildNodesOfTaxonNode(TaxonNode, List)} it is an important + * alternative from which web services benefit. Without this method the web service controller method, which operates outside of the + * transaction, would have to initialize the full taxon tree with all nodes of the taxon. + * This would be rather slow compared to using this method. + * @param taxon + * @param classification + * the classification to be used + * @param baseRank + * specifies the root level of the classification, may be null. + * Nodes of this rank or in case this rank does not exist in the + * current branch the next lower rank is taken as as root node for + * this rank henceforth called the base node. + * @param includeUnpublished + * if true no {@link UnpublishedException} + * is thrown if any of the taxa in the branch are unpublished + * @param propertyPaths + * the initialization strategy for the returned TaxonNode + * instances. + * @return the path of nodes from the base node to the node of the specified + * taxon. + * @throws UnpublishedException + * if any of the taxa in the path is unpublished an {@link UnpublishedException} is thrown + */ + public List loadTreeBranchDTOsToTaxon(Taxon taxon, Classification classification, + TaxonNode subtree, Rank baseRank, + boolean includeUnpublished, List propertyPaths) throws UnpublishedException; + public List loadTreeBranchToTaxon(Taxon taxon, Classification classification, Rank baseRank, boolean includeUnpublished, List propertyPaths) throws UnpublishedException; @@ -214,6 +234,8 @@ public interface IClassificationService extends IIdentifiableEntityService listChildNodesOfTaxon(UUID taxonUuid, UUID classificationUuid, UUID subtreeUuid, boolean includeUnpublished, Integer pageSize, Integer pageIndex, List propertyPaths) throws FilterException; + public List listChildNodeDtosOfTaxon(UUID taxonUuid, UUID classificationUuid, UUID subtreeUuid, boolean includeUnpublished, + Integer pageSize, Integer pageIndex, TaxonNodeDtoSortMode comparator) throws FilterException; /** * @param taxonNode @@ -224,35 +246,12 @@ public interface IClassificationService extends IIdentifiableEntityService loadChildNodesOfTaxonNode(TaxonNode taxonNode, List propertyPaths); - /** - * - * @param classification - * @return - */ public List> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification); + //FIXME seems not to be used anymore public Map> getAllMediaForChildNodes(TaxonNode taxonNode, List propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes); /** - * - * @param taxonNode - * @return - * @deprecated use TaxonNodeService instead - */ - @Deprecated - public UUID removeTaxonNode(TaxonNode taxonNode); - - /** - * - * @param taxonNode - * @return - * @deprecated use TaxonNodeService instead - */ - @Deprecated - public UUID saveTaxonNode(TaxonNode taxonNode); - - /** - * * @param taxonNodeCollection * @return * @deprecated use TaxonNodeService instead @@ -291,79 +290,36 @@ public interface IClassificationService extends IIdentifiableEntityService null and no taxon exists with minRank <= rank <= maxRank * no higher taxon is returned for this taxon. - * - * @param taxonUuids - * @param minRank - * @param maxRank - * @return */ public List groupTaxaByHigherTaxon(List taxonUuids, UUID classificationUuid, Rank minRank, Rank maxRank); - /** - * @param taxonUuids - * @param classificationUuid - * @param markerType - * @param value - * @return - */ public List groupTaxaByMarkedParents(List taxonUuids, UUID classificationUuid, MarkerType markerType, Boolean value); - /** * Returns the most relevant data of a taxon/taxon node, including children, synonyms * and certain ancestors if required. - * @param classificationUuid - * @param taxonUuid - * @param doSynonyms - * @param includeUnpublished - * @param ancestorMarkers - * @return */ public TaxonInContextDTO getTaxonInContext(UUID classificationUuid, UUID taxonUuid, Boolean doChildren, Boolean doSynonyms, boolean includeUnpublished, List ancestorMarkers, - NodeSortMode sortMode); + TaxonNodeSortMode sortMode); - /** - * @param classification - * @return - */ public UUID saveClassification(Classification classification); - /** - * @param classificationUuid - * @param limit - * @param pattern - * @param searchForClassifications - * @return - */ public List> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification( UUID classificationUuid, Integer limit, String pattern, boolean searchForClassifications); - /** - * @param classification - * @param limit - * @param pattern - * @param searchForClassifications - * @return - */ public List> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification( Classification classification, Integer limit, String pattern, boolean searchForClassifications); - /** - * @param classificationUuid - * @param searchForClassifications - * @return - */ public List> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification( UUID classificationUuid, boolean searchForClassifications); - /** - * @param classification - * @param searchForClassifications - * @return - */ public List> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification( Classification classification, boolean searchForClassifications); + List> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification( + UUID classificationUuid, Integer limit, String pattern, boolean searchForClassifications, + boolean includeDoubtful); + }