Project

General

Profile

Download (4.66 KB) Statistics
| Branch: | Tag: | Revision:
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.Collection;
13
import java.util.List;
14
import java.util.UUID;
15

    
16
import eu.etaxonomy.cdm.api.service.pager.Pager;
17
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
18
import eu.etaxonomy.cdm.model.common.Language;
19
import eu.etaxonomy.cdm.model.common.TermType;
20
import eu.etaxonomy.cdm.model.common.TermVocabulary;
21
import eu.etaxonomy.cdm.persistence.dto.TermDto;
22
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
23
import eu.etaxonomy.cdm.persistence.query.OrderHint;
24

    
25
public interface IVocabularyService extends IIdentifiableEntityService<TermVocabulary> {
26

    
27
    /**
28
     * Returns term vocabularies that contain terms of a certain {@link TermType} e.g. Feature, Modifier, State.
29
     *
30
     * @param <TERMTYPE>
31
     * @param termType the {@link TermType} of the terms in the vocabulary and of the vocabulary
32
     * @param includeSubTypes if <code>true</code> all subtypes will be included for computation of the result
33
     * @param limit The maximum number of vocabularies returned (can be null for all vocabularies)
34
     * @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)
35
     * @param orderHints
36
     *            Supports path like <code>orderHints.propertyNames</code> which
37
     *            include *-to-one properties like createdBy.username or
38
     *            authorTeam.persistentTitleCache
39
     * @param propertyPaths properties to be initialized
40
     * @return a list of term vocabularies
41
     */
42
    public List<TermVocabulary> listByTermType(TermType termType, boolean includeSubTypes, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
43

    
44
	/**
45
	 * Returns Language Vocabulary
46
	 * @return
47
	 */
48
	//TODO candidate for harmonization: rename to loadLanguageVocabulary(...
49
	public TermVocabulary<Language> getLanguageVocabulary();
50

    
51
	/**
52
	 * Returns a list of terms belonging to the vocabulary passed as an argument
53
	 *
54
	 * @param vocabulary The vocabulary for which the list of terms is desired
55
	 * @param limit The maximum number of terms returned (can be null for all terms in the vocabulary)
56
	 * @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)
57
	 * @param orderHints
58
	 *            Supports path like <code>orderHints.propertyNames</code> which
59
	 *            include *-to-one properties like createdBy.username or
60
	 *            authorTeam.persistentTitleCache
61
	 * @param propertyPaths properties to be initialized
62
	 * @return a paged list of terms
63
	 */
64
	//TODO candidate for harmonization: rename to getTerms(...
65
	public Pager<DefinedTermBase> getTerms(TermVocabulary vocabulary, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
66

    
67
	/**
68
	 * Returns a list of term vocabularies corresponding to a term type
69
	 *
70
	 * @param termType The term type for which the list of vocabularies is desired
71
	 * @return a list of vocabularies
72
	 */
73
	public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType, List<String> propertyPaths);
74

    
75
	/**
76
	 * Loads all top level terms, i.e. terms that have no parent terms, for the given vocabulary
77
	 * @param vocabularyUuid the uuid of the vocabulary
78
	 * @return a collection of top level terms
79
	 */
80
	public Collection<TermDto> getTopLevelTerms(UUID vocabularyUuid);
81

    
82
	/**
83
	 * Initializes the complete term hierarchy consisting of {@link TermDto}s
84
	 * for the given vocabulary
85
	 * @param vocabularyUuid the UUID of the {@link TermVocabulary}
86
	 * @return a the top level elements for this vocabulary
87
	 */
88

    
89
	public Collection<TermDto> getCompleteTermHierarchy(UUID vocabularyUuid);
90
    /**
91
     * Returns term vocabularies that contain terms of a certain {@link TermType} e.g. Feature, Modifier, State.
92
     *
93
     * @param termType the {@link TermType} of the terms in the vocabulary and of the vocabulary
94
     * @return a list of term vocabularies
95
     */
96
    public List<TermVocabularyDto> findVocabularyDtoByTermType(TermType termType);
97

    
98
    /**
99
     * Creates a new term as a direct child of the given vocabulary.
100
     * @param termType the {@link TermType} of the term to create
101
     * @param vocabularyUUID the {@link UUID} of the vocabulary
102
     * kindOf relation. Otherwise it will added via a partOf relation
103
     * @return the new term
104
     */
105
    public TermDto addNewTerm(TermType termType, UUID vocabularyUUID);
106

    
107
}
(70-70/103)