| com.knowgate.scheduler.Job com.knowgate.scheduler.jobs.EmailSender
EmailSender | public class EmailSender extends Job (Code) | | Add database fields to a document template and send it to a mail recipient
Mails are send using Sun JavaMail
author: Sergio Montoro Ten version: 1.0 |
Method Summary | |
public void | free() | public Object | process(Atom oAtm) Send PageSet document instance by e-mail.
Transforming and sending aPageSet is a two stages task. | public 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.
If Status if set to any value other than Job.STATUS_RUNNING then the MailTransport is closed. |
oMailSession | Session oMailSession(Code) | | |
oMailTransport | Transport oMailTransport(Code) | | |
EmailSender | public EmailSender()(Code) | | |
process | public Object process(Atom oAtm) throws FileNotFoundException, IOException, MessagingException(Code) | | 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.
Parameters: oAtm - Atom containing reference to PageSet. Atom must have the following parameters set:
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 | 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 | String with document template after replacing database tags throws: FileNotFoundException - throws: IOException - throws: MessagingException - See Also: com.knowgate.dataxslt.FastStreamReplacer |
setStatus | public void setStatus(JDCConnection oConn, int iStatus) throws SQLException(Code) | | 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.
Parameters: oConn - Database Connection Parameters: iStatus - Job Status throws: SQLException - |
Methods inherited from com.knowgate.scheduler.Job | public void abort(JDCConnection oConn) throws SQLException, IllegalStateException(Code)(Java Doc) public boolean delete(JDCConnection oConn) throws SQLException(Code)(Java Doc) public static boolean delete(JDCConnection oConn, String sJobId) throws SQLException(Code)(Java Doc) abstract public void free()(Code)(Java Doc) public DBBind getDataBaseBind()(Code)(Java Doc) public String getParameter(String sParamName)(Code)(Java Doc) public Properties getParameters()(Code)(Java Doc) public Properties getProperties()(Code)(Java Doc) public String getProperty(String sPropertyName)(Code)(Java Doc) public static synchronized Job instantiate(JDCConnection oConn, String sJobId, Properties oEnvironmentProps) throws ClassNotFoundException, IllegalAccessException, SQLException, InstantiationException, FileNotFoundException(Code)(Java Doc) public static synchronized Job instantiate(JDCConnection oConn, String sJobId, String sProfileName) throws ClassNotFoundException, IllegalAccessException, SQLException, InstantiationException, FileNotFoundException(Code)(Java Doc) public boolean load(JDCConnection oConn, Object[] PKVals) throws SQLException(Code)(Java Doc) public void log(String sStr)(Code)(Java Doc) public File logFile()(Code)(Java Doc) public static void main(String[] argv) throws SQLException, org.xml.sax.SAXException, java.io.IOException, ClassNotFoundException, IllegalAccessException, InstantiationException(Code)(Java Doc) public int pending()(Code)(Java Doc) abstract public Object process(Atom oAtm) throws SQLException, FileNotFoundException, IOException, MessagingException, NullPointerException(Code)(Java Doc) public void resolveAtomsEMails(JDCConnection oConn) throws SQLException(Code)(Java Doc) public void setDataBaseBind(DBBind oDbb)(Code)(Java Doc) public void setStatus(JDCConnection oConn, int iStatus) throws SQLException(Code)(Java Doc) public boolean store(JDCConnection oConn) throws SQLException(Code)(Java Doc)
|
|
|