Nuxeo Enterprise Platform 5.4

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

All Known Subinterfaces:
NotificationServiceLocal
All Known Implementing Classes:
NotificationService, NotificationServiceBean

public interface NotificationManager

Author:
Narcis Paslaru

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

Method Detail

getSubscribers

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

Throws:
ClientException

getSubscriptionsForUserOnDocument

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

Throws:
java.lang.ClassNotFoundException
ClientException

getUsersSubscribedToNotificationOnDocument

java.util.List<java.lang.String> getUsersSubscribedToNotificationOnDocument(java.lang.String notification,
                                                                            java.lang.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(java.lang.String username,
                     java.lang.String notification,
                     DocumentModel doc,
                     java.lang.Boolean sendConfirmationEmail,
                     NuxeoPrincipal principal,
                     java.lang.String notificationName)
                     throws ClientException
Called when a user subscribes to a notification.

Throws:
ClientException

removeSubscription

void removeSubscription(java.lang.String username,
                        java.lang.String notification,
                        java.lang.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(java.lang.String selectedNotification)
Returns a notification with all data loaded (label, etc).


sendNotification

void sendNotification(java.lang.String notificationName,
                      java.util.Map<java.lang.String,java.lang.Object> infoMap,
                      java.lang.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,
                        java.lang.String freemarkerTemplateName,
                        java.lang.String subject,
                        java.lang.String comment,
                        NuxeoPrincipal sender,
                        java.util.List<java.lang.String> sendTo)
Sends an e-mail directly.


getNotificationsForSubscriptions

java.util.List<Notification> getNotificationsForSubscriptions(java.lang.String parentType)

getNotificationsForEvents

java.util.List<Notification> getNotificationsForEvents(java.lang.String eventId)

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.