Class RecordPageResource
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionde.intranda.api.annotation.IAnnotationCollectiongetAnnotationsForRecord(Integer pageNo) Returns the crowdsourcing annotations created for a single page.de.intranda.api.iiif.presentation.IPresentationModelElementReturns the IIIF 2.1.1 canvas for a single page.de.intranda.api.annotation.IAnnotationCollectiongetCommentsForPage(Integer pageNo) Returns the comments left on a single page.de.intranda.api.iiif.presentation.IPresentationModelElementgetManifest(Integer pageNo, String mode) Returns the full IIIF 2.1.1 manifest for the record, with the base sequence restricted to the given page.getNERTags(Integer pageNo, String type) Returns the named entities (persons, corporations, events, locations or miscellaneous) recognized on a single page.de.intranda.api.iiif.presentation.IPresentationModelElementgetSequence(String mode, String preferedView) Returns the IIIF 2.1.1 base sequence of all canvases for the record.de.intranda.api.annotation.IAnnotationCollectiongetTextForPage(Integer pageNo, String format, String granularity) Returns the text content of a page as an IIIF 2 annotation list, at block, line or word granularity.
-
Constructor Details
-
RecordPageResource
-
-
Method Details
-
getNERTags
@GET @Path("/{pageNo}/ner/tags") @Produces("application/json") public DocumentReference getNERTags(@PathParam("pageNo") Integer pageNo, @QueryParam("type") String type) throws PresentationException, IndexUnreachableException Returns the named entities (persons, corporations, events, locations or miscellaneous) recognized on a single page.Tags are extracted from the page's indexed ALTO file; pages for which no ALTO file is indexed, or for which the fulltext view permission is not granted, are silently omitted from the result rather than causing an error. The type filter is matched against the type recorded in the ALTO file; tags whose recorded type is not one of the known types are reported as "miscellaneous" and therefore appear only when no type is given.
- Parameters:
pageNo- page number (1-based)type- tag type to consider (person, corporation, event or location)- Returns:
- the named entities found on the page, grouped by tag
- Throws:
PresentationExceptionIndexUnreachableException
-
getSequence
@GET @Path("/sequence/base") @Produces("application/json") public de.intranda.api.iiif.presentation.IPresentationModelElement getSequence(@QueryParam("mode") String mode, @QueryParam("preferedView") String preferedView) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException, PresentationException, IndexUnreachableException, URISyntaxException, ViewerConfigurationException, DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException Returns the IIIF 2.1.1 base sequence of all canvases for the record.Unlike the manifest and canvas endpoints, this returns only the sequence element, not the surrounding manifest. Access requires the record's basic list permission.
- Parameters:
mode- build mode for manifest to select type of resources to include. Default is 'iiif' which returns the full IIIF manifest with all resources. 'thumbs' Does not read width and height of canvas resources and 'iiif_simple' ignores all resources from filespreferedView- set prefered goobi-viewer view for rendering attribute of canvases. Only valid values is 'fullscreen', any other value results in default object/image view being referenced.- Returns:
- the
Sequenceof all canvases of the record - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException- if the identifier refers to a collection, which has no sequencede.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundExceptionPresentationExceptionIndexUnreachableExceptionURISyntaxExceptionViewerConfigurationExceptionDAOException
-
getManifest
@GET @Path("/{pageNo}/manifest") @Produces("application/json") public de.intranda.api.iiif.presentation.IPresentationModelElement getManifest(@PathParam("pageNo") Integer pageNo, @QueryParam("mode") String mode) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException, PresentationException, IndexUnreachableException, URISyntaxException, ViewerConfigurationException, DAOException Returns the full IIIF 2.1.1 manifest for the record, with the base sequence restricted to the given page.The manifest still describes the whole record (and, for multi-volume works, its child volumes); the canvas sequence embedded in it is limited to the requested page instead of listing every page of the record, and the manifest carries no structural ranges. Access requires the record's basic list permission.
- Parameters:
pageNo- page number (1-based)mode- build mode for manifest to select type of resources to include. Default is 'iiif' which returns the full IIIF manifest with all resources. 'thumbs' Does not read width and height of canvas resources and 'iiif_simple' ignores all resources from files- Returns:
- the
Manifest2orCollection2for the record - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundExceptionPresentationExceptionIndexUnreachableExceptionURISyntaxExceptionViewerConfigurationExceptionDAOException
-
getCanvas
@GET @Path("/{pageNo}/canvas") @Produces("application/json") public de.intranda.api.iiif.presentation.IPresentationModelElement getCanvas(@PathParam("pageNo") Integer pageNo) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException, PresentationException, IndexUnreachableException, URISyntaxException, ViewerConfigurationException, DAOException Returns the IIIF 2.1.1 canvas for a single page.The canvas includes links to other content representations of the page (e.g. fulltext/ALTO) and, if any exist, the page's crowdsourcing annotations. Access requires the record's basic list permission.
- Parameters:
pageNo- page number (1-based)- Returns:
- the
Canvas2for the requested page - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundExceptionPresentationExceptionIndexUnreachableExceptionURISyntaxExceptionViewerConfigurationExceptionDAOException
-
getAnnotationsForRecord
@GET @Path("/{pageNo}/annotations") @Produces("application/json") public de.intranda.api.annotation.IAnnotationCollection getAnnotationsForRecord(@PathParam("pageNo") Integer pageNo) throws DAOException Returns the crowdsourcing annotations created for a single page.Annotations are read from the database, not the Solr index, and are delivered as an Open Annotation collection. This includes every crowdsourcing motivation (e.g. describing, commenting, tagging), which distinguishes it from the dedicated comments endpoint.
- Parameters:
pageNo- page number (1-based)- Returns:
- the annotation collection for the requested page
- Throws:
DAOException
-
getCommentsForPage
@GET @Path("/{pageNo}/comments") @Produces("application/json") public de.intranda.api.annotation.IAnnotationCollection getCommentsForPage(@PathParam("pageNo") Integer pageNo) throws DAOException Returns the comments left on a single page.Comments are read from the database and delivered as an Open Annotation collection, one annotation per comment. Unlike the annotations endpoint, this only returns simple page comments, not other crowdsourcing motivations.
- Parameters:
pageNo- page number (1-based)- Returns:
- the annotation collection of comments for the requested page
- Throws:
DAOException
-
getTextForPage
@GET @Path("/{pageNo}/text") @Produces("application/json") public de.intranda.api.annotation.IAnnotationCollection getTextForPage(@PathParam("pageNo") Integer pageNo, @QueryParam("format") String format, @QueryParam("granularity") @DefaultValue("line") String granularity) throws URISyntaxException, DAOException, PresentationException, IndexUnreachableException, ViewerConfigurationException Returns the text content of a page as an IIIF 2 annotation list, at block, line or word granularity.- Parameters:
pageNo- page number (1-based)format- annotation format of the response ('oa' or W3C web annotations)granularity- OCR annotation granularity, 'word', 'block' or 'line'; unknown values are treated as 'line'- Returns:
- annotation list containing the page text
- Throws:
URISyntaxExceptionDAOExceptionPresentationExceptionIndexUnreachableExceptionViewerConfigurationException
-