FopProcess Element

Top  Previous  Next

FopProcess element of the Reporter component utilizes the Apache's Formatting Objects Processor to render the fo documents into PDF documents.

FopProcess_pe

Parameters

Template Type (Accepts MScript)

The type of the template that will be used in the document rendering. The valid types are:

1.XSL-Fo. An XSL-Formatting Object document prepared by an XSL-Fo editor. When Template type is XSL-Fo, the FopProcess first performs an XSLT processing that takes the XSL-Fo document defined with Template File property and the XML data created out of the contents of the symbols defined in XML Content property as inputs to create a Fo document.
 
This option makes it possible to create the Fo documents dynamically by providing data in XML format.
 
2.Fo. If the content of the output document is not data driven then a Fo document can be selected as the Template.

 

Template File (Accepts MScript)

Depending on the Template Type selection, this property should either be given a XSL-Fo document or a Fo document name. The template files can be prepared using third-party XSL-Fo or Fo editors and can be inserted into the project in order to be deployed to the web application.

Output Type

The only valid value is "1. PDF"

 

Output File Name (Accepts MScript)

The name of the output document file. It can be the name of either a permanent or a temporary file.

Note that the temporary files are created under {WEB_APPLICATION_ROOT}/WEB-INF/MM-INF/~tempfiles directory and the names of the files are stored in pool variables or in process record fields. MoreMotion constantly scans the temporary files under this folder and deletes the expired files.

 

Examples:

Definition

Description

WEB-INF/reports/products.pdf 

The output file is permanent and it is defined relative to the web application root.

c:\reports\urun.pdf

The output file is permanent.

v:products

The output file is temporary. It will be created under {WEB_APPLICATION_ROOT}/WEB-INF/MM-INF/~tempfiles directory and its name will be stored in pool variable products.

f:order

The output file is temporary. It will be created under {WEB_APPLICATION_ROOT}/WEB-INF/MM-INF/~tempfiles directory and its name will be stored in process record field order.

 
XML Content (Comma delimited symbols) (Accepts MScript)

If the Template Type is XSL-Fo, then you should specify symbols whose content will construct the XML data required for the XSLT processing. The symbols that can be specified here is as follows:

1.Process Record Fields. Example: f:Name
2.Input Fields. Example: i:Quantity
3.Pool Variables. Example: v:Status

 

You can specify one or more fields of different sort by delimiting them with commas.

Example: f:Name, i:Quantity, v:Status, LastWeekOrders

 

XML Fields:

Please note that a process record field or a pool variable can store XML data. An ADOM (MoreMotion Data Object) can be converted to XML and stored in a process record field or in a pool variable with AML function ToXml(). AML functions can be executed with "mor > ADOM > AMLProcess".

Generating XML data out of the values of the specified fields:

It is important to know the structure of the XML data created in order to successfully bind the XML nodes to element properties when developing the XSL-Fo document.

Assume that the specified fields contain the following values at the time the FopProcess is executed.
 

f:Name       i:Stock     v:Status    LastWeekOrders

-----------  ---------   ----------  ---------------------------------------

Printer      12          Discounted  <item>

                                       <custid>5</custid>

                                       <qty>5</qty>

                                     </item>

                                     <item>

                                       <custid>33</custid>

                                       <qty>20</qty>

                                     </item>

 

The FopProcess will create the XML data below prior to the XSLT processing to generate the eventual Fo document.

 

    <root>

      <Name>Printer</Name>

      <Stock>12</Stock>

      <Status>Discounted<Status>

      <LastWeekOrders>

        <item>

          <custid>5</custid>

          <qty>5</qty>

        </item>

        <item>

          <custid>33</custid>

          <qty>20</qty>

        </item>

      </LastWeekOrders>

    </root>