Merge branch 'develop' into feature/cdm-4.7
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / IVocabularyService.java
1 /**
2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.api.service;
11
12 import java.util.List;
13
14 import eu.etaxonomy.cdm.api.service.pager.Pager;
15 import eu.etaxonomy.cdm.model.common.DefinedTermBase;
16 import eu.etaxonomy.cdm.model.common.Language;
17 import eu.etaxonomy.cdm.model.common.TermType;
18 import eu.etaxonomy.cdm.model.common.TermVocabulary;
19 import eu.etaxonomy.cdm.persistence.query.OrderHint;
20
21 public interface IVocabularyService extends IIdentifiableEntityService<TermVocabulary> {
22
23 /**
24 * Returns term vocabularies that contain terms of a certain {@link TermType} e.g. Feature, Modifier, State.
25 *
26 * @param <TERMTYPE>
27 * @param termType the {@link TermType} of the terms in the vocabulary and of the vocabulary
28 * @param includeSubTypes if <code>true</code> all subtypes will be included for computation of the result
29 * @param limit The maximum number of vocabularies returned (can be null for all vocabularies)
30 * @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)
31 * @param orderHints
32 * Supports path like <code>orderHints.propertyNames</code> which
33 * include *-to-one properties like createdBy.username or
34 * authorTeam.persistentTitleCache
35 * @param propertyPaths properties to be initialized
36 * @return a list of term vocabularies
37 */
38 public List<TermVocabulary> listByTermType(TermType termType, boolean includeSubTypes, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
39
40 /**
41 * Returns Language Vocabulary
42 * @return
43 */
44 //TODO candidate for harmonization: rename to loadLanguageVocabulary(...
45 public TermVocabulary<Language> getLanguageVocabulary();
46
47 /**
48 * Returns a list of terms belonging to the vocabulary passed as an argument
49 *
50 * @param vocabulary The vocabulary for which the list of terms is desired
51 * @param limit The maximum number of terms returned (can be null for all terms in the vocabulary)
52 * @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)
53 * @param orderHints
54 * Supports path like <code>orderHints.propertyNames</code> which
55 * include *-to-one properties like createdBy.username or
56 * authorTeam.persistentTitleCache
57 * @param propertyPaths properties to be initialized
58 * @return a paged list of terms
59 */
60 //TODO candidate for harmonization: rename to getTerms(...
61 public Pager<DefinedTermBase> getTerms(TermVocabulary vocabulary, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
62
63 /**
64 * Returns a list of term vocabularies corresponding to a term type
65 *
66 * @param termType The term type for which the list of vocabularies is desired
67 * @return a list of vocabularies
68 */
69 public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType, List<String> propertyPaths);
70
71 }