public class AnnotationServiceImpl extends DefaultComponent implements AnnotationService
Modifier and Type | Field and Description |
---|---|
protected static String |
ANNOTATION_FOLDER_NAME |
protected static String |
ANNOTATION_NAME |
protected static String |
ANNOTATIONS_PLACELESS_STORAGE_PROPERTY |
protected static String |
GET_ANNOTATION_PAGEPROVIDER_NAME |
protected static String |
GET_ANNOTATIONS_FOR_DOC_PAGEPROVIDER_NAME |
protected static String |
HIDDEN_FOLDER_TYPE |
lastModified
Constructor and Description |
---|
AnnotationServiceImpl() |
Modifier and Type | Method and Description |
---|---|
Annotation |
createAnnotation(CoreSession session,
Annotation annotation)
Creates an annotation on a document.
|
void |
deleteAnnotation(CoreSession session,
String annotationId)
Deletes an annotation for a document.
|
Annotation |
getAnnotation(CoreSession session,
String annotationId)
Gets an annotation.
|
protected DocumentModel |
getAnnotationModel(CoreSession session,
String annotationId)
Session must be privileged.
|
List<Annotation> |
getAnnotations(CoreSession session,
String documentId,
String xpath)
Gets all annotations for a document.
|
protected void |
setAnnotationProperties(DocumentModel annotationModel,
Annotation annotation) |
void |
updateAnnotation(CoreSession session,
Annotation annotation)
Updates an annotation for a document.
|
activate, deactivate, getAdapter, getLastModified, registerContribution, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterContribution, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
protected static final String ANNOTATION_NAME
protected static final String GET_ANNOTATION_PAGEPROVIDER_NAME
protected static final String GET_ANNOTATIONS_FOR_DOC_PAGEPROVIDER_NAME
protected static final String ANNOTATIONS_PLACELESS_STORAGE_PROPERTY
protected static final String HIDDEN_FOLDER_TYPE
protected static final String ANNOTATION_FOLDER_NAME
public AnnotationServiceImpl()
public Annotation createAnnotation(CoreSession session, Annotation annotation)
AnnotationService
createAnnotation
in interface AnnotationService
session
- the core sessionannotation
- the annotation to createpublic Annotation getAnnotation(CoreSession session, String annotationId)
AnnotationService
getAnnotation
in interface AnnotationService
session
- the core sessionannotationId
- the annotation idnull
if the annotation with the given id was not foundpublic List<Annotation> getAnnotations(CoreSession session, String documentId, String xpath)
AnnotationService
getAnnotations
in interface AnnotationService
session
- the core sessiondocumentId
- the annotated document idxpath
- the annotated blob xpath in the documentpublic void updateAnnotation(CoreSession session, Annotation annotation)
AnnotationService
updateAnnotation
in interface AnnotationService
session
- the core sessionannotation
- the annotation containing the modificationspublic void deleteAnnotation(CoreSession session, String annotationId) throws IllegalArgumentException
AnnotationService
deleteAnnotation
in interface AnnotationService
session
- the core sessionannotationId
- the annotation idIllegalArgumentException
- if no annotation was found with the given idprotected void setAnnotationProperties(DocumentModel annotationModel, Annotation annotation)
protected DocumentModel getAnnotationModel(CoreSession session, String annotationId)
Copyright © 2018 Nuxeo. All rights reserved.