Interface NotificationManager
- All Known Implementing Classes:
NotificationService
public interface NotificationManager
- Author:
- Narcis Paslaru
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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) default String
Returns the name of theMailSender
that will handle notificationMailMessage
sgetNotificationByName
(String selectedNotification) Returns a notification with all data loaded (label, etc).Gets the list of event names used by notifications.getNotificationsForEvents
(String eventId) getNotificationsForSubscriptions
(String parentType) getSubscribedDocuments
(String prefixedPrincipalName, String respositoryName) Returns the list of live docs the user is subscribed to in the given repository .getSubscribers
(String notification, DocumentModel doc) Gets the users that subscribed to a notification on a certain document.getSubscriptionsForUserOnDocument
(String username, DocumentModel doc) Gets the notifications for which a user subscribed for a certain document.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
Directly sends a notification to the principal, using the data provided in the map
-
Method Details
-
getSubscribers
Gets the users that subscribed to a notification on a certain document. -
getSubscriptionsForUserOnDocument
Gets the notifications for which a user subscribed for a certain document. -
getUsersSubscribedToNotificationOnDocument
Gets all users and groups that subscribed to a notification on a document This is used in management of subscritptions. -
getMailSenderName
Returns the name of theMailSender
that will handle notificationMailMessage
s- Since:
- 2023.4
-
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
- Since:
- 5.6 Called when a user unsubscribes to all notifications.
-
removeSubscription
Called when a user cancels his notification. -
getNotificationByName
Returns a notification with all data loaded (label, etc). -
sendNotification
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
-
getNotificationsForEvents
-
getNotificationEventNames
Gets the list of event names used by notifications.- Since:
- 5.4.2
-
getSubscribedDocuments
Returns the list of live docs the user is subscribed to in the given repository .- Since:
- 9.1
-