Class WebAnnotationBuilder

java.lang.Object
io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractAnnotationBuilder
io.goobi.viewer.model.iiif.presentation.v2.builder.WebAnnotationBuilder

public class WebAnnotationBuilder extends AbstractAnnotationBuilder
Author:
florian
  • Constructor Details

    • WebAnnotationBuilder

      public WebAnnotationBuilder(AbstractApiUrlManager apiUrlManager)
      Parameters:
      apiUrlManager -
  • Method Details

    • getCrowdsourcingAnnotationsFromSolr

      public Map<Integer,List<de.intranda.api.annotation.wa.WebAnnotation>> getCrowdsourcingAnnotationsFromSolr(String pi, boolean urlOnlyTarget, javax.servlet.http.HttpServletRequest request) throws PresentationException, IndexUnreachableException
      Get all annotations for the given PI from the SOLR index, sorted by page number. The annotations are stored as DOCTYPE:UGC in the SOLR and are converted to WebAnnotations here
      Parameters:
      pi - The persistent identifier of the work to query
      urlOnlyTarget - a boolean.
      request -
      Returns:
      A map of page numbers (1-based) mapped to a list of associated annotations
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
    • getCrowdsourcingAnnotations

      public Map<Integer,List<de.intranda.api.annotation.wa.WebAnnotation>> getCrowdsourcingAnnotations(String pi, boolean urlOnlyTarget) throws DAOException
      Get all annotations for the given PI from the the DAO, sorted by page number. The annotations are stored as DOCTYPE:UGC in the SOLR and are converted to WebAnnotations here
      Parameters:
      pi - The persistent identifier of the work to query
      urlOnlyTarget - a boolean.
      Returns:
      A map of page numbers (1-based) mapped to a list of associated annotations
      Throws:
      PresentationException - if any.
      IndexUnreachableException - if any.
      DAOException
    • getCrowdsourcingAnnotation

      public de.intranda.api.annotation.IAnnotation getCrowdsourcingAnnotation(String id) throws PresentationException, IndexUnreachableException
      Parameters:
      id -
      Returns:
      IAnnotation
      Throws:
      PresentationException
      IndexUnreachableException
    • createUGCWebAnnotation

      public de.intranda.api.annotation.wa.WebAnnotation createUGCWebAnnotation(org.apache.solr.common.SolrDocument doc, boolean urlOnlyTarget)

      createWebAnnotation.

      Parameters:
      doc - a SolrDocument object.
      urlOnlyTarget - a boolean.
      Returns:
      a WebAnnotation object.
    • createUGCWebAnnotation

      public de.intranda.api.annotation.wa.WebAnnotation createUGCWebAnnotation(String pi, org.apache.solr.common.SolrDocument doc, boolean urlOnlyTarget)

      createWebAnnotation.

      Parameters:
      pi - a String object.
      doc - a SolrDocument object.
      urlOnlyTarget - a boolean.
      Returns:
      a WebAnnotation object.
    • createFragmentTarget

      public de.intranda.api.annotation.IResource createFragmentTarget(String pi, int pageOrder, String coordString, boolean urlOnlyTarget)
      Parameters:
      pi -
      pageOrder -
      coordString -
      urlOnlyTarget -
      Returns:
      IResource
    • createAnnnotationBodyFromUGCDocument

      public de.intranda.api.annotation.IResource createAnnnotationBodyFromUGCDocument(org.apache.solr.common.SolrDocument doc)
      Parameters:
      doc -
      Returns:
      IResource
    • getCrowdsourcingAnnotationCollection

      public de.intranda.api.annotation.wa.collection.AnnotationPage getCrowdsourcingAnnotationCollection(URI uri, String pi, boolean urlsOnly) throws DAOException
      Parameters:
      uri -
      pi -
      urlsOnly -
      Returns:
      AnnotationPage
      Throws:
      IndexUnreachableException
      PresentationException
      DAOException
    • getCrowdsourcingAnnotationCollection

      public de.intranda.api.annotation.wa.collection.AnnotationPage getCrowdsourcingAnnotationCollection(URI uri, String pi, Integer pageNo, boolean urlsOnly) throws DAOException
      Parameters:
      uri -
      pi -
      pageNo -
      urlsOnly -
      Returns:
      AnnotationPage
      Throws:
      DAOException