Class AnnotationGenerator
java.lang.Object
org.dspace.app.iiif.model.generator.AnnotationGenerator
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final de.digitalcollections.iiif.model.Motivationstatic final de.digitalcollections.iiif.model.Motivationstatic final de.digitalcollections.iiif.model.Motivationstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationGenerator(@NotNull String identifier) AnnotationGenerator(@NotNull String identifier, @NotNull de.digitalcollections.iiif.model.Motivation motivation) -
Method Summary
Modifier and TypeMethodDescriptionde.digitalcollections.iiif.model.sharedcanvas.Resource<de.digitalcollections.iiif.model.openannotation.Annotation>Creates and returns a resource model.setMotivation(@NotNull de.digitalcollections.iiif.model.Motivation motivation) Sets the motivation field.setOnCanvas(CanvasGenerator canvas) Sets the canvas that is associated with this annotation.setResource(ContentAsTextGenerator contentAsText) Sets a text resource for this annotation.setResource(ExternalLinksGenerator otherContent) Sets an external link for this annotation.setWithin(List<ManifestGenerator> within) Set the within property for this annotation.
-
Field Details
-
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
-
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
Sets the canvas that is associated with this annotation.- Parameters:
canvas-- Returns:
-
setResource
Sets a text resource for this annotation.- Parameters:
contentAsText-- Returns:
-
setResource
Sets an external link for this annotation.- Parameters:
otherContent- external link generator- Returns:
-
setWithin
Set the within property for this annotation. This property is a list of manifests. The property is renamed to partOf in v3Used 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:IIIFResourceCreates and returns a resource model.- Specified by:
generateResourcein interfaceIIIFResource- Returns:
- resource model
-