(no commit message)
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IDescriptionService.java
index e6611878fac2e94b3a29716aa382ab7fff9ca0b2..3dc5ac84dd19dafd0772651abb3dce18fc1ba1bb 100644 (file)
@@ -36,73 +36,6 @@ import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
 \r
 public interface IDescriptionService extends IIdentifiableEntityService<DescriptionBase> {\r
-\r
-       /**\r
-        * @return\r
-        */\r
-       // FIXME candidate for harmonization? findByUuid\r
-       public DescriptionBase getDescriptionBaseByUuid(UUID uuid);\r
-\r
-       /**\r
-        * Persists a <code>Description</code>\r
-         * @param description\r
-        * @return\r
-        */\r
-       // FIXME candidate for harmonization? save\r
-       public UUID saveDescription(DescriptionBase description);\r
-\r
-       /**\r
-        * Persists a <code>FeatureTree</code>\r
-        * @param tree\r
-        * @return\r
-        */\r
-       public UUID saveFeatureTree(FeatureTree tree);\r
-       // FIXME could you handle the feature data elements using @Cascade?\r
-       public void saveFeatureDataAll(Collection<VersionableEntity> featureData);\r
-       public Map<UUID, FeatureTree> saveFeatureTreeAll(Collection<FeatureTree> trees);\r
-       public Map<UUID, FeatureNode> saveFeatureNodeAll(Collection<FeatureNode> nodes);\r
-       \r
-       /**\r
-        * Gets a FeatureTree instance matching the supplied uuid\r
-        * \r
-        * @param uuid the uuid of the FeatureTree of interest\r
-        * @return a FeatureTree, or null if the FeatureTree does not exist\r
-        */\r
-       public FeatureTree getFeatureTreeByUuid(UUID uuid);\r
-       \r
-       /**\r
-        * Finds the feature tree specified by the <code>uuid</code> parameter and\r
-        * recursively initializes all bean properties given in the\r
-        * <code>propertyPaths</code> parameter.\r
-        * <p>\r
-        * For detailed description and examples <b>please refer to:</b> \r
-        * {@link BeanInitializer#initialize(Object, List)}\r
-        * \r
-        * @param uuid\r
-        * @param propertyPaths properties to initialize\r
-        * @return\r
-        */\r
-       public FeatureTree loadFeatureTree(UUID uuid, List<String> propertyPaths);\r
-       \r
-       /**\r
-        * Finds the feature node specified by the <code>uuid</code> parameter and\r
-        * recursively initializes all bean properties given in the\r
-        * <code>propertyPaths</code> parameter.\r
-        * <p>\r
-        * For detailed description and examples <b>please refer to:</b> \r
-        * {@link BeanInitializer#initialize(Object, List)}\r
-        * \r
-        * @param uuid\r
-        * @param propertyPaths properties to initialize\r
-        * @return\r
-        */\r
-       public FeatureNode loadFeatureNode(UUID uuid, List<String> propertyPaths);\r
-       public List<FeatureNode> getFeatureNodesAll();\r
-       public List<Feature> getFeaturesAll();\r
-       \r
-       public List<FeatureTree> getFeatureTreesAll(List<String> propertyPaths);\r
-       public List<FeatureNode> getFeatureNodesAll(List<String> propertyPaths);\r
-       public List<Feature> getFeaturesAll(List<String> propertyPaths);\r
        \r
        /**\r
         * \r
@@ -110,7 +43,7 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
         * @deprecated use TermService#getVocabulary(VocabularyType) instead\r
         */\r
        public TermVocabulary<Feature> getDefaultFeatureVocabulary();\r
-       //public TermVocabulary<Feature> getFeatureVocabulary();\r
+\r
        /**\r
         * @deprecated use TermService#getVocabulary(VocabularyType) instead\r
         */\r
@@ -153,7 +86,7 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
        public UUID deleteDescriptionElement(DescriptionElementBase descriptionElement);\r
        \r
        /**\r
-        * List the descriptions of type <TYPE>, filtered using the following parameters\r
+        * List the descriptions of type <T>, filtered using the following parameters\r
         *  \r
         * @param type The type of description returned (Taxon, TaxonName, or Specimen)\r
         * @param hasMedia Restrict the description to those that do (true) or don't (false) contain <i>elements</i> that have one or more media (can be null)\r
@@ -165,7 +98,7 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
         * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}\r
         * @return a Pager containing DescriptionBase instances\r
         */\r
-       public <TYPE extends DescriptionBase> Pager<TYPE> listDescriptions(Class<TYPE> type, Boolean hasMedia, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
+       public Pager<DescriptionBase> page(Class<? extends DescriptionBase> type, Boolean hasMedia, Boolean hasText, Set<Feature> feature, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
        \r
        /**\r
         * Count the descriptions of type <TYPE>, filtered using the following parameters\r
@@ -176,7 +109,7 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
         * @param feature Restrict the description to those <i>elements</i> which are scoped by one of the Features passed (can be null or empty)\r
         * @return a count of DescriptionBase instances\r
         */\r
-       public <TYPE extends DescriptionBase> int countDescriptions(Class<TYPE> type, Boolean hasImages, Boolean hasText, Set<Feature> feature);\r
+       public int count(Class<? extends DescriptionBase> type, Boolean hasImages, Boolean hasText, Set<Feature> feature);\r
        \r
        /**\r
         * Returns description elements of type <TYPE>, belonging to a given description, optionally filtered by one or more features\r
@@ -184,12 +117,13 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
         * @param description The description which these description elements belong to (can be null to count all description elements)\r
         * @param features Restrict the results to those description elements which are scoped by one of the Features passed (can be null or empty)\r
         * @param type The type of description\r
+        * @param class \r
         * @param pageSize The maximum number of description elements returned (can be null for all description elements)\r
         * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)\r
         * @param propertyPaths Properties to initialize in the returned entities, following the syntax described in {@link BeanInitializer#initialize(Object, List)}\r
         * @return a Pager containing DescriptionElementBase instances\r
         */\r
-       public <TYPE extends DescriptionElementBase> Pager<TYPE> getDescriptionElements(DescriptionBase description,Set<Feature> features, Class<TYPE> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);\r
+       public Pager<DescriptionElementBase> getDescriptionElements(DescriptionBase description,Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths);\r
        \r
        /**\r
         * Returns a List of TaxonDescription instances, optionally filtered by parameters passed to this method\r
@@ -244,7 +178,7 @@ public interface IDescriptionService extends IIdentifiableEntityService<Descript
         * @return a Pager DescriptionElementBase instances\r
         * @see <a href="http://lucene.apache.org/java/2_4_0/queryparsersyntax.html">Apache Lucene - Query Parser Syntax</a>\r
         */\r
-       public Pager<DescriptionElementBase> search(Class<? extends DescriptionElementBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
+       public Pager<DescriptionElementBase> searchElements(Class<? extends DescriptionElementBase> clazz, String queryString, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);\r
        \r
        /**\r
      * Returns a List of Media that are associated with a given description element\r