public class SubscriptionAdapter extends Object
| Modifier and Type | Field and Description | 
|---|---|
protected DocumentModel | 
doc  | 
protected static String | 
NOTIF_NAMEKEY  | 
protected static String | 
NOTIF_PROPERTY  | 
protected static String | 
NOTIF_SUBSCRIBERSKEY  | 
static String | 
NOTIFIABLE_FACET  | 
| Constructor and Description | 
|---|
SubscriptionAdapter(DocumentModel doc)  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addSubscription(String username,
               String notification)
Add a subscription to a notification for a given user. 
 | 
void | 
addSubscriptionsToAll(String username)
Add a subscription to all notification for a given user 
 | 
protected void | 
clearNotification()
Clears the notification in the document's property. 
 | 
void | 
copySubscriptionsTo(DocumentModel targetDoc)
Copy the subscriptions of the current doc to the targetted document. 
 | 
protected Map<String,Set<String>> | 
getNotificationMap()
Take the document storage propery and put it in a map. 
 | 
List<String> | 
getNotificationSubscribers(String notification)
Return the list of subscribers name for a given notification. 
 | 
List<String> | 
getUserSubscriptions(String username)
Return the list of of subscriptions for a given user 
 | 
void | 
removeUserNotificationSubscription(String username,
                                  String notification)
Remove a subscription to a notification for a given user. 
 | 
protected void | 
setNotificationMap(Map<String,Set<String>> map)
Take a map and store it in the document's notification property. 
 | 
public static final String NOTIFIABLE_FACET
protected static final String NOTIF_PROPERTY
protected static final String NOTIF_SUBSCRIBERSKEY
protected static final String NOTIF_NAMEKEY
protected DocumentModel doc
public SubscriptionAdapter(DocumentModel doc)
protected Map<String,Set<String>> getNotificationMap()
setNotificationMap(Map)protected void setNotificationMap(Map<String,Set<String>> map)
getNotificationMap()protected void clearNotification()
public List<String> getNotificationSubscribers(String notification)
public List<String> getUserSubscriptions(String username)
public void addSubscription(String username, String notification)
public void addSubscriptionsToAll(String username)
public void removeUserNotificationSubscription(String username, String notification)
public void copySubscriptionsTo(DocumentModel targetDoc)
Copyright © 2019 Nuxeo. All rights reserved.