Package org.xwiki.annotation.io
Interface IOService
-
@Role public interface IOService
This component provides services related to annotations storage and retrieval. It operates with string serialized references for the targets of annotations. This interface does not restrict the implementation of the annotation targets, they can be anything referencable through a string.- Since:
- 2.3M1
- Version:
- $Id: d2bab7711a4678aefcdd5d80d2e89a9cdd450bec $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAnnotation(String target, Annotation annotation)
Adds annotation on the specified target.Annotation
getAnnotation(String target, String annotationID)
Collection<Annotation>
getAnnotations(String target)
Returns all the annotations on the passed content.void
removeAnnotation(String target, String annotationID)
Removes an annotation given by its identifier, which should be unique among all annotations on the same target.void
updateAnnotations(String target, Collection<Annotation> annotations)
Updates the set of annotations in the annotations store.
-
-
-
Method Detail
-
getAnnotations
Collection<Annotation> getAnnotations(String target) throws IOServiceException
Returns all the annotations on the passed content.- Parameters:
target
- the string serialized reference to the content for which to get the annotations- Returns:
- all annotations which target the specified content
- Throws:
IOServiceException
- if any exception occurs while manipulating annotations store
-
getAnnotation
Annotation getAnnotation(String target, String annotationID) throws IOServiceException
- Parameters:
target
- the string serialized reference to the content for which the annotation is addedannotationID
- the identifier of the annotation- Returns:
- the annotation with the given id on the passed target
- Throws:
IOServiceException
- if any exception occurs while manipulating annotations store
-
addAnnotation
void addAnnotation(String target, Annotation annotation) throws IOServiceException
Adds annotation on the specified target.- Parameters:
target
- serialized reference of the target of the annotationannotation
- annotation to add on the target- Throws:
IOServiceException
- can be thrown if any exception occurs while manipulating annotations store
-
removeAnnotation
void removeAnnotation(String target, String annotationID) throws IOServiceException
Removes an annotation given by its identifier, which should be unique among all annotations on the same target.- Parameters:
target
- serialized reference of the target of the annotationannotationID
- annotation identifier- Throws:
IOServiceException
- can be thrown if any exception occurs while manipulating annotations store
-
updateAnnotations
void updateAnnotations(String target, Collection<Annotation> annotations) throws IOServiceException
Updates the set of annotations in the annotations store. They will be identified by their identifiers as returned byAnnotation.getId()
, and updated each to match the fields in the Annotation objects.- Parameters:
target
- serialized reference of the target of the annotationannotations
- collection of annotations to update- Throws:
IOServiceException
- can be thrown if any exception occurs while manipulating annotations store
-
-