public class AnnotationServiceImpl extends DefaultComponent implements AnnotationService
Modifier and Type | Field and Description |
---|---|
protected static String |
GET_ANNOTATION_PAGEPROVIDER_NAME |
protected static String |
GET_ANNOTATIONS_FOR_DOC_PAGEPROVIDER_NAME |
lastModified, name
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.
|
void |
deleteExternalAnnotation(CoreSession session,
String entityId)
Deletes an external annotation.
|
Annotation |
getAnnotation(CoreSession session,
String annotationId)
Gets an annotation.
|
protected DocumentModel |
getAnnotationModel(CoreSession session,
String entityId) |
List<Annotation> |
getAnnotations(CoreSession session,
String documentId,
String xpath)
Gets all annotations for a document.
|
Annotation |
getExternalAnnotation(CoreSession session,
String entityId)
Gets an annotation generated by an external service.
|
void |
updateAnnotation(CoreSession session,
String annotationId,
Annotation annotation)
Updates an annotation for a document.
|
void |
updateExternalAnnotation(CoreSession session,
String entityId,
Annotation annotation)
Updates an external annotation.
|
activate, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
protected static final String GET_ANNOTATION_PAGEPROVIDER_NAME
protected static final String GET_ANNOTATIONS_FOR_DOC_PAGEPROVIDER_NAME
public AnnotationServiceImpl()
public Annotation createAnnotation(CoreSession session, Annotation annotation) throws CommentSecurityException
AnnotationService
createAnnotation
in interface AnnotationService
session
- the core sessionannotation
- the annotation to createCommentSecurityException
- if the current user does have the right permissions on the document to annotate.public Annotation getAnnotation(CoreSession session, String annotationId) throws CommentNotFoundException, CommentSecurityException
AnnotationService
getAnnotation
in interface AnnotationService
session
- the core sessionannotationId
- the annotation document model idnull
if the annotation with the given id was not foundCommentNotFoundException
- if no annotation was found with the given idCommentSecurityException
- if the current user does have the right permissions on the annotated document.public List<Annotation> getAnnotations(CoreSession session, String documentId, String xpath) throws CommentNotFoundException, CommentSecurityException
AnnotationService
getAnnotations
in interface AnnotationService
session
- the core sessiondocumentId
- the annotated document idxpath
- the annotated blob xpath in the documentCommentNotFoundException
- if no annotation was found with the given idCommentSecurityException
- if the current user does have the right permissions on the annotated document.public void updateAnnotation(CoreSession session, String annotationId, Annotation annotation) throws CommentNotFoundException, CommentSecurityException
AnnotationService
updateAnnotation
in interface AnnotationService
session
- the core sessionannotationId
- the annotation document model idannotation
- the annotation containing the modificationsCommentNotFoundException
- if no annotation was found with the given idCommentSecurityException
- if the current user does have the right permissions on the annotated document.public void deleteAnnotation(CoreSession session, String annotationId) throws CommentNotFoundException
AnnotationService
deleteAnnotation
in interface AnnotationService
session
- the core sessionannotationId
- the annotation document model idCommentNotFoundException
- if no annotation was found with the given idpublic Annotation getExternalAnnotation(CoreSession session, String entityId) throws CommentNotFoundException, CommentSecurityException
AnnotationService
getExternalAnnotation
in interface AnnotationService
session
- the core sessionentityId
- the annotation entity idCommentNotFoundException
- if no annotation was found with the given external entity idCommentSecurityException
- if the current user does have the right permissions on the annotated document.public void updateExternalAnnotation(CoreSession session, String entityId, Annotation annotation) throws CommentNotFoundException, CommentSecurityException
AnnotationService
updateExternalAnnotation
in interface AnnotationService
session
- the core sessionentityId
- the annotation document model idannotation
- the annotation containing the modificationsCommentNotFoundException
- if no annotation was found with the given external entity idCommentSecurityException
- if the current user does have the right permissions on the annotated document.public void deleteExternalAnnotation(CoreSession session, String entityId) throws CommentNotFoundException, CommentSecurityException
AnnotationService
deleteExternalAnnotation
in interface AnnotationService
session
- the core sessionentityId
- the annotation entity idCommentNotFoundException
- if no annotation was found with the given external entity idCommentSecurityException
- if the current user does have the right permissions on the annotated document.protected DocumentModel getAnnotationModel(CoreSession session, String entityId)
Copyright © 2018 Nuxeo. All rights reserved.