Class RecordPagesResource
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionde.intranda.api.annotation.wa.collection.AnnotationPageReturns the crowdsourcing annotations created for a single page.de.intranda.api.iiif.presentation.IPresentationModelElementReturns the IIIF 3.0 canvas for a single page.de.intranda.api.annotation.wa.collection.AnnotationPageReturns the comments left on a single page.de.intranda.api.annotation.wa.collection.AnnotationPageReturns the fulltext of a page as IIIF 3.0 annotations.de.intranda.api.iiif.presentation.IPresentationModelElementgetManifest(String mode) Returns the IIIF 3.0 manifest for the record, limited to a single page.de.intranda.api.annotation.wa.collection.AnnotationPagegetMedia()Returns the annotation page containing the page's media resources.de.intranda.api.annotation.IAnnotationgetMediaItem(String itemId) Returns a single media annotation for a page by its identifier.
-
Constructor Details
-
RecordPagesResource
public RecordPagesResource(@Context HttpServletRequest request, @PathParam("pi") String pi, @PathParam("pageNo") Integer pageNo)
-
-
Method Details
-
getCanvas
@GET @Path("/canvas") @Produces("application/json") public de.intranda.api.iiif.presentation.IPresentationModelElement getCanvas() throws PresentationException, IndexUnreachableException, URISyntaxException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException, DAOExceptionReturns the IIIF 3.0 canvas for a single page.The canvas links to the page's comment and crowdsourcing annotation pages, adds the fulltext annotation page only if the page has fulltext, and, if enabled in the configuration, links to the record's page view in this viewer instance. Access requires the record's basic list permission.
- Returns:
- the
Canvas3for the requested page - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException- if no page exists at the given order for the recordPresentationExceptionIndexUnreachableExceptionURISyntaxExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionDAOException
-
getMedia
@GET @Path("/media") @Produces("application/json") public de.intranda.api.annotation.wa.collection.AnnotationPage getMedia() throws PresentationException, IndexUnreachableException, URISyntaxException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException, DAOExceptionReturns the annotation page containing the page's media resources.The media annotation page of the page's canvas is returned. The response is 404 if the IIIF content API is configured with a different base URL than this REST API. Access requires the record's basic list permission.
- Returns:
- the
AnnotationPagecontaining the page's media resources - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException- if the page has no matching media annotation page (e.g. the page is not an image)PresentationExceptionIndexUnreachableExceptionURISyntaxExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionDAOException
-
getMediaItem
@GET @Path("/media/{itemid}") @Produces("application/json") public de.intranda.api.annotation.IAnnotation getMediaItem(@PathParam("itemid") String itemId) throws PresentationException, IndexUnreachableException, URISyntaxException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException, DAOException Returns a single media annotation for a page by its identifier.The page's canvas is built and searched, across all of its annotation pages, for a single annotation whose identifier matches this endpoint's own URL. Access requires the record's basic list permission.
- Parameters:
itemId- identifier string of the annotation- Returns:
- the
IAnnotationmatching the given identifier - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException- if no matching annotation existsPresentationExceptionIndexUnreachableExceptionURISyntaxExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionDAOException
-
getFulltext
@GET @Path("/text") @Produces("application/json") public de.intranda.api.annotation.wa.collection.AnnotationPage getFulltext() throws PresentationException, IndexUnreachableException, URISyntaxException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException, DAOExceptionReturns the fulltext of a page as IIIF 3.0 annotations.If the page has an ALTO file, one annotation is created per text line; otherwise the page's plain fulltext, if any, is returned as a single annotation. If the page has neither, an empty annotation page is returned instead of an error. Access requires the page's fulltext view permission.
- Returns:
- the
AnnotationPageof fulltext annotations for the page - Throws:
PresentationExceptionIndexUnreachableExceptionURISyntaxExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionDAOException
-
getAnnotationsForRecord
@GET @Path("/annotations") @Produces("application/json") public de.intranda.api.annotation.wa.collection.AnnotationPage getAnnotationsForRecord() throws DAOExceptionReturns the crowdsourcing annotations created for a single page.Annotations are read from the database, not the Solr index, and delivered as a W3C web annotation page. This includes every crowdsourcing motivation (e.g. describing, commenting, tagging), which distinguishes it from the dedicated comments endpoint. Access requires the page's view-user-generated-content permission.
- Returns:
- the
AnnotationPagefor the requested page - Throws:
DAOException
-
getCommentsForPage
@GET @Path("/comments") @Produces("application/json") public de.intranda.api.annotation.wa.collection.AnnotationPage getCommentsForPage() throws DAOExceptionReturns the comments left on a single page.Comments are read from the database and delivered as a W3C web annotation page, one annotation per comment. Unlike the annotations endpoint, this only returns simple page comments, not other crowdsourcing motivations. Access requires the page's view-user-generated-content permission.
- Returns:
- the
AnnotationPageof comments for the requested page - Throws:
DAOException
-
getManifest
@GET @Path("/manifest") @Produces("application/json") public de.intranda.api.iiif.presentation.IPresentationModelElement getManifest(@QueryParam("mode") String mode) throws PresentationException, IndexUnreachableException, URISyntaxException, DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException Returns the IIIF 3.0 manifest for the record, limited to a single page.Only the requested page is added to the manifest as a canvas, instead of every page of the record, and the manifest's thumbnail is taken from that page; the manifest's own metadata still describes the whole record. Requesting a page for an anchor record, which has no pages of its own, is rejected instead of falling back to the anchor's collection. Access requires the record's basic list permission. The
modequery parameter has no effect on this endpoint.- Parameters:
mode- accepted but not evaluated by this endpoint; the manifest is always built with its default resource set- Returns:
- the
IPresentationModelElementfor the record - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException- if the record is an anchor record without pages of its ownPresentationExceptionIndexUnreachableExceptionURISyntaxExceptionDAOException
-