1
|
// $Id$
|
2
|
/**
|
3
|
* Copyright (C) 2007 EDIT
|
4
|
* European Distributed Institute of Taxonomy
|
5
|
* http://www.e-taxonomy.eu
|
6
|
*
|
7
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9
|
*/
|
10
|
|
11
|
package eu.etaxonomy.cdm.api.service;
|
12
|
|
13
|
import java.util.Enumeration;
|
14
|
import java.util.List;
|
15
|
import java.util.Locale;
|
16
|
import java.util.Set;
|
17
|
import java.util.UUID;
|
18
|
|
19
|
import eu.etaxonomy.cdm.api.service.pager.Pager;
|
20
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
21
|
import eu.etaxonomy.cdm.model.common.Language;
|
22
|
import eu.etaxonomy.cdm.model.common.LanguageString;
|
23
|
import eu.etaxonomy.cdm.model.common.LanguageStringBase;
|
24
|
import eu.etaxonomy.cdm.model.common.Representation;
|
25
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
26
|
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
|
27
|
import eu.etaxonomy.cdm.model.location.NamedAreaType;
|
28
|
import eu.etaxonomy.cdm.model.media.Media;
|
29
|
import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;
|
30
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
31
|
|
32
|
public interface ITermService extends IIdentifiableEntityService<DefinedTermBase> {
|
33
|
|
34
|
public DefinedTermBase getByUri(String uri);
|
35
|
|
36
|
public UUID saveLanguageData(LanguageStringBase languageData);
|
37
|
|
38
|
public List<LanguageString> getAllLanguageStrings(int limit, int start);
|
39
|
|
40
|
public List<Representation> getAllRepresentations(int limit, int start);
|
41
|
|
42
|
public Language getLanguageByIso(String iso639);
|
43
|
|
44
|
public List<Language> getLanguagesByLocale(Enumeration<Locale> locales);
|
45
|
|
46
|
public NamedArea getAreaByTdwgAbbreviation(String tdwgAbbreviation);
|
47
|
|
48
|
/**
|
49
|
* Returns a paged list of Media that represent a given DefinedTerm instance
|
50
|
*
|
51
|
* @param definedTerm the definedTerm represented by these media
|
52
|
* @param pageSize The maximum number of media returned (can be null for all related media)
|
53
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
54
|
* @return a Pager of media instances
|
55
|
*/
|
56
|
public Pager<Media> getMedia(DefinedTermBase definedTerm, Integer pageSize, Integer pageNumber);
|
57
|
|
58
|
/**
|
59
|
* Returns a paged list of NamedArea instances (optionally filtered by type or level)
|
60
|
*
|
61
|
* @param level restrict the result set to named areas of a certain level (can be null)
|
62
|
* @param type restrict the result set to named areas of a certain type (can be null)
|
63
|
* @param pageSize The maximum number of namedAreas returned (can be null for all named areas)
|
64
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
65
|
* @return a Pager of named areas
|
66
|
*/
|
67
|
public Pager<NamedArea> list(NamedAreaLevel level, NamedAreaType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
68
|
|
69
|
/**
|
70
|
* Return a paged list of terms which are specializations of a given definedTerm
|
71
|
*
|
72
|
* @param definedTerm The term which is a generalization of the terms returned
|
73
|
* @param pageSize The maximum number of terms returned (can be null for all specializations)
|
74
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
75
|
* @return a Pager of DefinedTerms
|
76
|
*/
|
77
|
public <T extends DefinedTermBase> Pager<T> getGeneralizationOf(T definedTerm, Integer pageSize, Integer pageNumber);
|
78
|
|
79
|
/**
|
80
|
* Return a paged list of distinct terms which include the terms supplied
|
81
|
*
|
82
|
* @param definedTerms the set of terms which are part of the terms of interest
|
83
|
* @param pageSize The maximum number of terms returned (can be null for all terms)
|
84
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
85
|
* @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
|
86
|
* @return a Pager of DefinedTerms
|
87
|
*/
|
88
|
public <T extends DefinedTermBase> Pager<T> getPartOf(Set<T> definedTerms, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
89
|
|
90
|
/**
|
91
|
* Return a paged list of terms which are part of the terms supplied
|
92
|
*
|
93
|
* @param definedTerms the set of terms which include the terms of interest
|
94
|
* @param pageSize The maximum number of terms returned (can be null for all terms)
|
95
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
96
|
* @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
|
97
|
* @return a Pager of DefinedTerms
|
98
|
*/
|
99
|
public <T extends DefinedTermBase> Pager<T> getIncludes(Set<T> definedTerms, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
100
|
|
101
|
/**
|
102
|
* Return a paged list of terms which have representations that match the supplied string
|
103
|
*
|
104
|
* @param label a string to match (exactly)
|
105
|
* @param pageSize The maximum number of terms returned (can be null for all terms)
|
106
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
107
|
* @return a Pager of DefinedTerms
|
108
|
*/
|
109
|
public <T extends DefinedTermBase> Pager<T> findByRepresentationText(String label, Class<T> clazz, Integer pageSize, Integer pageNumber);
|
110
|
}
|