com.xmlserv.app.basket
Class BasketMessage

java.lang.Object
  |
  +--com.xmlserv.app.basket.BasketMessage
Direct Known Subclasses:
AdminBasketMessage, AttachmentBasketMessage, ISDNBasketMessage, MailBasketMessage

public abstract class BasketMessage
extends java.lang.Object

The base class for all message actions generated by BasketSend. Message formats are defined in the DB table basketmessageformat, the table entries are represented by instances of the inner class BasketMessage.FormatInfo


Inner Class Summary
static class BasketMessage.FormatInfo
           
 
Constructor Summary
protected BasketMessage()
           
  BasketMessage(BasketContents basketContents, javax.xml.transform.Templates xslHTML, javax.xml.transform.Templates xslText)
           
 
Method Summary
abstract  javax.mail.Multipart constructMessageBody(java.sql.Connection con, SecurityManager securitymanager, SecurityManager.User from, BasketRecipient to, java.lang.String subject, java.lang.String messagetext, java.lang.String serverurl, java.lang.String cssbaseurl, java.lang.String picbaseurl)
          This method constructs a MIME MultiPart mailbody specific to the subclass implementing the method.
 BasketContents getBasketContents()
           
static BasketMessage getBasketMessage(java.sql.Connection con, int id, BasketContents basketContents, javax.xml.transform.Templates xslHTML, javax.xml.transform.Templates xslText)
          Return a complete BasketMessage object.
static BasketMessage.FormatInfo getFormatInfo(java.sql.Connection con, int id)
          Return an instance of the BasketMessage subclass implementing the message format identified by the given id.
static BasketMessage.FormatInfo getFormatInfo(java.sql.Connection con, java.lang.String name)
          Return an instance of the BasketMessage subclass implementing the message format identified by the given id.
static org.jdom.Element getMessageFormats(java.sql.Connection con)
          Return a list of available Message formats.
 javax.xml.transform.Templates getXslHTML()
           
 javax.xml.transform.Templates getXslSourceText()
           
 void send(java.sql.Connection con, java.util.Properties mailProperties, java.lang.String from, SecurityManager.User fromUser, BasketRecipient to, java.lang.String cc, java.lang.String bcc, java.lang.String subject, java.lang.String messagetext, java.lang.String serverurl, java.lang.String cssbaseurl, java.lang.String picbaseurl, SecurityManager securitymanager)
          The actual send operation.
 void send(java.sql.Connection con, java.util.Properties mailProperties, java.lang.String from, java.lang.String to, java.lang.String cc, java.lang.String bcc, java.lang.String subject)
          The actual send operation.
 void setBasketContents(BasketContents basketContents)
           
 void setXslHTML(javax.xml.transform.Templates xslSourceHTML)
           
 void setXslText(javax.xml.transform.Templates xslText)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasketMessage

protected BasketMessage()

BasketMessage

public BasketMessage(BasketContents basketContents,
                     javax.xml.transform.Templates xslHTML,
                     javax.xml.transform.Templates xslText)
Parameters:
basketContents - The BasketContents too send.
xslHTML - The Stylesheet to use for conversion between basketContents.toElement() and the HTML message to send.
xslText - Stylesheet for Text version of the message. Set to null to avoid sending a text version.
Method Detail

send

public void send(java.sql.Connection con,
                 java.util.Properties mailProperties,
                 java.lang.String from,
                 SecurityManager.User fromUser,
                 BasketRecipient to,
                 java.lang.String cc,
                 java.lang.String bcc,
                 java.lang.String subject,
                 java.lang.String messagetext,
                 java.lang.String serverurl,
                 java.lang.String cssbaseurl,
                 java.lang.String picbaseurl,
                 SecurityManager securitymanager)
          throws XMLServException
The actual send operation. This relies on a subclass implementing the abstract method constructMessageBody().

send

public void send(java.sql.Connection con,
                 java.util.Properties mailProperties,
                 java.lang.String from,
                 java.lang.String to,
                 java.lang.String cc,
                 java.lang.String bcc,
                 java.lang.String subject)
          throws XMLServException
The actual send operation. This relies on a subclass implementing the abstract method constructMessageBody().

constructMessageBody

public abstract javax.mail.Multipart constructMessageBody(java.sql.Connection con,
                                                          SecurityManager securitymanager,
                                                          SecurityManager.User from,
                                                          BasketRecipient to,
                                                          java.lang.String subject,
                                                          java.lang.String messagetext,
                                                          java.lang.String serverurl,
                                                          java.lang.String cssbaseurl,
                                                          java.lang.String picbaseurl)
                                                   throws XMLServException
This method constructs a MIME MultiPart mailbody specific to the subclass implementing the method.

getMessageFormats

public static org.jdom.Element getMessageFormats(java.sql.Connection con)
                                          throws XMLServException
Return a list of available Message formats.

getFormatInfo

public static BasketMessage.FormatInfo getFormatInfo(java.sql.Connection con,
                                                     int id)
                                              throws XMLServException
Return an instance of the BasketMessage subclass implementing the message format identified by the given id.
Parameters:
con - DB Connection
id - The message format id.

getFormatInfo

public static BasketMessage.FormatInfo getFormatInfo(java.sql.Connection con,
                                                     java.lang.String name)
                                              throws XMLServException
Return an instance of the BasketMessage subclass implementing the message format identified by the given id.
Parameters:
con - DB Connection
name - The message format name.

getBasketMessage

public static BasketMessage getBasketMessage(java.sql.Connection con,
                                             int id,
                                             BasketContents basketContents,
                                             javax.xml.transform.Templates xslHTML,
                                             javax.xml.transform.Templates xslText)
                                      throws XMLServException
Return a complete BasketMessage object.

getBasketContents

public BasketContents getBasketContents()

setBasketContents

public void setBasketContents(BasketContents basketContents)

getXslHTML

public javax.xml.transform.Templates getXslHTML()

setXslHTML

public void setXslHTML(javax.xml.transform.Templates xslSourceHTML)

getXslSourceText

public javax.xml.transform.Templates getXslSourceText()

setXslText

public void setXslText(javax.xml.transform.Templates xslText)