public abstract class A_CmsNotification extends CmsHtmlMail
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
HEADER_FOOTER_CONFIG_PATH
Path to optional config file containing header and footer.
|
static java.lang.String |
HEADER_FOOTER_SEPARATOR
Separator between header and footer in optional config file.
|
protected CmsObject |
m_cms
The CmsObject.
|
protected java.lang.String |
m_configuredFooter
The configured footer.
|
protected java.lang.String |
m_configuredHeader
The configured header.
|
protected java.util.Locale |
m_locale
The locale of the receiver of the content notification.
|
protected CmsNotificationMacroResolver |
m_macroResolver
The macro resolver used.
|
protected CmsXmlContent |
m_mailContent
The xml-content to read subject, header and footer of the notification.
|
CID_LENGTH, html, inlineEmbeds, inlineImages, textATTACHMENTS, authenticator, bccList, bounceAddress, ccList, charset, content, CONTENT_TYPE, contentType, debug, EMAIL_BODY, EMAIL_SUBJECT, emailBody, FILE_SERVER, fromAddress, headers, hostName, ISO_8859_1, KOI8_R, MAIL_DEBUG, MAIL_HOST, MAIL_PORT, MAIL_SMTP_AUTH, MAIL_SMTP_CONNECTIONTIMEOUT, MAIL_SMTP_FROM, MAIL_SMTP_PASSWORD, MAIL_SMTP_SOCKET_FACTORY_CLASS, MAIL_SMTP_SOCKET_FACTORY_FALLBACK, MAIL_SMTP_SOCKET_FACTORY_PORT, MAIL_SMTP_TIMEOUT, MAIL_SMTP_USER, MAIL_TRANSPORT_PROTOCOL, MAIL_TRANSPORT_TLS, message, popBeforeSmtp, popHost, popPassword, popUsername, RECEIVER_EMAIL, RECEIVER_NAME, replyList, SENDER_EMAIL, SENDER_NAME, sentDate, SMTP, smtpPort, socketConnectionTimeout, socketTimeout, ssl, sslSmtpPort, subject, TEXT_HTML, TEXT_PLAIN, tls, toList, US_ASCII| Constructor and Description |
|---|
A_CmsNotification(CmsObject cms,
CmsUser receiver)
Creates a new A_CmsNotification.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMacro(java.lang.String key,
java.lang.String value)
Adds a new macro to the used macro resolver.
|
protected void |
appendHtmlHeader(java.lang.StringBuffer buffer)
Append the html-code to start a html mail message to the given buffer.
|
protected void |
appendXMLContent(java.lang.StringBuffer msg)
Append XMLContent to StringBuffer.
|
protected void |
appenHtmlFooter(java.lang.StringBuffer buffer)
Append the html-code to finish a html mail message to the given buffer.
|
protected abstract java.lang.String |
generateHtmlMsg()
Overwrite the method to generate the message body of the notification.
|
CmsObject |
getCmsObject()
Returns the CmsObject.
|
java.util.Locale |
getLocale()
Returns the locale.
|
protected abstract java.lang.String |
getNotificationContent()
Overwrite the method to return the path to the xmlcontent, where the subject,
the header and the footer are defined.
|
CmsUser |
getReceiver()
Returns the receiver.
|
java.lang.String |
send() |
buildMimeMessage, embed, embed, embed, embed, embed, embed, setHtmlMsg, setMsg, setTextMsgaddPart, addPart, addPart, attach, attach, attach, attach, attach, attach, createBodyPart, createMimeMultipart, getContainer, getPrimaryBodyPart, getSubType, init, isBoolHasAttachments, isInitialized, setBoolHasAttachments, setInitialized, setSubTypeaddBcc, addBcc, addBcc, addBcc, addCc, addCc, addCc, addCc, addHeader, addReplyTo, addReplyTo, addReplyTo, addTo, addTo, addTo, addTo, createMimeMessage, getBccAddresses, getBounceAddress, getCcAddresses, getFromAddress, getHeader, getHeaders, getHostName, getMailSession, getMimeMessage, getReplyToAddresses, getSentDate, getSmtpPort, getSocketConnectionTimeout, getSocketTimeout, getSslSmtpPort, getSubject, getToAddresses, isSendPartial, isSSL, isSSLCheckServerIdentity, isSSLOnConnect, isStartTLSEnabled, isStartTLSRequired, isTLS, sendMimeMessage, setAuthentication, setAuthenticator, setBcc, setBounceAddress, setCc, setCharset, setContent, setContent, setDebug, setFrom, setFrom, setFrom, setHeaders, setHostName, setMailSession, setMailSessionFromJNDI, setPopBeforeSmtp, setReplyTo, setSendPartial, setSentDate, setSmtpPort, setSocketConnectionTimeout, setSocketTimeout, setSSL, setSSLCheckServerIdentity, setSSLOnConnect, setSslSmtpPort, setStartTLSEnabled, setStartTLSRequired, setSubject, setTLS, setTo, toInternetAddressArray, updateContentTypepublic static final java.lang.String HEADER_FOOTER_CONFIG_PATH
public static final java.lang.String HEADER_FOOTER_SEPARATOR
protected java.lang.String m_configuredHeader
protected java.lang.String m_configuredFooter
protected CmsXmlContent m_mailContent
protected java.util.Locale m_locale
protected CmsNotificationMacroResolver m_macroResolver
public A_CmsNotification(CmsObject cms, CmsUser receiver)
cms - the cms object to usereceiver - the receiver of the notificationpublic void addMacro(java.lang.String key, java.lang.String value)
key - The key of the macro.value - The value of the macro.public CmsObject getCmsObject()
public java.util.Locale getLocale()
public CmsUser getReceiver()
public java.lang.String send() throws org.apache.commons.mail.EmailException
send in class org.apache.commons.mail.Emailorg.apache.commons.mail.EmailExceptionEmail.send()protected void appendHtmlHeader(java.lang.StringBuffer buffer)
buffer - The StringBuffer to add the html code to.protected void appendXMLContent(java.lang.StringBuffer msg)
msg - StringBufferprotected void appenHtmlFooter(java.lang.StringBuffer buffer)
buffer - The StringBuffer to add the html code to.protected abstract java.lang.String generateHtmlMsg()
protected abstract java.lang.String getNotificationContent()