public class EmailSender extends Job
Add database fields to a document template and send it to a mail recipient
Mails are send using Sun JavaMail
COMMAND_DUMY, COMMAND_FAX, COMMAND_FTP, COMMAND_MAIL, COMMAND_SAVE, COMMAND_SEND, STATUS_ABORTED, STATUS_FINISHED, STATUS_INTERRUPTED, STATUS_PENDING, STATUS_RUNNING, STATUS_SUSPENDED
Constructor and Description |
---|
EmailSender() |
Modifier and Type | Method and Description |
---|---|
void |
free()
This method must free all the resource allocated by a Job
|
java.lang.Object |
process(Atom oAtm)
Send PageSet document instance by e-mail.
|
void |
setStatus(JDCConnection oConn,
int iStatus)
Set Job Status
If Status if set to Job.STATUS_FINISHED then dt_finished is set to current
system date.
|
abort, delete, delete, getDataBaseBind, getIdFromTitle, getParameter, getParameters, getProperties, getProperty, getStatus, insertRecipients, instantiate, instantiate, load, log, logFile, main, pending, resolveAtomsEMails, setDataBaseBind, store
allcaps, allcaps, clear, clone, columns, containsKey, containsValue, entrySet, exists, get, get, getAuditClassName, getCreationDate, getDate, getDate, getDateFormated, getDateShort, getDateTime, getDateTime24, getDecimal, getDecimalFormated, getDecimalFormated, getDouble, getDoubleFormated, getFloat, getFloatFormated, getInt, getIntArray, getInteger, getIntegerArray, getIntervalPart, getItemMap, getItems, getMoney, getPrimaryKey, getShort, getSQLDate, getSQLTime, getString, getStringHtml, getStringNull, getTable, getTable, getTime, getTimeOfDay, getTimestamp, isEmpty, isNull, iterator, keySet, load, parseXML, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, put, putAll, putAll, remove, remove, replace, replace, replace, replace, replace, replace, replace, replace, setAuditTransact, setAuditUser, setCreationDate, setPrimaryKey, size, toLowerCase, toUpperCase, toXML, toXML, toXML, values
public void free()
Job
This method must free all the resource allocated by a Job
public void setStatus(JDCConnection oConn, int iStatus) throws java.sql.SQLException
Set Job Status
If Status if set to Job.STATUS_FINISHED then dt_finished is set to current system date.
If Status if set to any value other than Job.STATUS_RUNNING then the MailTransport is closed.
public java.lang.Object process(Atom oAtm) throws java.io.FileNotFoundException, java.io.IOException, javax.mail.MessagingException
Send PageSet document instance by e-mail.
Transforming and sending aPageSet is a two stages task. First the PageSet stylesheet is combined via XSLT with user defined XML data and an XHTML document is pre-generated. This document still contains fixed database reference tags. At second stage the database reference tags are replaced for each document using FastStreamReplacer. Thus PageSet templates must have been previously transformed via XSLT before sending the PageSet instance by e-mail.
This method uses javax.mail package for e-mail sending
Parameters for locating e-mail server are stored at properties mail.transport.protocol, mail.host, mail.user from hipergate.cnf
If parameter bo_attachimages is set to "1" then any <IMG SRC=""> tag will be replaced by a cid: reference to an attached file.
process
in class Job
oAtm
- Atom containing reference to PageSet.gu_workarea | GUID of WorkArea owner of document to be sent |
gu_pageset | GUID of PageSet to be sent |
nm_pageset | Name of PageSet to be sent |
nm_page | File Name of HTML page to be sent |
bo_attachimages | "1" if must attach images on document, "0" if images must be absolute references |
tx_sender | Full Name of sender to be displayed |
tx_from | Sender e-mail address |
tx_subject | e-mail subject |
java.io.FileNotFoundException
java.io.IOException
javax.mail.MessagingException
FastStreamReplacer