Class RecordResource

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

@Path("/records/{pi}") public class RecordResource extends Object
REST resource providing IIIF Presentation v3 manifests and annotations for digitized records.
Author:
Florian Alpers
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    de.intranda.api.iiif.search.AutoSuggestResult
    autoCompleteInManifest(String query, String motivation, String date, String user, Integer page)
    Returns auto-complete suggestions for search terms within a IIIF manifest.
    de.intranda.api.annotation.IAnnotationCollection
    Returns all W3C Web Annotations recorded for the record as a single annotation collection.
    de.intranda.api.annotation.wa.collection.AnnotationPage
    Returns the single page of the record's annotation collection, containing all of its annotations.
    de.intranda.api.annotation.IAnnotationCollection
    Returns all user comments recorded for the record as a single annotation collection.
    de.intranda.api.annotation.IAnnotationCollection
    Returns the single page of the record's comment collection, containing all of its comments.
    de.intranda.api.iiif.presentation.IPresentationModelElement
    Returns the IIIF Presentation 3.0 manifest (or collection, for anchor records) for the record.
    de.intranda.api.iiif.search.SearchResult
    searchInManifest(String query, String motivation, String date, String user, Integer page)
    Serves the IIIF Search API of the record's manifest.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • getManifest

      @GET @Path("/manifest") @Produces("application/json") public de.intranda.api.iiif.presentation.IPresentationModelElement getManifest() throws PresentationException, IndexUnreachableException, URISyntaxException, ViewerConfigurationException, DAOException, de.unigoettingen.sub.commons.util.datasource.media.PageSource.IllegalPathSyntaxException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
      Returns the IIIF Presentation 3.0 manifest (or collection, for anchor records) for the record.

      When the record is configured to delegate to an external IIIF service, the response is instead an HTTP redirect to that service's manifest URL rather than a locally generated manifest. The manifest embeds the record's crowdsourcing annotations and user comments as annotation pages, hiding the annotation items behind an authorization service when the requester lacks the record's user-generated-content view privilege.

      Returns:
      the generated manifest or collection, or null when a redirect to an external manifest was issued instead
      Throws:
      PresentationException
      IndexUnreachableException
      URISyntaxException
      ViewerConfigurationException
      DAOException
      de.unigoettingen.sub.commons.util.datasource.media.PageSource.IllegalPathSyntaxException
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
    • getAnnotationsForRecord

      @GET @Path("/annotations") @Produces("application/json") public de.intranda.api.annotation.IAnnotationCollection getAnnotationsForRecord() throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
      Returns all W3C Web Annotations recorded for the record as a single annotation collection.

      The collection contains every annotation for the record on one page (its item count equals the total number of annotations).

      Returns:
      the record's annotation collection
      Throws:
      DAOException - if the annotations cannot be read from the database
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
    • getCommentsForRecord

      @GET @Path("/comments") @Produces("application/json") public de.intranda.api.annotation.IAnnotationCollection getCommentsForRecord() throws DAOException
      Returns all user comments recorded for the record as a single annotation collection.

      The collection contains every comment for the record on one page (its item count equals the total number of comments).

      Returns:
      the record's comment collection
      Throws:
      DAOException - if the comments cannot be read from the database
    • getAnnotationsPageForRecord

      @GET @Path("/annotations/1") @Produces("application/json") public de.intranda.api.annotation.wa.collection.AnnotationPage getAnnotationsPageForRecord() throws DAOException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
      Returns the single page of the record's annotation collection, containing all of its annotations.

      Because the collection has exactly one page, this endpoint always returns page 1; there is no parameter for requesting further pages. A record without annotations yields an empty page instead of an error.

      Returns:
      the record's annotation page
      Throws:
      DAOException - if the annotations cannot be read from the database
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
    • getCommentsForRecordPage

      @GET @Path("/comments/1") @Produces("application/json") public de.intranda.api.annotation.IAnnotationCollection getCommentsForRecordPage() throws DAOException
      Returns the single page of the record's comment collection, containing all of its comments.

      Because the collection has exactly one page, this endpoint always returns page 1; there is no parameter for requesting further pages. A record without comments yields an empty page instead of an error.

      Returns:
      the record's comment page
      Throws:
      DAOException - if the comments cannot be read from the database
    • searchInManifest

      @GET @Path("/manifest/search") @Produces("application/json") public de.intranda.api.iiif.search.SearchResult searchInManifest(@QueryParam("q") String query, @QueryParam("motivation") String motivation, @QueryParam("date") String date, @QueryParam("user") String user, @QueryParam("page") Integer page) throws IndexUnreachableException, PresentationException
      Serves the IIIF Search API of the record's manifest.

      Depending on the given motivation parameter, fulltext (motivation=painting) and/or crowdsourcing annotations, indexed metadata and user comments together (motivation=non-painting or motivation=describing) may be searched; omitting the parameter searches everything. Fulltext is only searched if the fulltext view permission is granted for the record.

      Parameters:
      query - The search query; a list of space separated terms. The search is for all complete words which match any of the query terms. Terms may contain the wildcard character '*' to represent an arbitrary number of characters within the word
      motivation - a space separated list of motivations of annotations to search for. Search for the following motivations is implemented:
      • painting: fulltext resources, searched only if the fulltext view permission is granted
      • non-painting or describing: crowdsourcing annotations, indexed metadata and user comments
      date - not supported. If this parameter is given, its name is listed in the 'ignored' property of the 'within' property of the answer
      user - not supported. If this parameter is given, its name is listed in the 'ignored' property of the 'within' property of the answer
      page - the page number for paged result sets. if this is empty, page=1 is assumed
      Returns:
      a SearchResult containing all annotations matching the query in the 'resources' property
      Throws:
      IndexUnreachableException - if any.
      PresentationException - if any.
    • autoCompleteInManifest

      @GET @Path("/manifest/autocomplete") @Produces("application/json") public de.intranda.api.iiif.search.AutoSuggestResult autoCompleteInManifest(@QueryParam("q") String query, @QueryParam("motivation") String motivation, @QueryParam("date") String date, @QueryParam("user") String user, @QueryParam("page") Integer page) throws IndexUnreachableException, PresentationException
      Returns auto-complete suggestions for search terms within a IIIF manifest.
      Parameters:
      query - partial query string for auto-completion
      motivation - space-separated list of annotation motivations to filter
      date - date filter (not supported; passed to 'ignored' property)
      user - user filter (not supported; passed to 'ignored' property)
      page - page number; not supported for auto-completion, the full term list is always returned
      Returns:
      the IIIF AutoSuggest result containing auto-completion candidates for the given query
      Throws:
      IndexUnreachableException - if any.
      PresentationException - if any.