|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taleo.integration.client.step.BaseStep
com.taleo.integration.client.step.BaseCustomStep
com.taleo.integration.client.customstep.BaseCustomStep
com.taleo.integration.client.customstep.mail.SendEmailsPostStep
public class SendEmailsPostStep
Post-processing step to send individual emails from the results of an export.
It executes over files containing individual emails. Those files must have
been created previously using
SplitFilePostStep
and
match the structure presented below.
This step takes all parameters from its base class
BaseCustomStep
and the
following additional parameters:
WildcardFileFilter
in the
file names only. Pattern is case sensitive. If the pattern includes multiple
files, they will be processed in ascending name order.Email files are structured as follows.
<email> <from></from> <to></to> <cc></cc> <bcc></bcc> <subject>...</subject> <content mimeType="">...</content> <tokens> <token name="xyz" value=""/> ... </tokens> </email>The XML tags are:
text/plain
or
text/html
. Other mime types have not been tested. (default:
text/plain
)$tokens.get("xyz")
.<email> ... <status> <success date=""/> or <error date="">...</error> </status> </email>Those XML tags are:
The following variables are also made available to build the email template:
DateTool
) to access various date
functions.MathTool
) to access various
mathematical functions.StringTool
) to
access various string functions.Example uses of these variables in the templates:
This class is dependent on:
Here is an example of how to define this custom step in the TCC configuration file:
Field Summary |
---|
Fields inherited from class com.taleo.integration.client.customstep.BaseCustomStep |
---|
parameterNames |
Fields inherited from class com.taleo.integration.client.step.BaseCustomStep |
---|
parameters |
Fields inherited from class com.taleo.integration.client.step.BaseStep |
---|
commType, ERROR_NULL_GLOBAL_CONFIG, ERROR_NULL_PIPELINE, ERROR_NULL_STEP_CONFIG, productCode, tempFolder, type, version |
Constructor Summary | |
---|---|
SendEmailsPostStep()
Constructor without arguments. |
Method Summary | |
---|---|
protected org.apache.velocity.VelocityContext |
buildVelocityContext(org.dom4j.Document document)
Build the Velocity context with the tokens element defined within the given file. |
protected void |
execute()
Execute the step over files matching the file pattern and containing each one a single email record. |
void |
execute(com.taleo.ws.integration.client.Pipeline pipeline)
|
protected void |
execute(javax.mail.Session session,
java.io.File file)
Execute the step over a file containing a single email record. |
java.lang.String |
getArchiveFolder()
Get the archive folder. |
java.lang.String |
getDescription()
|
java.lang.String |
getErrorFolder()
Get the error folder. |
java.lang.String |
getFilePattern()
Get the file pattern. |
java.lang.String |
getIdentifier()
|
java.lang.String |
getName()
|
java.lang.String |
getSmtpHost()
|
int |
getSmtpPort()
|
com.taleo.ws.integration.client.SupportedPipeline |
getSupportedPipeline()
|
void |
init(com.taleo.ws.integration.client.GlobalConfig config)
|
boolean |
isOnHold()
Get the onHold flag. |
protected org.dom4j.Document |
render(org.dom4j.Document document,
org.apache.velocity.VelocityContext context)
Render the document in the given Velocity context. |
protected void |
sendEmail(javax.mail.Session session,
org.dom4j.Document document)
Send an email with the content of an XML document. |
void |
setArchiveFolder(java.lang.String archiveFolder)
Set the archive folder. |
void |
setErrorFolder(java.lang.String errorFolder)
Set the error folder. |
void |
setFilePattern(java.lang.String filePattern)
Set the file pattern. |
void |
setOnHold(boolean onHold)
Set the onHold flag. |
void |
setSmtpHost(java.lang.String smtpHost)
|
void |
setSmtpPort(int smtpPort)
|
Methods inherited from class com.taleo.integration.client.customstep.BaseCustomStep |
---|
createTempFile, createTempFile, getEncoding, getTempFolder, isActive, registerParameterName, setActive, setEncoding, validateParameterNames |
Methods inherited from class com.taleo.integration.client.step.BaseCustomStep |
---|
getType, init |
Methods inherited from class com.taleo.integration.client.step.BaseStep |
---|
getAllProcessSupportPipeline, getCurrentFile, getCurrentFile, getCurrentMessage, getPostProcessSupportPipeline, getPreProcessSupportPipeline, isOriginalFile, validateLastStepType, validateMessageType, validatePipeline |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.taleo.integration.client.step.Step |
---|
validatePipeline |
Constructor Detail |
---|
public SendEmailsPostStep()
Method Detail |
---|
public java.lang.String getIdentifier()
getIdentifier
in interface com.taleo.integration.client.step.CustomStep
getIdentifier
in interface com.taleo.integration.client.step.Step
getIdentifier
in class com.taleo.integration.client.step.BaseCustomStep
public java.lang.String getDescription()
getDescription
in interface com.taleo.integration.client.step.CustomStep
getDescription
in interface com.taleo.integration.client.step.Step
getDescription
in class com.taleo.integration.client.step.BaseCustomStep
public java.lang.String getName()
getName
in interface com.taleo.integration.client.step.CustomStep
getName
in interface com.taleo.integration.client.step.Step
getName
in class com.taleo.integration.client.step.BaseCustomStep
public java.lang.String getSmtpHost()
public void setSmtpHost(java.lang.String smtpHost)
smtpHost
- public int getSmtpPort()
public void setSmtpPort(int smtpPort)
port
- public java.lang.String getFilePattern()
public void setFilePattern(java.lang.String filePattern)
filePattern
- public java.lang.String getArchiveFolder()
public void setArchiveFolder(java.lang.String archiveFolder)
archiveFolder
- public java.lang.String getErrorFolder()
public void setErrorFolder(java.lang.String errorFolder)
errorFolder
- public boolean isOnHold()
public void setOnHold(boolean onHold)
onHold
- public com.taleo.ws.integration.client.SupportedPipeline getSupportedPipeline()
getSupportedPipeline
in interface com.taleo.integration.client.step.Step
getSupportedPipeline
in class com.taleo.integration.client.step.BaseCustomStep
public void init(com.taleo.ws.integration.client.GlobalConfig config)
init
in class BaseCustomStep
public void execute(com.taleo.ws.integration.client.Pipeline pipeline) throws com.taleo.integration.client.step.StepException
com.taleo.integration.client.step.StepException
protected void execute() throws java.lang.Exception
java.lang.Exception
protected void execute(javax.mail.Session session, java.io.File file) throws java.lang.Exception
session
- The email session.file
- The file to process.
java.lang.Exception
protected void sendEmail(javax.mail.Session session, org.dom4j.Document document) throws java.lang.IllegalArgumentException, javax.mail.MessagingException, java.io.IOException, org.apache.velocity.exception.VelocityException, org.dom4j.DocumentException
session
- The email session.document
- The document to process.
java.lang.IllegalArgumentException
javax.mail.MessagingException
java.io.IOException
org.dom4j.DocumentException
org.apache.velocity.exception.VelocityException
protected org.apache.velocity.VelocityContext buildVelocityContext(org.dom4j.Document document) throws org.dom4j.DocumentException, java.io.FileNotFoundException
file
- The file containing the document.
org.dom4j.DocumentException
java.io.FileNotFoundException
protected org.dom4j.Document render(org.dom4j.Document document, org.apache.velocity.VelocityContext context) throws java.io.IOException, org.dom4j.DocumentException
document
- context
-
java.io.IOException
org.dom4j.DocumentException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |