public interface NotificationManager
Modifier and Type | Method and Description |
---|---|
void |
addSubscription(String username,
String notification,
DocumentModel doc,
Boolean sendConfirmationEmail,
NuxeoPrincipal principal,
String notificationName)
Called when a user subscribes to a notification.
|
void |
addSubscriptions(String username,
DocumentModel doc,
Boolean sendConfirmationEmail,
NuxeoPrincipal principal) |
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.
|
List<Notification> |
getNotificationsForEvents(String eventId) |
List<Notification> |
getNotificationsForSubscriptions(String parentType) |
default List<DocumentModel> |
getSubscribedDocuments(String prefixedPrincipalName)
Deprecated.
since 9.1, use
getSubscribedDocuments(String, String) instead |
List<DocumentModel> |
getSubscribedDocuments(String prefixedPrincipalName,
String respositoryName)
Returns the list of live docs the user is subscribed to in the given repository .
|
List<String> |
getSubscribers(String notification,
DocumentModel doc)
Gets the users that subscribed to a notification on a certain document.
|
List<String> |
getSubscriptionsForUserOnDocument(String username,
DocumentModel doc)
Gets the notifications for which a user subscribed for a certain document.
|
List<String> |
getUsersSubscribedToNotificationOnDocument(String notification,
DocumentModel doc)
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,
DocumentModel doc)
Called when a user cancels his notification.
|
void |
removeSubscriptions(String username,
List<String> notifications,
DocumentModel doc) |
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
|
List<String> getSubscribers(String notification, DocumentModel doc)
List<String> getSubscriptionsForUserOnDocument(String username, DocumentModel doc)
List<String> getUsersSubscribedToNotificationOnDocument(String notification, DocumentModel doc)
void addSubscription(String username, String notification, DocumentModel doc, Boolean sendConfirmationEmail, NuxeoPrincipal principal, String notificationName)
void addSubscriptions(String username, DocumentModel doc, Boolean sendConfirmationEmail, NuxeoPrincipal principal)
void removeSubscriptions(String username, List<String> notifications, DocumentModel doc)
void removeSubscription(String username, String notification, DocumentModel doc)
Notification getNotificationByName(String selectedNotification)
void sendNotification(String notificationName, Map<String,Object> infoMap, String userPrincipal)
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.
notificationName
- name of notificationinfoMap
- data used to compose the notification bodyuserPrincipal
- recipient used to get the adress(es) to send emailsvoid sendDocumentByMail(DocumentModel doc, String freemarkerTemplateName, String subject, String comment, NuxeoPrincipal sender, List<String> sendTo)
List<Notification> getNotificationsForSubscriptions(String parentType)
List<Notification> getNotificationsForEvents(String eventId)
Set<String> getNotificationEventNames()
@Deprecated default List<DocumentModel> getSubscribedDocuments(String prefixedPrincipalName)
getSubscribedDocuments(String, String)
insteadList<DocumentModel> getSubscribedDocuments(String prefixedPrincipalName, String respositoryName)
Copyright © 2018 Nuxeo. All rights reserved.