wt.notify
Class TemplateNotification

java.lang.Object
  extended bywt.notify.TemplateNotification
All Implemented Interfaces:
Notification, Serializable

public class TemplateNotification
extends Object
implements Notification

A Notification that derives its message body from an html template and its subject from a resource bundle message.

Provides the ability to send a translated version of the notification body, based on an html template, when the distribution list contains users in different locales.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  String contentType
           
private static String RESOURCE
           
private  String sender
           
private  Object[] subjectInserts
           
private  String subjectMessageKey
           
private  String subjectResource
           
private  String template
           
private  Object templateProcessor
           
private  String textPart
           
private  DistributionList theDistributionList
           
private static boolean VERBOSE
           
 
Fields inherited from interface wt.notify.Notification
BODY, CONTENT_TYPE, DISTRIBUTION_LIST, SENDER, SUBJECT
 
Constructor Summary
TemplateNotification(DistributionList recipients)
          

Supported API: false
 
Method Summary
 String getBody()
          Processes the HTML template and returns the HTML body of the notification.
 String getBody(Locale locale)
          Return the HTML template for the given Locale.
 String getContentType()
          Gets the value of the attribute: contentType; "text/html" indicates a SimpleNotification, and "text/html" indicates a TemplateNotification.
 DistributionList getDistributionList()
          Gets the object for the association that plays role: theDistributionList.
 String getSender()
          Gets the value of the attribute: sender.
 String getSubject()
          

Supported API: false
 Object[] getSubjectInserts()
          Gets the value of the attribute: subjectInserts.
 String getSubjectMessageKey()
          Gets the value of the attribute: subjectMessageKey; The key of the subject message as found in the subjectResource.
 String getSubjectResource()
          Gets the value of the attribute: subjectResource; The name of the base resource bundle that the subject string belongs to.
 String getTemplate()
          Gets the value of the attribute: template; The name of the html template that will be processed to generate the body of this notification.
 Object getTemplateProcessor()
          Gets the value of the attribute: templateProcessor; The object containing all the methods that can be invoked from the html template which is being processed to generate the notification body.
 String getTextPart()
          Gets the value of the attribute: textPart; The text part of the notification.
 void send()
          This method constructs and sends an e-mail message for each locale in the distribution list.
 void setBody(String a_Body)
          Sets the value of the attribute: body.
 void setDistributionList(DistributionList a_DistributionList)
          Sets the object for the association that plays role: theDistributionList.
 void setSender(String a_Sender)
          Sets the value of the attribute: sender.
 void setSubjectInserts(Object[] a_SubjectInserts)
          Sets the value of the attribute: subjectInserts.
 void setSubjectMessageKey(String a_SubjectMessageKey)
          Sets the value of the attribute: subjectMessageKey; The key of the subject message as found in the subjectResource.
 void setSubjectResource(String a_SubjectResource)
          Sets the value of the attribute: subjectResource; The name of the base resource bundle that the subject string belongs to.
 void setTemplate(String a_Template)
          Sets the value of the attribute: template; The name of the html template that will be processed to generate the body of this notification.
 void setTemplateProcessor(Object a_TemplateProcessor)
          Sets the value of the attribute: templateProcessor; The object containing all the methods that can be invoked from the html template which is being processed to generate the notification body.
 void setTextPart(String a_TextPart)
          Sets the value of the attribute: textPart; The text part of the notification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

templateProcessor

private Object templateProcessor

template

private String template

subjectResource

private String subjectResource

subjectMessageKey

private String subjectMessageKey

subjectInserts

private Object[] subjectInserts

textPart

private String textPart

sender

private String sender

contentType

private String contentType

theDistributionList

private DistributionList theDistributionList

VERBOSE

private static final boolean VERBOSE
Constructor Detail

TemplateNotification

public TemplateNotification(DistributionList recipients)


Supported API: false

Parameters:
recipients -
Method Detail

getTemplateProcessor

public Object getTemplateProcessor()
Gets the value of the attribute: templateProcessor; The object containing all the methods that can be invoked from the html template which is being processed to generate the notification body.

Supported API: false

Returns:
Object

setTemplateProcessor

