Class RecordPagesResource

java.lang.Object
io.goobi.viewer.api.rest.v2.records.RecordPagesResource

@Path("/records/{pi}/pages/{pageNo}") public class RecordPagesResource extends Object
Author:
Florian Alpers
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    de.intranda.api.annotation.wa.collection.AnnotationPage
    Returns the crowdsourcing annotations created for a single page.
    de.intranda.api.iiif.presentation.IPresentationModelElement
    Returns the IIIF 3.0 canvas for a single page.
    de.intranda.api.annotation.wa.collection.AnnotationPage
    Returns the comments left on a single page.
    de.intranda.api.annotation.wa.collection.AnnotationPage
    Returns the fulltext of a page as IIIF 3.0 annotations.
    de.intranda.api.iiif.presentation.IPresentationModelElement
    Returns the IIIF 3.0 manifest for the record, limited to a single page.
    de.intranda.api.annotation.wa.collection.AnnotationPage
    Returns the annotation page containing the page's media resources.
    de.intranda.api.annotation.IAnnotation
    Returns a single media annotation for a page by its identifier.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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, DAOException
      Returns 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 Canvas3 for the requested page
      Throws:
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException - if no page exists at the given order for the record
      PresentationException
      IndexUnreachableException
      URISyntaxException
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
      DAOException
    • 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, DAOException
      Returns 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 AnnotationPage containing 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)
      PresentationException
      IndexUnreachableException
      URISyntaxException
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
      DAOException
    • 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 IAnnotation matching the given identifier
      Throws:
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException - if no matching annotation exists
      PresentationException
      IndexUnreachableException
      URISyntaxException
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
      DAOException
    • 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, DAOException
      Returns 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 AnnotationPage of fulltext annotations for the page
      Throws:
      PresentationException
      IndexUnreachableException
      URISyntaxException
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
      DAOException
    • getAnnotationsForRecord

      @GET @Path("/annotations") @Produces("application/json") public de.intranda.api.annotation.wa.collection.AnnotationPage getAnnotationsForRecord() throws DAOException
      Returns 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 AnnotationPage for the requested page
      Throws:
      DAOException
    • getCommentsForPage

      @GET @Path("/comments") @Produces("application/json") public de.intranda.api.annotation.wa.collection.AnnotationPage getCommentsForPage() throws DAOException
      Returns 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 AnnotationPage of 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 mode query 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 IPresentationModelElement for the record
      Throws:
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - if the record is an anchor record without pages of its own
      PresentationException
      IndexUnreachableException
      URISyntaxException
      DAOException