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 StringGET_ANNOTATION_PAGEPROVIDER_NAMEDeprecated.since 11.1, because unused.protected static StringGET_ANNOTATIONS_FOR_DOC_PAGEPROVIDER_NAMEDeprecated.since 11.1, because unused.protected static StringGET_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 AnnotationcreateAnnotation(CoreSession session, Annotation annotation)Creates an annotation on a document.voiddeleteAnnotation(CoreSession session, String annotationId)Deletes an annotation for a document.voiddeleteExternalAnnotation(CoreSession session, String documentId, String entityId)Deletes an external annotation by its {code entityId} under the document withdocumentId.AnnotationgetAnnotation(CoreSession s, String annotationId)Gets an annotation.protected DocumentModelgetAnnotationModel(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.AnnotationgetExternalAnnotation(CoreSession session, String documentId, String entityId)Gets an external annotation by itsentityIdunder 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)voidupdateAnnotation(CoreSession session, String annotationId, Annotation annotation)Updates an annotation for a document.AnnotationupdateExternalAnnotation(CoreSession session, String documentId, String entityId, Annotation annotation)Updates an external annotation by itsentityIdunder 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
-
-
Constructor Detail
-
AnnotationServiceImpl
public AnnotationServiceImpl()
-
-
Method Detail
-
createAnnotation
public Annotation createAnnotation(CoreSession session, Annotation annotation) throws CommentSecurityException
Description copied from interface:AnnotationServiceCreates an annotation on a document.- Specified by:
createAnnotationin 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:AnnotationServiceGets an annotation.- Specified by:
getAnnotationin interfaceAnnotationService- Parameters:
s- the core sessionannotationId- the annotation document model id- Returns:
- the annotation, or
nullif 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:AnnotationServiceGets all annotations for a document.- Specified by:
getAnnotationsin 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:AnnotationServiceUpdates an annotation for a document.- Specified by:
updateAnnotationin 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:AnnotationServiceDeletes an annotation for a document.- Specified by:
deleteAnnotationin 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:AnnotationServiceGets an external annotation by itsentityIdunder the document withdocumentId.- Specified by:
getExternalAnnotationin interfaceAnnotationService- Returns:
- the annotation with given
entityIdunder 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:AnnotationServiceUpdates an external annotation by itsentityIdunder the document withdocumentId.- Specified by:
updateExternalAnnotationin interfaceAnnotationService- Returns:
- the updated annotation with given
entityIdunder 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:AnnotationServiceDeletes an external annotation by its {code entityId} under the document withdocumentId.- Specified by:
deleteExternalAnnotationin 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.
-
-