public void setTemplateProcessor(Object a_TemplateProcessor)
Sets the value of the attribute: templateProcessor; The object containing all the methods that can be invoked from the html template which is being processed to generate the notification body.

Supported API: false

Parameters:
a_TemplateProcessor -

getTemplate

public String getTemplate()
Gets the value of the attribute: template; The name of the html template that will be processed to generate the body of this notification.

Supported API: false

Returns:
String

setTemplate

public void setTemplate(String a_Template)
Sets the value of the attribute: template; The name of the html template that will be processed to generate the body of this notification.

Supported API: false

Parameters:
a_Template -

getSubjectResource

public String getSubjectResource()
Gets the value of the attribute: subjectResource; The name of the base resource bundle that the subject string belongs to.

Supported API: false

Returns:
String

setSubjectResource

public void setSubjectResource(String a_SubjectResource)
Sets the value of the attribute: subjectResource; The name of the base resource bundle that the subject string belongs to.

Supported API: false

Parameters:
a_SubjectResource -

getSubjectMessageKey

public String getSubjectMessageKey()
Gets the value of the attribute: subjectMessageKey; The key of the subject message as found in the subjectResource.

Supported API: false

Returns:
String

setSubjectMessageKey

public void setSubjectMessageKey(String a_SubjectMessageKey)
Sets the value of the attribute: subjectMessageKey; The key of the subject message as found in the subjectResource.

Supported API: false

Parameters:
a_SubjectMessageKey -

getSubjectInserts

public Object[] getSubjectInserts()
Gets the value of the attribute: subjectInserts.

Supported API: false

Returns:
Object[]

setSubjectInserts

public void setSubjectInserts(Object[] a_SubjectInserts)
Sets the value of the attribute: subjectInserts.

Supported API: false

Parameters:
a_SubjectInserts -

getTextPart

public String getTextPart()
Gets the value of the attribute: textPart; The text part of the notification.

Supported API: false

Returns:
String

setTextPart

public void setTextPart(String a_TextPart)
Sets the value of the attribute: textPart; The text part of the notification.

Supported API: false

Parameters:
a_TextPart -

getBody

public String getBody()
               throws WTRuntimeException
Processes the HTML template and returns the HTML body of the notification. If plain text notifications only are supposed to be sent (currently specified by a property), then the plain text template corresponding to the HTML template will be processed instead.

Supported API: false

Specified by:
getBody in interface Notification
Returns:
String
Throws:
WTRuntimeException

getSubject

public String getSubject()


Supported API: false

Specified by:
getSubject in interface Notification
Returns:
String

send

public void send()
          throws NotificationException
This method constructs and sends an e-mail message for each locale in the distribution list.

Supported API: false

Specified by:
send in interface Notification
Throws:
NotificationException
See Also:
wt.mail

getBody

public String getBody(Locale locale)
               throws WTRuntimeException
Return the HTML template for the given Locale. If the Locale is null, the HTML template for the default Locale is returned.

Supported API: false

Parameters:
locale -
Returns:
String
Throws:
WTRuntimeException

getSender

public String getSender()
Gets the value of the attribute: sender.

Supported API: false

Specified by:
getSender in interface Notification
Returns:
String

setSender

public void setSender(String a_Sender)
Sets the value of the attribute: sender.

Supported API: false

Specified by:
setSender in interface Notification
Parameters:
a_Sender -

setBody

public void setBody(String a_Body)
Sets the value of the attribute: body.

Supported API: false

Specified by:
setBody in interface Notification
Parameters:
a_Body -

getContentType

public String getContentType()
Gets the value of the attribute: contentType; "text/html" indicates a SimpleNotification, and "text/html" indicates a TemplateNotification.

Supported API: false

Specified by:
getContentType in interface Notification
Returns:
String

getDistributionList

public DistributionList getDistributionList()
Gets the object for the association that plays role: theDistributionList.

Supported API: false

Specified by:
getDistributionList in interface Notification
Returns:
DistributionList

setDistributionList

public void setDistributionList(DistributionList a_DistributionList)
Sets the object for the association that plays role: theDistributionList.

Supported API: false

Specified by:
setDistributionList in interface Notification
Parameters:
a_DistributionList -