Class IIIFPresentationAPIHandler

java.lang.Object
io.goobi.viewer.controller.imaging.IIIFPresentationAPIHandler

public class IIIFPresentationAPIHandler extends Object
Creates urls to IIIF Presentation api calls to get manifests, canvases, annotationLists or layers.
Author:
Florian Alpers
  • Constructor Details

    • IIIFPresentationAPIHandler

      public IIIFPresentationAPIHandler(AbstractApiUrlManager urls, Configuration configuration) throws URISyntaxException
      Creates a new IIIFPresentationAPIHandler instance.
      Parameters:
      urls - API URL manager for building IIIF resource URLs
      configuration - viewer configuration used to initialize the builder
      Throws:
      URISyntaxException - if any.
  • Method Details

    • getPageManifestUrl

      public String getPageManifestUrl(String pi, int pageNo) throws URISyntaxException
      Returns the url to the manifest for the given pi.
      Parameters:
      pi - persistent identifier of the record
      pageNo - physical page number
      Returns:
      The IIIF manifest
      Throws:
      URISyntaxException - if any.
    • getManifestUrl

      public String getManifestUrl(String pi) throws URISyntaxException
      Returns the url to the manifest for the given pi.
      Parameters:
      pi - persistent identifier of the record
      Returns:
      The IIIF manifest
      Throws:
      URISyntaxException - if any.
    • getCollectionUrl

      public String getCollectionUrl() throws URISyntaxException
      Returns the url to a IIIF collection resource containing all top level collections for the field DC.
      Returns:
      The IIIF collection url
      Throws:
      URISyntaxException - if any.
    • getCollectionUrl

      public String getCollectionUrl(String field) throws URISyntaxException
      Returns the url to a IIIF collection resource containing all top level collections for the given field.
      Parameters:
      field - Solr field name identifying the collection hierarchy
      Returns:
      The IIIF collection url
      Throws:
      URISyntaxException - if any.
    • getCollectionUrl

      public String getCollectionUrl(String field, String collection) throws URISyntaxException
      Returns the url to a IIIF collection resource for the given collection name for the given field.
      Parameters:
      field - Solr field name identifying the collection hierarchy
      collection - collection name within the field hierarchy
      Returns:
      The IIIF collection url
      Throws:
      URISyntaxException - if any.
    • getLayerUrl

      public String getLayerUrl(String pi, String annotationType) throws URISyntaxException
      Returns a IIIF layer with all annotations of the given type within the work of the given pi.
      Parameters:
      pi - persistent identifier of the record
      annotationType - name of the annotation type to filter by
      Returns:
      The IIIF layer url
      Throws:
      URISyntaxException - if any.
    • getAnnotationsUrl

      public String getAnnotationsUrl(String pi, int pageOrder, String annotationType) throws URISyntaxException
      Returns a IIIF annotation list containing all annotations of the given type for the given page.
      Parameters:
      pi - persistent identifier of the record
      pageOrder - physical page order number
      annotationType - name of the annotation type to filter by
      Returns:
      The IIIF annotation list
      Throws:
      URISyntaxException - if any.
    • getCanvasUrl

      public String getCanvasUrl(String pi, int pageOrder) throws URISyntaxException
      Returns the IIIF canvas for the given page.
      Parameters:
      pi - persistent identifier of the record
      pageOrder - physical page order number
      Returns:
      The IIIF canvas url
      Throws:
      URISyntaxException - if any.
    • getRangeUrl

      public String getRangeUrl(String pi, String logId) throws URISyntaxException
      Returns a IIIF range representing the structural element for the given PI and logid. If the logid is the logid of the work itself, The "CONTENT" range is returned, containing all topmost ranges but no canvases and no metadata
      Parameters:
      pi - persistent identifier of the record
      logId - logical structure element identifier
      Returns:
      The IIIF range url
      Throws:
      URISyntaxException - if any.