Class NotificationContext
java.lang.Object
org.alfresco.service.cmr.notification.NotificationContext
Notification context. Provides the contextual information about a notification.
- Since:
- 4.0
- Author:
- Roy Wetherall
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetBody()getFrom()getTo()booleanbooleanvoidsetAsyncNotification(boolean asyncNotification) Indicates whether the notification will be sent asynchronously or not.voidNote: this takes presendence over the body template if both are setvoidsetBodyTemplate(String bodyTemplate) The body template is a node re or classpath ref to a template that can be executed with the given template arguments to produce the body of the notification.voidsetDocument(NodeRef document) Document that the notification relates to.voidvoidsetIgnoreNotificationFailure(boolean ignoreNotificationFailure) Indicates whether to ignore a notification failure or not.voidsetSubject(String subject) voidsetTemplateArgs(Map<String, Serializable> templateArgs) The template arguments are used as context for the body template when it is executed.
-
Constructor Details
-
NotificationContext
public NotificationContext()Default constructor
-
-
Method Details
-
setFrom
- Parameters:
from- from authority
-
getFrom
- Returns:
Stringfrom authority
-
addTo
- Parameters:
to- to authorities
-
getTo
-
setSubject
- Parameters:
subject- subject of notification
-
getSubject
- Returns:
- subject of notification
-
setBody
Note: this takes presendence over the body template if both are set- Parameters:
body- body of notification.
-
getBody
- Returns:
Stringbody of notification
-
setBodyTemplate
The body template is a node re or classpath ref to a template that can be executed with the given template arguments to produce the body of the notification.- Parameters:
bodyTemplate- body template
-
getBodyTemplate
- Returns:
NodeRefbody template
-
setTemplateArgs
The template arguments are used as context for the body template when it is executed. Any values placed in this map will be available in the template from the root object 'args'. For example '${args.workflowDescription}'.- Parameters:
templateArgs- template arguments
-
getTemplateArgs
- Returns:
Map<String,Serializable> template arguments
-
setDocument
Document that the notification relates to. This does not have to be set. Will be used to populate the 'document' root object accessable within the body template if set.- Parameters:
document- related document
-
getDocument
- Returns:
NodeRefrelated document
-
setIgnoreNotificationFailure
public void setIgnoreNotificationFailure(boolean ignoreNotificationFailure) Indicates whether to ignore a notification failure or not.- Parameters:
ignoreNotificationFailure- true if ignore notification failure, false otherwise
-
isIgnoreNotificationFailure
public boolean isIgnoreNotificationFailure()- Returns:
- boolean true if ignore notification failure, false otherwise
-
setAsyncNotification
public void setAsyncNotification(boolean asyncNotification) Indicates whether the notification will be sent asynchronously or not.- Parameters:
asyncNotification- true if notification sent asynchronously, false otherwise
-
isAsyncNotification
public boolean isAsyncNotification()- Returns:
- boolean true if notification send asynchronously, false otherwise
-