Class CollectionBuilder
java.lang.Object
io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractBuilder
io.goobi.viewer.model.iiif.presentation.v2.builder.CollectionBuilder
Builds IIIF Presentation API v2 Collection resources from Solr index data.
- Author:
- Florian Alpers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]Required field to create manifest stubs for works in collection.static final StringConstantRSS_FEED_FORMAT="Rss feed".static final StringConstantRSS_FEED_LABEL="Rss feed".Fields inherited from class io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractBuilder
config, REQUIRED_SOLR_FIELDS, urls -
Constructor Summary
ConstructorsConstructorDescriptionCollectionBuilder(AbstractApiUrlManager apiUrlManager) Creates a new CollectionBuilder instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContainedWorks(String collectionField, String topElement, de.intranda.api.iiif.presentation.v2.Collection2 collection) addContainedWorks.voidaddTagListService(de.intranda.api.iiif.presentation.v2.Collection2 collection, String collectionField, String facetField, String label) Add a taglist service to the collection and all subcollections.de.intranda.api.iiif.presentation.v2.Collection2createCollection(CollectionView collectionView, HierarchicalBrowseDcElement baseElement, URI uri) createCollection.createCollectionQuery(String collectionField, String topElement) createCollectionQuery.createCollectionView(String collectionField, String facetField, String splittingChar) de.intranda.api.iiif.presentation.v2.Collection2generateCollection(String collectionField, String topElement, String facetField, String splittingChar, List<String> ignoreCollections) generateCollection.getCollectionView(String collectionField, String groupingField, String splittingChar) getCollectionView.getFacetField(String collectionField) getFacetField.Methods inherited from class io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractBuilder
absolutize, absolutize, addCrowdourcingAnnotations, addEventMetadataToWorkElement, addLanguageFields, addMetadata, addRendering, addSeeAlso, contained, getAnnotationListURI, getAnnotationListURI, getAnnotationURI, getAnnotationURI, getAttributions, getAutoCompleteServiceURI, getAutoSuggestURI, getCanvasURI, getCollectionURI, getCommentAnnotationURI, getDescription, getDocument, getDocumentWithChildren, getEventFields, getExternalManifestURI, getImageAnnotationURI, getLabel, getLabel, getLabelIfExists, getLayerURI, getLidoResolverUrl, getLocale, getManifestURI, getManifestURI, getMetsResolverUrl, getPageManifestURI, getPageOrderFromCanvasURI, getPIFromCanvasURI, getRangeURI, getRenderings, getSearchServiceURI, getSearchURI, getSeeAlsos, getSequenceURI, getSolrFieldList, getViewUrl
-
Field Details
-
CONTAINED_WORKS_QUERY_FIELDS
Required field to create manifest stubs for works in collection. -
RSS_FEED_LABEL
ConstantRSS_FEED_LABEL="Rss feed".- See Also:
-
RSS_FEED_FORMAT
ConstantRSS_FEED_FORMAT="Rss feed".- See Also:
-
-
Constructor Details
-
CollectionBuilder
Creates a new CollectionBuilder instance.- Parameters:
apiUrlManager- the URL manager for building API paths- Throws:
URISyntaxException- if any.
-
-
Method Details
-
generateCollection
public de.intranda.api.iiif.presentation.v2.Collection2 generateCollection(String collectionField, String topElement, String facetField, String splittingChar, List<String> ignoreCollections) throws IndexUnreachableException, URISyntaxException, PresentationException, ViewerConfigurationException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException generateCollection.- Parameters:
collectionField- Solr field name identifying the collectiontopElement- name of the collection element to use as root; null or blank for top-levelfacetField- A SOLR field which values are requested for all records within the collection and stored within the collection for later usesplittingChar- character separating hierarchy levels in collection namesignoreCollections- collection names to exclude from the result- Returns:
- the generated IIIF Collection for the given Solr collection field and top element
- Throws:
IndexUnreachableException- if any.URISyntaxException- if any.PresentationException- if any.ViewerConfigurationException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException- if the top element is not empty and is not a collection
-
addContainedWorks
public void addContainedWorks(String collectionField, String topElement, de.intranda.api.iiif.presentation.v2.Collection2 collection) throws PresentationException, IndexUnreachableException, URISyntaxException addContainedWorks.- Parameters:
collectionField- Solr field name identifying the collectiontopElement- name of the root collection element to query works forcollection- the IIIF collection to add the work manifests to- Throws:
PresentationException- if any.IndexUnreachableException- if any.URISyntaxException- if any.
-
createCollectionQuery
createCollectionQuery.- Parameters:
collectionField- Solr field name identifying the collectiontopElement- name of the top-level collection element to filter by; null for all- Returns:
- the Solr query string for retrieving records in the given collection hierarchy
-
createCollection
public de.intranda.api.iiif.presentation.v2.Collection2 createCollection(CollectionView collectionView, HierarchicalBrowseDcElement baseElement, URI uri) throws URISyntaxException, ViewerConfigurationException createCollection.- Parameters:
collectionView- the collection view providing metadata and child elementsbaseElement- the collection element to build the IIIF collection for; null for top-leveluri- the identifier URI for the resulting IIIF collection- Returns:
- the IIIF Collection built from the given collection view and base element
- Throws:
URISyntaxException- if any.ViewerConfigurationException- if any.
-
addTagListService
public void addTagListService(de.intranda.api.iiif.presentation.v2.Collection2 collection, String collectionField, String facetField, String label) throws IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException Add a taglist service to the collection and all subcollections. The taglist service provides a list of- Parameters:
collection- the IIIF collection to attach the service tocollectionField- the Solr field name identifying the collectionfacetField- the Solr field whose values populate the tag listlabel- display label for the tag list service- Throws:
IndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getCollectionView
public CollectionView getCollectionView(String collectionField, String groupingField, String splittingChar) throws IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException getCollectionView.- Parameters:
collectionField- Solr field name identifying the collectiongroupingField- Solr field used for grouping or faceting within the collectionsplittingChar- character separating hierarchy levels in collection names- Returns:
- the CollectionView for the given field, retrieved from session cache or freshly created
- Throws:
IndexUnreachableException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
createCollectionView
public CollectionView createCollectionView(String collectionField, String facetField, String splittingChar) throws IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException - Parameters:
collectionField- the Solr field name identifying the collectionfacetField- A SOLR field which values are queried and kept in the collectionView for later usesplittingChar- character used to separate hierarchy levels in collection names- Returns:
CollectionView- Throws:
IndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getFacetField
getFacetField.- Parameters:
collectionField- Solr field name to derive the facet field from- Returns:
- the corresponding Solr facet field name for the given collection field (e.g. MD_ prefix replaced with FACET_)
-