Products Downloads


French version


 

This Web service is used to execute the APE's two steps in sequence.


Input message format

The JSON input message format is as follows:

{

"merge": {

"jsonDataModel": {},

"locale""string",

"mimeType""string",

"namespace""string",

"options": {},

"templateName""string"

},

"transform": {

"outputMimeType""string",

"options": {

"docDescription": {

"author""string",

"creationDate""2018-12-03T15:06:22.646Z",

"creator""string",

"keywords""string",

"producer""string",

"subject""string",

"title""string"

},

"pdfDocPolicy": {

"allowAccessContent""string",

"allowAssembleDocument""string",

"allowCopyContent""string",

"allowEditAnnotations""string",

"allowEditContent""string",

"allowFillInForms""string",

"allowPrint""string",

"allowPrintHq""string",

"encryptMetadata""string",

"ownerPassword""string",

"userPassword""string"

}

}

}


When the Web service runs without error, the returned HTTP code is 200 and the response is a document in the requested output format.

If there is an error, the returned HTTP code is either 400 if the query body is incorrect, or 500 when an error occurs during template processing. If there is an error, the returned response is JSON type.


Attributes

The message must represent a JSON object with the following attributes:

merge

This attribute is mandatory and Object type. Its value must represent the mergedoc Web service's input message content.

transform

This attribute is mandatory and Object type. Its value must represent the transformxslfo Web service's input message content.

Headers

Some headers can be added in the HTTP request which triggers this web service. These headers are treated as additional input or input/output parameters:

NameTypeDescription
Ape-Total-Number-PagesInput/OutputWhen the request contains this parameter, it is returned in the response with the total number of pages of the produced document as a value.
Ape-Template-UrlInput/Output

When it is present in the request, it is returned in the response with the value of the URI of the template file executed to produce the document.

The URI syntax depends on the type of template loader (template loader key in freemarker.properties) which loaded the template:

  • if FileTemplateLoader: the URI syntax is file:/<template URL>,
  • if ClassTemplateLoader: the URI syntax is jar:file:/<URL of the jar file containing the template>!/<Template path in the jar>,
  • if ZipFileTemplateLoader: the URI syntax is jar:file:///<URL of the zip file containing the template>!/<Template path in the zip>.


Notes:

  • The non-ASCII characters of the URI are encoded according to RFC 2396 (e.g. a space is replaced by the %20 string; the é character is replaced by the %C3%A9 string). The VatoolBx VaToolBxJavaDecodeURL function decodes the URI.
  • If the requested template is localized, the file URI will point to the one which corresponds to the requested locale. For example, if the "templateName" parameter of the JSON message is "foo.ftlx" and the "locale" parameter is "it", if there is a "foo_it.ftlx" file, the URI will point to this file (otherwise, it will point to the "foo.ftlx" file).
  • If there is an error, the returned alphanumeric string is empty.
Ape-Template-LoaderInput/Output

Description in JSON format of the template loader which loaded the template. The JSON object has several properties which depend on the template loader type:

  • if FileTemplateLoader:

    {
     "classname":"com.hardis.adelia.mergedocengine.freemarker.conf.FileTemplateLoader", 
    "baseDir":"file:/<absolute URL of the baseDir parameter in the template_loader key>", 
    "disableCanonicalPathCheck":<true or false: value of the disableCanonicalPathCheck parameter in the template_loader key> 
    }

    Non-ACSII characters of the baseDir property are encoded according to RFC 2396 (see above).

  • if ClassTemplateLoader:

    { 
    "classname":"com.hardis.adelia.mergedocengine.freemarker.conf.ClassTemplateLoader", 
    "resourceLoaderClass":"<value of the resourceLoaderClass parameter in the template_loader key>", 
    "basePackagePath":"<value of the basePackagePath parameter in the template_loader key>" 
    }
  • if ZipFileTemplateLoader:

    { 
    "classname":"com.hardis.adelia.mergedocengine.freemarker.conf.ZipFileTemplateLoader",
    "schemeFileURI":"<value of the schemeFileURI parameter in the template_loader key>", 
    "basePackagePath":"<value of the basePackagePath parameter in the template_loader key>", 
    "useCache":<true or false: value of the useCache parameter in the template_loader key> 
    }

    Non-ASCII characters of the schemeFileURI and basePackagePath properties are encoded according to RFC 2396 (see above).


Note: if there is an error, the returned JSON value is "null".




↑ Top of page


 

  • Aucune étiquette