Products Downloads


French version


 


This function is provided when using Adelia Print Engine.
It is an extended version of VaToolBxAPEMergeAndTransformDoc. It performs the same processing plus an additional input-output parameter to retrieve information about the document produced.


NB: This function is the Adelia counterpart of the APE "mergeandtransform" Web service.



Remember:

The VaToolBx dll must already be loaded (LOAD_DLL  instruction) when this function is called and must remain loaded when the VaToolBxAPEClearDataModel, VaToolBxAPEMergeDoc, VaToolBxAPETransformDoc or VaToolBxAPEAddInDataModel functions are called. 


Application area

  • Java client,
  • Java server,
  • Adelia Web client,
  • Adelia Cloud client.


Parameters

ALPHA(n)

NameSpaceName

Name of the namespace.

ALPHA(n)

TemplateName

Name of template to be processed.

ALPHA(n)

Locale

Name of locale (in IETF BCP 47 format) to be applied when searching for and processing the template.

ALPHA(n)

ModelName

Name of the data model used as a data source when processing the template.

ALPHA(n)

MimeType

Result document output format.

The string must be in the format defined by RFC 6838 (click here for more information).

ALPHA(n) or IMAGE

Options

Definition of options to apply during template processing and document transformation.

IMAGE or ALPHA(n)

MergeTransformDoc

When the parameter is an IMAGE-type variable, it will contain the result document of the APE's processing of the TemplateName template with the ModelName data source.

If the parameter is ALPHA(n) type, the result document is written in the URI specified in the alphanumerical variable.

IMAGE or ALPHA(n) ExtraParams

Input-output parameter in JSON object format. Each attribute of this object must have a name among the following elements:

    • Ape-Total-Number-Pages: when this attribute is present (with any value), it is updated by the function return, and the value it takes is the total number of pages of the document produced.

NUM_BIN_2

ReturnCode

Operation return code:

0: Operation completed successfully. 

-1: The template name cannot be empty. 

-2: The data model name does not correspond to any previously created data models.

-3: Error when closing the document produced by the merge step.

-4: Error during syntax analysis in JSON format of "Options" processing options.

-5: Error during value analysis of "Options" processing options.

-6: Input/output error during analysis of "Options" processing options.

-7: The "Options" parameter must be ALPHA or IMAGE type.

-8: The "MergeTransformDoc" parameter must be ALPHA or IMAGE type.

-9: Error while processing the "MergeTransformDoc" parameter as a URI.

-10: Error when closing the "MergeTransformDoc" result document.

-11: The type of the "ExtraParams" parameter must be ALPHA or IMAGE.

-12 : Error analyzing JSON format syntax of the "ExtraParams" processing options.

-13 : Error analyzing values of "ExtraParams" processing options.

-14 : Input/output error analyzing "ExtraParams" processing options.

-15: Error updating the "ExtraParams" parameter.



The errors described below relate to the FreeMarker processing of the template:

1: Error during "jsonPathConv" option processing for data conversion in the data source. 

2: Error when merging additional data into the FreeMarker result document. 

3: Error when searching for the template: requested template cannot be found.

4: The template name does not comply with the template name format used.

5: Error during template syntax analysis.

6: Input/output error when processing the template.

7: Error when executing template processing.

8: Error when processing the "jsonGenerator" option to generate the fake data source.

9: Internal error during FreeMarker template processing.

10: Error when formatting the document produced by the merge step.


The errors described below relate to the processing of the document produced by the merge step by the Apache FOP engine:

31: Apache FOP engine creation error. 

32: Document transformer creation error. 

33: Error when transforming the document produced by the merge step.

34: Input/output error when processing the result document.

35: Internal error when formatting the document produced by the engine's merge step. 


Namespace

This is a template group space.

Namespaces can be compared with folders: they behave in an identical way to a folder, there can be elements of the same name in different namespaces.

A namespace can also contain other namespaces.

Click here for more details.


Locale

This is used to specify the template to be looked up according to the information making up the locale (the language code, country or region code and variant).

Click here for more details.


Apache FOP engine output formats

This engine supports several output formats.


XSL-FO document transformation and template processing options

The "Options" parameter includes VaToolBxAPEMergeDoc and VaToolBxAPETransformDoc function options.
The options must be in JSON format.

This must be an object with each member describing the options of the two VaToolBxAPEMergeDoc functions, namely:

    • merge: groups VaToolBxAPEMergeDoc function options in an object,
    • transform: groups VaToolBxAPETransformDoc function options in an object.

See "options" section of "mergedoc" and "options" section in "transformxslfo".


For example

ALPHA(250) URI
NUM_BIN_2 returnCode
ALPHA(256) extraParams
ALPHA(256) xmlDoc
xml_idf idfXmlDoc
NUM_BIN_2 totalNbPages


URI = 'file:///c:/bdcadel/detailarticle.pdf'

* Preparation of the additional parameter requesting the total number of pages of the constructed document

extraParams = '{"Ape-Total-Number-Pages": null}'


CALL_DLL 'VaToolbx.dll' 'VaToolBxAPEMergeAndTransformDocEx' 'stock/article' 'detailArticle.ftlx' 'fr' 'articleDataModel' 'application/pdf' *BLANK URI extraParams returnCode

* Retrieve the total number of pages from the JSON extraParams parameter

conv_data extraParams 'JSON' xmlDoc 'XML'


xml_open idfXmlDoc *read *doc_var (xmlDoc)


xml_select idfXmlDoc //Ape-Total-Number-Pages


XML_GET_VAL idfXmlDoc totalNbPages


xml_close idfXmlDoc


↑ Top of page




  • Aucune étiquette