Interface NodeService<N extends de.digitalcollections.model.identifiable.Identifiable>

All Superinterfaces:
IdentifiableService<N>
All Known Subinterfaces:
CollectionService, TopicService, WebpageService
All Known Implementing Classes:
CollectionServiceImpl, TopicServiceImpl, WebpageServiceImpl

public interface NodeService<N extends de.digitalcollections.model.identifiable.Identifiable>
extends IdentifiableService<N>
  • Method Details

    • addChild

      default boolean addChild​(N parent, N child)
    • addChild

      default boolean addChild​(java.util.UUID parentUuid, java.util.UUID childUuid)
    • addChildren

      default boolean addChildren​(N parent, java.util.List<N> children)
    • addChildren

      boolean addChildren​(java.util.UUID parentUuid, java.util.List<java.util.UUID> childrenUUIDs)
    • getBreadcrumbNavigation

      de.digitalcollections.model.view.BreadcrumbNavigation getBreadcrumbNavigation​(java.util.UUID nodeUuid)
      Build and return the breadcrumb navigation for the given node UUID
      Parameters:
      nodeUuid - the uuid of the node.
      Returns:
      BreadcrumbNavigation with labels in all available languages
    • getBreadcrumbNavigation

      default de.digitalcollections.model.view.BreadcrumbNavigation getBreadcrumbNavigation​(java.util.UUID nodeUuid, java.util.Locale locale, java.util.Locale fallbackLocale)
      Build and return the breadcrumb navigation for the given webpage UUID and desired locale. If no label for that locale exists, use the label for the fallbackLocale, and if even this fails, use the first locale.
      Parameters:
      nodeUuid - the uuid of the webpage
      locale - the desired locale for the navigation item labels
      fallbackLocale - the fallback locale for the navigation item labels
      Returns:
      Breadcrumb navigation with labels in the desired language (if possible)
    • getChildren

      default java.util.List<N> getChildren​(N node)
    • getChildren

      java.util.List<N> getChildren​(java.util.UUID nodeUuid)
    • getChildren

      de.digitalcollections.model.paging.PageResponse<N> getChildren​(java.util.UUID uuid, de.digitalcollections.model.paging.PageRequest pageRequest)
    • findChildren

      de.digitalcollections.model.paging.SearchPageResponse<N> findChildren​(java.util.UUID uuid, de.digitalcollections.model.paging.SearchPageRequest searchPageRequest)
    • getParent

      default N getParent​(N node)
    • getParent

      N getParent​(java.util.UUID nodeUuid)
    • getParents

      java.util.List<N> getParents​(java.util.UUID uuid)
    • getRootNodes

      de.digitalcollections.model.paging.PageResponse<N> getRootNodes​(de.digitalcollections.model.paging.PageRequest pageRequest)
    • findRootNodes

      de.digitalcollections.model.paging.SearchPageResponse<N> findRootNodes​(de.digitalcollections.model.paging.SearchPageRequest searchPageRequest)
    • getRootNodesLanguages

      java.util.List<java.util.Locale> getRootNodesLanguages()
    • removeChild

      default boolean removeChild​(N parent, N child)
    • removeChild

      boolean removeChild​(java.util.UUID parentUuid, java.util.UUID childUuid)
    • saveWithParent

      default N saveWithParent​(N child, java.util.UUID parentUuid) throws IdentifiableServiceException, ValidationException
      Parameters:
      child - newly created child node to be saved
      parentUuid - parent node the new node is child of
      Returns:
      saved child node
      Throws:
      IdentifiableServiceException - if saving fails
      ValidationException
    • saveWithParent

      N saveWithParent​(java.util.UUID childUuid, java.util.UUID parentUuid) throws IdentifiableServiceException
      Parameters:
      childUuid - UUID of newly created child node
      parentUuid - parent node the new node is child of
      Returns:
      saved child node
      Throws:
      IdentifiableServiceException - if saving fails
    • updateChildrenOrder

      boolean updateChildrenOrder​(java.util.UUID parentUuid, java.util.List<N> children)