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, httpClient

    Fields inherited from class de.digitalcollections.cudami.server.business.impl.service.identifiable.IdentifiableServiceImpl

    identifierService

    Fields inherited from class de.digitalcollections.cudami.server.business.impl.service.UniqueObjectServiceImpl

    repository
  • Constructor Summary

    Constructors
    Constructor
    Description
    CollectionServiceImpl(CollectionRepository repository, IdentifierService identifierService, UrlAliasService urlAliasService, HookProperties hookProperties, LocaleService localeService, CudamiConfig cudamiConfig)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    addChild(de.digitalcollections.model.identifiable.entity.Collection parent, de.digitalcollections.model.identifiable.entity.Collection child)
     
    boolean
    addChildren(de.digitalcollections.model.identifiable.entity.Collection parent, List<de.digitalcollections.model.identifiable.entity.Collection> children)
     
    boolean
    addDigitalObject(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject)
     
    boolean
    addDigitalObjects(de.digitalcollections.model.identifiable.entity.Collection collection, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects)
     
    boolean
    delete(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.BreadcrumbNavigation
    getBreadcrumbNavigation(de.digitalcollections.model.identifiable.entity.Collection collection)
    Build and return the breadcrumb navigation for the given node
    de.digitalcollections.model.identifiable.entity.Collection
    getByExample(de.digitalcollections.model.identifiable.entity.Collection example)
    Retrieve one UniqueObject by given properties in example instance.
    de.digitalcollections.model.identifiable.entity.Collection
    getByExampleAndActive(de.digitalcollections.model.identifiable.entity.Collection example)
     
    de.digitalcollections.model.identifiable.entity.Collection
    getByExampleAndActiveAndLocale(de.digitalcollections.model.identifiable.entity.Collection example, Locale pLocale)
     
    de.digitalcollections.model.identifiable.entity.Collection
    getByExampleAndLocale(de.digitalcollections.model.identifiable.entity.Collection example, Locale locale)
     
    de.digitalcollections.model.identifiable.entity.Collection
    getByIdentifier(de.digitalcollections.model.identifiable.Identifier identifier)
     
    de.digitalcollections.model.identifiable.entity.Collection
    getByRefId(long refId)
     
    List<de.digitalcollections.model.identifiable.entity.Collection>
    getChildren(de.digitalcollections.model.identifiable.entity.Collection collection)
     
    de.digitalcollections.model.identifiable.entity.Collection
    getParent(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)
     
     
    boolean
    removeChild(de.digitalcollections.model.identifiable.entity.Collection parent, de.digitalcollections.model.identifiable.entity.Collection child)
     
    boolean
    removeDigitalObject(de.digitalcollections.model.identifiable.entity.Collection collection, de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject)
     
    boolean
    removeDigitalObjectFromAllCollections(de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject)
    Removes a digitalObject from all collections, to which it was connected to.
    void
    save(de.digitalcollections.model.identifiable.entity.Collection entity)
    Persist an UniqueObject (with validation)
    de.digitalcollections.model.identifiable.entity.Collection
    saveWithParent(de.digitalcollections.model.identifiable.entity.Collection child, de.digitalcollections.model.identifiable.entity.Collection parent)
     
    boolean
    setDigitalObjects(de.digitalcollections.model.identifiable.entity.Collection collection, List<de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject> digitalObjects)
     
    void
    update(de.digitalcollections.model.identifiable.entity.Collection entity)
    Updates an persisted UniqueObject
    boolean
    updateChildrenOrder(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, sendNotification

    Methods inherited from class de.digitalcollections.cudami.server.business.impl.service.UniqueObjectServiceImpl

    count, create, delete, getAll, getByExamples, getByExamplesAndFiltering, setDefaultSorting

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface de.digitalcollections.cudami.server.business.api.service.content.ManagedContentService

    setPublicationStatus, setPublicationStatus

    Methods inherited from interface de.digitalcollections.cudami.server.business.api.service.identifiable.NodeService

    getBreadcrumbNavigation

    Methods inherited from interface de.digitalcollections.cudami.server.business.api.service.UniqueObjectService

    count, create, delete, getAll, getByExamples, getByExamplesAndFiltering
  • Constructor Details

  • Method Details

    • addChild

      public boolean addChild(de.digitalcollections.model.identifiable.entity.Collection parent, de.digitalcollections.model.identifiable.entity.Collection child) throws ServiceException
      Specified by:
      addChild in interface NodeService<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:
      addChildren in interface NodeService<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:
      addDigitalObject in interface CollectionService
      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:
      addDigitalObjects in interface CollectionService
      Throws:
      ServiceException
    • delete

      public boolean delete(de.digitalcollections.model.identifiable.entity.Collection collection) throws ConflictException, ServiceException
      Specified by:
      delete in interface UniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>
      Overrides:
      delete in class UniqueObjectServiceImpl<de.digitalcollections.model.identifiable.entity.Collection,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>>
      Throws:
      ConflictException
      ServiceException
    • 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:
      find in interface UniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>
      Overrides:
      find in class IdentifiableServiceImpl<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:
      findActive in interface CollectionService
      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:
      findActiveChildren in interface CollectionService
      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:
      findByLanguageAndInitial in interface IdentifiableService<de.digitalcollections.model.identifiable.entity.Collection>
      Overrides:
      findByLanguageAndInitial in class IdentifiableServiceImpl<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:
      findChildren in interface NodeService<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:
      findDigitalObjects in interface CollectionService
      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:
      findRootNodes in interface NodeService<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:
      getActiveChildren in interface CollectionService
      Throws:
      ServiceException
    • getBreadcrumbNavigation

      public de.digitalcollections.model.view.BreadcrumbNavigation getBreadcrumbNavigation(de.digitalcollections.model.identifiable.entity.Collection collection) throws ServiceException
      Description copied from interface: NodeService
      Build and return the breadcrumb navigation for the given node
      Specified by:
      getBreadcrumbNavigation in interface NodeService<de.digitalcollections.model.identifiable.entity.Collection>
      Parameters:
      collection - the node.
      Returns:
      BreadcrumbNavigation with labels in all available languages
      Throws:
      ServiceException
    • getByExample

      public de.digitalcollections.model.identifiable.entity.Collection getByExample(de.digitalcollections.model.identifiable.entity.Collection example) throws ServiceException
      Description copied from interface: UniqueObjectService
      Retrieve one UniqueObject by given properties in example instance.
      Specified by:
      getByExample in interface UniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>
      Parameters:
      example - example instance containing unique property
      Returns:
      the found UniqueObject or null
      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:
      getByExampleAndActive in interface CollectionService
      Throws:
      ServiceException
    • getByExampleAndActiveAndLocale

      public de.digitalcollections.model.identifiable.entity.Collection getByExampleAndActiveAndLocale(de.digitalcollections.model.identifiable.entity.Collection example, Locale pLocale) throws ServiceException
      Specified by:
      getByExampleAndActiveAndLocale in interface CollectionService
      Throws:
      ServiceException
    • getByExampleAndLocale

      public de.digitalcollections.model.identifiable.entity.Collection getByExampleAndLocale(de.digitalcollections.model.identifiable.entity.Collection example, Locale locale) throws ServiceException
      Specified by:
      getByExampleAndLocale in interface IdentifiableService<de.digitalcollections.model.identifiable.entity.Collection>
      Specified by:
      getByExampleAndLocale in interface UniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>
      Overrides:
      getByExampleAndLocale in class IdentifiableServiceImpl<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:
      getByIdentifier in interface IdentifiableService<de.digitalcollections.model.identifiable.entity.Collection>
      Overrides:
      getByIdentifier in class IdentifiableServiceImpl<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:
      getByRefId in interface EntityService<de.digitalcollections.model.identifiable.entity.Collection>
      Overrides:
      getByRefId in class EntityServiceImpl<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:
      getChildren in interface NodeService<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:
      getParent in interface NodeService<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:
      getParents in interface NodeService<de.digitalcollections.model.identifiable.entity.Collection>
      Throws:
      ServiceException
    • getRandom

      public List<de.digitalcollections.model.identifiable.entity.Collection> getRandom(int count) throws ServiceException
      Specified by:
      getRandom in interface UniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>
      Overrides:
      getRandom in class UniqueObjectServiceImpl<de.digitalcollections.model.identifiable.entity.Collection,EntityRepository<de.digitalcollections.model.identifiable.entity.Collection>>
      Throws:
      ServiceException
    • getRootNodesLanguages

      public List<Locale> getRootNodesLanguages() throws ServiceException
      Specified by:
      getRootNodesLanguages in interface NodeService<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:
      removeChild in interface NodeService<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:
      removeDigitalObject in interface CollectionService
      Throws:
      ServiceException
    • removeDigitalObjectFromAllCollections

      public boolean removeDigitalObjectFromAllCollections(de.digitalcollections.model.identifiable.entity.digitalobject.DigitalObject digitalObject) throws ServiceException
      Description copied from interface: CollectionService
      Removes a digitalObject from all collections, to which it was connected to.
      Specified by:
      removeDigitalObjectFromAllCollections in interface CollectionService
      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: UniqueObjectService
      Persist an UniqueObject (with validation)
      Specified by:
      save in interface UniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>
      Overrides:
      save in class EntityServiceImpl<de.digitalcollections.model.identifiable.entity.Collection>
      Parameters:
      entity - the UniqueObject (not yet stored)
      Throws:
      ServiceException - in case of an error
      ValidationException - 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:
      saveWithParent in interface NodeService<de.digitalcollections.model.identifiable.entity.Collection>
      Parameters:
      child - newly created child node to be saved
      parent - 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:
      setDigitalObjects in interface CollectionService
      Throws:
      ServiceException
    • update

      public void update(de.digitalcollections.model.identifiable.entity.Collection entity) throws ServiceException, ValidationException
      Description copied from interface: UniqueObjectService
      Updates an persisted UniqueObject
      Specified by:
      update in interface UniqueObjectService<de.digitalcollections.model.identifiable.entity.Collection>
      Overrides:
      update in class EntityServiceImpl<de.digitalcollections.model.identifiable.entity.Collection>
      Parameters:
      entity - the UniqueObject (with set UUID)
      Throws:
      ServiceException - in case of an error
      ValidationException - 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:
      updateChildrenOrder in interface NodeService<de.digitalcollections.model.identifiable.entity.Collection>
      Throws:
      ServiceException