@Service @Transactional(readOnly=true) public class TermServiceImpl extends IdentifiableServiceBase<DefinedTermBase,IDefinedTermDao> implements ITermService
Modifier and Type | Class and Description |
---|---|
static class |
TermServiceImpl.TermMovePosition |
UPDATE_TITLE_CACHE_DEFAULT_STEP_SIZE
commonService
appContext, dao, INCLUDE_UNPUBLISHED, NO_UNPUBLISHED
Constructor and Description |
---|
TermServiceImpl() |
Modifier and Type | Method and Description |
---|---|
TermDto |
addNewTerm(TermType termType,
java.util.UUID parentUUID,
boolean isKindOf)
Creates a new term as a child of the given parent.
|
DeleteResult |
delete(DefinedTermBase term)
Deprecated.
use
delete(DefinedTermBase, TermDeletionConfigurator) instead
to allow DeleteResult return type |
DeleteResult |
delete(DefinedTermBase term,
TermDeletionConfigurator config)
Delete the given term according to the given delete configuration.
|
DeleteResult |
delete(java.util.UUID termUuid)
Deprecated.
|
DeleteResult |
delete(java.util.UUID termUuid,
TermDeletionConfigurator config) |
<TERM extends DefinedTermBase> |
findByIdInVocabulary(java.lang.String id,
java.util.UUID vocabularyUuid,
java.lang.Class<TERM> clazz)
Returns the term with the given idInVocabulary for the given vocabulary.
|
<T extends DefinedTermBase> |
findByRepresentationAbbreviation(java.lang.String abbrev,
java.lang.Class<T> clazz,
java.lang.Integer pageSize,
java.lang.Integer pageNumber)
Return a paged list of terms which have representations that match the supplied string in the abbreviated label
|
<T extends DefinedTermBase> |
findByRepresentationText(java.lang.String label,
java.lang.Class<T> clazz,
java.lang.Integer pageSize,
java.lang.Integer pageNumber)
Return a paged list of terms which have representations that match the supplied string in the text (description)
|
java.util.Collection<TermDto> |
findByTitleAsDto(java.lang.String title,
TermType termType)
Returns a collection of
TermDto s that match the given search parameters. |
java.util.Collection<TermDto> |
findByUriAsDto(java.net.URI uri,
java.lang.String termLabel,
TermType termType)
Returns a collection of
TermDto s that match the given search parameters. |
java.util.Collection<TermDto> |
findByUUIDsAsDto(java.util.List<java.util.UUID> uuidList)
Returns a list of
TermDto of terms with uuid matches one of uuids in list |
java.util.List<LanguageString> |
getAllLanguageStrings(int limit,
int start) |
java.util.List<Representation> |
getAllRepresentations(int limit,
int start) |
NamedArea |
getAreaByTdwgAbbreviation(java.lang.String tdwgAbbreviation) |
DefinedTermBase |
getByUri(java.net.URI uri)
Returns a term according to it's uri
|
<T extends DefinedTermBase> |
getGeneralizationOf(T definedTerm,
java.lang.Integer pageSize,
java.lang.Integer pageNumber)
Return a paged list of terms which are specializations of a given definedTerm
|
<T extends DefinedTermBase> |
getIncludes(java.util.Collection<T> definedTerms,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
java.util.List<java.lang.String> propertyPaths)
Return a paged list of terms which are part of the terms supplied
|
java.util.Collection<TermDto> |
getIncludesAsDto(TermDto parentTerm)
Returns all terms that are included in the given parent term resp.
|
java.util.Collection<TermDto> |
getKindOfsAsDto(TermDto parentTerm)
Returns all terms that the given term is a generalization of resp.
|
Language |
getLanguageByIso(java.lang.String iso639) |
Language |
getLanguageByLabel(java.lang.String label) |
java.util.List<Language> |
getLanguagesByLocale(java.util.Enumeration<java.util.Locale> locales) |
Pager<Media> |
getMedia(DefinedTermBase definedTerm,
java.lang.Integer pageSize,
java.lang.Integer pageNumber)
Returns a paged list of Media that represent a given DefinedTerm instance
|
<T extends DefinedTermBase> |
getPartOf(java.util.Set<T> definedTerms,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
java.util.List<java.lang.String> propertyPaths)
Return a paged list of distinct terms which include the terms supplied
|
java.util.List<UuidAndTitleCache<NamedArea>> |
getUuidAndTitleCacheNamedArea(java.util.List<TermVocabulary> vocs,
java.lang.Integer limit,
java.lang.String pattern,
Language lang) |
java.util.List<UuidAndTitleCache<NamedArea>> |
getUuidAndTitleCacheNamedAreaByAbbrev(java.util.List<TermVocabulary> vocs,
java.lang.Integer limit,
java.lang.String pattern,
Language lang,
NamedAreaSearchField type)
Returns a list of
UuidAndTitleCache of named areas with IdInVocabulary matches search parameter |
DeleteResult |
isDeletable(java.util.UUID termUuid,
DeleteConfiguratorBase config)
the basic isDeletable method return false if the object is referenced from any other object.
|
Pager<NamedArea> |
list(NamedAreaLevel level,
NamedAreaType type,
java.lang.Integer pageSize,
java.lang.Integer pageNumber,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths)
Returns a paged list of NamedArea instances (optionally filtered by type or level)
|
<T extends DefinedTermBase> |
listByTermType(TermType termType,
java.lang.Integer limit,
java.lang.Integer start,
java.util.List<OrderHint> orderHints,
java.util.List<java.lang.String> propertyPaths)
Retrieves all
DefinedTermBase s with the given TermType |
UpdateResult |
moveTerm(TermDto termDto,
java.util.UUID parentUUID)
Move the given term to the given parent
|
UpdateResult |
moveTerm(TermDto termDto,
java.util.UUID parentUuid,
TermServiceImpl.TermMovePosition termMovePosition)
Move the given term to the given parent
|
java.util.UUID |
saveLanguageData(LanguageStringBase languageData) |
java.util.Map<java.util.UUID,Representation> |
saveOrUpdateRepresentations(java.util.Collection<Representation> representations) |
protected void |
setDao(IDefinedTermDao dao) |
void |
setLanguageStringDao(ILanguageStringDao languageStringDao) |
void |
setRepresentationDao(IRepresentationDao representationDao) |
UpdateResult |
updateCaches(java.lang.Class<? extends DefinedTermBase> clazz,
java.lang.Integer stepSize,
IIdentifiableEntityCacheStrategy<DefinedTermBase> cacheStrategy,
IProgressMonitor monitor)
(Re-)generate the caches for all objects of this concrete IdentifiableEntity class
|
countByTitle, countByTitle, countByTitleWithRestrictions, deduplicate, find, findByIdentifier, findByMarker, findByTitle, findByTitle, findByTitleWithRestrictions, findTitleCache, findUuidAndTitleCacheByMarker, getRights, getSourcedObjectByIdInSource, getSources, getTitleCache, getUuidAndTitleCache, getUuidAndTitleCache, listByIdentifier, listByReferenceTitle, listByReferenceTitleWithRestrictions, listByTitle, listByTitleWithRestrictions, replace, search, switchOfAutoinitializer, switchOnOldAutoInitializer, updateCaches, updateCachesImpl
countMarkers, getAnnotations, getMarkers, groupMarkers
getNextAuditEvent, getPreviousAuditEvent, pageAuditEvents, pageAuditEvents
checkPublished, clear, count, delete, exists, find, find, find, find, findById, findWithoutFlush, getSession, group, list, list, load, load, load, load, loadByIds, loadByIds, loadWithUpdate, lock, merge, merge, merge, merge, page, page, page, pageByParamWithRestrictions, refresh, refresh, save, save, saveOrUpdate, saveOrUpdate, setApplicationContext, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countByTitle, countByTitle, countByTitleWithRestrictions, deduplicate, find, findByIdentifier, findByMarker, findByTitle, findByTitle, findByTitleWithRestrictions, findTitleCache, findUuidAndTitleCacheByMarker, getRights, getSourcedObjectByIdInSource, getSources, getTitleCache, getUuidAndTitleCache, getUuidAndTitleCache, listByIdentifier, listByReferenceTitle, listByReferenceTitleWithRestrictions, listByTitle, listByTitleWithRestrictions, replace, search, updateCaches
countMarkers, getAnnotations, getMarkers, groupMarkers
getNextAuditEvent, getPreviousAuditEvent, pageAuditEvents, pageAuditEvents
clear, count, delete, exists, find, find, find, find, findById, findWithoutFlush, getSession, group, list, list, load, load, load, load, loadByIds, loadByIds, loadWithUpdate, lock, merge, merge, merge, merge, page, page, page, pageByParamWithRestrictions, refresh, refresh, save, save, saveOrUpdate, saveOrUpdate, update
@Autowired public void setLanguageStringDao(ILanguageStringDao languageStringDao)
@Autowired public void setRepresentationDao(IRepresentationDao representationDao)
@Autowired protected void setDao(IDefinedTermDao dao)
setDao
in class ServiceBase<DefinedTermBase,IDefinedTermDao>
public <T extends DefinedTermBase> java.util.List<T> listByTermType(TermType termType, java.lang.Integer limit, java.lang.Integer start, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
ITermService
DefinedTermBase
s with the given TermType
listByTermType
in interface ITermService
termType
- the term type to filter the termspublic DefinedTermBase getByUri(java.net.URI uri)
ITermService
getByUri
in interface ITermService
public Language getLanguageByIso(java.lang.String iso639)
getLanguageByIso
in interface ITermService
public Language getLanguageByLabel(java.lang.String label)
getLanguageByLabel
in interface ITermService
public java.util.List<Language> getLanguagesByLocale(java.util.Enumeration<java.util.Locale> locales)
getLanguagesByLocale
in interface ITermService
public <TERM extends DefinedTermBase> TERM findByIdInVocabulary(java.lang.String id, java.util.UUID vocabularyUuid, java.lang.Class<TERM> clazz) throws java.lang.IllegalArgumentException
ITermService
findByIdInVocabulary
in interface ITermService
id
- idInVocabularyvocabularyUuid
- uuid of vocabularyclazz
- term clazz filter on certain term classes. May be null
for no filter.java.lang.IllegalArgumentException
- if id or vocabularyUuid is null
public NamedArea getAreaByTdwgAbbreviation(java.lang.String tdwgAbbreviation)
getAreaByTdwgAbbreviation
in interface ITermService
public <T extends DefinedTermBase> Pager<T> getGeneralizationOf(T definedTerm, java.lang.Integer pageSize, java.lang.Integer pageNumber)
ITermService
getGeneralizationOf
in interface ITermService
definedTerm
- The term which is a generalization of the terms returnedpageSize
- The maximum number of terms returned (can be null for all specializations)pageNumber
- The offset (in pageSize chunks) from the start of the result set (0 - based)public <T extends DefinedTermBase> Pager<T> getIncludes(java.util.Collection<T> definedTerms, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.List<java.lang.String> propertyPaths)
ITermService
getIncludes
in interface ITermService
definedTerms
- the set of terms which include the terms of interestpageSize
- The maximum number of terms returned (can be null for all terms)pageNumber
- The offset (in pageSize chunks) from the start of the result set (0 - based)propertyPaths
- properties to initialize - see IBeanInitializer.initialize(Object, List)
public Pager<Media> getMedia(DefinedTermBase definedTerm, java.lang.Integer pageSize, java.lang.Integer pageNumber)
ITermService
getMedia
in interface ITermService
definedTerm
- the definedTerm represented by these mediapageSize
- The maximum number of media returned (can be null for all related media)pageNumber
- The offset (in pageSize chunks) from the start of the result set (0 - based)public <T extends DefinedTermBase> Pager<T> getPartOf(java.util.Set<T> definedTerms, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.List<java.lang.String> propertyPaths)
ITermService
getPartOf
in interface ITermService
definedTerms
- the set of terms which are part of the terms of interestpageSize
- The maximum number of terms returned (can be null for all terms)pageNumber
- The offset (in pageSize chunks) from the start of the result set (0 - based)propertyPaths
- properties to initialize - see IBeanInitializer.initialize(Object, List)
public Pager<NamedArea> list(NamedAreaLevel level, NamedAreaType type, java.lang.Integer pageSize, java.lang.Integer pageNumber, java.util.List<OrderHint> orderHints, java.util.List<java.lang.String> propertyPaths)
ITermService
list
in interface ITermService
level
- restrict the result set to named areas of a certain level (can be null)type
- restrict the result set to named areas of a certain type (can be null)pageSize
- The maximum number of namedAreas returned (can be null for all named areas)pageNumber
- The offset (in pageSize chunks) from the start of the result set (0 - based)public <T extends DefinedTermBase> Pager<T> findByRepresentationText(java.lang.String label, java.lang.Class<T> clazz, java.lang.Integer pageSize, java.lang.Integer pageNumber)
ITermService
findByRepresentationText
in interface ITermService
label
- a string to match (exactly)pageSize
- The maximum number of terms returned (can be null for all terms)pageNumber
- The offset (in pageSize chunks) from the start of the result set (0 - based)public <T extends DefinedTermBase> Pager<T> findByRepresentationAbbreviation(java.lang.String abbrev, java.lang.Class<T> clazz, java.lang.Integer pageSize, java.lang.Integer pageNumber)
ITermService
findByRepresentationAbbreviation
in interface ITermService
pageSize
- The maximum number of terms returned (can be null for all terms)pageNumber
- The offset (in pageSize chunks) from the start of the result set (0 - based)public java.util.List<LanguageString> getAllLanguageStrings(int limit, int start)
getAllLanguageStrings
in interface ITermService
public java.util.List<Representation> getAllRepresentations(int limit, int start)
getAllRepresentations
in interface ITermService
public java.util.UUID saveLanguageData(LanguageStringBase languageData)
saveLanguageData
in interface ITermService
@Deprecated public DeleteResult delete(DefinedTermBase term)
delete(DefinedTermBase, TermDeletionConfigurator)
instead
to allow DeleteResult return typedelete
in interface IService<DefinedTermBase>
delete
in class ServiceBase<DefinedTermBase,IDefinedTermDao>
@Deprecated @Transactional(readOnly=false) public DeleteResult delete(java.util.UUID termUuid)
IService
delete
in interface IService<DefinedTermBase>
delete
in class ServiceBase<DefinedTermBase,IDefinedTermDao>
public DeleteResult delete(DefinedTermBase term, TermDeletionConfigurator config)
ITermService
delete
in interface ITermService
term
- the term to deleteconfig
- the configurator@Transactional(readOnly=false) public DeleteResult delete(java.util.UUID termUuid, TermDeletionConfigurator config)
delete
in interface ITermService
@Transactional(readOnly=false) public UpdateResult updateCaches(java.lang.Class<? extends DefinedTermBase> clazz, java.lang.Integer stepSize, IIdentifiableEntityCacheStrategy<DefinedTermBase> cacheStrategy, IProgressMonitor monitor)
IIdentifiableEntityService
updateCaches
in interface IIdentifiableEntityService<DefinedTermBase>
clazz
- class of objects to be updatedstepSize
- number of objects loaded per step. If null
use default.cacheStrategy
- cache strategy used for cache generation. If null
use default.monitor
- progress monitor. If null
use default.public DeleteResult isDeletable(java.util.UUID termUuid, DeleteConfiguratorBase config)
VersionableServiceBase
isDeletable
in interface IVersionableService<DefinedTermBase>
isDeletable
in class VersionableServiceBase<DefinedTermBase,IDefinedTermDao>
@Transactional(readOnly=false) public java.util.Map<java.util.UUID,Representation> saveOrUpdateRepresentations(java.util.Collection<Representation> representations)
saveOrUpdateRepresentations
in interface ITermService
@Transactional(readOnly=true) public java.util.List<UuidAndTitleCache<NamedArea>> getUuidAndTitleCacheNamedArea(java.util.List<TermVocabulary> vocs, java.lang.Integer limit, java.lang.String pattern, Language lang)
getUuidAndTitleCacheNamedArea
in interface ITermService
@Transactional(readOnly=true) public java.util.List<UuidAndTitleCache<NamedArea>> getUuidAndTitleCacheNamedAreaByAbbrev(java.util.List<TermVocabulary> vocs, java.lang.Integer limit, java.lang.String pattern, Language lang, NamedAreaSearchField type)
ITermService
UuidAndTitleCache
of named areas with IdInVocabulary matches search parametergetUuidAndTitleCacheNamedAreaByAbbrev
in interface ITermService
public java.util.Collection<TermDto> getIncludesAsDto(TermDto parentTerm)
ITermService
getIncludesAsDto
in interface ITermService
parentTerm
- the parent termpublic java.util.Collection<TermDto> getKindOfsAsDto(TermDto parentTerm)
ITermService
getKindOfsAsDto
in interface ITermService
parentTerm
- the parent term@Transactional(readOnly=false) public UpdateResult moveTerm(TermDto termDto, java.util.UUID parentUUID)
ITermService
moveTerm
in interface ITermService
termDto
- the TermDto
of the term to moveparentUUID
- the UUID
of the new parent term@Transactional(readOnly=false) public UpdateResult moveTerm(TermDto termDto, java.util.UUID parentUuid, TermServiceImpl.TermMovePosition termMovePosition)
ITermService
moveTerm
in interface ITermService
termDto
- the TermDto
of the term to moveparentUuid
- the UUID
of the new parent termtermMovePosition
- enum to specify the position for OrderedTermBase
s in an OrderedTermVocabulary
@Transactional(readOnly=false) public TermDto addNewTerm(TermType termType, java.util.UUID parentUUID, boolean isKindOf)
ITermService
addNewTerm
in interface ITermService
termType
- the TermType
of the term to createparentUUID
- the UUID
of the parent termisKindOf
- if true
the term will be added via a
kindOf relation. Otherwise it will added via a partOf relationpublic java.util.Collection<TermDto> findByTitleAsDto(java.lang.String title, TermType termType)
ITermService
TermDto
s that match the given search parameters.findByTitleAsDto
in interface ITermService
title
- the term label that the terms have to matchtermType
- the termType that the terms have to matchpublic java.util.Collection<TermDto> findByUriAsDto(java.net.URI uri, java.lang.String termLabel, TermType termType)
ITermService
TermDto
s that match the given search parameters.findByUriAsDto
in interface ITermService
uri
- the URI
that the terms have to matchtermLabel
- the term label that the terms have to matchtermType
- the termType that the terms have to matchpublic java.util.Collection<TermDto> findByUUIDsAsDto(java.util.List<java.util.UUID> uuidList)
ITermService
TermDto
of terms with uuid matches one of uuids in listfindByUUIDsAsDto
in interface ITermService
Copyright © 2007-2020 EDIT. All Rights Reserved.