org.blojsom.plugin.notification
Class AbstractVelocityEmailNotification

java.lang.Object
  extended byorg.blojsom.plugin.notification.AbstractNotification
      extended byorg.blojsom.plugin.notification.AbstractVelocityEmailNotification
All Implemented Interfaces:
Notification, org.springframework.web.context.ServletContextAware
Direct Known Subclasses:
RegistrationNotification

public abstract class AbstractVelocityEmailNotification
extends AbstractNotification
implements org.springframework.web.context.ServletContextAware


Field Summary
 
Fields inherited from class org.blojsom.plugin.notification.AbstractNotification
charEncoding, contentType, emailTemplate, mailServer
 
Constructor Summary
AbstractVelocityEmailNotification(org.apache.commons.mail.Email email, java.net.URL emailTemplate)
          Construct a new abstract velocity e-mail notification
AbstractVelocityEmailNotification(java.net.URL emailTemplate, java.lang.String charEncoding, java.lang.String mailServer, java.lang.String contentType)
          Construct a new abstract velocity e-mail notification
AbstractVelocityEmailNotification(java.net.URL emailTemplate, java.lang.String charEncoding, java.lang.String mailServer, java.lang.String contentType, java.util.Properties velocityProps)
          Construct a new abstract velocity e-mail notification
AbstractVelocityEmailNotification(java.net.URL emailTemplate, java.lang.String charEncoding, java.lang.String mailServer, java.lang.String contentType, java.lang.String velocityPropsPath)
          Construct a new abstract velocity e-mail notification
 
Method Summary
 java.lang.Object get(java.lang.String key)
          Get a value from the context
protected  java.lang.String getMessage()
          Get the e-mail message content evaluated
 void put(java.lang.String name, java.lang.Object value)
          Put a name and value in the context
 void putAll(java.util.Map values)
          Put a map of name/value pairs in the context
 void setServletContext(javax.servlet.ServletContext servletContext)
          Set the servlet context
 
Methods inherited from class org.blojsom.plugin.notification.AbstractNotification
encodeRegexCharacters, getBlindCarbonCopyRecipients, getCarbonCopyRecipients, getEmailTemplate, getRecipients, getSender, getSubject, send
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractVelocityEmailNotification

public AbstractVelocityEmailNotification(org.apache.commons.mail.Email email,
                                         java.net.URL emailTemplate)
                                  throws javax.mail.MessagingException
Construct a new abstract velocity e-mail notification

Parameters:
email - E-mail message
emailTemplate - E-mail template
Throws:
javax.mail.MessagingException - If there is an error constructing the e-mail notification

AbstractVelocityEmailNotification

public AbstractVelocityEmailNotification(java.net.URL emailTemplate,
                                         java.lang.String charEncoding,
                                         java.lang.String mailServer,
                                         java.lang.String contentType)
                                  throws java.lang.Exception
Construct a new abstract velocity e-mail notification

Parameters:
emailTemplate - E-mail template
charEncoding - Character encoding
mailServer - Mail server
contentType - Content type
Throws:
java.lang.Exception - If there is an error constructing the e-mail notification

AbstractVelocityEmailNotification

public AbstractVelocityEmailNotification(java.net.URL emailTemplate,
                                         java.lang.String charEncoding,
                                         java.lang.String mailServer,
                                         java.lang.String contentType,
                                         java.util.Properties velocityProps)
                                  throws java.lang.Exception
Construct a new abstract velocity e-mail notification

Parameters:
emailTemplate - E-mail template
charEncoding - Character encoding
mailServer - Mail server
contentType - Content type
velocityProps - Velocity properties
Throws:
java.lang.Exception - If there is an error constructing the e-mail notification

AbstractVelocityEmailNotification

public AbstractVelocityEmailNotification(java.net.URL emailTemplate,
                                         java.lang.String charEncoding,
                                         java.lang.String mailServer,
                                         java.lang.String contentType,
                                         java.lang.String velocityPropsPath)
                                  throws java.lang.Exception
Construct a new abstract velocity e-mail notification

Parameters:
emailTemplate - E-mail template
charEncoding - Character encoding
mailServer - Mail server
contentType - Content type
velocityPropsPath - Velocity properties path
Throws:
java.lang.Exception - If there is an error constructing the e-mail notification
Method Detail

getMessage

protected java.lang.String getMessage()
                               throws java.lang.Exception
Get the e-mail message content evaluated

Specified by:
getMessage in class AbstractNotification
Returns:
E-mail message content
Throws:
java.lang.Exception - If there is an error evaluating the template

put

public void put(java.lang.String name,
                java.lang.Object value)
Put a name and value in the context

Parameters:
name - Name
value - Value

putAll

public void putAll(java.util.Map values)
Put a map of name/value pairs in the context

Parameters:
values - Map of name/value pairs

get

public java.lang.Object get(java.lang.String key)
Get a value from the context

Parameters:
key - Key
Returns:
Value for the given key

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Set the servlet context

Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware
Parameters:
servletContext - ServletContext