2017-05-18 18:26 GMT+02:00 Vincent Massol <vinc...@massol.net>: > > > On 17 May 2017, at 23:29, Clément Aubin <clement.au...@xwiki.com> wrote: > > > > Hi everyone, > > > > I’m currently working on a feature that should allow users to define > > custom notification types in XWiki only through the definition of an > > XObject (link to the issue : https://jira.xwiki.org/browse/XWIKI-14119). > > > > In this context, I wanted to know your thoughts about what properties > > should be proposed by this XObject. > > > > Currently, here is my proposition : > > > > - The application name (applicationName) : the event application name > > > > - A unique ID for the event (eventId) > > > > - An event «pretty» name / description (eventPrettyName) > > > > - An event icon, mainly displayed in the user notification preferences > > pane (eventIcon) > > > > - An event type (eventType) : the name of the event that should trigger > > the notification (such as org.xwiki.bridge.event.DocumentUpdatedEvent) > > I think this should be a list since for example for the Blog use case > you’ll want to send a Blog Post Published event by listening to 2 events: > * DocumentUpdatedEvent (when the use publishes an existing non-published > Blog post) > * DocumentCreatedEvent (when the user creates and publishes at the same > time a new Blog post) > > In those 2 cases, I think you’d use the same app name, event id, pretty > name, icon, etc. >
+1 > > > - An object type (objectType) : an XObject that _has_ to be associated > > with the document triggering the event in order to trigger the custom > > notification > > > > - A validation expression (validationExpression) : a script that will be > > parsed in the event context in order to filter certain event kinds. > > This is not very clear but I think this is what I asked Clement to add > yesterday in order to implement the Blog Post Published use case. For this > example you need to check the BlogPostClass XObject to verify if it’s > published or not. > > Is that it? It's how I understand it too. > > Thanks > -Vincent > > > - A notification template (notificationTemplate) : the template that > > should be used for rendering the notification in the notification center > > > > To summarize, a custom notification is triggered if the following > > expression is fully satisfied : > > «The (eventType) has been triggered on a document having (objectType) in > > his XObjects and the (validationExpression) is true in the current > context». > > > > What do you think ? > > > > Thanks, > > > > -- Clément Aubin Web Developer Intern @XWiki SAS clement.au...@xwiki.com > > More about us at http://www.xwiki.com > > > > -- Guillaume Delhumeau (guillaume.delhum...@xwiki.com) Research & Development Engineer at XWiki SAS Committer on the XWiki.org project