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 class e.g. Feature, Modifier, State.
|
25
|
*
|
26
|
* @param <TERM>
|
27
|
* @param clazz the term class of the terms in the vocabulary
|
28
|
* @param limit The maximum number of vocabularies returned (can be null for all vocabularies)
|
29
|
* @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)
|
30
|
* @param orderHints
|
31
|
* Supports path like <code>orderHints.propertyNames</code> which
|
32
|
* include *-to-one properties like createdBy.username or
|
33
|
* authorTeam.persistentTitleCache
|
34
|
* @param propertyPaths properties to be initialized
|
35
|
* @return a list of term vocabularies
|
36
|
* @see #listByTermClass(Class, boolean, Integer, Integer, List, List)
|
37
|
* @deprecated use {@link #listByTermType(TermType, boolean, boolean, Integer, Integer, List, List)} instead.
|
38
|
* May be removed in future versions.
|
39
|
*/
|
40
|
@Deprecated
|
41
|
public <TERM extends DefinedTermBase> List<TermVocabulary<TERM>> listByTermClass(Class<TERM> clazz, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
|
42
|
|
43
|
/**
|
44
|
* Returns term vocabularies that contain terms of a certain class e.g. Feature, Modifier, State.
|
45
|
*
|
46
|
* @param <TERM>
|
47
|
* @param clazz the term class of the terms in the vocabulary
|
48
|
* @param includeSubclasses if <code>true</code> all subclasses of clazz will be included for computation of the result
|
49
|
* @param includeEmptyVocs if <code>true</code> all vocabularies that do not contain any term will be included in the result
|
50
|
* @param limit The maximum number of vocabularies returned (can be null for all vocabularies)
|
51
|
* @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)
|
52
|
* @param orderHints
|
53
|
* Supports path like <code>orderHints.propertyNames</code> which
|
54
|
* include *-to-one properties like createdBy.username or
|
55
|
* authorTeam.persistentTitleCache
|
56
|
* @param propertyPaths properties to be initialized
|
57
|
* @return a list of term vocabularies
|
58
|
* @see #listByTermClass(Class, Integer, Integer, List, List)
|
59
|
* @deprecated use {@link #listByTermType(TermType, boolean, boolean, Integer, Integer, List, List)} instead.
|
60
|
* May be removed in future versions.
|
61
|
*/
|
62
|
@Deprecated
|
63
|
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);
|
64
|
|
65
|
// /**
|
66
|
// * Returns term vocabularies that contain terms of a certain {@link TermType} e.g. Feature, Modifier, State.
|
67
|
// *
|
68
|
// * @param <TERMTYPE>
|
69
|
// * @param termType the {@link TermType} of the terms in the vocabulary and of the vocabulary
|
70
|
// * @param includeSubtypes if <code>true</code> all subtypes will be included for computation of the result
|
71
|
// * @param includeEmptyVocs if <code>true</code> all vocabularies that do not contain any term will be included in the result
|
72
|
// * @param limit The maximum number of vocabularies returned (can be null for all vocabularies)
|
73
|
// * @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)
|
74
|
// * @param orderHints
|
75
|
// * Supports path like <code>orderHints.propertyNames</code> which
|
76
|
// * include *-to-one properties like createdBy.username or
|
77
|
// * authorTeam.persistentTitleCache
|
78
|
// * @param propertyPaths properties to be initialized
|
79
|
// * @return a list of term vocabularies
|
80
|
// */
|
81
|
// public List<TermVocabulary> listByTermType(TermType termType, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
|
82
|
//
|
83
|
|
84
|
/**
|
85
|
* Returns term vocabularies that contain terms of a certain {@link TermType} e.g. Feature, Modifier, State.
|
86
|
*
|
87
|
* @param <TERMTYPE>
|
88
|
* @param termType the {@link TermType} of the terms in the vocabulary and of the vocabulary
|
89
|
* @param includeSubTypes if <code>true</code> all subtypes will be included for computation of the result
|
90
|
* @param limit The maximum number of vocabularies returned (can be null for all vocabularies)
|
91
|
* @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)
|
92
|
* @param orderHints
|
93
|
* Supports path like <code>orderHints.propertyNames</code> which
|
94
|
* include *-to-one properties like createdBy.username or
|
95
|
* authorTeam.persistentTitleCache
|
96
|
* @param propertyPaths properties to be initialized
|
97
|
* @return a list of term vocabularies
|
98
|
*/
|
99
|
public List<TermVocabulary> listByTermType(TermType termType, boolean includeSubTypes, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
|
100
|
|
101
|
/**
|
102
|
* Returns Language Vocabulary
|
103
|
* @return
|
104
|
*/
|
105
|
//TODO candidate for harmonization: rename to loadLanguageVocabulary(...
|
106
|
public TermVocabulary<Language> getLanguageVocabulary();
|
107
|
|
108
|
/**
|
109
|
* Returns a list of terms belonging to the vocabulary passed as an argument
|
110
|
*
|
111
|
* @param vocabulary The vocabulary for which the list of terms is desired
|
112
|
* @param limit The maximum number of terms returned (can be null for all terms in the vocabulary)
|
113
|
* @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)
|
114
|
* @param orderHints
|
115
|
* Supports path like <code>orderHints.propertyNames</code> which
|
116
|
* include *-to-one properties like createdBy.username or
|
117
|
* authorTeam.persistentTitleCache
|
118
|
* @param propertyPaths properties to be initialized
|
119
|
* @return a paged list of terms
|
120
|
*/
|
121
|
//TODO candidate for harmonization: rename to getTerms(...
|
122
|
public Pager<DefinedTermBase> getTerms(TermVocabulary vocabulary, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
|
123
|
|
124
|
/**
|
125
|
* Returns a list of term vocabularies corresponding to a term type
|
126
|
*
|
127
|
* @param termType The term type for which the list of vocabularies is desired
|
128
|
* @return a list of vocabularies
|
129
|
*/
|
130
|
public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType);
|
131
|
|
132
|
}
|