Package org.opencms.workflow
Class CmsWorkflowNotification
- java.lang.Object
-
- org.apache.commons.mail.Email
-
- org.apache.commons.mail.MultiPartEmail
-
- org.apache.commons.mail.HtmlEmail
-
- org.opencms.mail.CmsHtmlMail
-
- org.opencms.notification.A_CmsNotification
-
- org.opencms.workflow.CmsWorkflowNotification
-
public class CmsWorkflowNotification extends A_CmsNotification
Notification class for the workflow 'release' action.
-
-
Field Summary
-
Fields inherited from class org.opencms.notification.A_CmsNotification
HEADER_FOOTER_CONFIG_PATH, HEADER_FOOTER_SEPARATOR, m_cms, m_configuredFooter, m_configuredHeader, m_locale, m_macroResolver, m_mailContent
-
Fields inherited from class org.apache.commons.mail.HtmlEmail
CID_LENGTH, html, inlineEmbeds, inlineImages, text
-
Fields inherited from class org.apache.commons.mail.Email
ATTACHMENTS, 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 Summary
Constructors Constructor Description CmsWorkflowNotification(CmsObject adminCms, CmsObject userCms, CmsUser receiver, java.lang.String notificationContent, CmsProject project, java.util.List<CmsResource> resources, java.lang.String link)
Creates a new workflow notification mail object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
generateHtmlMsg()
Overwrite the method to generate the message body of the notification.protected java.lang.String
getMessage(java.lang.String key, java.lang.String... args)
Gets a message from the message bundle.protected java.lang.String
getNotificationContent()
Overwrite the method to return the path to the xmlcontent, where the subject, the header and the footer are defined.java.lang.String[]
getResourceInfo(CmsResource resource)
Gets the fields which should be displayed for a single resource.java.lang.String[]
getResourceInfoHeaders()
Gets the resource info headers.-
Methods inherited from class org.opencms.notification.A_CmsNotification
addMacro, appendHtmlHeader, appendXMLContent, appenHtmlFooter, getCmsObject, getLocale, getReceiver, send
-
Methods inherited from class org.apache.commons.mail.HtmlEmail
buildMimeMessage, embed, embed, embed, embed, embed, embed, setHtmlMsg, setMsg, setTextMsg
-
Methods inherited from class org.apache.commons.mail.MultiPartEmail
addPart, addPart, addPart, attach, attach, attach, attach, attach, attach, createBodyPart, createMimeMultipart, getContainer, getPrimaryBodyPart, getSubType, init, isBoolHasAttachments, isInitialized, setBoolHasAttachments, setInitialized, setSubType
-
Methods inherited from class org.apache.commons.mail.Email
addBcc, 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, updateContentType
-
-
-
-
Constructor Detail
-
CmsWorkflowNotification
public CmsWorkflowNotification(CmsObject adminCms, CmsObject userCms, CmsUser receiver, java.lang.String notificationContent, CmsProject project, java.util.List<CmsResource> resources, java.lang.String link) throws org.apache.commons.mail.EmailException
Creates a new workflow notification mail object.- Parameters:
adminCms
- the admin CMS contextuserCms
- the user CMS contextreceiver
- the mail recipientnotificationContent
- the file from which to read the notification configurationproject
- the workflow projectresources
- the workflow resourceslink
- the link used for publishing the resources- Throws:
org.apache.commons.mail.EmailException
- if an email error occurs
-
-
Method Detail
-
getResourceInfo
public java.lang.String[] getResourceInfo(CmsResource resource)
Gets the fields which should be displayed for a single resource.- Parameters:
resource
- the resource for which we should fetch the fields- Returns:
- a string array containing the information for the given resource
-
getResourceInfoHeaders
public java.lang.String[] getResourceInfoHeaders()
Gets the resource info headers.- Returns:
- the resource info headers
-
generateHtmlMsg
protected java.lang.String generateHtmlMsg()
Description copied from class:A_CmsNotification
Overwrite the method to generate the message body of the notification. This text is placed between the header and the footer of the defined xmlcontent and the required html code is added.- Specified by:
generateHtmlMsg
in classA_CmsNotification
- Returns:
- The text to be inserted in the notification.
- See Also:
A_CmsNotification.generateHtmlMsg()
-
getMessage
protected java.lang.String getMessage(java.lang.String key, java.lang.String... args)
Gets a message from the message bundle.- Parameters:
key
- the message keyargs
- the message parameters- Returns:
- the message from the message bundle
-
getNotificationContent
protected java.lang.String getNotificationContent()
Description copied from class:A_CmsNotification
Overwrite the method to return the path to the xmlcontent, where the subject, the header and the footer are defined.- Specified by:
getNotificationContent
in classA_CmsNotification
- Returns:
- The path to the xmlcontent file.
- See Also:
A_CmsNotification.getNotificationContent()
-
-