Interface AnnotationService


public interface AnnotationService
Manages user annotations within media.
  • Method Details

    • addAnnotation

      Annotation addAnnotation(Annotation a)
      Adds a new annotation to the database and returns the event with an updated annotationId, to make sure the annotationId stays unique
      Parameters:
      a - The Annotation that will be added to the database
      Returns:
      the updated annotation, with a new ID. NULL if there are errors while adding the annotation.
    • changeAnnotation

      Annotation changeAnnotation(Annotation a) throws org.opencastproject.util.NotFoundException
      Changes an annotation in the database it uses the annotationId to overwrite the value. It returns the event with an updated annotation.
      Parameters:
      a - The Annotation that will be changed in the database
      Returns:
      the updated annotation. NULL if there are errors while changing the annotation.
      Throws:
      org.opencastproject.util.NotFoundException
    • removeAnnotation

      boolean removeAnnotation(Annotation a)
      Remove a given annotation from database
      Parameters:
      a - The Annotation that will be removed from the database
      Returns:
      true if successfull removed, false else.
    • getAnnotation

      Annotation getAnnotation(long id) throws org.opencastproject.util.NotFoundException
      Gets an annotation by its identifier.
      Parameters:
      id - the annotation identifier
      Returns:
      the annotation
      Throws:
      org.opencastproject.util.NotFoundException - if there is no annotation with this identifier
    • getAnnotations

      AnnotationList getAnnotations(int offset, int limit)
      Returns annotations
      Parameters:
      offset - the offset
      limit - the limit
      Returns:
      the annotation list
    • getAnnotationsByMediapackageId

      AnnotationList getAnnotationsByMediapackageId(String mediapackageId, int offset, int limit)
      Returns annotations of a given mediapackage ID
      Parameters:
      mediapackageId - The mediapackage ID
      offset - the offset
      limit - the limit
      Returns:
      the annotation list
    • getAnnotationsByType

      AnnotationList getAnnotationsByType(String type, int offset, int limit)
      Returns annotations of a given type
      Parameters:
      type - The annotation type
      offset - the offset
      limit - the limit
      Returns:
      the annotation list
    • getAnnotationsByDay

      AnnotationList getAnnotationsByDay(String day, int offset, int limit)
      Returns annotations of a given day (YYYYMMDD)
      Parameters:
      day - The day in the format of YYYYMMDD
      offset - the offset
      limit - the limit
      Returns:
      the annotation list
    • getAnnotationsByTypeAndDay

      AnnotationList getAnnotationsByTypeAndDay(String type, String day, int offset, int limit)
      Returns annotations of a given type and day
      Parameters:
      type - the annotation type
      day - the day
      offset - the offset
      limit - the limit
      Returns:
      the annotation list
    • getAnnotationsByTypeAndMediapackageId

      AnnotationList getAnnotationsByTypeAndMediapackageId(String type, String mediapackageId, int offset, int limit)
      Returns annotations of a given type and mediapackage id
      Parameters:
      type - the annotation type
      mediapackageId - the mediapackage id
      offset - the offset
      limit - the limit
      Returns:
      the annotation list