Example transform setup
Use the following information as an example of how to setup a transform for ODF to use. The example uses a transform from line data to PDF.
Transform from line data to PDF
A sample transform that converts line data into a PDF file might look like this:
/opt/line2pdf>./line2pdf
Converts line data into a PDF file.
Usage: line2pdf [options] {input.txt} output-file < input-file
Options: -r replace existing output file
-n nnn set the lines per page to nnn
-lm nnn set the maximum line length
-x nnn choose the type of carriage control
-l nnn choose a fixed line length
-a nnn choose a code page
-ag application group name
-an application name
-af full path to the configuration file
You should test your transform program outside of ODF to learn the behavior and requirements of the program. For example, your transform program might require certain options to be specified in a certain sequence, or require that the input file and output file be specified as the last two parameters of the command.
How to use the <CmdParms> element
Sample mappings between the Content Manager OnDemand available values and the sample transform command line parameters:
<CmdParms>
<AG_NAME>-ag</AG_NAME>
<APPL_NAME>-an</APPL_NAME>
<CARRIAGECONTROL>-x</CARRIAGECONTROL>
<RECORDLENGTH>-lm</RECORDLENGTH>
<CODEPAGE>-a</CODEPAGE>
<OUTPUTFILE>-o</OUTPUTFILE>
<INPUTFILE> </INPUTFILE>
</CmdParms>
Before the transform process begins, ODF extracts the requested information from the Content Manager OnDemand application definition, and then maps the fields and generates a command line to send to the transform process. See the View Information page of the application definition for the type of information that can be requested. The transform process will match up the mappings:
- The application group name with option -ag as: -ag <ag_name>
- The application name with option -an as: -an <app_name>
- The carriage control CCType with option -x as: -x 0
- and so on
The transform process will ignore the mapping if a value is not available in the Content Manager OnDemand application definition's View Information.
How to use the Passthru <cmdlineparm> element
Passthru is used for mismatched options or options that are not available in the Content Manager OnDemand repository.
For example, you can use Passthru if a configuration file is required on the transform program command line. Passthru can also be used to set various command line flags that are required by the transform program at run time.
Example: Use a configuration file (-af) and indicate that the transform output file should be overwritten (-r)
You can use the -af option to specify a configuration file for additional transform options, and the -r option to indicate that the transform output file should be overwritten. For example:
<Passthru>
<cmdlineparm>-r -af /opt/odtxf/line2pdf.cfg</cmdlineparm>
</Passthru>
Refer to your transform documentation for details about creating the contents of the configuration file, such as the line2pdf.cfg file named in the example.