Interface AnnotationService
public interface AnnotationService
Manages user annotations within media.
-
Method Summary
Modifier and TypeMethodDescriptionAdds a new annotation to the database and returns the event with an updated annotationId, to make sure the annotationId stays uniqueChanges an annotation in the database it uses the annotationId to overwrite the value.getAnnotation(long id) Gets an annotation by its identifier.getAnnotations(int offset, int limit) Returns annotationsgetAnnotationsByDay(String day, int offset, int limit) Returns annotations of a given day (YYYYMMDD)getAnnotationsByMediapackageId(String mediapackageId, int offset, int limit) Returns annotations of a given mediapackage IDgetAnnotationsByType(String type, int offset, int limit) Returns annotations of a given typegetAnnotationsByTypeAndDay(String type, String day, int offset, int limit) Returns annotations of a given type and daygetAnnotationsByTypeAndMediapackageId(String type, String mediapackageId, int offset, int limit) Returns annotations of a given type and mediapackage idbooleanRemove a given annotation from database
-
Method Details
-
addAnnotation
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
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
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
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
Returns annotations- Parameters:
offset- the offsetlimit- the limit- Returns:
- the annotation list
-
getAnnotationsByMediapackageId
Returns annotations of a given mediapackage ID- Parameters:
mediapackageId- The mediapackage IDoffset- the offsetlimit- the limit- Returns:
- the annotation list
-
getAnnotationsByType
Returns annotations of a given type- Parameters:
type- The annotation typeoffset- the offsetlimit- the limit- Returns:
- the annotation list
-
getAnnotationsByDay
Returns annotations of a given day (YYYYMMDD)- Parameters:
day- The day in the format of YYYYMMDDoffset- the offsetlimit- the limit- Returns:
- the annotation list
-
getAnnotationsByTypeAndDay
Returns annotations of a given type and day- Parameters:
type- the annotation typeday- the dayoffset- the offsetlimit- 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 typemediapackageId- the mediapackage idoffset- the offsetlimit- the limit- Returns:
- the annotation list
-