3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.cdm
.api
.service
;
13 import java
.util
.Collection
;
14 import java
.util
.Enumeration
;
15 import java
.util
.List
;
16 import java
.util
.Locale
;
19 import java
.util
.UUID
;
21 import eu
.etaxonomy
.cdm
.api
.service
.pager
.Pager
;
22 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
23 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
24 import eu
.etaxonomy
.cdm
.model
.common
.LanguageString
;
25 import eu
.etaxonomy
.cdm
.model
.common
.LanguageStringBase
;
26 import eu
.etaxonomy
.cdm
.model
.common
.Representation
;
27 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
28 import eu
.etaxonomy
.cdm
.model
.common
.VocabularyType
;
29 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
30 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
31 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaType
;
32 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
33 import eu
.etaxonomy
.cdm
.persistence
.dao
.BeanInitializer
;
35 public interface ITermService
extends IService
<DefinedTermBase
> {
37 public DefinedTermBase
getTermByUri(String uri
);
39 // FIXME candidate for harmonization?
40 public DefinedTermBase
getTermByUuid(UUID uuid
);
43 * FIXME candidate for harmonization?
48 public List
<DefinedTermBase
> getAllDefinedTerms(int limit
, int start
);
50 public TermVocabulary
getVocabulary(UUID vocabularyUuid
);
52 public TermVocabulary
getVocabulary(VocabularyType vocabularyType
);
54 public Set
<TermVocabulary
> listVocabularies(Class termClass
);
57 * Returns Language Vocabulary
60 public TermVocabulary
<Language
> getLanguageVocabulary();
62 public UUID
saveTermVocabulary(TermVocabulary termVocabulary
);
65 * FIXME candidate for harmonization?
69 public UUID
saveTerm(DefinedTermBase termBase
);
72 * FIXME candidate for harmonization?
73 * @param termBaseCollection
76 public Map
<UUID
, DefinedTermBase
> saveTermsAll(Collection
<?
extends DefinedTermBase
> termBaseCollection
);
78 public List
<TermVocabulary
<DefinedTermBase
>> getAllTermVocabularies(int limit
, int start
);
80 public Map
<UUID
, TermVocabulary
<DefinedTermBase
>>
81 saveTermVocabulariesAll(Collection
<TermVocabulary
<DefinedTermBase
>> termVocabularies
);
83 public List
<Representation
> getAllRepresentations(int limit
, int start
);
85 public Map
<UUID
, LanguageStringBase
> saveLanguageDataAll(Collection
<LanguageStringBase
> languageData
);
87 public UUID
saveLanguageData(LanguageStringBase languageData
);
89 public List
<LanguageString
> getAllLanguageStrings(int limit
, int start
);
91 public Map
<UUID
, LanguageStringBase
>
92 saveLanguageStringBasesAll(Collection
<LanguageStringBase
> languageStringBases
);
94 public Language
getLanguageByIso(String iso639
);
96 public List
<Language
> getLanguagesByLocale(Enumeration
<Locale
> locales
);
98 public NamedArea
getAreaByTdwgAbbreviation(String tdwgAbbreviation
);
101 * Returns a paged list of Media that represent a given DefinedTerm instance
103 * @param definedTerm the definedTerm represented by these media
104 * @param pageSize The maximum number of media returned (can be null for all related media)
105 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
106 * @return a Pager of media instances
108 public Pager
<Media
> getMedia(DefinedTermBase definedTerm
, Integer pageSize
, Integer pageNumber
);
111 * Returns a paged list of NamedArea instances (optionally filtered by type or level)
113 * @param level restrict the result set to named areas of a certain level (can be null)
114 * @param type restrict the result set to named areas of a certain type (can be null)
115 * @param pageSize The maximum number of namedAreas returned (can be null for all named areas)
116 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
117 * @return a Pager of named areas
119 public Pager
<NamedArea
> list(NamedAreaLevel level
, NamedAreaType type
, Integer pageSize
, Integer pageNumber
);
122 * Return a paged list of terms which are specializations of a given definedTerm
124 * @param definedTerm The term which is a generalization of the terms returned
125 * @param pageSize The maximum number of terms returned (can be null for all specializations)
126 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
127 * @return a Pager of DefinedTerms
129 public <T
extends DefinedTermBase
> Pager
<T
> getGeneralizationOf(T definedTerm
, Integer pageSize
, Integer pageNumber
);
132 * Return a paged list of distinct terms which include the terms supplied
134 * @param definedTerms the set of terms which are part of the terms of interest
135 * @param pageSize The maximum number of terms returned (can be null for all terms)
136 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
137 * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
138 * @return a Pager of DefinedTerms
140 public <T
extends DefinedTermBase
> Pager
<T
> getPartOf(Set
<T
> definedTerms
, Integer pageSize
, Integer pageNumber
, List
<String
> propertyPaths
);
143 * Return a paged list of terms which are part of the terms supplied
145 * @param definedTerms the set of terms which include the terms of interest
146 * @param pageSize The maximum number of terms returned (can be null for all terms)
147 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
148 * @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
149 * @return a Pager of DefinedTerms
151 public <T
extends DefinedTermBase
> Pager
<T
> getIncludes(Set
<T
> definedTerms
, Integer pageSize
, Integer pageNumber
, List
<String
> propertyPaths
);