import java.util.UUID;
import eu.etaxonomy.cdm.api.service.config.CreateHierarchyForClassificationConfigurator;
+import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator;
+import eu.etaxonomy.cdm.api.service.dto.GroupedTaxonDTO;
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.ITaxonTreeNode;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
+import eu.etaxonomy.cdm.persistence.dto.ClassificationLookupDTO;
+import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
import eu.etaxonomy.cdm.persistence.query.OrderHint;
* @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
+ */
+ public TaxonNode getRootNode(UUID classificationUuid);
/**
*
@Deprecated
public TaxonNode loadTaxonNode(TaxonNode taxonNode, List<String> 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 <code>rank</code> 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<TaxonNode> loadRankSpecificRootNodes(Classification classification, Rank rank, Integer limit, Integer start, List<String> 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
* @param treeNode
* @return
*/
+
public UUID removeTreeNode(ITaxonTreeNode treeNode);
/**
public List<TaxonNode> getAllNodes();
- public Classification createHierarchyInClassification(Classification classification, CreateHierarchyForClassificationConfigurator configurator);
+ public UpdateResult createHierarchyInClassification(Classification classification, CreateHierarchyForClassificationConfigurator configurator);
+
+ /**
+ * @param classificationUuid
+ * @param excludeTaxa
+ * @return
+ */
+ public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(UUID classificationUuid, List<UUID> excludeTaxa);
+
+ /**
+ * @param classificationUuid
+ * @param excludeTaxa
+ * @param limit
+ * @param pattern
+ * @return
+ */
+ List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
+ UUID classificationUuid, List<UUID> excludeTaxa, Integer limit, String pattern);
+
+ /**
+ * @param classification
+ * @param excludeTaxa
+ * @param limit
+ * @param pattern
+ * @return
+ */
+ List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(
+ Classification classification, List<UUID> excludeTaxa, Integer limit, String pattern);
+
+ /**
+ * @param taxonUuid
+ * @param classificationUuid
+ * @param pageSize
+ * @param pageIndex
+ * @param propertyPaths
+ * @return
+ */
+ List<TaxonNode> listSiblingsOfTaxon(UUID taxonUuid, UUID classificationUuid, Integer pageSize, Integer pageIndex,
+ List<String> propertyPaths);
+
+ /**
+ * @param taxonUuid
+ * @param classificationUuid
+ * @param pageSize
+ * @param pageIndex
+ * @param propertyPaths
+ * @return
+ */
+ Pager<TaxonNode> pageSiblingsOfTaxon(UUID taxonUuid, UUID classificationUuid, Integer pageSize, Integer pageIndex,
+ List<String> propertyPaths);
+
+ /**
+ * @param classification
+ * @return
+ */
+ ClassificationLookupDTO classificationLookup(Classification classification);
+
+ DeleteResult delete(UUID classificationUuid, TaxonDeletionConfigurator config);
+
+ /**
+ * Returns the higher taxon id for each taxon in taxonUuids.
+ * The highter taxon is defined by rank where the lowest rank equal or above minRank
+ * is taken. If maxRank <> null and no taxon exists with minRank <= rank <= maxRank
+ * no higher taxon is returned for this taxon.
+ *
+ * @param taxonUuids
+ * @param minRank
+ * @param maxRank
+ * @return
+ */
+ List<GroupedTaxonDTO> groupTaxaByHigherTaxon(List<UUID> taxonUuids, UUID classificationUuid, Rank minRank, Rank maxRank);
}