generate (Java class GenerateFile)
Generate
generates a document given a template layout and data.
Attribute name | Value | Type | Description |
---|---|---|---|
type | "generate" | string | The file object type. |
data | file object | A file object of type pid, xquery, template or data. The actual document must be an XML document. The normal scenario would be an XML produced by the client and sent in as a data object. | |
template | file object | A file object of type pid, xquery, template or data. The actual document
must be a Word template. The normal scenario would be a template or xquery.
It is discouraged to send the Word layout as a data object because unnecessary data is transferred to Document Output. Performance is affected. |
|
filename | Example: "MyFile.pdf" | string | Name of generated file. This value is used if you are sending the document
as an attachment, saving it back to IDM, or referencing it in any other way.
The extension of the name determines what type of document is produced.
Currently .pdf, .docx, and
.html are the only supported document types. Note that HTML documents cannot be stored back to IDM. HTML is mainly used for generating an email body. |
pdfA | Optional True / False Ignored if file extension differs from .pdf Default value is False. |
boolean | Indicates whether to generate the pdf as a pdf/A. If the IDM_OUTPUTFORMAT custom property is specified in the document, then this property is ignored. |
item | Optional File object containing an item. |
file object | If there is an item target defined, then you can override the item that is
defined in the item target with this value. If no item target is defined, then
this value is ignored. Use this field if you must generate several documents in one job and save them to IDM with different attributes. |
This is an example of this input type in JSon:
{
"type": "generate",
"data": {
"type": "data",
"filename": "OrderData_2342345.xml",
"base64": "dGVzdA=="
},
"xquery": {
"type": "xquery",
"xquery": "/OutputManagementTesting[@RESOURCENAME = \"OrderConfirmation.docx\"]"
},
"filename": "OrderConfirmation_2342345.pdf",
"item": {
"type": "data",
"base64": "sdfdsf=",
"filename": "MyItem.xml"
}
}