Class IIIFPresentation2ResourceBuilder
java.lang.Object
io.goobi.viewer.api.rest.resourcebuilders.IIIFPresentation2ResourceBuilder
- Author:
- Florian Alpers
-
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionde.intranda.api.iiif.presentation.v2.SequencegetBaseSequence(String pi, BuildMode buildMode, String preferedViewName) de.intranda.api.iiif.presentation.IPresentationModelElementde.intranda.api.iiif.presentation.v2.Collection2getCollection(String collectionField, String topElement, List<String> ignore) Returns a iiif collection of the given topCollection for the give collection field.Getter for the fieldcollectionBuilder.de.intranda.api.iiif.presentation.v2.Collection2getCollections(String collectionField, List<String> ignore) Returns a iiif collection of all collections from the given solr-field.de.intranda.api.iiif.presentation.v2.Collection2getCollectionsWithGrouping(String collectionField, List<String> ignore, String groupingField) Returns a iiif collection of all collections from the given solr-field.de.intranda.api.iiif.presentation.v2.Collection2getCollectionWithGrouping(String collectionField, String topElement, String facetField, List<String> ignore) Returns a iiif collection of the given topCollection for the give collection field The response includes the metadata and subcollections of the direct child collections.de.intranda.api.iiif.presentation.v2.LayerGetter for the fieldlayerBuilder.de.intranda.api.iiif.presentation.IPresentationModelElementgetManifest(String pi, List<Integer> pagesToInclude, BuildMode mode) Getter for the fieldmanifestBuilder.List<de.intranda.api.iiif.presentation.IPresentationModelElement> getManifestsForQuery(String query, String sortFields, int first, int rows) getPreferedPageTypeForCanvas(String preferredViewName) de.intranda.api.iiif.presentation.v2.Range2Getter for the fieldsequenceBuilder.
-
Constructor Details
-
IIIFPresentation2ResourceBuilder
-
-
Method Details
-
getManifest
public de.intranda.api.iiif.presentation.IPresentationModelElement getManifest(String pi, List<Integer> pagesToInclude, BuildMode mode) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException, URISyntaxException, ViewerConfigurationException, DAOException - Parameters:
pi- persistent identifier of the record to buildpagesToInclude- list of page orders to include; empty means all pagesmode- build mode controlling which resources are included- Returns:
IPresentationModelElement- Throws:
PresentationExceptionIndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundExceptionURISyntaxExceptionViewerConfigurationExceptionDAOException
-
getRange
public de.intranda.api.iiif.presentation.v2.Range2 getRange(String pi, String logId) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException, URISyntaxException, ViewerConfigurationException, DAOException - Parameters:
pi- persistent identifier of the record to searchlogId- logical struct ID identifying the target range- Returns:
Range2- Throws:
PresentationExceptionIndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundExceptionURISyntaxExceptionViewerConfigurationExceptionDAOException
-
getBaseSequence
public de.intranda.api.iiif.presentation.v2.Sequence getBaseSequence(String pi, BuildMode buildMode, String preferedViewName) throws PresentationException, IndexUnreachableException, URISyntaxException, ViewerConfigurationException, DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException - Parameters:
pi- persistent identifier of the record to buildbuildMode- build mode controlling which resources are includedpreferedViewName- name of the preferred page type for canvas links- Returns:
Sequence- Throws:
PresentationExceptionIndexUnreachableExceptionURISyntaxExceptionViewerConfigurationExceptionDAOExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException
-
getPreferedPageTypeForCanvas
- Parameters:
preferredViewName- view name string to resolve to a page type- Returns:
- Preferred
PageTypefor given preferredViewName
-
getLayer
public de.intranda.api.iiif.presentation.v2.Layer getLayer(String pi, String typeName) throws PresentationException, IndexUnreachableException, URISyntaxException, ViewerConfigurationException, DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, IOException - Parameters:
pi- persistent identifier of the recordtypeName- annotation type name used to select the layer content- Returns:
Layer- Throws:
PresentationExceptionIndexUnreachableExceptionURISyntaxExceptionViewerConfigurationExceptionDAOExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundExceptionde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestExceptionIOException
-
getCanvas
public de.intranda.api.iiif.presentation.IPresentationModelElement getCanvas(String pi, Integer pageNo) throws URISyntaxException, ViewerConfigurationException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException, PresentationException, IndexUnreachableException, DAOException - Parameters:
pi- persistent identifier of the recordpageNo- physical page number of the canvas to retrieve- Returns:
IPresentationModelElement- Throws:
ViewerConfigurationExceptionURISyntaxExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundExceptionIndexUnreachableExceptionPresentationExceptionDAOException
-
getManifestBuilder
Getter for the fieldmanifestBuilder.- Returns:
- the ManifestBuilder used to construct IIIF manifests
-
getSequenceBuilder
Getter for the fieldsequenceBuilder.- Returns:
- the SequenceBuilder used to construct IIIF sequences of canvases
-
getLayerBuilder
Getter for the fieldlayerBuilder.- Returns:
- the LayerBuilder used to construct IIIF annotation layers
-
getCollections
public de.intranda.api.iiif.presentation.v2.Collection2 getCollections(String collectionField, List<String> ignore) throws PresentationException, IndexUnreachableException, URISyntaxException, ViewerConfigurationException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException Returns a iiif collection of all collections from the given solr-field. The response includes the metadata and subcollections of the topmost collections. Child collections may be accessed following the links in the @id properties in the member-collections Requires passing a language to set the language for all metadata values- Parameters:
collectionField- Solr field name that holds the collection valuesignore- list of collection names to exclude from the result- Returns:
- the IIIF Presentation v2 Collection containing all top-level collections for the given Solr field
- Throws:
PresentationException- if any.IndexUnreachableException- if any.URISyntaxException- if any.ViewerConfigurationException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getCollectionsWithGrouping
public de.intranda.api.iiif.presentation.v2.Collection2 getCollectionsWithGrouping(String collectionField, List<String> ignore, String groupingField) throws PresentationException, IndexUnreachableException, URISyntaxException, ViewerConfigurationException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException Returns a iiif collection of all collections from the given solr-field. The response includes the metadata and subcollections of the topmost collections. Child collections may be accessed following the links in the @id properties in the member-collections Requires passing a language to set the language for all metadata values- Parameters:
collectionField- Solr field name that holds the collection valuesignore- list of collection names to exclude from the resultgroupingField- Solr field used to group collections within the response- Returns:
- the IIIF Presentation v2 Collection containing all top-level collections grouped by the given Solr field
- Throws:
PresentationException- if any.IndexUnreachableException- if any.URISyntaxException- if any.ViewerConfigurationException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-
getCollection
public de.intranda.api.iiif.presentation.v2.Collection2 getCollection(String collectionField, String topElement, List<String> ignore) throws IndexUnreachableException, URISyntaxException, PresentationException, ViewerConfigurationException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException Returns a iiif collection of the given topCollection for the give collection field. The response includes the metadata and subcollections of the direct child collections. Collections further down the hierarchy may be accessed following the links in the @id properties in the member-collections Requires passing a language to set the language for all metadata values- Parameters:
collectionField- Solr field name that holds the collection valuestopElement- name of the root collection to use as the response rootignore- list of collection names to exclude from the result- Returns:
- the IIIF Presentation v2 Collection rooted at the given top-level collection element
- Throws:
IndexUnreachableException- if any.URISyntaxException- if any.PresentationException- if any.ViewerConfigurationException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException- If the topElement is not a collection
-
getManifestsForQuery
public List<de.intranda.api.iiif.presentation.IPresentationModelElement> getManifestsForQuery(String query, String sortFields, int first, int rows) throws DAOException, PresentationException, IndexUnreachableException, URISyntaxException, ViewerConfigurationException - Parameters:
query- Solr query string to select matching recordssortFields- comma-separated Solr sort field expressionsfirst- zero-based offset of the first result to returnrows- maximum number of results to return- Returns:
- List
- Throws:
DAOExceptionPresentationExceptionIndexUnreachableExceptionURISyntaxExceptionViewerConfigurationException
-
getCollectionWithGrouping
public de.intranda.api.iiif.presentation.v2.Collection2 getCollectionWithGrouping(String collectionField, String topElement, String facetField, List<String> ignore) throws IndexUnreachableException, URISyntaxException, PresentationException, ViewerConfigurationException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException Returns a iiif collection of the given topCollection for the give collection field The response includes the metadata and subcollections of the direct child collections. Collections further down the hierarchy may be accessed following the links in the @id properties in the member-collections Requires passing a language to set the language for all metadata values- Parameters:
collectionField- Solr field name that holds the collection valuestopElement- name of the root collection to use as the response rootfacetField- Solr field used for grouping/faceting within the collectionignore- list of collection names to exclude from the result- Returns:
- the IIIF Presentation v2 Collection rooted at the given top-level element, with sub-collections grouped by the facet field
- Throws:
IndexUnreachableException- if any.URISyntaxException- if any.PresentationException- if any.ViewerConfigurationException- if any.de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException- if the topElement is not a collection
-
getCollectionBuilder
Getter for the fieldcollectionBuilder.- Returns:
- the
CollectionBuilderinstance used to build IIIF collection responses
-