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
.List
;
17 import java
.util
.UUID
;
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
.common
.TermBase
;
26 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
27 import eu
.etaxonomy
.cdm
.model
.common
.VersionableEntity
;
28 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
29 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
30 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaType
;
31 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
32 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
34 public interface ITermService
extends IService
<DefinedTermBase
> {
36 public abstract DefinedTermBase
getTermByUri(String uri
);
38 // FIXME candidate for harmonization?
39 public abstract DefinedTermBase
getTermByUuid(UUID uuid
);
42 * FIXME candidate for harmonization?
47 public abstract List
<DefinedTermBase
> getAllDefinedTerms(int limit
, int start
);
49 public abstract TermVocabulary
getVocabulary(UUID vocabularyUuid
);
51 public abstract Set
<TermVocabulary
> listVocabularies(Class termClass
);
53 public abstract UUID
saveTermVocabulary(TermVocabulary termVocabulary
);
56 * FIXME candidate for harmonization?
60 public abstract UUID
saveTerm(DefinedTermBase termBase
);
63 * FIXME candidate for harmonization?
64 * @param termBaseCollection
67 public Map
<UUID
, DefinedTermBase
> saveTermsAll(Collection
<?
extends DefinedTermBase
> termBaseCollection
);
69 public List
<TermVocabulary
<DefinedTermBase
>> getAllTermVocabularies(int limit
, int start
);
71 public Map
<UUID
, TermVocabulary
<DefinedTermBase
>>
72 saveTermVocabulariesAll(Collection
<TermVocabulary
<DefinedTermBase
>> termVocabularies
);
74 public List
<Representation
> getAllRepresentations(int limit
, int start
);
76 public Map
<UUID
, LanguageStringBase
> saveLanguageDataAll(Collection
<LanguageStringBase
> languageData
);
78 public UUID
saveLanguageData(LanguageStringBase languageData
);
80 public List
<LanguageString
> getAllLanguageStrings(int limit
, int start
);
82 public Map
<UUID
, LanguageStringBase
>
83 saveLanguageStringBasesAll(Collection
<LanguageStringBase
> languageStringBases
);
85 public Language
getLanguageByIso(String iso639
);
87 public NamedArea
getAreaByTdwgAbbreviation(String tdwgAbbreviation
);
90 * Returns a paged list of Media that represent a given DefinedTerm instance
92 * @param definedTerm the definedTerm represented by these media
93 * @param pageSize The maximum number of media returned (can be null for all related media)
94 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
95 * @return a Pager of media instances
97 public Pager
<Media
> getMedia(DefinedTermBase definedTerm
, Integer pageSize
, Integer pageNumber
);
100 * Returns a paged list of NamedArea instances (optionally filtered by type or level)
102 * @param level restrict the result set to named areas of a certain level (can be null)
103 * @param type restrict the result set to named areas of a certain type (can be null)
104 * @param pageSize The maximum number of namedAreas returned (can be null for all named areas)
105 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
106 * @return a Pager of named areas
108 public Pager
<NamedArea
> list(NamedAreaLevel level
, NamedAreaType type
, Integer pageSize
, Integer pageNumber
);
111 * Return a paged list of terms which are specializations of a given definedTerm
113 * @param definedTerm The term which is a generalization of the terms returned
114 * @param pageSize The maximum number of terms returned (can be null for all specializations)
115 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
116 * @return a Pager of DefinedTerms
118 public <T
extends DefinedTermBase
> Pager
<T
> getGeneralizationOf(T definedTerm
, Integer pageSize
, Integer pageNumber
);
121 * Return a paged list of distinct terms which include the terms supplied
123 * @param definedTerms the set of terms which are part of the terms of interest
124 * @param pageSize The maximum number of terms returned (can be null for all terms)
125 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
126 * @return a Pager of DefinedTerms
128 public <T
extends DefinedTermBase
> Pager
<T
> getPartOf(Set
<T
> definedTerms
, Integer pageSize
, Integer pageNumber
);
131 * Return a paged list of terms which are part of the terms supplied
133 * @param definedTerms the set of terms which include the terms of interest
134 * @param pageSize The maximum number of terms returned (can be null for all terms)
135 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
136 * @return a Pager of DefinedTerms
138 public <T
extends DefinedTermBase
> Pager
<T
> getIncludes(Set
<T
> definedTerms
, Integer pageSize
, Integer pageNumber
);