com.adobe.icc.ddg.api
Interface LetterRenderService

All Known Implementing Classes:
LetterRenderServiceImpl

public interface LetterRenderService

Dynamic Document Generation a.k.a Letter Rendering Service that accepts a Letter definition and an initial data XML to render a Letter as a PDF, either interactive or non-interactive.


Field Summary
static java.lang.String LAYOUT_TEMPLATE_KEY
          Return value of processLetter API contains processed template against this key.
static java.lang.String XML_DATA_KEY
          Return value of processLetter API contains processed data xml against this key.
 
Method Summary
 java.lang.String getExtendedLayoutPath(java.lang.String letterId, java.lang.String initialDataXML, boolean useTestData)
          Extends the layout with the following, and returns the repository path to the prepared layout (XDP):

1.
 java.util.Map processLetter(Letter letter, java.lang.String initialDataXML, boolean useTestData)
          Process the given Letter object, preparing the augmented layout template and final XML data that can be merged together in the desired render format.
 java.util.Map processLetter(Letter letter, java.lang.String initialDataXML, LetterRenderOptionsSpec letterRenderOptionsSpec)
          Process the Letter identified by the given Letter ID, preparing the augmented layout template and final XML data that can be merged together in the desired render format.
 java.util.Map processLetter(java.lang.String letterId, java.lang.String initialDataXML, boolean useTestData)
          Process the Letter identified by the given Letter ID, preparing the augmented layout template and final XML data that can be merged together in the desired render format.
 java.util.Map processLetter(java.lang.String letterId, java.lang.String initialDataXML, LetterRenderOptionsSpec letterRenderOptionsSpec)
          Process the Letter identified by the given Letter ID, preparing the augmented layout template and final XML data that can be merged together in the desired render format.
 byte[] renderLetter(Letter letter, java.lang.String dataXML, boolean renderInteractive)
          Render the given Letter object against the given data XML.
 PDFResponseType renderLetter(Letter letter, java.lang.String initialDataXML, boolean mergeDataOnServer, boolean useTestData, boolean renderInteractive)
          Render the CTD against the given data XML.
 PDFResponseType renderLetter(Letter letter, java.lang.String initialDataXML, boolean mergeDataOnServer, boolean useTestData, boolean renderInteractive, boolean saveToFile)
          Render the CTD against the given data XML.
 PDFResponseType renderLetter(Letter letter, java.lang.String initialDataXML, LetterRenderOptionsSpec letterRenderOptionsSpec)
          Render the CTD against the given data XML.
 byte[] renderLetter(java.lang.String letterId, java.lang.String dataXML, boolean renderInteractive)
          Render the given Letter, identified by the letter ID, against the given data XML.
 PDFResponseType renderLetter(java.lang.String letterId, java.lang.String initialDataXML, boolean mergeDataOnServer, boolean useTestData, boolean renderInteractive)
          Render the CTD against the given data XML.
 PDFResponseType renderLetter(java.lang.String letterId, java.lang.String initialDataXML, boolean mergeDataOnServer, boolean useTestData, boolean renderInteractive, boolean saveToFile)
          Render the CTD against the given data XML.
 PDFResponseType renderLetter(java.lang.String letterId, java.lang.String initialDataXML, LetterRenderOptionsSpec letterRenderOptionsSpec)
          Render the CTD against the given data XML.
 java.lang.String serializeDataElementsToXML(java.lang.String ddiAsXml, java.util.Map phValues, java.util.Map fieldValues)
          Serialize data elements into XML by appending Fields/Variables elements to the input xml.
 

Field Detail

LAYOUT_TEMPLATE_KEY

static final java.lang.String LAYOUT_TEMPLATE_KEY
Return value of processLetter API contains processed template against this key.

See Also:
Constant Field Values

XML_DATA_KEY

static final java.lang.String XML_DATA_KEY
Return value of processLetter API contains processed data xml against this key.

See Also:
Constant Field Values
Method Detail

renderLetter

