add limit and pattern to getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IClassificationService.java
index f0cca2fb69e64e4bcf32631a16d2c0a35a148710..9de31f6d5f78c3aa3e4ef8223e35eb8edc439c8f 100644 (file)
@@ -15,14 +15,15 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 
 import java.util.Map;
 import java.util.UUID;
 
+import eu.etaxonomy.cdm.api.service.config.CreateHierarchyForClassificationConfigurator;
 import eu.etaxonomy.cdm.api.service.pager.Pager;
 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.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.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
 
 import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
 
@@ -78,27 +79,6 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
     @Deprecated
     public TaxonNode loadTaxonNode(TaxonNode taxonNode, List<String> propertyPaths);
 
     @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
     /**
      * 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
@@ -175,16 +155,12 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
 
 
     /**
 
 
     /**
-     * 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 taxonUuid
+     * @param classificationUuid
      * @param propertyPaths
      * @return
      */
      * @param propertyPaths
      * @return
      */
-    public List<TaxonNode> loadChildNodesOfTaxon(Taxon taxon, Classification classification, List<String> propertyPaths);
+    public List<TaxonNode> listChildNodesOfTaxon(UUID taxonUuid, UUID classificationUuid, Integer pageSize, Integer pageIndex, List<String> propertyPaths);
 
     /**
      * @param taxonNode
 
     /**
      * @param taxonNode
@@ -200,7 +176,7 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      * @param classification
      * @return
      */
      * @param classification
      * @return
      */
-    public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification);
+    public List<UuidAndTitleCache<TaxonNode>> getTaxonNodeUuidAndTitleCacheOfAcceptedTaxaByClassification(Classification classification, List<UUID> excludeTaxa);
 
     /**
      * @param taxon
 
     /**
      * @param taxon
@@ -211,7 +187,8 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      * @param widthOrDuration
      * @param mimeTypes
      * @return
      * @param widthOrDuration
      * @param mimeTypes
      * @return
-     *  @deprecated use getAllMediaForChildNodes(TaxonNode taxonNode, ...) instead
+     *
+     * @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
      * if you have a classification and a taxon that is in it, you should also have the according taxonNode
      */
     @Deprecated
@@ -261,6 +238,7 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
      * @param treeNode
      * @return
      */
      * @param treeNode
      * @return
      */
+
     public UUID removeTreeNode(ITaxonTreeNode treeNode);
 
     /**
     public UUID removeTreeNode(ITaxonTreeNode treeNode);
 
     /**
@@ -273,5 +251,34 @@ public interface IClassificationService extends IIdentifiableEntityService<Class
 
     public List<TaxonNode> getAllNodes();
 
 
     public List<TaxonNode> getAllNodes();
 
+       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);
+
 
 }
 
 }