Class CollectionServiceImpl
java.lang.Object
de.digitalcollections.cudami.server.business.impl.service.UniqueObjectServiceImpl<I,R>
de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl<E,EntityRepository<E>>
de.digitalcollections.cudami.server.business.impl.service.identifiable.entity.EntityServiceImpl<de.digitalcollections.model.identifiable.entity.Collection>
de.digitalcollections.cudami.server.business.impl.service.identifiable.entity.CollectionServiceImpl
- All Implemented Interfaces:
ManagedContentService<de.digitalcollections.model.identifiable.entity.Collection>,CollectionService,EntityService<de.digitalcollections.model.identifiable.entity.Collection>,IdentifiableService<de.digitalcollections.model.identifiable.entity.Collection>,NodeService<de.digitalcollections.model.identifiable.entity.Collection>,UniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>
@Service
public class CollectionServiceImpl
extends EntityServiceImpl<de.digitalcollections.model.identifiable.entity.Collection>
implements CollectionService, ManagedContentService<de.digitalcollections.model.identifiable.entity.Collection>
-
Field Summary
Fields inherited from class de.digitalcollections.cudami.server.business.impl.service.identifiable.entity.EntityServiceImpl
hookProperties, httpClientFields inherited from class de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl
identifierServiceFields inherited from class de.digitalcollections.cudami.server.business.impl.service.UniqueObjectServiceImpl
repository -
Constructor Summary
ConstructorsConstructorDescriptionCollectionServiceImpl(CollectionRepository repository, IdentifierService identifierService, UrlAliasService urlAliasService, HookProperties hookProperties, LocaleService localeService, CudamiConfig cudamiConfig) -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddChild(de.digitalcollections.model.identifiable.entity.Collection parent, de.digitalcollections.model.identifiable.entity.Collection child) booleanaddChildren(de.digitalcollections.model.identifiable.entity.Collection parent, List<de.digitalcollections.model.identifiable.entity.Collection> children) booleanaddDigitalObject(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject) booleanaddDigitalObjects(de.digitalcollections.model.identifiable.entity.Collection collection, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects) booleandelete(de.digitalcollections.model.identifiable.entity.Collection collection) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection>find(de.digitalcollections.model.list.paging.PageRequest pageRequest) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection>findActive(de.digitalcollections.model.list.paging.PageRequest pageRequest) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection>findActiveChildren(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.list.paging.PageRequest pageRequest) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection>findByLanguageAndInitial(de.digitalcollections.model.list.paging.PageRequest pageRequest, String language, String initial) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection>findChildren(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.list.paging.PageRequest pageRequest) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject>findDigitalObjects(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.list.paging.PageRequest pageRequest) de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection>findRootNodes(de.digitalcollections.model.list.paging.PageRequest pageRequest) List<de.digitalcollections.model.identifiable.entity.Collection>getActiveChildren(de.digitalcollections.model.identifiable.entity.Collection collection) de.digitalcollections.model.view.BreadcrumbNavigationgetBreadcrumbNavigation(de.digitalcollections.model.identifiable.entity.Collection collection) Build and return the breadcrumb navigation for the given nodede.digitalcollections.model.identifiable.entity.CollectiongetByExample(de.digitalcollections.model.identifiable.entity.Collection example) Retrieve oneUniqueObjectby given properties in example instance.de.digitalcollections.model.identifiable.entity.CollectiongetByExampleAndActive(de.digitalcollections.model.identifiable.entity.Collection example) de.digitalcollections.model.identifiable.entity.CollectiongetByExampleAndActiveAndLocale(de.digitalcollections.model.identifiable.entity.Collection example, Locale pLocale) de.digitalcollections.model.identifiable.entity.CollectiongetByExampleAndLocale(de.digitalcollections.model.identifiable.entity.Collection example, Locale locale) de.digitalcollections.model.identifiable.entity.CollectiongetByIdentifier(de.digitalcollections.model.identifiable.Identifier identifier) de.digitalcollections.model.identifiable.entity.CollectiongetByRefId(long refId) List<de.digitalcollections.model.identifiable.entity.Collection>getChildren(de.digitalcollections.model.identifiable.entity.Collection collection) de.digitalcollections.model.identifiable.entity.CollectiongetParent(de.digitalcollections.model.identifiable.entity.Collection collection) List<de.digitalcollections.model.identifiable.entity.Collection>getParents(de.digitalcollections.model.identifiable.entity.Collection collection) List<de.digitalcollections.model.identifiable.entity.Collection>getRandom(int count) booleanremoveChild(de.digitalcollections.model.identifiable.entity.Collection parent, de.digitalcollections.model.identifiable.entity.Collection child) booleanremoveDigitalObject(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject) booleanremoveDigitalObjectFromAllCollections(de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject) Removes a digitalObject from all collections, to which it was connected to.voidsave(de.digitalcollections.model.identifiable.entity.Collection entity) Persist anUniqueObject(with validation)de.digitalcollections.model.identifiable.entity.CollectionsaveWithParent(de.digitalcollections.model.identifiable.entity.Collection child, de.digitalcollections.model.identifiable.entity.Collection parent) booleansetDigitalObjects(de.digitalcollections.model.identifiable.entity.Collection collection, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects) voidupdate(de.digitalcollections.model.identifiable.entity.Collection entity) Updates an persistedUniqueObjectbooleanupdateChildrenOrder(de.digitalcollections.model.identifiable.entity.Collection parent, List<de.digitalcollections.model.identifiable.entity.Collection> children) Methods inherited from class de.digitalcollections.cudami.server.business.impl.service.identifiable.entity.EntityServiceImpl
addRelatedFileresource, buildNotificationUrl, sendNotificationMethods inherited from class de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl
addRelatedEntity, findRelatedEntities, findRelatedFileResources, getLanguages, reduceMultilanguageFieldsToGivenLocale, setRelatedEntities, setRelatedFileResources, validateMethods inherited from class de.digitalcollections.cudami.server.business.impl.service.UniqueObjectServiceImpl
count, create, delete, getAll, getByExampleAndFiltering, setDefaultSortingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.digitalcollections.cudami.server.business.api.service.identifiable.IdentifiableService
addRelatedEntity, addRelatedFileresource, cleanupLabelFromUnwantedLocales, findRelatedEntities, findRelatedFileResources, getLanguages, setRelatedEntities, setRelatedFileResources, validateMethods inherited from interface de.digitalcollections.cudami.server.business.api.service.content.ManagedContentService
setPublicationStatus, setPublicationStatusMethods inherited from interface de.digitalcollections.cudami.server.business.api.service.identifiable.NodeService
getBreadcrumbNavigationMethods inherited from interface de.digitalcollections.cudami.server.business.api.service.UniqueObjectService
count, create, delete, getAll, getByExampleAndFiltering
-
Constructor Details
-
CollectionServiceImpl
public CollectionServiceImpl(CollectionRepository repository, IdentifierService identifierService, UrlAliasService urlAliasService, HookProperties hookProperties, LocaleService localeService, CudamiConfig cudamiConfig)
-
-
Method Details
-
addChild
public boolean addChild(de.digitalcollections.model.identifiable.entity.Collection parent, de.digitalcollections.model.identifiable.entity.Collection child) throws ServiceException - Specified by:
addChildin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
addChildren
public boolean addChildren(de.digitalcollections.model.identifiable.entity.Collection parent, List<de.digitalcollections.model.identifiable.entity.Collection> children) throws ServiceException - Specified by:
addChildrenin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
addDigitalObject
public boolean addDigitalObject(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject) throws ServiceException - Specified by:
addDigitalObjectin interfaceCollectionService- Throws:
ServiceException
-
addDigitalObjects
public boolean addDigitalObjects(de.digitalcollections.model.identifiable.entity.Collection collection, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects) throws ServiceException - Specified by:
addDigitalObjectsin interfaceCollectionService- Throws:
ServiceException
-
delete
public boolean delete(de.digitalcollections.model.identifiable.entity.Collection collection) throws ConflictException, ServiceException - Specified by:
deletein interfaceUniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
deletein classUniqueObjectServiceImpl<de.digitalcollections.model.identifiable.entity.Collection,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>> - Throws:
ConflictExceptionServiceException
-
find
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> find(de.digitalcollections.model.list.paging.PageRequest pageRequest) throws ServiceException - Specified by:
findin interfaceUniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
findin classIdentifiableServiceImpl<de.digitalcollections.model.identifiable.entity.Collection,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>> - Throws:
ServiceException
-
findActive
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findActive(de.digitalcollections.model.list.paging.PageRequest pageRequest) throws ServiceException - Specified by:
findActivein interfaceCollectionService- Throws:
ServiceException
-
findActiveChildren
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findActiveChildren(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.list.paging.PageRequest pageRequest) throws ServiceException - Specified by:
findActiveChildrenin interfaceCollectionService- Throws:
ServiceException
-
findByLanguageAndInitial
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findByLanguageAndInitial(de.digitalcollections.model.list.paging.PageRequest pageRequest, String language, String initial) throws ServiceException - Specified by:
findByLanguageAndInitialin interfaceIdentifiableService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
findByLanguageAndInitialin classIdentifiableServiceImpl<de.digitalcollections.model.identifiable.entity.Collection,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>> - Throws:
ServiceException
-
findChildren
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findChildren(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.list.paging.PageRequest pageRequest) throws ServiceException - Specified by:
findChildrenin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
findDigitalObjects
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> findDigitalObjects(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.list.paging.PageRequest pageRequest) throws ServiceException - Specified by:
findDigitalObjectsin interfaceCollectionService- Throws:
ServiceException
-
findRootNodes
public de.digitalcollections.model.list.paging.PageResponse<de.digitalcollections.model.identifiable.entity.Collection> findRootNodes(de.digitalcollections.model.list.paging.PageRequest pageRequest) throws ServiceException - Specified by:
findRootNodesin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
getActiveChildren
public List<de.digitalcollections.model.identifiable.entity.Collection> getActiveChildren(de.digitalcollections.model.identifiable.entity.Collection collection) throws ServiceException - Specified by:
getActiveChildrenin interfaceCollectionService- Throws:
ServiceException
-
getByExample
public de.digitalcollections.model.identifiable.entity.Collection getByExample(de.digitalcollections.model.identifiable.entity.Collection example) throws ServiceException Description copied from interface:UniqueObjectServiceRetrieve oneUniqueObjectby given properties in example instance.- Specified by:
getByExamplein interfaceUniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
getByExamplein classUniqueObjectServiceImpl<de.digitalcollections.model.identifiable.entity.Collection,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>> - Parameters:
example- example instance containing unique property- Returns:
- the found
UniqueObjectornull - Throws:
ServiceException- in case of problems
-
getByExampleAndActive
public de.digitalcollections.model.identifiable.entity.Collection getByExampleAndActive(de.digitalcollections.model.identifiable.entity.Collection example) throws ServiceException - Specified by:
getByExampleAndActivein interfaceCollectionService- Throws:
ServiceException
-
getByExampleAndActiveAndLocale
public de.digitalcollections.model.identifiable.entity.Collection getByExampleAndActiveAndLocale(de.digitalcollections.model.identifiable.entity.Collection example, Locale pLocale) throws ServiceException - Specified by:
getByExampleAndActiveAndLocalein interfaceCollectionService- Throws:
ServiceException
-
getByExampleAndLocale
public de.digitalcollections.model.identifiable.entity.Collection getByExampleAndLocale(de.digitalcollections.model.identifiable.entity.Collection example, Locale locale) throws ServiceException - Specified by:
getByExampleAndLocalein interfaceIdentifiableService<de.digitalcollections.model.identifiable.entity.Collection>- Specified by:
getByExampleAndLocalein interfaceUniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
getByExampleAndLocalein classIdentifiableServiceImpl<de.digitalcollections.model.identifiable.entity.Collection,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>> - Throws:
ServiceException
-
getByIdentifier
public de.digitalcollections.model.identifiable.entity.Collection getByIdentifier(de.digitalcollections.model.identifiable.Identifier identifier) throws ServiceException - Specified by:
getByIdentifierin interfaceIdentifiableService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
getByIdentifierin classIdentifiableServiceImpl<de.digitalcollections.model.identifiable.entity.Collection,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>> - Throws:
ServiceException
-
getByRefId
public de.digitalcollections.model.identifiable.entity.Collection getByRefId(long refId) throws ServiceException - Specified by:
getByRefIdin interfaceEntityService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
getByRefIdin classEntityServiceImpl<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
getChildren
public List<de.digitalcollections.model.identifiable.entity.Collection> getChildren(de.digitalcollections.model.identifiable.entity.Collection collection) throws ServiceException - Specified by:
getChildrenin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
getParent
public de.digitalcollections.model.identifiable.entity.Collection getParent(de.digitalcollections.model.identifiable.entity.Collection collection) throws ServiceException - Specified by:
getParentin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
getParents
public List<de.digitalcollections.model.identifiable.entity.Collection> getParents(de.digitalcollections.model.identifiable.entity.Collection collection) throws ServiceException - Specified by:
getParentsin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
getRandom
public List<de.digitalcollections.model.identifiable.entity.Collection> getRandom(int count) throws ServiceException - Specified by:
getRandomin interfaceUniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
getRandomin classUniqueObjectServiceImpl<de.digitalcollections.model.identifiable.entity.Collection,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>> - Throws:
ServiceException
-
getRootNodesLanguages
- Specified by:
getRootNodesLanguagesin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
removeChild
public boolean removeChild(de.digitalcollections.model.identifiable.entity.Collection parent, de.digitalcollections.model.identifiable.entity.Collection child) throws ServiceException - Specified by:
removeChildin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-
removeDigitalObject
public boolean removeDigitalObject(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject) throws ServiceException - Specified by:
removeDigitalObjectin interfaceCollectionService- Throws:
ServiceException
-
removeDigitalObjectFromAllCollections
public boolean removeDigitalObjectFromAllCollections(de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject) throws ServiceException Description copied from interface:CollectionServiceRemoves a digitalObject from all collections, to which it was connected to.- Specified by:
removeDigitalObjectFromAllCollectionsin interfaceCollectionService- Parameters:
digitalObject- the digital object- Returns:
- boolean value for success
- Throws:
ServiceException
-
save
public void save(de.digitalcollections.model.identifiable.entity.Collection entity) throws ServiceException, ValidationException Description copied from interface:UniqueObjectServicePersist anUniqueObject(with validation)- Specified by:
savein interfaceUniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
savein classEntityServiceImpl<de.digitalcollections.model.identifiable.entity.Collection>- Parameters:
entity- theUniqueObject(not yet stored)- Throws:
ServiceException- in case of an errorValidationException- in case of a validation error
-
saveWithParent
public de.digitalcollections.model.identifiable.entity.Collection saveWithParent(de.digitalcollections.model.identifiable.entity.Collection child, de.digitalcollections.model.identifiable.entity.Collection parent) throws ServiceException - Specified by:
saveWithParentin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Parameters:
child- newly created child node to be savedparent- parent node the new node is child of- Returns:
- saved child node
- Throws:
ServiceException- if saving fails
-
setDigitalObjects
public boolean setDigitalObjects(de.digitalcollections.model.identifiable.entity.Collection collection, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects) throws ServiceException - Specified by:
setDigitalObjectsin interfaceCollectionService- Throws:
ServiceException
-
update
public void update(de.digitalcollections.model.identifiable.entity.Collection entity) throws ServiceException, ValidationException Description copied from interface:UniqueObjectServiceUpdates an persistedUniqueObject- Specified by:
updatein interfaceUniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>- Overrides:
updatein classEntityServiceImpl<de.digitalcollections.model.identifiable.entity.Collection>- Parameters:
entity- theUniqueObject(with set UUID)- Throws:
ServiceException- in case of an errorValidationException- in case of a validation error
-
updateChildrenOrder
public boolean updateChildrenOrder(de.digitalcollections.model.identifiable.entity.Collection parent, List<de.digitalcollections.model.identifiable.entity.Collection> children) throws ServiceException - Specified by:
updateChildrenOrderin interfaceNodeService<de.digitalcollections.model.identifiable.entity.Collection>- Throws:
ServiceException
-