X-Git-Url: https://dev.e-taxonomy.eu/gitweb/cdmlib.git/blobdiff_plain/1d36aa543c3acc5c2d7cd81e35ddca50a70a4f11..a08fca00948afa4651c101d1a01a9dd8c4473948:/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 3ea4e65928..3661abb6b9 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 @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -15,218 +15,263 @@ import java.util.List; import java.util.Map; import java.util.UUID; +import eu.etaxonomy.cdm.api.service.pager.Pager; import eu.etaxonomy.cdm.model.common.UuidAndTitleCache; import eu.etaxonomy.cdm.model.media.MediaRepresentation; import eu.etaxonomy.cdm.model.name.Rank; +import eu.etaxonomy.cdm.model.taxon.Classification; import eu.etaxonomy.cdm.model.taxon.ITreeNode; import eu.etaxonomy.cdm.model.taxon.Taxon; import eu.etaxonomy.cdm.model.taxon.TaxonNode; -import eu.etaxonomy.cdm.model.taxon.Classification; import eu.etaxonomy.cdm.persistence.query.OrderHint; /** * @author n.hoffmann * @created Sep 21, 2009 - * @version 1.0 */ public interface IClassificationService extends IIdentifiableEntityService { - /** - * - * @param uuid - * @return - */ - public TaxonNode getTaxonNodeByUuid(UUID uuid); - - /** - * - * @param uuid - * @return - */ - public ITreeNode getTreeNodeByUuid(UUID uuid); - - /** - * - * @param limit - * @param start - * @param orderHints - * @param propertyPaths - * @return - */ - public List listClassifications(Integer limit, Integer start, List orderHints, List propertyPaths); - - /** - * - * @param uuid - * @return - */ - public Classification getClassificationByUuid(UUID uuid); - - /** - * - * @param taxon - * @param classificationUuid - * @param propertyPaths - * @return - * @deprecated use loadTaxonNode(TaxonNode taxonNode, ...) instead - * if you have a classification and a taxon that is in it, you should also have the according taxonNode - */ - public TaxonNode loadTaxonNodeByTaxon(Taxon taxon, UUID classificationUuid, List propertyPaths); - - /** - * - * @param taxonNode - * @param propertyPaths - * @return - * @deprecated use TaxonNodeService instead - */ - public TaxonNode loadTaxonNode(TaxonNode taxonNode, List propertyPaths); - - /** - * Loads all TaxonNodes of the specified tree for a given Rank. - * If a branch does not contain a TaxonNode with a TaxonName at the given - * Rank the node associated with the next lower Rank is taken as root node. - * If the rank is null the absolute root nodes will be returned. - * - * @param classification - * @param rank may be null - * @param propertyPaths - * @return - */ - public List loadRankSpecificRootNodes(Classification classification, Rank rank, List propertyPaths); - - /** - * @param taxonNode - * @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 root node for - * this rank henceforth called the base node. - * @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. - */ - public List loadTreeBranch(TaxonNode taxonNode, Rank baseRank, List propertyPaths); - - /** - * 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 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. - */ - public List loadTreeBranchToTaxon(Taxon taxon, Classification classification, Rank baseRank, List propertyPaths); - - - - /** - * 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 - * @param propertyPaths - * @return - */ - public List loadChildNodesOfTaxon(Taxon taxon, Classification classification, List propertyPaths); - - /** - * @param taxonNode - * @param propertyPaths - * @deprecated move to TaxonNodeService - * @return - */ - public List loadChildNodesOfTaxonNode(TaxonNode taxonNode, List propertyPaths); - - /** - * - * @param classification - * @return - */ - public List> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification); - - /** - * @param taxon - * @param taxTree - * @param propertyPaths - * @param size - * @param height - * @param widthOrDuration - * @param mimeTypes - * @return - * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead - * if you have a classification and a taxon that is in it, you should also have the according taxonNode - */ - public Map> getAllMediaForChildNodes(Taxon taxon, Classification taxTree, List propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes); - - /** - * - * @param taxonNode - * @param propertyPaths - * @param size - * @param height - * @param widthOrDuration - * @param mimeTypes - * @return - */ - public Map> getAllMediaForChildNodes(TaxonNode taxonNode, List propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes); - - /** - * - * @param taxonNode - * @return - * @deprecated use TaxonNodeService instead - */ - public UUID removeTaxonNode(TaxonNode taxonNode); - - /** - * - * @param taxonNode - * @return - * @deprecated use TaxonNodeService instead - */ - public UUID saveTaxonNode(TaxonNode taxonNode); - - /** - * - * @param taxonNodeCollection - * @return - * @deprecated use TaxonNodeService instead - */ - public Map saveTaxonNodeAll(Collection taxonNodeCollection); - - /** - * - * @param treeNode - * @return - */ - public UUID removeTreeNode(ITreeNode treeNode); - - /** - * - * @param treeNode - * @return - */ - public UUID saveTreeNode(ITreeNode treeNode); - - - public List getAllNodes(); + /** + * + * @param uuid + * @return + */ + public TaxonNode getTaxonNodeByUuid(UUID uuid); + + /** + * + * @param uuid + * @return + */ + public ITreeNode getTreeNodeByUuid(UUID uuid); + + /** + * + * @param limit + * @param start + * @param orderHints + * @param propertyPaths + * @return + */ + public List listClassifications(Integer limit, Integer start, List orderHints, List propertyPaths); + + /** + * + * @param taxon + * @param classificationUuid + * @param propertyPaths + * @return + * @deprecated use loadTaxonNode(TaxonNode taxonNode, ...) instead + * if you have a classification and a taxon that is in it, you should also have the according taxonNode + */ + @Deprecated + public TaxonNode loadTaxonNodeByTaxon(Taxon taxon, UUID classificationUuid, List propertyPaths); + + /** + * + * @param taxonNode + * @param propertyPaths + * @return + * @deprecated use TaxonNodeService instead + */ + @Deprecated + public TaxonNode loadTaxonNode(TaxonNode taxonNode, List propertyPaths); + + /** + * 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 rank the set to null for to get the root nodes of classifications + * @param limit The maximum number of objects returned (can be null for all matching objects) + * @param start The offset from the start of the result set (0 - based, can be null - + * equivalent of starting at the beginning of the recordset) + * @param propertyPaths + * @return + * @deprecated use {@link #listRankSpecificRootNodes(Classification, Rank, Integer, Integer, List)} instead + */ + @Deprecated + public List loadRankSpecificRootNodes(Classification classification, Rank rank, Integer limit, Integer start, List propertyPaths); + + + /** + * 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 rank the set to null for to get the root nodes of classifications + * @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 + * + */ + public List listRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize, Integer pageIndex, List propertyPaths); + + + /** + * 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 rank the set to null for to get the root nodes of classifications + * @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 + * + */ + public Pager pageRankSpecificRootNodes(Classification classification, Rank rank, Integer pageSize, Integer pageIndex, List propertyPaths); + + /** + * @param taxonNode + * @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 root node for + * this rank henceforth called the base node. + * @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. + */ + public List loadTreeBranch(TaxonNode taxonNode, Rank baseRank, List propertyPaths); + + /** + * 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 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. + */ + public List loadTreeBranchToTaxon(Taxon taxon, Classification classification, Rank baseRank, List propertyPaths); + + + + /** + * 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 + * @param propertyPaths + * @return + */ + public List loadChildNodesOfTaxon(Taxon taxon, Classification classification, List propertyPaths); + + /** + * @param taxonNode + * @param propertyPaths + * @deprecated move to TaxonNodeService + * @return + */ + @Deprecated + public List loadChildNodesOfTaxonNode(TaxonNode taxonNode, List propertyPaths); + + /** + * + * @param classification + * @return + */ + public List> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification); + + /** + * @param taxon + * @param taxTree + * @param propertyPaths + * @param size + * @param height + * @param widthOrDuration + * @param mimeTypes + * @return + * @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead + * if you have a classification and a taxon that is in it, you should also have the according taxonNode + */ + @Deprecated + public Map> getAllMediaForChildNodes(Taxon taxon, Classification taxTree, List propertyPaths, int size, int height, int widthOrDuration, String[] mimeTypes); + + /** + * + * @param taxonNode + * @param propertyPaths + * @param size + * @param height + * @param widthOrDuration + * @param mimeTypes + * @return + */ + 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 + */ + @Deprecated + public Map saveTaxonNodeAll(Collection taxonNodeCollection); + + /** + * + * @param treeNode + * @return + */ + public UUID removeTreeNode(ITreeNode treeNode); + + /** + * + * @param treeNode + * @return + */ + public UUID saveTreeNode(ITreeNode treeNode); + + + public List getAllNodes(); }