|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.userprofiling.email.MessageContentProcessor atg.userprofiling.email.HtmlContentProcessor
public class HtmlContentProcessor
A MessageContentProcessor which takes in HTML content and
converts it into plain text. The Message content is set based
on the values of two properties: sendAsHtml
and
sendAsText
. If both are true, the Message content
is set to the multipart (with content type
"multipart/alternative") containing both the text and the HTML
versions. If only sendAsHtml
is true, the Message
content is set to the HTML version. If only
sendAsText
is true, the Message content is set to
the plain text version.
Message
Nested Class Summary |
---|
Nested classes/interfaces inherited from class atg.userprofiling.email.MessageContentProcessor |
---|
MessageContentProcessor.UrlAndMimeType |
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
HtmlContentProcessor()
|
Method Summary | |
---|---|
char |
getHrChar()
Returns the char used by the HTML to text converter when constructing a horizontal rule (an <hr> tag). |
java.util.List |
getIgnorableContentTags()
Gets the list of tag names which should have their content ignored |
int |
getIndentWidth()
Returns the indentation width used by the HTML to text converter. |
char |
getLiChar()
Returns the char used by the HTML to text converter when displaying list elements inside a <ul> tag. |
int |
getLineWidth()
Returns the line width used by the HTML to text converter. |
boolean |
getReplaceATagWithHrefAttribute()
Flag to indicate if we should replace all <a> tag contents with the tags href attribute (if available) |
boolean |
getSendAsHtml()
Returns the property indicating whether message content should be sent as HTML. |
boolean |
getSendAsText()
Returns the property indicating whether message content should be sent as plain text. |
void |
setHrChar(char pHrChar)
Sets the char used by the HTML to text converter when constructing a horizontal rule (an <hr> tag). |
void |
setIgnorableContentTags(java.util.List pIgnorableContentTags)
Sets the list of tags which should have their content ignored |
void |
setIndentWidth(int pIndentWidth)
Sets the indentation width used by the HTML to text converter. |
void |
setLiChar(char pLiChar)
Returns the char used by the HTML to text converter when displaying list elements inside a <ul> tag. |
void |
setLineWidth(int pLineWidth)
Sets the line width used by the HTML to text converter. |
void |
setMessageContent(javax.mail.Message pMessage,
java.lang.String pContent,
java.lang.String pContentType,
java.io.File[] pAttachments,
boolean pInlineAttachments)
Processes the email message content (assumed to be HTML) and stuffs the resulting content into the Message. |
void |
setMessageContents(javax.mail.Message pMessage,
java.lang.String[] pContents,
java.lang.String[] pContentTypes,
java.io.File[] pAttachments,
boolean pInlineAttachments)
Processes the email message content (assumed to be HTML) and stuffs the resulting content into the Message. |
void |
setReplaceATagWithHrefAttribute(boolean pReplaceATagWithHrefAttribute)
Sets mReplaceATagWithHrefAttribute |
void |
setSendAsHtml(boolean pSendAsHtml)
Sets the property indicating whether message content should be sent as HTML. |
void |
setSendAsText(boolean pSendAsText)
Sets the property indicating whether message content should be sent as plain text. |
boolean |
supportsMultipleContents()
We do support multiple contents. |
Methods inherited from class atg.userprofiling.email.MessageContentProcessor |
---|
pruneAlternatives, setMessageContent, setMessageContent |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public HtmlContentProcessor()
Method Detail |
---|
public boolean getSendAsHtml()
sendAsHtml
and
sendAsText
are true, both versions of the
content will be sent in a multipart message.
public void setSendAsHtml(boolean pSendAsHtml)
sendAsHtml
and
sendAsText
are true, both versions of the
content will be sent in a multipart message.
public boolean getSendAsText()
sendAsHtml
and sendAsText
are true,
both versions of the content will be sent in a multipart
message.
public void setSendAsText(boolean pSendAsText)
sendAsHtml
and
sendAsText
are true, both versions of the
content will be sent in a multipart message.
public int getLineWidth()
public void setLineWidth(int pLineWidth)
public int getIndentWidth()
public void setIndentWidth(int pIndentWidth)
public char getHrChar()
public void setHrChar(char pHrChar)
public char getLiChar()
public void setLiChar(char pLiChar)
public java.util.List getIgnorableContentTags()
public void setIgnorableContentTags(java.util.List pIgnorableContentTags)
pIgnorableContentTags
- The IgnorableContentTags to setpublic boolean getReplaceATagWithHrefAttribute()
true
if mReplaceATagWithHrefAttributepublic void setReplaceATagWithHrefAttribute(boolean pReplaceATagWithHrefAttribute)
pReplaceATagWithHrefAttribute
- The flag to setpublic void setMessageContent(javax.mail.Message pMessage, java.lang.String pContent, java.lang.String pContentType, java.io.File[] pAttachments, boolean pInlineAttachments) throws TemplateEmailException
sendAsText
property is set to true, the content
is converted into text, and the text version is sent. If
the sendAsHtml
property is also true, the HTML
version is sent along as well.
setMessageContent
in class MessageContentProcessor
pAttachments
- the files to attach to the message, in
addition to setting the regular contentpInlineAttachments
- if true, the files will be inlined
into the message, rather than attached
TemplateEmailException
- if the content could not be
processed or set in the Messagepublic void setMessageContents(javax.mail.Message pMessage, java.lang.String[] pContents, java.lang.String[] pContentTypes, java.io.File[] pAttachments, boolean pInlineAttachments) throws TemplateEmailException
sendAsText
property is set to true, the content
is converted into text, and the text version is sent. If
the sendAsHtml
property is also true, the HTML
version is sent along as well.
setMessageContents
in class MessageContentProcessor
pAttachments
- the files to attach to the message, in
addition to setting the regular contentpInlineAttachments
- if true, the files will be inlined
into the message, rather than attachedpContents
- an array of multi-part-alternative contentspContentTypes
- an array of content types which correspond
to each of the pContents elements.
TemplateEmailException
- if the content could not be
processed or set in the Messagepublic boolean supportsMultipleContents()
supportsMultipleContents
in class MessageContentProcessor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |