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
public class AnnotationServiceImpl extends DefaultComponent implements AnnotationService
- Since:
- 10.1
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
GET_ANNOTATION_PAGEPROVIDER_NAME
Deprecated.since 11.1, because unused.protected static String
GET_ANNOTATIONS_FOR_DOC_PAGEPROVIDER_NAME
Deprecated.since 11.1, because unused.protected static String
GET_ANNOTATIONS_FOR_DOCUMENT_PAGE_PROVIDER_NAME
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description AnnotationServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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 documentId, String entityId)
Deletes an external annotation by its {code entityId} under the document withdocumentId
.Annotation
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.List<Annotation>
getAnnotations(CoreSession session, String documentId, String xpath)
Gets all annotations for a document.Annotation
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.Annotation
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
applicationStarted, getApplicationStartedOrder
-
-
-
-
Field Detail
-
GET_ANNOTATION_PAGEPROVIDER_NAME
@Deprecated(since="11.1") protected static final String GET_ANNOTATION_PAGEPROVIDER_NAME
Deprecated.since 11.1, because unused.- See Also:
- Constant Field Values
-
GET_ANNOTATIONS_FOR_DOC_PAGEPROVIDER_NAME
@Deprecated(since="11.1") protected static final String GET_ANNOTATIONS_FOR_DOC_PAGEPROVIDER_NAME
Deprecated.since 11.1, because unused.- See Also:
- Constant Field Values
-
GET_ANNOTATIONS_FOR_DOCUMENT_PAGE_PROVIDER_NAME
protected static final String GET_ANNOTATIONS_FOR_DOCUMENT_PAGE_PROVIDER_NAME
- Since:
- 11.1
- See Also:
- Constant Field Values
-
-
Method Detail
-
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.
-
-