PDFResponseType renderLetter(java.lang.String letterId,
                             java.lang.String initialDataXML,
                             LetterRenderOptionsSpec letterRenderOptionsSpec)
                             throws ICCException
Render the CTD against the given data XML. If there is a need to simply render the Letter without merging data with it, *mergeData* should be set to false.

Parameters:
letterId - ID of the Letter/CT to be rendered.
initialDataXML - XML data to be merged with the Layout template.
letterRenderOptionsSpec - specifies options to render letter.
Returns:
PDFResponseType that contains the PDFFile object
Throws:
java.lang.Exception
ICCException

renderLetter

PDFResponseType renderLetter(Letter letter,
                             java.lang.String initialDataXML,
                             LetterRenderOptionsSpec letterRenderOptionsSpec)
                             throws ICCException
Render the CTD against the given data XML. If there is a need to simply render the Letter without merging data with it, *mergeData* should be set to false.

Parameters:
letter - Correspondence Template to be rendered -- must be the *full* letter object containing all necessary data and assignments.
initialDataXML - XML data to be merged with the Layout template.
letterRenderOptionsSpec - specifies options to render letter.
Returns:
PDFResponseType that contains the PDFFile object
Throws:
java.lang.Exception
ICCException

renderLetter

PDFResponseType renderLetter(Letter letter,
                             java.lang.String initialDataXML,
                             boolean mergeDataOnServer,
                             boolean useTestData,
                             boolean renderInteractive)
                             throws ICCException
Render the CTD against the given data XML. If there is a need to simply render the Letter without merging data with it, *mergeData* should be set to false.

Parameters:
letter - Correspondence Template to be rendered -- must be the *full* letter object containing all necessary data and assignments.
initialDataXML - XML data to be merged with the Layout template
mergeDataOnServer - False if we only need to render the Letter, without merging data with it. If False, the letter is also augmented with the FormBridge library for use in an interactive filling environment. True if data needs to be merged (in which case the FormBridge library is not included). If true, the PDF bytes are returned; if false, the bytes are not returned and the PDF is saved to a temporary location that so that it can be loaded from the client using a URL to the file name in the PDFResponseType.
useTestData - specify whether to use test data for rendering or not
renderInteractive - specify whether to render an interactive or flat PDF
Returns:
PDFResponseType that contains the PDFFile object
Throws:
java.lang.Exception
ICCException

renderLetter

PDFResponseType renderLetter(java.lang.String letterId,
                             java.lang.String initialDataXML,
                             boolean mergeDataOnServer,
                             boolean useTestData,
                             boolean renderInteractive)
                             throws ICCException
Render the CTD against the given data XML. If there is a need to simply render the Letter without merging data with it, *mergeData* should be set to false.

Parameters:
letterId - ID of the Letter/CT to be rendered
initialDataXML - XML data to be merged with the Layout template
mergeDataOnServer - False if we only need to render the Letter, without merging data with it. If False, the letter is also augmented with the FormBridge library for use in an interactive filling environment. True if data needs to be merged (in which case the FormBridge library is not included). If true, the PDF bytes are returned; if false, the bytes are not returned and the PDF is saved to a temporary location that so that it can be loaded from the client using a URL to the file name in the PDFResponseType.
useTestData - specify whether to use test data for rendering or not
renderInteractive - specify whether to render an interactive or flat PDF
Returns:
PDFResponseType that contains the PDFFile object
Throws:
java.lang.Exception
ICCException

renderLetter

PDFResponseType renderLetter(Letter letter,
                             java.lang.String initialDataXML,
                             boolean mergeDataOnServer,
                             boolean useTestData,
                             boolean renderInteractive,
                             boolean saveToFile)
                             throws ICCException
Render the CTD against the given data XML.

