- added service method to term service that retrieves terms by TermType
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IVocabularyService.java
index 75770da25cff6af6d7b6ddffc415cc7172812e86..160267f6e0e9a2dcc20e56ec92d44cc97230caad 100644 (file)
@@ -5,7 +5,7 @@
 *\r
 * The contents of this file are subject to the Mozilla Public License Version 1.1\r
 * See LICENSE.TXT at the top of this package for the full license terms.\r
-*/ \r
+*/\r
 \r
 package eu.etaxonomy.cdm.api.service;\r
 \r
@@ -14,22 +14,20 @@ import java.util.List;
 import eu.etaxonomy.cdm.api.service.pager.Pager;\r
 import eu.etaxonomy.cdm.model.common.DefinedTermBase;\r
 import eu.etaxonomy.cdm.model.common.Language;\r
+import eu.etaxonomy.cdm.model.common.TermType;\r
 import eu.etaxonomy.cdm.model.common.TermVocabulary;\r
-import eu.etaxonomy.cdm.model.common.VocabularyEnum;\r
 import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
 \r
 public interface IVocabularyService extends IIdentifiableEntityService<TermVocabulary> {\r
-    \r
-       public TermVocabulary getVocabulary(VocabularyEnum vocabularyType);\r
-       \r
+\r
     /**\r
      * Returns term vocabularies that contain terms of a certain class e.g. Feature, Modifier, State.\r
-     * \r
+     *\r
      * @param <TERM>\r
      * @param clazz the term class of the terms in the vocabulary\r
      * @param limit The maximum number of vocabularies returned (can be null for all vocabularies)\r
      * @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)\r
-     * @param orderHints \r
+     * @param orderHints\r
      *            Supports path like <code>orderHints.propertyNames</code> which\r
         *            include *-to-one properties like createdBy.username or\r
         *            authorTeam.persistentTitleCache\r
@@ -41,14 +39,14 @@ public interface IVocabularyService extends IIdentifiableEntityService<TermVocab
 \r
           /**\r
      * Returns term vocabularies that contain terms of a certain class e.g. Feature, Modifier, State.\r
-     * \r
+     *\r
      * @param <TERM>\r
      * @param clazz the term class of the terms in the vocabulary\r
      * @param includeSubclasses if <code>true</code> all subclasses of clazz will be included for computation of the result\r
      * @param includeEmptyVocs if <code>true</code> all vocabularies that do not contain any term will be included in the result\r
      * @param limit The maximum number of vocabularies returned (can be null for all vocabularies)\r
      * @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)\r
-     * @param orderHints \r
+     * @param orderHints\r
      *            Supports path like <code>orderHints.propertyNames</code> which\r
         *            include *-to-one properties like createdBy.username or\r
         *            authorTeam.persistentTitleCache\r
@@ -58,16 +56,17 @@ public interface IVocabularyService extends IIdentifiableEntityService<TermVocab
      */\r
        public <TERM extends DefinedTermBase> List<TermVocabulary<? extends TERM>> listByTermClass(Class<TERM> clazz, boolean includeSubclasses, boolean includeEmptyVocs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);\r
 \r
-       \r
+\r
        /**\r
         * Returns Language Vocabulary\r
         * @return\r
         */\r
+       //TODO candidate for harmonization: rename to loadLanguageVocabulary(...\r
        public TermVocabulary<Language> getLanguageVocabulary();\r
-       \r
+\r
        /**\r
         * Returns a list of terms belonging to the vocabulary passed as an argument\r
-        * \r
+        *\r
         * @param vocabulary The vocabulary for which the list of terms is desired\r
         * @param limit The maximum number of terms returned (can be null for all terms in the vocabulary)\r
         * @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)\r
@@ -78,6 +77,15 @@ public interface IVocabularyService extends IIdentifiableEntityService<TermVocab
         * @param propertyPaths properties to be initialized\r
         * @return a paged list of terms\r
         */\r
+       //TODO candidate for harmonization: rename to getTerms(...\r
        public Pager<DefinedTermBase> getTerms(TermVocabulary vocabulary, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);\r
+       \r
+       /**\r
+        * Returns a list of term vocabularies corresponding to a term type\r
+        *\r
+        * @param termType The term type for which the list of vocabularies is desired\r
+        * @return a list of vocabularies\r
+        */\r
+       public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType);\r
 \r
 }\r