Changes for page User Mentions

Last modified by Vincent Massol on 2024/02/26 17:57

From version 52.3
edited by Manuel Leduc
on 2020/05/11 18:04
Change comment: There is no comment for this version
To version 52.5
edited by Manuel Leduc
on 2020/05/11 18:08
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -361,15 +361,21 @@
361 361  Mentions are identified by listening to XWiki existing events. The events listed below are listened to using a class implementing org.xwiki.observation.AbstractEventListener.
362 362  
363 363  |=Type|=Events|=Content
364 -|Document/AWM textarea| org.xwiki.bridge.event.DocumentCreatedEvent, org.xwiki.bridge.event.AnnotationAddedEvent|XDOM/Fields of type LargeStringProperty of the objects of the document.|
365 -|Comment| org.xwiki.bridge.event.CommentAddedEvent, org.xwiki.bridge.event.AnnotationAddedEvent|XDOM|
366 -|Annotation| org.xwiki.bridge.event.AnnotationAddedEvent, org.xwiki.bridge.event.AnnotationAddedEvent|XDOM|
364 +|Document/AWM textarea|
367 367  
368 -To make the event handling asynchronous, the only task of this event listener is to create 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.
366 +{{{ org.xwiki.bridge.event.DocumentCreatedEvent, org.xwiki.bridge.event.AnnotationAddedEvent}}}|XDOM/Fields of type LargeStringProperty of the objects of the document.|
367 +|Comment|
369 369  
370 -In the case of content initial creation (DocumentCreatedEvent, CommentAddedEvent, AnnotationAddedEvent), all occurrences of the mention macro found in the content trigger a mention.
369 +{{{ org.xwiki.bridge.event.CommentAddedEvent, org.xwiki.bridge.event.AnnotationAddedEvent}}}|XDOM|
370 +|Annotation|
371 371  
372 -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.
372 +{{{ org.xwiki.bridge.event.AnnotationAddedEvent, org.xwiki.bridge.event.AnnotationAddedEvent}}}|XDOM|
373 +
374 +To make the event handling asynchronous, the only task of this event listener is to create 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.
375 +
376 +In the case of content initial creation ({{{DocumentCreatedEvent, CommentAddedEvent, AnnotationAddedEvent}}}), all occurrences of the mention macro found in the content trigger a mention.
377 +
378 +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.
373 373  Newly identified mention are realized by counting the number of occurrences of the mentions to a given user in the updated XDOM, and to do the same task on the initial XDOM. A notification is sent to a given user if her number of mentions has increased.
374 374  
375 375  (% class="box infomessage" %)
... ... @@ -379,22 +379,22 @@
379 379  
380 380  Note that this count must be realized after the resolution of the mentions macro's identifiers because there might be more than one way to identify the same user.
381 381  
382 -In practice, triggering a mention is realized by emitting a new event called org.xwiki.bridge.event.MentionCreatedEvent.
388 +In practice, triggering a mention is realized by emitting a new event called {{{org.xwiki.bridge.event.MentionCreatedEvent}}}.
383 383  
384 384  One event is created for each mentioned user. If a mention refers to a group, an event is created for each member of the group.
385 385  
386 386  == MentionCreatedEvent handling ==
387 387  
388 -This event can be freely listened to using a class implementing org.xwiki.observation.AbstractEventListener.
394 +This event can be freely listened to using a class implementing {{{org.xwiki.observation.AbstractEventListener}}}.
389 389  
390 -We provide a default implementation that is in charge 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.
396 +We provide a default implementation that is in charge 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.
391 391  
392 392  Dedicated events must be created, for each type of notification:
393 393  
394 -* DocumentMentionEvent: for mentions from a document body
395 -* AnnotationMentionEvent: for mentions from an annotation
396 -* CommentMentionEvent: for mentions from a comment
397 -* AWMFieldMentionEvent: for mentions from an AWM textarea field
400 +* {{{DocumentMentionEvent}}}: for mentions from a document body
401 +* {{{AnnotationMentionEvent}}}: for mentions from an annotation
402 +* {{{CommentMentionEvent}}}: for mentions from a comment
403 +* {{{AWMFieldMentionEvent}}}: for mentions from an AWM textarea field
398 398  
399 399  == Notifications integration ==
400 400  

Get Connected