Class ActivityCollectionBuilder
java.lang.Object
io.goobi.viewer.model.iiif.discovery.ActivityCollectionBuilder
Builder for both
OrderedCollection and OrderedCollectionPage of
Acvitities for the IIIF Discovery API.- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescriptionActivityCollectionBuilder(AbstractApiUrlManager apiUrlManager, SolrSearchIndex searchIndex, int itemsPerPage) -
Method Summary
Modifier and TypeMethodDescriptionde.intranda.api.iiif.discovery.OrderedCollection<de.intranda.api.iiif.discovery.Activity> Creates a AnOrderedCollectionofAcvitities, linking to the first and last containedOrderedCollectionPageas well as counting the total number of Activities.de.intranda.api.iiif.discovery.OrderedCollectionPage<de.intranda.api.iiif.discovery.Activity> buildPage(int pageNo) Creates AnOrderedCollectionofActivities, i.e. a partial list of Activities.intGet the number of activities per page as defined byConfiguration#getIIIFDiscoveryAvtivitiesPerPage().Gets the URI for the collection request.intGets the total number ofActivitiesin the collection.getPageURI(int no) Gets the URI to request a specific collection page.Gets the earliest date of Activities which may be contained in the collection.setFilterQuery(String query) Sets an additional filter query which must be met by all processes for which activities are counted.setStartDate(LocalDateTime startDate) Set the earliest date of Activities to be included in this collection.
-
Constructor Details
-
ActivityCollectionBuilder
public ActivityCollectionBuilder(AbstractApiUrlManager apiUrlManager, SolrSearchIndex searchIndex, int itemsPerPage)
-
-
Method Details
-
buildCollection
public de.intranda.api.iiif.discovery.OrderedCollection<de.intranda.api.iiif.discovery.Activity> buildCollection() throws PresentationException, IndexUnreachableExceptionCreates a AnOrderedCollectionofAcvitities, linking to the first and last containedOrderedCollectionPageas 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 AnOrderedCollectionofActivities, 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 byConfiguration#getIIIFDiscoveryAvtivitiesPerPage()- Parameters:
pageNo- The number of this page, beginning with 0- Returns:
- An
OrderedCollectionPage - Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
setStartDate
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
Sets 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
Gets 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 byConfiguration#getIIIFDiscoveryAvtivitiesPerPage().- Returns:
- the number of activities per page as defined by
Configuration#getIIIFDiscoveryAvtivitiesPerPage()
-
getNumActivities
Gets the total number ofActivitiesin the collection.- Returns:
- the total number of
Activitiesin the collection - Throws:
PresentationException- if any.IndexUnreachableException- if any.
-
getCollectionURI
Gets the URI for the collection request.- Returns:
- the URI for the collection request
-
getPageURI
Gets the URI to request a specific collection page.- Parameters:
no- the page number- Returns:
- the URI to request a specific collection page
-