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
ConstructorDescriptionActivityCollectionBuilder
(AbstractApiUrlManager apiUrlManager, SolrSearchIndex searchIndex, int itemsPerPage) -
Method Summary
Modifier and TypeMethodDescriptionde.intranda.api.iiif.discovery.OrderedCollection<de.intranda.api.iiif.discovery.Activity>
Creates a AnOrderedCollection
ofAcvitities
, linking to the first and last containedOrderedCollectionPage
as well as counting the total number of Activitiesde.intranda.api.iiif.discovery.OrderedCollectionPage<de.intranda.api.iiif.discovery.Activity>
buildPage
(int pageNo) Creates AnOrderedCollection
ofActivities
, i.e. a partial list of Activities.int
Get the number of activities per page as defined byConfiguration#getIIIFDiscoveryAvtivitiesPerPage()
Get the URI for the collection requestint
Get the total number ofActivities
in the collectiongetPageURI
(int no) Get the URI to request a specific collection pageGet the earliest date of Activities which may be contained in the collectionsetFilterQuery
(String query) Set an additional filter query which must be met by all processes for which activities are countedsetStartDate
(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 AnOrderedCollection
ofAcvitities
, linking to the first and last containedOrderedCollectionPage
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 AnOrderedCollection
ofActivities
, 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
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
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 byConfiguration#getIIIFDiscoveryAvtivitiesPerPage()
- Returns:
- the number of activities per page as defined by
Configuration#getIIIFDiscoveryAvtivitiesPerPage()
-
getNumActivities
Get the total number ofActivities
in the collection- Returns:
- the total number of
Activities
in the collection - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
getCollectionURI
Get the URI for the collection request- Returns:
- the URI for the collection request
-
getPageURI
Get the URI to request a specific collection page- Parameters:
no
- the page number- Returns:
- the URI to request a specific collection page
-