Parameters:
letter - Correspondence Template to be rendered -- must be the *full* letter object containing all necessary data and assignments.
initialDataXML - XML data to be merged with the Layout template
mergeDataOnServer - False if we only need to render the Letter, without merging data with it. If False, the letter is also augmented with the FormBridge library for use in an interactive filling environment. True if data needs to be merged (in which case the FormBridge library is not included).
useTestData - specify whether to use test data for rendering or not
renderInteractive - specify whether to render an interactive or flat PDF
saveToFile - true to have the PDF saved to a temporary file for retrieval via URL from the client; false to have the PDF bytes returned in the PDFResponseType response.
Returns:
PDFResponseType that contains the PDFFile object
Throws:
java.lang.Exception
ICCException

renderLetter

PDFResponseType renderLetter(java.lang.String letterId,
                             java.lang.String initialDataXML,
                             boolean mergeDataOnServer,
                             boolean useTestData,
                             boolean renderInteractive,
                             boolean saveToFile)
                             throws ICCException
Render the CTD against the given data XML.

Parameters:
letterId - ID of the Letter/CT to be rendered
initialDataXML - XML data to be merged with the Layout template
mergeDataOnServer - False if we only need to render the Letter, without merging data with it. If False, the letter is also augmented with the FormBridge library for use in an interactive filling environment. True if data needs to be merged (in which case the FormBridge library is not included).
useTestData - specify whether to use test data for rendering or not
renderInteractive - specify whether to render an interactive or flat PDF
saveToFile - true to have the PDF saved to a temporary file for retrieval via URL from the client; false to have the PDF bytes returned in the PDFResponseType response.
Returns:
PDFResponseType that contains the PDFFile object
Throws:
java.lang.Exception
ICCException

renderLetter

byte[] renderLetter(java.lang.String letterId,
                    java.lang.String dataXML,
                    boolean renderInteractive)
                    throws ICCException
Render the given Letter, identified by the letter ID, against the given data XML. This would return a flat PDF file, with data populated per the data XML provided. Note 1: The data XML in such cases is a must. Note 2: This API is not intended to be called from an ActionScript client due to the byte[] return type. ActionScript clients should use the alternate APIs which can save the PDF to a temporary file so that the client can access it via a URL.

Parameters:
letterId - ID of the Letter/CT for which the PDF has to be generated
dataXML - XML data to be merged with the Layout template
renderInteractive - specify whether to render an interactive or flat PDF
Returns:
flattened PDF bytes
Throws:
java.lang.Exception
ICCException

renderLetter

byte[] renderLetter(Letter letter,
                    java.lang.String dataXML,
                    boolean renderInteractive)
                    throws ICCException
Render the given Letter object against the given data XML. This would return a flat PDF file, with data populated per the data XML provided. Note 1: The data XML in such cases is a must. Note 2: This API is not intended to be called from an ActionScript client due to the byte[] return type. ActionScript clients should use the alternate APIs which can save the PDF to a temporary file so that the client can access it via a URL.

Parameters:
letter - The Letter object for which the PDF has to be generated
dataXML - XML data to be merged with the Layout template
renderInteractive - specify whether to render an interactive or flat PDF
Returns:
flattened PDF bytes
Throws:
java.lang.Exception
ICCException

serializeDataElementsToXML

java.lang.String serializeDataElementsToXML(java.lang.String ddiAsXml,
                                            java.util.Map phValues,
                                            java.util.Map fieldValues)
                                            throws ICCException
Serialize data elements into XML by appending Fields/Variables elements to the input xml.

Parameters:
ddiAsXml - Serialize XML input data for DDI to be used
phValues - is map having PH values with key as place holder variable name
fieldValues - is map having Field values with key as somExpr of the Field
Returns:
String representing XML having data element as provided into dataElementValues
Throws:
ICCException

processLetter

java.util.Map processLetter(Letter letter,
                            java.lang.String initialDataXML,
                            boolean useTestData)
                            throws ICCException
Process the given Letter object, preparing the augmented layout template and final XML data that can be merged together in the desired render format.

Parameters:
letter - The Letter object which is to be processed.
initialDataXML - Initial XML data that is used to initialize the associated Data Dictionary (if any), and also augmented and merged with the Letter's layout template.
useTestData - specify whether to use the Letter's test data as initial XML data or not.
Returns:
A result Map that contains the augmented layout template and the final XML data.

