public class MailMessage extends Content
Example :
MailMessage msg = new MailMessage("myplugin.log-mail"); msg.setTo(channel.getDefaultAdmin()); msg.setSubject("[" + channel.getName() + "] Daily log"); msg.setContentText("Daily log attached"); msg.addFile(new File(channel.getRealPath("WEB-INF/data/logs/jcms.log"))); msg.send(); logger.info("Log mail sent in " + Util.formatDuration(msg.getDuration()));
MailMessage msg = new MailMessage("starwarsplugin.war-mail-alert"); msg.setFrom("Darth Vader <dv@deathstar.com>"); msg.setTo("Son <luke@alliance.com>"); msg.setBcc("Palpatine <palpatine@deathstar.com>"); for (Member sithMember : sithGroup.getMemberSet()) { msg.addCc(sithMember); } msg.setSubject("I am your father"); msg.setContentText("The Force is with you, young Skywalker. But you are not a Jedi yet."); msg.setContentHtml("The <strong>Force</strong> is with you, young Skywalker. But you are not a Jedi yet."); msg.send();
Modifier and Type | Class and Description |
---|---|
static class |
MailMessage.Part
Convenient recursive structure to wrap javax.mail.Message Part
|
static class |
MailMessage.SentDateComparator<T extends MailMessage>
Compares two MailMessage using their SentDate in descending order (newest date first).
|
Publication.AdateComparator<T extends Publication>, Publication.AdateSelector, Publication.AudienceRightComparator<T extends Publication>, Publication.AudienceRightSelector, Publication.AuthorComparator<T extends Publication>, Publication.AuthorizedSelector, Publication.CanWorkOnSelector, Publication.DdateComparator<T extends Publication>, Publication.EdateComparator<T extends Publication>, Publication.EdateSelector, Publication.PdateComparator<T extends Publication>, Publication.PdateSelector, Publication.PopularityComparator<T extends Publication>, Publication.PstatusComparator<T extends Publication>, Publication.PstatusSelector, Publication.ReaderComparator<T extends Publication>, Publication.ReadRightSelector, Publication.RightComparator<T extends Publication>, Publication.SdateComparator<T extends Publication>, Publication.SdateSelector, Publication.TitleComparator<T extends Publication>, Publication.TrackedSelector, Publication.TypeComparator<T extends Publication>, Publication.UdateComparator<T extends Publication>, Publication.UdateSelector, Publication.UserContentSelector, Publication.VisibleStateSelector, Publication.VoteScoreComparator<T extends Publication>, Publication.WorkspaceAuthorSelector, Publication.WorkspaceComparator<T extends Publication>, Publication.WorkspaceSelector
Data.AuthorSelector, Data.CdateSelector, Data.DataNameComparator<T extends Data>, Data.DeletableSelector, Data.ImportSelector, Data.MdateSelector, Data.OpAuthorComparator<T extends Data>, Data.RowIdComparator<T extends Data>, Data.StrongLockSelector
BasicStorable.CdateComparator<T extends Storable>, BasicStorable.IdComparator<T extends Storable>, BasicStorable.MdateComparator<T extends Storable>
Modifier and Type | Field and Description |
---|---|
protected static int |
ASCII_WIDTH |
static java.lang.String |
DB_MESSAGE_ACCOUNT |
static java.lang.String |
DB_MESSAGE_BCC |
static java.lang.String |
DB_MESSAGE_CC |
static java.lang.String |
DB_MESSAGE_FROM |
static java.lang.String |
DB_MESSAGE_ID |
static java.lang.String |
DB_MESSAGE_INREPLYTO |
static java.lang.String |
DB_MESSAGE_REFERENCES |
static java.lang.String |
DB_MESSAGE_REPLYTO |
static java.lang.String |
DB_MESSAGE_SUBJECT |
static java.lang.String |
DB_MESSAGE_THREAD |
static java.lang.String |
DB_MESSAGE_TO |
protected long |
duration |
protected java.util.Map<java.io.File,java.lang.String> |
fileMap |
protected java.util.Map<java.lang.String,java.lang.Object> |
headers |
protected javax.mail.Message |
message |
protected java.util.Collection<MailMessage.Part> |
multiparts |
static java.lang.String |
REVISION |
static java.lang.String |
SEP |
adate, allCatIdSet, authGrpIdSet, authGrpIdSetDirty, authGrpIdSetInit, authMbrIdSet, authMbrIdSetDirty, authMbrIdSetInit, authorizedGroupSet, authorizedMemberSet, categories, categorySet, catIdSet, catIdSetDirty, catIdSetInit, CTRL_TOPIC_ADVANCED, CTRL_TOPIC_CATEGORIES, CTRL_TOPIC_WORKFLOW, edate, friendlyURLSet, hasNoReadRightsDBData, indexMgr, isTracked, mainInstance, mainLanguage, majorVersion, mergeDate, mergeId, minorVersion, pdate, pstatus, PUBLICATION_WFNOTE, readerCount, roleMap, sdate, templates, title, titleML, udate, updateGroupSet, updateMemberSet, voteCount, voteScore, wfExpressAlarmEntry, wfReminderAlarmEntry, workflowId, workspace
author, authorDBID, channel, DISPLAY_URL_EXTRA_INFO, extension, extraDataMap, extraDBDataMapToSaveOnOp, importMap, opAuthor, opDelegate
IMPORT_ALARM_MGR, IMPORT_AUTHOR_PROP, IMPORT_CATEGORY_DEFAULT, IMPORT_DC_ATTR, IMPORT_DC_STEP, IMPORT_DIR, IMPORT_ENABLED, IMPORT_JDOM_ELEMENT, IMPORT_LOG_FILE, IMPORT_LOG_MAX, IMPORT_OPTIONS, IMPORT_OPTIONS_DC_CONTEXT, IMPORT_ROOT_PROP, IMPORT_SOURCE_FILE, IMPORT_SOURCE_PREFIX_PROP, IMPORT_SOURCES_DIR, IMPORT_STEP_CLEAN, IMPORT_STEP_IMPORT, IMPORT_STEP_UPDATE_REF, IMPORT_WS_PROP
DATA_TAG, DATASET_TAG, FIELD_CLASS, FIELD_ENTRY, FIELD_ITEM, FIELD_KEY, FIELD_NAME, FIELD_TAG, FIELD_VALUE, FILE_FIELD, FILE_ID, FILE_MTIME, FILE_SIZE, FILE_TAG, FILE_TICKET, FILESET_TAG, RELATED_TAG
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
Constructor and Description |
---|
MailMessage() |
MailMessage(MailMessage other) |
MailMessage(javax.mail.Message msg) |
MailMessage(java.lang.String origin) |
Modifier and Type | Method and Description |
---|---|
MailMessage |
addAttachements(FileDocument v) |
MailMessage |
addAttachements(java.util.Set<FileDocument> v) |
MailMessage |
addBcc(Member v) |
MailMessage |
addBcc(java.util.Set<Member> v) |
MailMessage |
addBcc(java.lang.String v) |
MailMessage |
addCc(Member v) |
MailMessage |
addCc(java.util.Set<Member> v) |
MailMessage |
addCc(java.lang.String v) |
MailMessage |
addFile(java.io.File file)
Add a file to send with this MailMessage.
|
MailMessage |
addFile(java.io.File file,
java.lang.String id)
Add a file to send with this MailMessage.
|
MailMessage |
addTo(Member v) |
MailMessage |
addTo(java.util.Set<Member> v) |
MailMessage |
addTo(java.lang.String v) |
protected javax.mail.Message |
buildOneMessageForAll()
Create one message to be sent to all recipients.
|
protected javax.mail.Message[] |
buildOneMessageForEach()
Create one message one for each recipients.
|
boolean |
checkAuthKey()
Returns true if the authkey contains in the localpart of the "to" field is consistent with the "from" field.
|
protected void |
fillMessageContent(javax.mail.Message message) |
java.lang.String |
getAccount() |
protected java.util.Set<java.lang.String> |
getAddressSet(javax.mail.Address[] ia)
Returns a Set of Address.toString()
|
java.util.Set<FileDocument> |
getAttachements() |
java.util.Set<FileDocument> |
getAttachements(boolean b) |
java.util.Set<java.lang.String> |
getBcc() |
javax.mail.internet.InternetAddress[] |
getBccIA() |
java.util.Set<Member> |
getBccMember() |
java.util.Set<Member> |
getBccMember(boolean b) |
java.util.Set<java.lang.String> |
getCc() |
javax.mail.internet.InternetAddress[] |
getCcIA() |
java.util.Set<Member> |
getCcMember() |
java.util.Set<Member> |
getCcMember(boolean b) |
java.lang.String |
getContentHtml() |
java.lang.String |
getContentText() |
javax.mail.BodyPart[] |
getCustomBodyParts() |
protected javax.activation.DataHandler |
getDataHandler(java.io.File file)
Compute the correct handler to manage this file
|
long |
getDuration()
Retrieve the time the sending process took to execute.
|
java.util.Map<java.io.File,java.lang.String> |
getFileMap()
Retrieve the Map of File/id to send in this MailMessage.
|
protected java.lang.String |
getFirstAddress(javax.mail.Address[] ia)
Returns the first Address.toString()
|
javax.mail.internet.InternetAddress |
getFirstFromIA()
Resolve "From" from all froms and Member's from
|
protected javax.mail.internet.InternetAddress |
getFirstIA(java.lang.String email,
Member mbr) |
java.lang.String |
getFrom() |
javax.mail.internet.InternetAddress[] |
getFromIA() |
Member |
getFromMember() |
protected javax.mail.internet.InternetAddress[] |
getIAQuietly(java.util.Set<java.lang.String> address,
java.util.Set<Member> addressMember)
Returns an array of InternetAddress joins of addresses and Member's addresses
|
java.lang.String |
getInReplyTo() |
java.util.Collection<? extends MailMessage> |
getMailMessageReplies()
Returns a Collection of MailMessage replies of the current MailMessage
|
java.util.Collection<? extends MailMessage> |
getMailMessageThread()
Returns a Collection of MailMessage, thread of the current discussion
in ascending order (oldest date first).
|
java.lang.String |
getMatchingRecipient(java.util.regex.Pattern pattern)
Returns the address matching the given pattern in all recipient and members
|
java.lang.String |
getMatchingRecipient(java.lang.String address)
Returns the address matching (indexOf) the given address in all recipient and members
|
java.lang.String |
getMessageId() |
java.lang.String |
getOrigin() |
int |
getPriority() |
java.util.Date |
getReceivedDate() |
java.util.Set<java.lang.String> |
getRecipient() |
java.util.Set<Member> |
getRecipientMember() |
java.util.Set<java.lang.String> |
getReferences() |
java.lang.String |
getReplyTo() |
javax.mail.internet.InternetAddress[] |
getReplyToIA() |
Member |
getReplyToMember() |
boolean |
getSendAcknowledge()
Get whether acknowledge message should be sent at end of process.
|
Member |
getSenderMember() |
boolean |
getSendOneMailPerRecipient()
Get sending mode, one mail for all recipients (false), or one mail for each recipients (true).
|
java.util.Date |
getSentDate() |
Member |
getSingleRecipient()
Returns the single Member recipients of the message or null if there is multiple recipients
|
java.lang.String |
getSubject() |
java.util.Map<java.lang.String,java.lang.Object> |
getTemporaryHeaders()
Returns a temporary Map of all mail's header.
|
javax.mail.Message |
getTemporaryMessage()
Returns temporary javax.mail.Message store while fetching mail
Message might be null.
|
java.util.Collection<MailMessage.Part> |
getTemporaryMultiparts()
Returns flatten collection of MailMessage.Part with decoded Files and Contents
|
java.lang.String |
getThread() |
java.util.Set<java.lang.String> |
getTo() |
javax.mail.internet.InternetAddress[] |
getToIA() |
java.util.Set<Member> |
getToMember() |
java.util.Set<Member> |
getToMember(boolean b) |
java.util.Collection<? extends TreeNode> |
getTreeChildren()
Returns a Collection of TreeNode children
of the current node
|
TreeNode |
getTreeParent()
Returns parent of the current node
|
protected void |
performBeforeWrite(int op,
Member mbr,
java.util.Map context)
Called to perform some action before the write.
|
void |
send()
Send this MailMessage.
|
void |
send(java.util.HashMap<java.lang.String,java.lang.Object> ctxt)
Send this MailMessage.
|
protected void |
sendAcknowledge(java.util.Collection<javax.mail.Message> successMessages,
java.util.Collection<javax.mail.Message> errorMessages) |
void |
sendInThread()
Send this MailMessage in a seperate thread.
|
void |
sendInThread(java.util.HashMap<java.lang.String,java.lang.Object> ctxt)
Send this MailMessage in a seperate thread.
|
void |
setAccount(java.lang.String v) |
void |
setAttachements(java.util.Set<FileDocument> v) |
MailMessage |
setBcc(Member v) |
void |
setBcc(java.util.Set<java.lang.String> v) |
MailMessage |
setBcc(java.lang.String v) |
void |
setBccMember(java.util.Set<Member> v) |
MailMessage |
setCc(Member v) |
void |
setCc(java.util.Set<java.lang.String> v) |
MailMessage |
setCc(java.lang.String v) |
void |
setCcMember(java.util.Set<Member> v) |
void |
setContentHtml(java.lang.String v) |
MailMessage |
setContentHtmlFromJsp(java.lang.String jspPath,
Member loggedMember,
java.lang.String language,
java.util.HashMap<java.lang.Object,java.lang.Object> requestAttribute,
java.util.HashMap<java.lang.Object,java.lang.Object> sessionAttribute)
Set the HTML text content of this MailMessage from the rendering of the specified jsp.
|
void |
setContentText(java.lang.String v) |
MailMessage |
setContentTextFromJsp(java.lang.String jspPath,
Member loggedMember,
java.lang.String language,
java.util.HashMap<java.lang.Object,java.lang.Object> requestAttribute,
java.util.HashMap<java.lang.Object,java.lang.Object> sessionAttribute)
Set the plain text content of this MailMessage from the rendering of the specified jsp.
|
void |
setCustomBodyParts(javax.mail.BodyPart[] v) |
MailMessage |
setFrom(Member v) |
void |
setFrom(java.lang.String v) |
void |
setFromMember(Member v) |
void |
setInReplyTo(java.lang.String v) |
protected void |
setMessage(javax.mail.Message msg)
Set fields for the given Message and download attachements in temporary folder
Caller should also set:
Account setAccount()
Author setAuthor()
|
void |
setMessageId(java.lang.String v) |
void |
setOrigin(java.lang.String origin) |
void |
setPriority(int v) |
void |
setReceivedDate(java.util.Date v) |
void |
setReferences(java.util.Set<java.lang.String> v) |
MailMessage |
setReplyTo(Member v) |
void |
setReplyTo(java.lang.String v) |
void |
setReplyToMember(Member v) |
void |
setSendAcknowledge(boolean sendAcknowledge)
Set whether acknowledge message should be sent at end of process.
|
void |
setSendOneMailPerRecipient(boolean sendOneMailPerRecipient)
Set sending mode, one mail for all recipients (false), or one mail for each recipients (true).
|
void |
setSentDate(java.util.Date v) |
void |
setSubject(java.lang.String v) |
void |
setThread(java.lang.String v) |
MailMessage |
setTo(Member v) |
void |
setTo(java.util.Set<java.lang.String> v) |
MailMessage |
setTo(java.lang.String v) |
void |
setToMember(java.util.Set<Member> v) |
addAuthorizedGroup, addAuthorizedMember, addCategory, addFollower, addWeakReferrer, addWFExpressAlarm, addWFReminderAlarm, assignCommonPublicationFields, assignRole, assignRole, canBeArchived, canBeArchived, canBeEditedFieldByField, canBeFollowedBy, canBeReadBy, canBeReadBy, canBeReadBy, canBeReadBy, canBeReadBy, canBeVotedBy, canCreateCopy, canCreateCopy, canCreateWorkCopy, canMergeWorkCopy, canRequestUnlock, checkCreate, checkDelete, checkIntegrity, checkLang, checkMember, checkMerge, checkStateChange, checkStateChange, checkTemplateEntry, checkUpdate, checkWrite, clearTransientIndex, cloneDBDataCollections, computeSignature, computeSignature, containsCategory, createCopy, createWFNote, createWFNote, createWorkCopy, discardCopy, exportXmlField, getAbstract, getAbstract, getAbstract, getAbstractML, getAccessCount, getAdate, getAdateComparator, getAdateSelector, getAllCatIdSet, getAllFilePath, getAllWikiText, getAllWysiwygText, getAudiencedRightsString, getAudienceRightComparator, getAudienceRightSelector, getAuthGrpIdSet, getAuthMbrIdSet, getAuthorizedGroupSet, getAuthorizedMemberSet, getAuthorizedSelector, getCanWorkOnSelector, getCategories, getCategories, getCategorySet, getCatIdSet, getComparator, getComparator, getComparator, getCSVHeader, getDataIcon, getDataIconTitle, getDataName, getDate, getDate, getDateSelector, getDBDataRevision, getDdateComparator, getDefaultTemplateUsage, getDescendantCategorySet, getDescendantCategorySet, getDescendantCategorySet, getDisplayTemplateFile, getDocumentLinkSet, getEdate, getEdateComparator, getEdateSelector, getEstimatedReminderCount, getExternalLinkSet, getFieldInMainLanguage, getFieldValue, getFirstDescendantCategory, getFirstDescendantCategory, getFirstDescendantCategory, getFollowerList, getFriendlyURLSet, getHasNoReadRights, getImportConflictCopy, getImportVersion, getIndexingDate, getInternalWorkflow, getLinkDataSet, getMainInstance, getMainLanguage, getMajorVersion, getMemberSetAssignedToRole, getMergeDate, getMergeId, getMinorVersion, getNextWFStateSet, getPdate, getPdateComparator, getPdateSelector, getPopularity, getPopularityComparator, getPstatus, getPstatusAlarmEntry, getPstatusComparator, getPstatusSelector, getPstatusSelector, getQueryTemplateFile, getReaderComparator, getReaderCount, getReaderTrackerList, getReadRightSelector, getReadRightsString, getRightComparator, getRoleMap, getRoleMapStr, getSdate, getSdateComparator, getSdateSelector, getSearchStrings, getTemplate, getTemplateEntry, getTemplateEntry, getTemplateEntrySet, getTemplatePath, getTemplatePath, getTemplates, getTitle, getTitle, getTitle, getTitleComparator, getTitleComparator, getTitleML, getTrackedSelector, getTreeRoot, getTypeComparator, getTypeLabel, getUdate, getUdateComparator, getUdateSelector, getUpdateGroupSet, getUpdateMemberSet, getVersionString, getVisibleStateSelector, getVoteCount, getVoteScore, getVoteScoreComparator, getVoteValue, getWeakReferrerSet, getWFNoteList, getWFState, getWFStateLabel, getWFStateLabelHtml, getWorkCopySet, getWorkflow, getWorkflowId, getWorkspace, getWorkspaceAuthorSelector, getWorkspaceComparator, getWorkspaceId, getWorkspaceSelector, getWSTypeEntry, getWSTypeEntry, hasAlreadyVoted, hasAnyReadRights, hasBeenReadBy, hasCategory, hasImportConflict, hasNoReadRights, hasWeakReferrers, importConvertToLocal, importMarkAsMerged, importOverrideAndUpdate, importXml, init, initCopy, initializeDBDataCollections, internalCanBeReadBy, isAudienced, isDefaultTemplate, isFollowedBy, isImportConflictCopy, isInRole, isInVisibleState, isPublic, isRoleAssigned, isTracked, isTreeLeaf, isTreeNode, isUserContent, isUserContentType, isVersioned, isVotable, isWorkCopy, majorUpdate, notifyFollowers, performAfterWrite, performCreate, performDelete, performMerge, performMerge, performUpdate, prepareMergeCopy, putPstatusAlarmEntry, recomputeScore, removeAllDescendants, removeAllFollowers, removeAllReaderTracker, removeAuthorizedGroup, removeAuthorizedMember, removeCategory, removeDataSet, removeFollower, removeImportMetadata, removePstatusAlarmEntry, removeWeakReferrer, removeWFExpressAlarm, removeWFReminderAlarm, resolveTypeTemplateEntry, setAbstract, setAbstract, setAdate, setAllCatIdSet, setAuthGrpIdSet, setAuthMbrIdSet, setAuthorizedGroupSet, setAuthorizedMemberSet, setCategories, setCategorySet, setCatIdSet, setCdate, setEdate, setFieldValue, setFriendlyURLSet, setHasNoReadRights, setImportConflictCopy, setImportVersion, setMainInstance, setMainLanguage, setMajorVersion, setMergeDate, setMergeId, setMinorVersion, setPdate, setPstatus, setReaderCount, setRoleMap, setRoleMapStr, setRoleMemberSetMap, setSdate, setTemplate, setTemplates, setTitle, setTitle, setTitleML, setTracked, setUdate, setUpdateGroupSet, setUpdateMemberSet, setVoteCount, setVoteScore, setWorkflow, setWorkflowId, setWorkspace, setWorkspaceId, toCSV, toFullString, toString, trackReader, trackReader, unassignMember, unassignRole, updatePstatus, updateTemplate
checkCreate, checkDelete, checkIntegrity, checkLockMember, checkStrongLockMember, checkUpdate, clone, computeDBIDArray, exportXml, exportXml, exportXml, exportXml, exportXmlRelated, exportXmlRelated, fillExportXmlFieldAttributes, getAllReferrerSet, getAllReferrerSet, getAllTypeFieldEntry, getAuthor, getAuthor, getAuthorComparator, getAuthorDBID, getAuthorId, getAuthorSelector, getBooleanFieldValue, getBooleanFieldValue, getCaddyComparator, getCategoryFieldValue, getCategoryFieldValue, getCdateSelector, getDataIconAlt, getDataIconHtml, getDataIconHtml, getDataImage, getDataImage, getDataImage, getDataNameComparator, getDeletableSelector, getDisplayLink, getDisplayLink, getDisplayLink, getDisplayUrl, getDoubleFieldValue, getDoubleFieldValue, getExportXmlDataValue, getExtension, getExtraData, getExtraDataMap, getExtraDBData, getExtraDBDataMap, getExtraInfo, getExtraInfoMap, getFieldStatusMap, getFieldValue, getFieldValue, getFieldValue, getGenericThumbnail, getImportAuthor, getImportBatch, getImportDate, getImportDisplayUrl, getImportId, getImportMap, getImportMdate, getImportSelector, getImportSignature, getImportSource, getImportSourceUrl, getImportUrl, getIntFieldValue, getIntFieldValue, getLangPropertyValue, getLinkCount, getLinkIndexedDataSet, getLinkIndexedDataSet, getLockDate, getLockInfo, getLockMember, getLongFieldValue, getLongFieldValue, getMdateSelector, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getNewDefaultExtraDBDataMap, getOpAuthor, getOpAuthorComparator, getOpDelegate, getRowId, getRowIdComparator, getStrongLock, getStrongLockDate, getStrongLockInfo, getStrongLockMember, getStrongLockSelector, getTypeEntry, getTypeFieldsEntries, getUpdateInstance, getVirtualIDSet, hashCode, importXmlFieldsWithReferences, importXmlFiles, importXmlReferences, isDBData, isImported, isImportUpdated, isInDatabase, isLocked, isPersisted, isStrongLocked, lock, markNewImport, mergeHybridLink, performCreate, performDelete, performUpdate, prepareUpdateContext, printDataName, printDisplayLinkEnd, printDisplayLinkStart, printDisplayUrl, printDisplayUrl, putStrongLock, releaseStrongLock, releaseStrongLock, removeExtraData, removeExtraDBData, removeExtraInfo, setAuthor, setAuthorDBID, setAuthorId, setBooleanFieldValue, setCategoryFieldValue, setDoubleFieldValue, setExtension, setExtraData, setExtraDataMap, setExtraDBData, setExtraDBDataMap, setExtraDBDataMap, setExtraInfo, setFieldValue, setId, setImportAuthor, setImportBatch, setImportDate, setImportDisplayUrl, setImportId, setImportMap, setImportMdate, setImportSignature, setImportSource, setImportSourceUrl, setImportUpdated, setIntFieldValue, setLongFieldValue, setMdate, setOpAuthor, setOpDelegate, setRowId, unlock, unlock, unmarkNewImport, updateExtraDataMap, updateExtraDBDataMap, updateIndexTreeSet
clearId, compareTo, equals, getAttribute, getAttributes, getCdate, getCdateComparator, getDdate, getId, getIdComparator, getMdate, getMdateComparator, getStore, getUrid, hasBeenUpdated, isStored, resolveAtt, resolveVal, setAttributes, setAttributes, setDdate, setStore, toXml
public static final java.lang.String REVISION
public static final java.lang.String SEP
public static final java.lang.String DB_MESSAGE_ID
public static final java.lang.String DB_MESSAGE_FROM
public static final java.lang.String DB_MESSAGE_TO
public static final java.lang.String DB_MESSAGE_CC
public static final java.lang.String DB_MESSAGE_BCC
public static final java.lang.String DB_MESSAGE_REPLYTO
public static final java.lang.String DB_MESSAGE_INREPLYTO
public static final java.lang.String DB_MESSAGE_REFERENCES
public static final java.lang.String DB_MESSAGE_SUBJECT
public static final java.lang.String DB_MESSAGE_ACCOUNT
public static final java.lang.String DB_MESSAGE_THREAD
protected transient javax.mail.Message message
protected transient java.util.Map<java.lang.String,java.lang.Object> headers
protected transient java.util.Collection<MailMessage.Part> multiparts
protected transient java.util.Map<java.io.File,java.lang.String> fileMap
protected transient long duration
protected static final int ASCII_WIDTH
public MailMessage()
public MailMessage(MailMessage other)
public MailMessage(javax.mail.Message msg) throws java.io.IOException, javax.mail.MessagingException
java.io.IOException
javax.mail.MessagingException
public MailMessage(java.lang.String origin)
public java.lang.String getSubject()
public java.lang.String getOrigin()
public java.lang.String getFrom()
public java.util.Set<java.lang.String> getTo()
public java.util.Set<java.lang.String> getCc()
public java.util.Set<java.lang.String> getBcc()
public java.lang.String getReplyTo()
public Member getFromMember()
public java.util.Set<Member> getToMember()
public java.util.Set<Member> getToMember(boolean b)
public java.util.Set<Member> getCcMember()
public java.util.Set<Member> getCcMember(boolean b)
public java.util.Set<Member> getBccMember()
public java.util.Set<Member> getBccMember(boolean b)
public Member getReplyToMember()
public Member getSenderMember()
public java.util.Set<FileDocument> getAttachements()
public java.util.Set<FileDocument> getAttachements(boolean b)
public java.lang.String getContentText()
public java.lang.String getContentHtml()
public java.lang.String getAccount()
public int getPriority()
public java.util.Date getSentDate()
public java.util.Date getReceivedDate()
public java.lang.String getMessageId()
public java.lang.String getInReplyTo()
public java.util.Set<java.lang.String> getReferences()
public java.lang.String getThread()
public javax.mail.BodyPart[] getCustomBodyParts()
public void setSubject(java.lang.String v)
public void setOrigin(java.lang.String origin)
public void setFrom(java.lang.String v)
public void setTo(java.util.Set<java.lang.String> v)
public void setCc(java.util.Set<java.lang.String> v)
public void setBcc(java.util.Set<java.lang.String> v)
public void setReplyTo(java.lang.String v)
public void setFromMember(Member v)
public void setToMember(java.util.Set<Member> v)
public void setCcMember(java.util.Set<Member> v)
public void setBccMember(java.util.Set<Member> v)
public void setReplyToMember(Member v)
public void setAttachements(java.util.Set<FileDocument> v)
public void setContentText(java.lang.String v)
public void setContentHtml(java.lang.String v)
public void setAccount(java.lang.String v)
public void setPriority(int v)
public void setSentDate(java.util.Date v)
public void setReceivedDate(java.util.Date v)
public void setMessageId(java.lang.String v)
public void setInReplyTo(java.lang.String v)
public void setReferences(java.util.Set<java.lang.String> v)
public void setThread(java.lang.String v)
public void setCustomBodyParts(javax.mail.BodyPart[] v)
public void setSendOneMailPerRecipient(boolean sendOneMailPerRecipient)
Default is false, ie send one mail for all.
sendOneMailPerRecipient
- set to true to send one mail to each recipient, false to send one mail for all.public void setSendAcknowledge(boolean sendAcknowledge)
sendAcknowledge
- the acknowledge messagepublic javax.mail.internet.InternetAddress[] getFromIA()
public javax.mail.internet.InternetAddress[] getToIA()
public javax.mail.internet.InternetAddress[] getCcIA()
public javax.mail.internet.InternetAddress[] getBccIA()
public javax.mail.internet.InternetAddress[] getReplyToIA()
public MailMessage setTo(java.lang.String v)
public MailMessage setCc(java.lang.String v)
public MailMessage setBcc(java.lang.String v)
public MailMessage setFrom(Member v)
public MailMessage setTo(Member v)
public MailMessage setCc(Member v)
public MailMessage setBcc(Member v)
public MailMessage setReplyTo(Member v)
public MailMessage addTo(java.lang.String v)
public MailMessage addCc(java.lang.String v)
public MailMessage addBcc(java.lang.String v)
public MailMessage addTo(Member v)
public MailMessage addCc(Member v)
public MailMessage addBcc(Member v)
public MailMessage addTo(java.util.Set<Member> v)
public MailMessage addCc(java.util.Set<Member> v)
public MailMessage addBcc(java.util.Set<Member> v)
public MailMessage addAttachements(FileDocument v)
public MailMessage addAttachements(java.util.Set<FileDocument> v)
public java.util.Set<java.lang.String> getRecipient()
public java.util.Set<Member> getRecipientMember()
public boolean getSendOneMailPerRecipient()
Default is false, ie send one mail for all.
public boolean getSendAcknowledge()
public java.lang.String getMatchingRecipient(java.lang.String address)
address
- to matchpublic java.lang.String getMatchingRecipient(java.util.regex.Pattern pattern)
pattern
- to matchpublic javax.mail.internet.InternetAddress getFirstFromIA()
protected javax.mail.internet.InternetAddress getFirstIA(java.lang.String email, Member mbr)
public Member getSingleRecipient()
protected javax.mail.internet.InternetAddress[] getIAQuietly(java.util.Set<java.lang.String> address, java.util.Set<Member> addressMember)
address
- Set of email addressaddressMember
- Set of memberprotected java.util.Set<java.lang.String> getAddressSet(javax.mail.Address[] ia)
ia
- an array of Addressprotected java.lang.String getFirstAddress(javax.mail.Address[] ia)
ia
- an array of Addresspublic MailMessage setContentHtmlFromJsp(java.lang.String jspPath, Member loggedMember, java.lang.String language, java.util.HashMap<java.lang.Object,java.lang.Object> requestAttribute, java.util.HashMap<java.lang.Object,java.lang.Object> sessionAttribute)
jspPath
- a jsp path relative to the webapp root e.g "/custom/jcms/doNotificationText.jsp"
loggedMember
- the Member that will be set as the logged member when invoking jsplanguage
- the language that will be set when invoking jsprequestAttribute
- a HashMap of request attribute available to the jsp executionsessionAttribute
- a HashMap of session attribute available to the jsp executionpublic MailMessage setContentTextFromJsp(java.lang.String jspPath, Member loggedMember, java.lang.String language, java.util.HashMap<java.lang.Object,java.lang.Object> requestAttribute, java.util.HashMap<java.lang.Object,java.lang.Object> sessionAttribute)
jspPath
- a jsp path relative to the webapp root e.g "/custom/jcms/doNotificationText.jsp"
loggedMember
- the Member that will be set as the logged member when invoking jsplanguage
- the language that will be set when invoking jsprequestAttribute
- a HashMap of request attribute available to the jsp executionsessionAttribute
- a HashMap of session attribute available to the jsp executionpublic javax.mail.Message getTemporaryMessage()
public java.util.Collection<MailMessage.Part> getTemporaryMultiparts()
public java.util.Map<java.lang.String,java.lang.Object> getTemporaryHeaders()
protected void setMessage(javax.mail.Message msg) throws javax.mail.MessagingException, java.io.IOException
msg
- the messagejavax.mail.MessagingException
- if an error occursjava.io.IOException
- if an error occursprotected void performBeforeWrite(int op, Member mbr, java.util.Map context)
Data
performBeforeWrite
in class Publication
op
- the operation (OP_CREATE, OP_UPDATE, ...)mbr
- the member which requests the write operationcontext
- a map which contains context parameters (may be null)public java.util.Map<java.io.File,java.lang.String> getFileMap()
public MailMessage addFile(java.io.File file)
file
- a File to send.public MailMessage addFile(java.io.File file, java.lang.String id)
file
- a File to send.id
- an optionnal identifier for this fileprotected javax.mail.Message buildOneMessageForAll() throws javax.mail.MessagingException
javax.mail.MessagingException
- if an error occursprotected javax.mail.Message[] buildOneMessageForEach() throws javax.mail.MessagingException
javax.mail.MessagingException
- if an error occursprotected void fillMessageContent(javax.mail.Message message) throws javax.mail.MessagingException
javax.mail.MessagingException
protected javax.activation.DataHandler getDataHandler(java.io.File file) throws javax.mail.MessagingException
file
- the File
to addDataHandler
javax.mail.MessagingException
- if any exception occurspublic long getDuration()
public void send() throws javax.mail.MessagingException
javax.mail.MessagingException
- if an error occurspublic void send(java.util.HashMap<java.lang.String,java.lang.Object> ctxt) throws javax.mail.MessagingException
ctxt
- an optionnal context used to store information for this mail sending
(context may be used by MailPolicyFilters in beforeSendMail and afterSensMail)javax.mail.MessagingException
- if an error occurspublic void sendInThread()
public void sendInThread(java.util.HashMap<java.lang.String,java.lang.Object> ctxt)
ctxt
- an optionnal context used to store information for this mail sending
(context may be used by MailPolicyFilters in beforeSendMail and afterSensMail)protected void sendAcknowledge(java.util.Collection<javax.mail.Message> successMessages, java.util.Collection<javax.mail.Message> errorMessages)
public TreeNode getTreeParent()
TreeNode
getTreeParent
in interface TreeNode
getTreeParent
in class Publication
TreeNode.getTreeParent()
public java.util.Collection<? extends TreeNode> getTreeChildren()
TreeNode
getTreeChildren
in interface TreeNode
getTreeChildren
in class Publication
TreeNode.getTreeChildren()
public java.util.Collection<? extends MailMessage> getMailMessageReplies()
public java.util.Collection<? extends MailMessage> getMailMessageThread()
public boolean checkAuthKey()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.