Class AnnotationGenerator

java.lang.Object
org.dspace.app.iiif.model.generator.AnnotationGenerator
All Implemented Interfaces:
IIIFResource

public class AnnotationGenerator extends Object implements IIIFResource
Generator for an annotation model. Annotations associate content resources and commentary with a canvas. This is used for the seeAlso annotation and Search response.
  • Field Details

    • TYPE

      public static final String TYPE
      See Also:
    • PAINTING

      public static final de.digitalcollections.iiif.model.Motivation PAINTING
    • COMMENTING

      public static final de.digitalcollections.iiif.model.Motivation COMMENTING
    • LINKING

      public static final de.digitalcollections.iiif.model.Motivation LINKING
  • Constructor Details

    • AnnotationGenerator

      public AnnotationGenerator(@NotNull @NotNull String identifier)
    • AnnotationGenerator

      public AnnotationGenerator(@NotNull @NotNull String identifier, @NotNull @NotNull de.digitalcollections.iiif.model.Motivation motivation)
  • Method Details

    • setMotivation

      public AnnotationGenerator setMotivation(@NotNull @NotNull de.digitalcollections.iiif.model.Motivation motivation)
      Sets the motivation field. Required.
      Parameters:
      motivation - the motivation
      Returns:
    • setOnCanvas

      public AnnotationGenerator setOnCanvas(CanvasGenerator canvas)
      Sets the canvas that is associated with this annotation.
      Parameters:
      canvas -
      Returns:
    • setResource

      public AnnotationGenerator setResource(ContentAsTextGenerator contentAsText)
      Sets a text resource for this annotation.
      Parameters:
      contentAsText -
      Returns:
    • setResource

      public AnnotationGenerator setResource(ExternalLinksGenerator otherContent)
      Sets an external link for this annotation.
      Parameters:
      otherContent - external link generator
      Returns:
    • setWithin

      public AnnotationGenerator setWithin(List<ManifestGenerator> within)
      Set the within property for this annotation. This property is a list of manifests. The property is renamed to partOf in v3

      Used by search result annotations.

      Parameters:
      within -
      Returns:
    • generateResource

      public de.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.openannotation.Annotation> generateResource()
      Description copied from interface: IIIFResource
      Creates and returns a resource model.
      Specified by:
      generateResource in interface IIIFResource
      Returns:
      resource model