|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.object.PersistentObject
com.waveset.object.EmailTemplate
A class used to represent email templates. The provisioning engine and other parts of the system need to send email messages at certain points. But since the content of these messages must be configurable, we use message templates stored in the repository.
There will be a collection of built-in email templates that are expected to exist. Their names are defined in Constants.java.
Customer defined templates may also be referenced from workflow processes.
All fields of the template may contain references to "variables"
that will be substituted when the template is processed. The
names of the available variables will depend on the context in which
the template is used.
The syntax for a variable reference is $(name)
where name is substituted with the name of a variable.
It is recommended that any variable you reference in the body have a corresponding variable definition. This will allow tools to detect unresolved variable references and issue warnings.
Some fields, such as _toAddress
are usually not
specified in the template object, but instead filled in by
the system.
Nested Class Summary |
Nested classes inherited from class com.waveset.object.PersistentObject |
PersistentObject.Comparator, PersistentObject.InitialInstance |
Field Summary | |
static java.lang.String |
ATT_CC
|
static java.lang.String |
ATT_FROM
|
static java.lang.String |
ATT_HOST
|
static java.lang.String |
ATT_HTML
|
static java.lang.String |
ATT_MIME
|
static java.lang.String |
ATT_TO
|
static java.lang.String |
code_id
|
static java.lang.String |
EL_BODY
|
static java.lang.String |
EL_COMMENTS
|
static java.lang.String |
EL_SUBJECT
|
static java.lang.String |
VAR_BODY
|
static java.lang.String |
VAR_CC
|
static java.lang.String |
VAR_FROM
|
static java.lang.String |
VAR_FROM_ADDRESS
Deprecated. - use FROM |
static java.lang.String |
VAR_HOST
|
static java.lang.String |
VAR_MIME_TYPE
|
static java.lang.String |
VAR_SUBJECT
|
static java.lang.String |
VAR_TO
|
static java.lang.String |
VAR_TO_ADDRESS
Deprecated. - use TO |
Fields inherited from class com.waveset.object.PersistentObject |
_trace, trace |
Constructor Summary | |
EmailTemplate()
Build an empty template object. |
|
EmailTemplate(org.w3c.dom.Element e)
Flesh out a template object by parsing its XML representation. |
Method Summary | |
java.lang.String |
getBody()
Get the string that will used as the body of the email. |
java.lang.String |
getBody(VariableResolver res)
Generate the body. |
java.lang.String |
getCC()
Get the string that will appear as the "cc address" of the email. |
java.lang.String |
getComments()
|
java.lang.String |
getEffectiveMimeType()
|
java.lang.String |
getFrom()
Get the string that will appear as the "from address" of the email. |
java.lang.String |
getFromAddress()
Deprecated. Use getFrom() instead |
Library |
getLibrary()
Gets the library. |
java.lang.String |
getMimeType()
|
java.lang.String |
getSmtpHost()
Get the name of the SMTP host to which mail will be sent. |
java.lang.String |
getSubject()
Get the string that will appear as the subject of the email. |
java.lang.String |
getTo()
Get the string that will appear as the "to address" of the email. |
java.lang.String |
getToAddress()
Deprecated. Use getTo() instead |
Type |
getType()
Returns the associated Type object. |
java.lang.Object |
getVariable(java.lang.String name,
ExState state)
Return the value of a variable. |
java.util.List |
getVariables()
|
boolean |
hasVariable(java.lang.String name)
Return true if we have a value for a variable. |
boolean |
isHtmlEnabled()
|
protected void |
parseSubclassAttributes(org.w3c.dom.Element e)
Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer). |
protected void |
parseSubclassElements(org.w3c.dom.Element e)
Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer). |
void |
setBody(java.lang.String s)
Set the string that will used as the body of the email. |
void |
setCC(java.lang.String s)
Set the string that will appear as the "cc address" of the email. |
void |
setComments(java.lang.String s)
|
void |
setFrom(java.lang.String s)
Set the string that will appear as the "from address" of the email. |
void |
setFromAddress(java.lang.String s)
Deprecated. Use setFrom() instead |
void |
setHtmlEnabled(boolean isEnabled)
|
void |
setLibrary(Library lib)
Remember when we're placed in a library. |
void |
setMimeType(java.lang.String s)
|
void |
setSmtpHost(java.lang.String s)
Set the name of the SMTP host to which mail will be sent. |
void |
setSubject(java.lang.String s)
Set the string that will appear as the subject of the email. |
void |
setTo(java.lang.String s)
Set the string that will appear as the "to address" of the email. |
void |
setToAddress(java.lang.String s)
Deprecated. Uset setTo() instead |
void |
setVariables(java.util.List vars)
|
void |
toXml(java.lang.StringBuffer b)
This is what PersistentObject.toXml calls. |
void |
toXml(java.lang.StringBuffer b,
int indent)
This is what XmlObjectFactory calls. |
void |
visit(Visitor v)
Visitor interface. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.waveset.object.Library.Member |
getName |
Field Detail |
public static final java.lang.String code_id
public static final java.lang.String VAR_HOST
public static final java.lang.String VAR_FROM_ADDRESS
public static final java.lang.String VAR_FROM
public static final java.lang.String VAR_TO_ADDRESS
public static final java.lang.String VAR_TO
public static final java.lang.String VAR_CC
public static final java.lang.String VAR_SUBJECT
public static final java.lang.String VAR_BODY
public static final java.lang.String VAR_MIME_TYPE
public static final java.lang.String ATT_HOST
public static final java.lang.String ATT_FROM
public static final java.lang.String ATT_TO
public static final java.lang.String ATT_CC
public static final java.lang.String ATT_HTML
public static final java.lang.String ATT_MIME
public static final java.lang.String EL_COMMENTS
public static final java.lang.String EL_SUBJECT
public static final java.lang.String EL_BODY
Constructor Detail |
public EmailTemplate()
public EmailTemplate(org.w3c.dom.Element e) throws WavesetException
Method Detail |
public Type getType()
getType
in class PersistentObject
public void visit(Visitor v) throws WavesetException
visit
in class PersistentObject
WavesetException
public java.lang.String getFromAddress()
public void setFromAddress(java.lang.String s)
public java.lang.String getFrom()
public void setFrom(java.lang.String s)
public java.lang.String getToAddress()
public void setToAddress(java.lang.String s)
public java.lang.String getTo()
public void setTo(java.lang.String s)
public java.lang.String getCC()
public void setCC(java.lang.String s)
public java.lang.String getSubject()
public void setSubject(java.lang.String s)
public java.lang.String getBody()
This string typically contains references to variables.
public void setBody(java.lang.String s)
public java.lang.String getSmtpHost()
public void setSmtpHost(java.lang.String s)
public boolean isHtmlEnabled()
public void setHtmlEnabled(boolean isEnabled)
public java.util.List getVariables()
public void setVariables(java.util.List vars)
public java.lang.String getComments()
public void setComments(java.lang.String s)
public void setMimeType(java.lang.String s)
public java.lang.String getMimeType()
public java.lang.String getEffectiveMimeType()
public boolean hasVariable(java.lang.String name)
public java.lang.Object getVariable(java.lang.String name, ExState state) throws WavesetException
WavesetException
public void setLibrary(Library lib)
setLibrary
in interface Library.Member
public Library getLibrary()
Library.Member
getLibrary
in interface Library.Member
public java.lang.String getBody(VariableResolver res) throws WavesetException
WavesetException
public void toXml(java.lang.StringBuffer b)
toXml
in class PersistentObject
public void toXml(java.lang.StringBuffer b, int indent)
toXml
in interface XmlObject
toXml
in class PersistentObject
protected void parseSubclassAttributes(org.w3c.dom.Element e) throws WavesetException
PersistentObject
parseSubclassAttributes
in class PersistentObject
WavesetException
PersistentObject's default implementation is a no-op.
,
PersistentObject.parseXml(Element)
protected void parseSubclassElements(org.w3c.dom.Element e) throws WavesetException
PersistentObject
parseSubclassElements
in class PersistentObject
WavesetException
PersistentObject's default implementation is a no-op.
,
PersistentObject.parseXml(Element)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |