Changes for page User Mentions
Last modified by Vincent Massol on 2024/02/26 17:57
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -251,28 +251,63 @@ 251 251 252 252 The business logic triggered by introduction of a mention must be asynchronous and must not impact the reactiveness of the UX. 253 253 254 +(% class="wikigeneratedid" %) 255 +== Mentions macro == 254 254 257 +(% class="box errormessage" %) 258 +((( 259 +TODO 260 +))) 255 255 262 +== Mentions auto-completion == 256 256 264 +(% class="box errormessage" %) 265 +((( 266 +TODO 267 +))) 257 257 258 258 == Mention creation == 259 259 260 -Mentions are identified by listening to XWiki existing events 271 +Mentions are identified by listening to XWiki existing events. The event listed below are listened using a class implementing org.xwiki.observation.AbstractEventListener. 261 261 262 262 |=Type|=Events|=Content 263 263 |Document/AWM textarea| 264 264 265 -{{{org.xwiki.bridge.event.DocumentCreatedEvent, org.xwiki.bridge.event. DocumentUpdatedEvent}}}|XDOM/Fields of type LargeStringProperty of the objects of the document.276 +{{{org.xwiki.bridge.event.DocumentCreatedEvent, org.xwiki.bridge.event.AnnotationAddedEvent}}}|XDOM/Fields of type LargeStringProperty of the objects of the document. 266 266 |Comment| 267 267 268 -{{{org.xwiki.bridge.event.CommentAddedEvent, org.xwiki.bridge.event. CommentUpdatedEvent}}}|XDOM279 +{{{org.xwiki.bridge.event.CommentAddedEvent, org.xwiki.bridge.event.AnnotationAddedEvent}}}|XDOM 269 269 |Annotation| 270 270 271 -{{{org.xwiki.bridge.event.AnnotationAddedEvent, org.xwiki.bridge.event.Annotation UpdatedEvent}}}|XDOM282 +{{{org.xwiki.bridge.event.AnnotationAddedEvent, org.xwiki.bridge.event.AnnotationAddedEvent}}}|XDOM 272 272 284 +In order to make the event handling asynchronous, the only task of this event listener is to created a job executor request (MentionRequest) later handled by a dedicated org.xwiki.contrib.activitypub.internal.async.jobs.AbstractPageNotificationJob<MentionRequest, MentionStatus> implementation, in charge of the identification of actual mentions in the content. 273 273 274 -aaa 286 +In case of content initial creation (DocumentCreatedEvent, CommentAddedEvent, AnnotationAddedEvent), all occurrences of the mention macro found in the content triggers a mention. 275 275 288 +In case of content update (AnnotationAddedEvent, AnnotationAddedEvent, AnnotationAddedEvent), a comparison is realized against the previous version of the document, only newly introduced mention macro triggers a mention. 289 + 290 +In practice, triggering a mention is realized by emitting a new event called org.xwiki.bridge.event.MentionCreatedEvent. 291 + 292 +== MentionCreatedEvent handling == 293 + 294 +This event can be freely listened to using a class implementing org.xwiki.observation.AbstractEventListener. 295 + 296 +We provide a default implementation that is in change to identify if the mentioned user is a local user of the XWiki, and if so, send a notification using the org.xwiki.observation.ObservationManager component. 297 + 298 +Dedicated events must be created, for each type of notification: 299 + 300 +* DocumentMentionEvent: for mentions from a document body 301 +* AnnotationMentionEvent: for mentions from an annotation 302 +* CommentMentionEvent: for mentions from a comment 303 +* AWMFieldMentionEvent: for mentions from an AWM texterare field 304 + 305 +== Notifications integration == 306 + 307 +This component is dedicated to the handling and display of the mentions event. 308 + 309 +A specific template is to be defined for each type of mention. 310 + 276 276 = Existing discussions = 277 277 278 278 This section collects discussions that are related to user mentions.