com.taleo.integration.client.customstep.xml
Class SplitFilePostStep

java.lang.Object
  extended by com.taleo.integration.client.step.BaseStep
      extended by com.taleo.integration.client.step.BaseCustomStep
          extended by com.taleo.integration.client.customstep.BaseCustomStep
              extended by com.taleo.integration.client.customstep.xml.SplitFilePostStep
All Implemented Interfaces:
com.taleo.integration.client.step.CustomStep, com.taleo.integration.client.step.Step

public class SplitFilePostStep
extends BaseCustomStep

Post-processing step to split the XML result file into one file for each record.

This step takes all parameters from its base class BaseCustomStep and offers two different APIs.

  1. Primary API

    The primary API consumes an XML document with the following structure and produces one file for each <File> tag. File content must be in XML format included in CDATA section. It can be further transformed using XSL if needed (see below).

     <files>
       <file path="...">
         <![CDATA[... file content ...]]>
       </file>
     </files>
     
    Where:
  2. Secondary API

    The second API uses the following parameters:

In both cases, the following parameters apply:

This class is dependent on:

Here is an example of how to define this custom step in the TCC configuration file, using the primary API:

Here is an example of how to define this custom step in the TCC configuration file, using the secondary API:

Author:
Romain Guay, Taleo Corporation

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
SplitFilePostStep()
          Constructor without arguments.
 
Method Summary
protected  void execute(java.io.File inputFile)
          Split the input file.
 void execute(com.taleo.ws.integration.client.Pipeline pipeline)
           
 java.text.DateFormat getDateFormat()
          Get the date format.
 java.lang.String getDescription()
           
 java.lang.String getFilenameXPath()
          Get the XPath expression for filename.
 java.lang.String getIdentifier()
           
 java.lang.String getName()
           
 java.lang.String getOutputDirectory()
          Deprecated. Use getOutputDirectoryXPath instead.
 java.lang.String getOutputDirectoryXPath()
          Get the output directory XPath.
 java.lang.String getRecordXPath()
          Get the XPath expression for the records.
 com.taleo.ws.integration.client.SupportedPipeline getSupportedPipeline()
           
 java.lang.String getXslFile()
          Get the XSL file.
 java.util.Properties getXslParameters()
          Get the XSL parameters.
 void init(com.taleo.ws.integration.client.GlobalConfig config)
           
 void setDateFormat(java.text.DateFormat dateFormat)
          Set the date format.
 void setFilenameXPath(java.lang.String filenameXPath)
          Set the XPath expression for filename.
 void setOutputDirectory(java.lang.String outputDirectory)
          Deprecated. Use setOutputDirectoryXPath instead.
 void setOutputDirectoryXPath(java.lang.String outputDirectoryXPath)
          Set the output directory XPath.
 void setRecordXPath(java.lang.String recordXPath)
          Set the XPath expression for the records.
 void setXslFile(java.lang.String xslFile)
          Set the XSL file.
protected  void validateParameterNames()
          Validate the parameters names.
 
Methods inherited from class com.taleo.integration.client.customstep.BaseCustomStep
createTempFile, createTempFile, getEncoding, getTempFolder, isActive, registerParameterName, setActive, setEncoding
 
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

SplitFilePostStep

public SplitFilePostStep()
Constructor without arguments.

Method Detail

validateParameterNames

protected void validateParameterNames()
Validate the parameters names.

Override the default method to allow for extra parameters to be passed to the XSL transformation.

Overrides:
validateParameterNames in class BaseCustomStep

getIdentifier

public java.lang.String getIdentifier()
Specified by:
getIdentifier in interface com.taleo.integration.client.step.CustomStep
Specified by:
getIdentifier in interface com.taleo.integration.client.step.Step
Specified by:
getIdentifier in class com.taleo.integration.client.step.BaseCustomStep

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface com.taleo.integration.client.step.CustomStep
Specified by:
getDescription in interface com.taleo.integration.client.step.Step
Specified by:
getDescription in class com.taleo.integration.client.step.BaseCustomStep

getName

public java.lang.String getName()
Specified by:
getName in interface com.taleo.integration.client.step.CustomStep
Specified by:
getName in interface com.taleo.integration.client.step.Step
Specified by:
getName in class com.taleo.integration.client.step.BaseCustomStep

getRecordXPath

public java.lang.String getRecordXPath()
Get the XPath expression for the records.

Returns:

setRecordXPath

public void setRecordXPath(java.lang.String recordXPath)
Set the XPath expression for the records.

Parameters:
recordXPath -

getFilenameXPath

public java.lang.String getFilenameXPath()
Get the XPath expression for filename.

Returns:

setFilenameXPath

public void setFilenameXPath(java.lang.String filenameXPath)
Set the XPath expression for filename.

Parameters:
filenameXPath -

getDateFormat

public java.text.DateFormat getDateFormat()
Get the date format.

Returns:

setDateFormat

public void setDateFormat(java.text.DateFormat dateFormat)
Set the date format.

Parameters:
dateFormat -

getOutputDirectory

public java.lang.String getOutputDirectory()
Deprecated. Use getOutputDirectoryXPath instead.

Get the output directory.

Returns:

setOutputDirectory

public void setOutputDirectory(java.lang.String outputDirectory)
Deprecated. Use setOutputDirectoryXPath instead.

Set the output directory.

Parameters:
outputDirectory -

getOutputDirectoryXPath

public java.lang.String getOutputDirectoryXPath()
Get the output directory XPath.

Returns:

setOutputDirectoryXPath

public void setOutputDirectoryXPath(java.lang.String outputDirectoryXPath)
Set the output directory XPath.

Parameters:
outputDirectoryXPath -

getXslFile

public java.lang.String getXslFile()
Get the XSL file.

Returns:

setXslFile

public void setXslFile(java.lang.String xslFile)
Set the XSL file.

Parameters:
xslFile -

getXslParameters

public java.util.Properties getXslParameters()
Get the XSL parameters.

Returns:

getSupportedPipeline

public com.taleo.ws.integration.client.SupportedPipeline getSupportedPipeline()
Specified by:
getSupportedPipeline in interface com.taleo.integration.client.step.Step
Overrides:
getSupportedPipeline in class com.taleo.integration.client.step.BaseCustomStep

init

public void init(com.taleo.ws.integration.client.GlobalConfig config)
Overrides:
init in class BaseCustomStep

execute

public void execute(com.taleo.ws.integration.client.Pipeline pipeline)
             throws com.taleo.integration.client.step.StepException
Throws:
com.taleo.integration.client.step.StepException

execute

protected void execute(java.io.File inputFile)
                throws javax.xml.transform.TransformerConfigurationException,
                       org.dom4j.DocumentException,
                       javax.xml.parsers.ParserConfigurationException,
                       java.io.IOException
Split the input file.

Parameters:
inputFile - The input file.
Throws:
javax.xml.transform.TransformerConfigurationException
org.dom4j.DocumentException
javax.xml.parsers.ParserConfigurationException
java.io.IOException