The Layout template can be fetched by the key 'layoutTemplate', with the value being a byte array (byte[]).
The XML data can be fetched by the key 'xmlData', with the value being a byte array (byte[]).
Throws:
ICCException

processLetter

java.util.Map processLetter(java.lang.String letterId,
                            java.lang.String initialDataXML,
                            boolean useTestData)
                            throws ICCException
Process the Letter identified by the given Letter ID, preparing the augmented layout template and final XML data that can be merged together in the desired render format.

Parameters:
letterId - ID of the Letter which is to be processed.
initialDataXML - Initial XML data that is used to initialize the associated Data Dictionary (if any), and also augmented and merged with the Letter's layout template.
useTestData - specify whether to use the Letter's test data as initial XML data or not.
Returns:
A result Map that contains the augmented layout template and the final XML data.

The Layout template can be fetched by the key 'layoutTemplate', with the value being a byte array (byte[]).
The XML data can be fetched by the key 'xmlData', with the value being a byte array (byte[]).
Throws:
ICCException

processLetter

java.util.Map processLetter(java.lang.String letterId,
                            java.lang.String initialDataXML,
                            LetterRenderOptionsSpec letterRenderOptionsSpec)
                            throws ICCException
Process the Letter identified by the given Letter ID, preparing the augmented layout template and final XML data that can be merged together in the desired render format.

Parameters:
letterId - ID of the Letter which is to be processed.
initialDataXML - Initial XML data that is used to initialize the associated Data Dictionary (if any), and also augmented and merged with the Letter's layout template.
letterRenderOptionsSpec - specifies options to process letter.
Returns:
A result Map that contains the augmented layout template and the final XML data.

The Layout template can be fetched by the key 'layoutTemplate', with the value being a byte array (byte[]).
The XML data can be fetched by the key 'xmlData', with the value being a byte array (byte[]).
Throws:
ICCException

processLetter

java.util.Map processLetter(Letter letter,
                            java.lang.String initialDataXML,
                            LetterRenderOptionsSpec letterRenderOptionsSpec)
                            throws ICCException
Process the Letter identified by the given Letter ID, preparing the augmented layout template and final XML data that can be merged together in the desired render format.

Parameters:
letter - The Letter object which is to be processed.
initialDataXML - Initial XML data that is used to initialize the associated Data Dictionary (if any), and also augmented and merged with the Letter's layout template.
letterRenderOptionsSpec - specifies options to process letter.
Returns:
A result Map that contains the augmented layout template and the final XML data.

The Layout template can be fetched by the key 'layoutTemplate', with the value being a byte array (byte[]).
The XML data can be fetched by the key 'xmlData', with the value being a byte array (byte[]).
Throws:
ICCException

getExtendedLayoutPath

java.lang.String getExtendedLayoutPath(java.lang.String letterId,
                                       java.lang.String initialDataXML,
                                       boolean useTestData)
                                       throws ICCException
Extends the layout with the following, and returns the repository path to the prepared layout (XDP):

1. Add fragment layout xdp bytes to the layout xdp. 2. Add additions to the XDP's <dataDescription> such that Target Areas (subforms) for which data bindings are generated are appropriately represented, leveraging XFA 3.1's Data Description Injection. This will enable data within the "icc:" space — which is not within the form's optional (corporate) schema — to be imported/exported into/out of the PDF from Reader.

3. Inject XFA Module Object into all subforms identified as Target Areas, such that they can contain and show the Content that they may be related to in the Letter template.

Parameters:
letterId - ID of the Letter whose extended layout is to be fetched.
initialDataXML - Initial XML data that is used to initialize the associated Data Dictionary (if any), and also augmented and merged with the Letter's layout template.
useTestData - True if the Letter's test data is to be used, rather than an external XML data.
Returns:
Creates a temporary file for extended layout in repository and returns its path.
Throws:
ICCException


[an error occurred while processing this directive] [an error occurred while processing this directive]