public class NotificationEventListener extends Object implements PostCommitFilteringEventListener
Modifier and Type | Field and Description |
---|---|
static String |
JSF_NOTIFICATION_DOCUMENT_ID_CODEC_PREFIX |
static String |
NOTIFICATION_DOCUMENT_ID_CODEC_NAME |
Constructor and Description |
---|
NotificationEventListener() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptEvent(Event event)
Checks if this event is worth passing to the asynchronous
PostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle) . |
EmailHelper |
getEmailHelper() |
protected List<String> |
getGroupMembers(String groupId) |
protected UserManager |
getUserManager() |
void |
handleEvent(EventBundle events)
Handles the set of events that were raised during the life of an user operation.
|
protected void |
handleNotifications(Event event,
List<Notification> notifs) |
boolean |
isInterestedInNotification(Notification notif) |
void |
sendNotification(Event event,
DocumentEventContext ctx) |
protected void |
sendNotificationSignalForUser(Notification notification,
String subscriptor,
Event event,
DocumentEventContext ctx) |
void |
setEmailHelper(EmailHelper emailHelper) |
public static final String NOTIFICATION_DOCUMENT_ID_CODEC_NAME
public static final String JSF_NOTIFICATION_DOCUMENT_ID_CODEC_PREFIX
public NotificationEventListener()
public boolean acceptEvent(Event event)
PostCommitFilteringEventListener
PostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)
.
Note that the event's documents are usually disconnected into
ShallowDocumentModel
instances, which means that this
method may not be able to get to all the information it would get from a standard DocumentModel implementation.
If there is not enough information in the ShallowDocumentModel to decide whether this event is of interest, then
this method should accept it an let the actual logic done in PostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)
do the final filtering.
acceptEvent
in interface PostCommitFilteringEventListener
event
- the eventtrue
to accept it, or false
to ignore itpublic void handleEvent(EventBundle events)
PostCommitEventListener
The events are fired as a BundleEvent
after the transaction is committed.
handleEvent
in interface PostCommitEventListener
events
- the events to handleprotected void handleNotifications(Event event, List<Notification> notifs)
protected UserManager getUserManager()
protected List<String> getGroupMembers(String groupId)
protected void sendNotificationSignalForUser(Notification notification, String subscriptor, Event event, DocumentEventContext ctx)
public void sendNotification(Event event, DocumentEventContext ctx)
public boolean isInterestedInNotification(Notification notif)
public EmailHelper getEmailHelper()
public void setEmailHelper(EmailHelper emailHelper)
Copyright © 2016 Nuxeo SA. All rights reserved.