Class SubscriptionAdapter
java.lang.Object
org.nuxeo.ecm.platform.ec.notification.SubscriptionAdapter
Encapsulates all notification storage logic in the Notifiable facet.
- Since:
- 7.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DocumentModelprotected static final Stringprotected static final Stringprotected static final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubscription(String username, String notification) Add a subscription to a notification for a given user.voidaddSubscriptionsToAll(String username) Add a subscription to all notification for a given userprotected voidClears the notification in the document's property.voidcopySubscriptionsTo(DocumentModel targetDoc) Copy the subscriptions of the current doc to the targetted document.Take the document storage propery and put it in a map.getNotificationSubscribers(String notification) Return the list of subscribers name for a given notification.getUserSubscriptions(String username) Return the list of of subscriptions for a given uservoidremoveUserNotificationSubscription(String username, String notification) Remove a subscription to a notification for a given user.protected voidsetNotificationMap(Map<String, Set<String>> map) Take a map and store it in the document's notification property.
-
Field Details
-
NOTIFIABLE_FACET
- See Also:
-
NOTIF_PROPERTY
- See Also:
-
NOTIF_SUBSCRIBERSKEY
- See Also:
-
NOTIF_NAMEKEY
- See Also:
-
doc
-
-
Constructor Details
-
SubscriptionAdapter
-
-
Method Details
-
getNotificationMap
Take the document storage propery and put it in a map.- key
- notificationName
- value
- list of subscribers
setNotificationMap(Map) -
setNotificationMap
Take a map and store it in the document's notification property. To get the original map, usegetNotificationMap() -
clearNotification
protected void clearNotification()Clears the notification in the document's property.- Since:
- 10.2
-
getNotificationSubscribers
Return the list of subscribers name for a given notification. -
getUserSubscriptions
Return the list of of subscriptions for a given user -
addSubscription
Add a subscription to a notification for a given user. -
addSubscriptionsToAll
Add a subscription to all notification for a given user -
removeUserNotificationSubscription
Remove a subscription to a notification for a given user. -
copySubscriptionsTo
Copy the subscriptions of the current doc to the targetted document.
-