Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.notification.api
Interface NotificationManager

All Known Implementing Classes:
NotificationService

public interface NotificationManager

Author:
Narcis Paslaru

Method Summary
 void addSubscription(String username, String notification, DocumentModel doc, Boolean sendConfirmationEmail, NuxeoPrincipal principal, String notificationName)
          Called when a user subscribes to a notification.
 Notification getNotificationByName(String selectedNotification)
          Returns a notification with all data loaded (label, etc).
 Set<String> getNotificationEventNames()
          Gets the list of event names used by notifications.
 NotificationRegistry getNotificationRegistry()
          Deprecated. should never have to return the registry : use delegation
 List<Notification> getNotificationsForEvents(String eventId)
           
 List<Notification> getNotificationsForSubscriptions(String parentType)
           
 List<String> getSubscribers(String notification, String docId)
          Gets the users that subscribed to a notification on a certain document.
 List<String> getSubscriptionsForUserOnDocument(String username, String docId)
          Gets the notifications for which a user subscribed for a certain document.
 List<String> getUsersSubscribedToNotificationOnDocument(String notification, String docId)
          Gets all users and groups that subscribed to a notification on a document This is used in management of subscritptions.
 void removeSubscription(String username, String notification, String docId)
          Called when a user cancels his notification.
 void sendDocumentByMail(DocumentModel doc, String freemarkerTemplateName, String subject, String comment, NuxeoPrincipal sender, List<String> sendTo)
          Sends an e-mail directly.
 void sendNotification(String notificationName, Map<String,Object> infoMap, String userPrincipal)
          Directly sends a notification to the principal, using the data provided in the map
 

Method Detail

getSubscribers

List<String> getSubscribers(String notification,
                            String docId)
                            throws ClientException
Gets the users that subscribed to a notification on a certain document.

Throws:
ClientException

getSubscriptionsForUserOnDocument

List<String> getSubscriptionsForUserOnDocument(String username,
                                               String docId)
                                               throws ClassNotFoundException,
                                                      ClientException
Gets the notifications for which a user subscribed for a certain document.

Throws:
ClassNotFoundException
ClientException

getUsersSubscribedToNotificationOnDocument

List<String> getUsersSubscribedToNotificationOnDocument(String notification,
                                                        String docId)
                                                        throws ClientException
Gets all users and groups that subscribed to a notification on a document This is used in management of subscritptions.

Throws:
ClientException

addSubscription

void addSubscription(String username,
                     String notification,
                     DocumentModel doc,
                     Boolean sendConfirmationEmail,
                     NuxeoPrincipal principal,
                     String notificationName)
                     throws ClientException
Called when a user subscribes to a notification.

Throws:
ClientException

removeSubscription

void removeSubscription(String username,
                        String notification,
                        String docId)
                        throws ClientException
Called when a user cancels his notification.

Throws:
ClientException

getNotificationRegistry

@Deprecated
NotificationRegistry getNotificationRegistry()
Deprecated. should never have to return the registry : use delegation

Returns the notification manager.


getNotificationByName

Notification getNotificationByName(String selectedNotification)
Returns a notification with all data loaded (label, etc).


sendNotification

void sendNotification(String notificationName,
                      Map<String,Object> infoMap,
                      String userPrincipal)
                      throws ClientException
Directly sends a notification to the principal, using the data provided in the map

The map should contain at least the userName of the user calling the method stored under the key "author".

infoMap should also contain all the variables that should be used to make-up the body of the notifications message.

Parameters:
notificationName - name of notification
infoMap - data used to compose the notification body
userPrincipal - recipient used to get the adress(es) to send emails
Throws:
ClientException

sendDocumentByMail

void sendDocumentByMail(DocumentModel doc,
                        String freemarkerTemplateName,
                        String subject,
                        String comment,
                        NuxeoPrincipal sender,
                        List<String> sendTo)
Sends an e-mail directly.


getNotificationsForSubscriptions

List<Notification> getNotificationsForSubscriptions(String parentType)

getNotificationsForEvents

List<Notification> getNotificationsForEvents(String eventId)

getNotificationEventNames

Set<String> getNotificationEventNames()
Gets the list of event names used by notifications.

Since:
5.4.2

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.