BuildFileFromProperties
To create the output file, the step first writes the value of the File header property to the output file. Then the step writes the value of the File body property to the file, once for each document in the document properties file. Finally, the step writes the value of the File footer property to the file.
You can use RICOH ProcessDirector symbol notation in all three of those property values. The symbols are placeholders for the job and document values that you want to include in the file when the step creates it.
You can use symbols for job properties—but not document properties—in the values for the File header and File footer properties.
You can use symbols for both job and document properties in the value for the File body property. In the output file, job values are the same for each document.
The step uses the document properties file in the spool directory for the job as input.
The file name is in the format jobid.document.dpf
where jobid is the job number. For example: 10000009.document.dpf
. The first line in the file contains the database name of each document property.
Each additional line contains values for each of the properties from one document.
- Example
-
This example shows how the step creates an XML output file for three documents in a job named Bank Statements 02032017 with 14 pages.
The example creates XML elements that contain the values of two job properties:
- Job name ( Job.Name)
- Total pages ( Job.TotalPages)
The database names of the properties are in parentheses.
The example creates XML elements that contain the values of four document properties:
- Document number ( Doc.ID)
- Current pages ( Doc.CurrentPages)
- Customer name ( Doc.Custom.CustomerName)
- Customer account number ( Doc.Custom.AccountNumber)
Value of File header property:
<?xml version="1.0" encoding="utf-8"?> <InputFile> <PDF>${Job.Name}</PDF> <TotalPages>${Job.TotalPages}</TotalPages>
Value of File body property:
<Document> <DocNumber>${Doc.ID}</DocNumber> <PageCount>${Doc.CurrentPages}</PageCount> <Customer Custname="${Doc.Custom.CustomerName}" CustAccount="${Doc.Custom.AccountNumber}" /> </Document>
Value of File footer property:
</InputFile>
Document properties file in the spool directory for the job:
Doc.ID,Doc.CurrentPages,Doc.Custom.CustomerName,Doc.Custom.AccountNumber 1,4,Jane Smith,SA349088 2,4,Chris Lopez,SA347202 3,6,John Gray,SA340655
XML output file:
<?xml version="1.0" encoding="utf-8"?> <InputFile> <PDF>Bank Statements 02032017</PDF> <TotalPages>14</TotalPages> <Document> <DocNumber>1</DocNumber> <PageCount>4</PageCount> <Customer Custname="Jane Smith" CustAccount="SA349088" /> </Document> <Document> <DocNumber>2</DocNumber> <PageCount>4</PageCount> <Customer Custname="Chris Lopez" CustAccount="SA347202" /> </Document> <Document> <DocNumber>3</DocNumber> <PageCount>6</PageCount> <Customer Custname="John Gray" CustAccount="SA340655" /> </Document> </InputFile>
- Job property defaults
-
-
File header:
-
File body:
-
File footer:
-
Output file:
-
Usage notes:
- To create an output file that contains the values of job properties but not document properties, leave the value of the File body property blank.
- The step writes the value of the File body property to the output file only when both these conditions apply:
- The File body property specifies a value, typically referencing one or more valid document properties.
- The spool directory for the job contains a document properties file.
- If you created XML or JSON output, you can validate it by using a step based on the CheckFileStructure step template.
- If no values are supplied for the File header, File body, and File footer properties, the step creates an empty file.