Class AnnotationServiceImpl
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.platform.comment.impl.AnnotationServiceImpl
- All Implemented Interfaces:
AnnotationService
,Adaptable
,Component
,Extensible
,TimestampedService
- Since:
- 10.1
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
Deprecated.since 11.1, because unused.protected static final String
Deprecated.since 11.1, because unused.protected static final String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAnnotation
(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 documentId, String entityId) Deletes an external annotation by its {code entityId} under the document withdocumentId
.getAnnotation
(CoreSession s, String annotationId) Gets an annotation.protected DocumentModel
getAnnotationModel
(CoreSession session, String entityId) Deprecated, for removal: This API element is subject to removal in a future version.since 11.1.getAnnotations
(CoreSession session, String documentId, String xpath) Gets all annotations for a document.getExternalAnnotation
(CoreSession session, String documentId, String entityId) Gets an external annotation by itsentityId
under the document withdocumentId
.protected List<DocumentModel>
getPageProviderPage
(String ppName, Map<String, Serializable> props, Object... parameters) protected Stream<DocumentModel>
streamAnnotations
(CoreSession session, String documentId, String xpath) void
updateAnnotation
(CoreSession session, String annotationId, Annotation annotation) Updates an annotation for a document.updateExternalAnnotation
(CoreSession session, String documentId, String entityId, Annotation annotation) Updates an external annotation by itsentityId
under the document withdocumentId
.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.ecm.platform.comment.api.AnnotationService
deleteExternalAnnotation, getExternalAnnotation, updateExternalAnnotation
Methods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
GET_ANNOTATION_PAGEPROVIDER_NAME
Deprecated.since 11.1, because unused.- See Also:
-
GET_ANNOTATIONS_FOR_DOC_PAGEPROVIDER_NAME
Deprecated.since 11.1, because unused.- See Also:
-
GET_ANNOTATIONS_FOR_DOCUMENT_PAGE_PROVIDER_NAME
- Since:
- 11.1
- See Also:
-
-
Constructor Details
-
AnnotationServiceImpl
public AnnotationServiceImpl()
-
-
Method Details
-
createAnnotation
public Annotation createAnnotation(CoreSession session, Annotation annotation) throws CommentSecurityException Description copied from interface:AnnotationService
Creates an annotation on a document.- Specified by:
createAnnotation
in interfaceAnnotationService
- Parameters:
session
- the core sessionannotation
- the annotation to create- Returns:
- the created annotation
- Throws:
CommentSecurityException
- if the current user does have the right permissions on the document to annotate.
-
getAnnotation
public Annotation getAnnotation(CoreSession s, String annotationId) throws CommentNotFoundException, CommentSecurityException Description copied from interface:AnnotationService
Gets an annotation.- Specified by:
getAnnotation
in interfaceAnnotationService
- Parameters:
s
- the core sessionannotationId
- the annotation document model id- Returns:
- the annotation, or
null
if the annotation with the given id was not found - Throws:
CommentNotFoundException
- if no annotation was found with the given idCommentSecurityException
- if the current user does have the right permissions on the annotated document.
-
getAnnotations
public List<Annotation> getAnnotations(CoreSession session, String documentId, String xpath) throws CommentNotFoundException, CommentSecurityException Description copied from interface:AnnotationService
Gets all annotations for a document.- Specified by:
getAnnotations
in interfaceAnnotationService
- Parameters:
session
- the core sessiondocumentId
- the annotated document idxpath
- the annotated blob xpath in the document- Returns:
- the list of annotations, or an empty list if no annotation is found
- Throws:
CommentNotFoundException
- if no annotation was found with the given idCommentSecurityException
- if the current user does have the right permissions on the annotated document.
-
streamAnnotations
protected Stream<DocumentModel> streamAnnotations(CoreSession session, String documentId, String xpath) -
getPageProviderPage
protected List<DocumentModel> getPageProviderPage(String ppName, Map<String, Serializable> props, Object... parameters) -
updateAnnotation
public void updateAnnotation(CoreSession session, String annotationId, Annotation annotation) throws CommentNotFoundException, CommentSecurityException Description copied from interface:AnnotationService
Updates an annotation for a document.- Specified by:
updateAnnotation
in interfaceAnnotationService
- Parameters:
session
- the core sessionannotationId
- the annotation document model idannotation
- the annotation containing the modifications- Throws:
CommentNotFoundException
- if no annotation was found with the given idCommentSecurityException
- if the current user does have the right permissions on the annotated document.
-
deleteAnnotation
public void deleteAnnotation(CoreSession session, String annotationId) throws CommentNotFoundException Description copied from interface:AnnotationService
Deletes an annotation for a document.- Specified by:
deleteAnnotation
in interfaceAnnotationService
- Parameters:
session
- the core sessionannotationId
- the annotation document model id- Throws:
CommentNotFoundException
- if no annotation was found with the given id
-
getExternalAnnotation
public Annotation getExternalAnnotation(CoreSession session, String documentId, String entityId) throws CommentNotFoundException, CommentSecurityException Description copied from interface:AnnotationService
Gets an external annotation by itsentityId
under the document withdocumentId
.- Specified by:
getExternalAnnotation
in interfaceAnnotationService
- Returns:
- the annotation with given
entityId
under the document with givendocumentId
- Throws:
CommentNotFoundException
- if no annotation was found with the given external entity idCommentSecurityException
- if the current user does have the right permissions on the annotated document.
-
updateExternalAnnotation
public Annotation updateExternalAnnotation(CoreSession session, String documentId, String entityId, Annotation annotation) throws CommentNotFoundException, CommentSecurityException Description copied from interface:AnnotationService
Updates an external annotation by itsentityId
under the document withdocumentId
.- Specified by:
updateExternalAnnotation
in interfaceAnnotationService
- Returns:
- the updated annotation with given
entityId
under the document with givendocumentId
- Throws:
CommentNotFoundException
- if no annotation was found with the given external entity idCommentSecurityException
- if the current user does have the right permissions on the annotated document.
-
deleteExternalAnnotation
public void deleteExternalAnnotation(CoreSession session, String documentId, String entityId) throws CommentNotFoundException, CommentSecurityException Description copied from interface:AnnotationService
Deletes an external annotation by its {code entityId} under the document withdocumentId
.- Specified by:
deleteExternalAnnotation
in interfaceAnnotationService
- Throws:
CommentNotFoundException
- if no annotation was found with the given external entity idCommentSecurityException
- if the current user does have the right permissions on the annotated document.
-
getAnnotationModel
@Deprecated(since="11.1", forRemoval=true) protected DocumentModel getAnnotationModel(CoreSession session, String entityId) Deprecated, for removal: This API element is subject to removal in a future version.since 11.1. No used any more.
-