|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.platform.ec.notification.service.NotificationService
public class NotificationService
| Field Summary | |
|---|---|
static ComponentName |
NAME
|
static String |
SUBSCRIPTION_NAME
|
| Constructor Summary | |
|---|---|
NotificationService()
|
|
| Method Summary | ||
|---|---|---|
void |
activate(ComponentContext context)
Activates the component. |
|
void |
addSubscription(String username,
String notification,
DocumentModel doc,
Boolean sendConfirmationEmail,
NuxeoPrincipal principal,
String notificationName)
Called when a user subscribes to a notification. |
|
void |
deactivate(ComponentContext context)
Deactivates the component. |
|
|
getAdapter(Class<T> adapter)
Returns an object which is an instance of the given class associated with this object. |
|
EmailHelper |
getEmailHelper()
|
|
String |
getEMailSubjectPrefix()
|
|
Collection<NotificationListenerHook> |
getListenerHooks()
|
|
String |
getMailSessionJndiName()
|
|
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. |
|
NotificationRegistry |
getNotificationRegistry()
Returns the notification manager. |
|
List<Notification> |
getNotificationsForEvents(String eventId)
|
|
List<Notification> |
getNotificationsForSubscriptions(String parentType)
|
|
String |
getServerUrlPrefix()
|
|
List<String> |
getSubscribers(String notification,
String docId)
Gets the users that subscribed to a notification on a certain document. |
|
List<String> |
getSubscriptionsForUserOnDocument(String username,
String docId)
Gets the notifications for which a user subscribed for a certain document. |
|
static URL |
getTemplateURL(String name)
|
|
List<String> |
getUsersSubscribedToNotificationOnDocument(String notification,
String docId)
Gets all users and groups that subscribed to a notification on a document This is used in management of subscritptions. |
|
void |
registerExtension(Extension extension)
Registers the given extension. |
|
void |
removeSubscription(String username,
String notification,
String docId)
Called when a user cancels his notification. |
|
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 |
|
void |
setEmailHelper(EmailHelper emailHelper)
|
|
void |
unregisterExtension(Extension extension)
Unregisters the given extension. |
|
| Methods inherited from class org.nuxeo.runtime.model.DefaultComponent |
|---|
applicationStarted, registerContribution, unregisterContribution |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ComponentName NAME
public static final String SUBSCRIPTION_NAME
| Constructor Detail |
|---|
public NotificationService()
| Method Detail |
|---|
public <T> T getAdapter(Class<T> adapter)
Adaptablenull if
no such object can be found.
getAdapter in interface AdaptablegetAdapter in class DefaultComponentadapter - the adapter class to look up
null if this object does not
have an adapter for the given class
public void activate(ComponentContext context)
throws Exception
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime context
Exception - if an error occurs during activation
public void deactivate(ComponentContext context)
throws Exception
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime context
Exception - if an error occurs during activation
public void registerExtension(Extension extension)
throws Exception
Extensible
registerExtension in interface ExtensibleregisterExtension in class DefaultComponentextension - the extension to register
Exception - if any error occurs
public void unregisterExtension(Extension extension)
throws Exception
Extensible
unregisterExtension in interface ExtensibleunregisterExtension in class DefaultComponentextension - the extension to unregister
Exception - if any error occurspublic NotificationRegistry getNotificationRegistry()
NotificationManager
getNotificationRegistry in interface NotificationManager
public List<String> getSubscribers(String notification,
String docId)
throws ClientException
NotificationManager
getSubscribers in interface NotificationManagerClientException
public List<String> getSubscriptionsForUserOnDocument(String username,
String docId)
throws ClassNotFoundException,
ClientException
NotificationManager
getSubscriptionsForUserOnDocument in interface NotificationManagerClassNotFoundException
ClientException
public void addSubscription(String username,
String notification,
DocumentModel doc,
Boolean sendConfirmationEmail,
NuxeoPrincipal principal,
String notificationName)
throws ClientException
NotificationManager
addSubscription in interface NotificationManagerClientException
public void removeSubscription(String username,
String notification,
String docId)
throws ClientException
NotificationManager
removeSubscription in interface NotificationManagerClientException
public List<String> getUsersSubscribedToNotificationOnDocument(String notification,
String docId)
throws ClientException
NotificationManager
getUsersSubscribedToNotificationOnDocument in interface NotificationManagerClientExceptionpublic static URL getTemplateURL(String name)
public String getServerUrlPrefix()
public String getEMailSubjectPrefix()
public String getMailSessionJndiName()
public Notification getNotificationByName(String selectedNotification)
NotificationManager
getNotificationByName in interface NotificationManager
public void sendNotification(String notificationName,
Map<String,Object> infoMap,
String userPrincipal)
throws ClientException
NotificationManagerThe 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.
sendNotification in interface NotificationManagernotificationName - name of notificationinfoMap - data used to compose the notification bodyuserPrincipal - recipient used to get the adress(es) to send emails
ClientException
public void sendDocumentByMail(DocumentModel doc,
String freemarkerTemplateName,
String subject,
String comment,
NuxeoPrincipal sender,
List<String> sendTo)
NotificationManager
sendDocumentByMail in interface NotificationManagerpublic List<Notification> getNotificationsForSubscriptions(String parentType)
getNotificationsForSubscriptions in interface NotificationManagerpublic List<Notification> getNotificationsForEvents(String eventId)
getNotificationsForEvents in interface NotificationManagerpublic EmailHelper getEmailHelper()
public void setEmailHelper(EmailHelper emailHelper)
public Set<String> getNotificationEventNames()
NotificationManager
getNotificationEventNames in interface NotificationManagerpublic Collection<NotificationListenerHook> getListenerHooks()
|
Nuxeo ECM Projects 5.4.3-SNAPSHOT | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||