Class ActivityCollectionBuilder

java.lang.Object
io.goobi.viewer.model.iiif.discovery.ActivityCollectionBuilder

public class ActivityCollectionBuilder extends Object
Builder for both OrderedCollection and OrderedCollectionPage of Acvitities for the IIIF Discovery API.
Author:
Florian Alpers
  • Constructor Details

  • Method Details

    • buildCollection

      public de.intranda.api.iiif.discovery.OrderedCollection<de.intranda.api.iiif.discovery.Activity> buildCollection() throws PresentationException, IndexUnreachableException
      Creates a An OrderedCollection of Acvitities, linking to the first and last contained OrderedCollectionPage as well as counting the total number of Activities
      Returns:
      An OrderedCollection
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
    • buildPage

      public de.intranda.api.iiif.discovery.OrderedCollectionPage<de.intranda.api.iiif.discovery.Activity> buildPage(int pageNo) throws PresentationException, IndexUnreachableException
      Creates An OrderedCollection of Activities, i.e. a partial list of Activities. Which Activities are contained within the page depends on the given pageNo as well as the configured number of entries per page defined by Configuration#getIIIFDiscoveryAvtivitiesPerPage()
      Parameters:
      pageNo - The number of this page, beginning with 0
      Returns:
      An OrderedCollectionPage
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
    • setStartDate

      public ActivityCollectionBuilder setStartDate(LocalDateTime startDate)
      Set the earliest date of Activities to be included in this collection.
      Parameters:
      startDate - the earliest date of Activities to be included in this collection. If null, Activities are not filtered by date which is the default
      Returns:
      The Builder itself
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
    • setFilterQuery

      public ActivityCollectionBuilder setFilterQuery(String query)
      Set an additional filter query which must be met by all processes for which activities are counted
      Parameters:
      query - The solr query which counted processes must meet
      Returns:
      myself
    • getStartDate

      public LocalDateTime getStartDate()
      Get the earliest date of Activities which may be contained in the collection
      Returns:
      the earliest date of Activities which may be contained in the collection. May return null if no startDate is specified
    • getActivitiesPerPage

      public int getActivitiesPerPage()
      Get the number of activities per page as defined by Configuration#getIIIFDiscoveryAvtivitiesPerPage()
      Returns:
      the number of activities per page as defined by Configuration#getIIIFDiscoveryAvtivitiesPerPage()
    • getNumActivities

      public int getNumActivities() throws PresentationException, IndexUnreachableException
      Get the total number of Activities in the collection
      Returns:
      the total number of Activities in the collection
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
    • getCollectionURI

      public URI getCollectionURI()
      Get the URI for the collection request
      Returns:
      the URI for the collection request
    • getPageURI

      public URI getPageURI(int no)
      Get the URI to request a specific collection page
      Parameters:
      no - the page number
      Returns:
      the URI to request a specific collection page