Interface NotificationManager
-
- All Known Implementing Classes:
NotificationService
public interface NotificationManager
- Author:
- Narcis Paslaru
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method 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, usegetSubscribedDocuments(String, String)
insteadList<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
-
-
-
Method Detail
-
getSubscribers
List<String> getSubscribers(String notification, DocumentModel doc)
Gets the users that subscribed to a notification on a certain document.
-
getSubscriptionsForUserOnDocument
List<String> getSubscriptionsForUserOnDocument(String username, DocumentModel doc)
Gets the notifications for which a user subscribed for a certain document.
-
getUsersSubscribedToNotificationOnDocument
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.
-
addSubscription
void addSubscription(String username, String notification, DocumentModel doc, Boolean sendConfirmationEmail, NuxeoPrincipal principal, String notificationName)
Called when a user subscribes to a notification.
-
addSubscriptions
void addSubscriptions(String username, DocumentModel doc, Boolean sendConfirmationEmail, NuxeoPrincipal principal)
- Since:
- 5.6 Called when a user subscribes to all notifications.
-
removeSubscriptions
void removeSubscriptions(String username, List<String> notifications, DocumentModel doc)
- Since:
- 5.6 Called when a user unsubscribes to all notifications.
-
removeSubscription
void removeSubscription(String username, String notification, DocumentModel doc)
Called when a user cancels his notification.
-
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)
Directly sends a notification to the principal, using the data provided in the mapThe 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 notificationinfoMap
- data used to compose the notification bodyuserPrincipal
- recipient used to get the adress(es) to send emails
-
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
-
getSubscribedDocuments
@Deprecated default List<DocumentModel> getSubscribedDocuments(String prefixedPrincipalName)
Deprecated.since 9.1, usegetSubscribedDocuments(String, String)
insteadReturns the list of live docs the user is subscribed to.- Since:
- 7.3
-
getSubscribedDocuments
List<DocumentModel> getSubscribedDocuments(String prefixedPrincipalName, String respositoryName)
Returns the list of live docs the user is subscribed to in the given repository .- Since:
- 9.1
-
-