Chapter 9. Data conversion 211
9.2.3  Basic implementation: Executable interface
The basic implementation of the Generic Transform Interface involves an XML configuration 
to define a transform to ODWEK that uses the command-line (cmdline) executable 
functionality. With this configuration, you can request details that Content Manager 
OnDemand stored for the document to be passed in the specified cmdline options and to also 
pass through transform-specific options, as specified in the ODTransform.xml file.
Example 9-2 shows a sample of the ODTransform.xml file that can be used in this 
implementation.
Example 9-2   ODTransform.xml sample
<Transforms>
   <transform>
    <TransformName>MyTXFRM_EXE</TransformName>
    <TransformDescription>Transform Cmdline Executable</TransformDescription>
    <OutputMimeType>application/pdf</OutputMimeType>
    <OutputExtension>pdf</OutputExtension><CmdParms>
      <RECORDLENGTH>-lm</RECORDLENGTH>
      <CARRIAGECONTROL>-x</CARRIAGECONTROL>
      <CODEPAGE>-a</CODEPAGE>
      <OUTPUTFILE>-o</OUTPUTFILE></CmdParms>
    <CmdLineExe>c://opt//txfrm.exe</CmdLineExe>
    <Passthru>
     <!-- Use tag cmdlineparm to declare additional cmdline variables that the 
transform might require -->
        <Cmdlineparm>-r PDF</Cmdlineparm>
    </Passthru>
  </transform>
<Transforms>
In this example, you can see that we defined a transform that is named MyTXFRM_EXE, which 
calls the transform command txfrm.exe, which is defined in the <CmdLineExe> tag.   
The <TransformName> is used as the viewer name when it calls the ODWEK Retrieve APIs. 
From this configuration, ODWEK knows that the transform requires RECORDLENGTH, 
CARRIAGECONTROL, CODEPAGE, and OUTPUTFILE information from Content Manager OnDemand, 
and can set it on the cmdline by using the options that are specified in each related XML tag.
Also, the txfrm.exe requires additional information to be passed on the cmdline. The -r that 
is specified in the <Cmdlineparm> tag has no meaning to Content Manager OnDemand, so it is 
passed through and set on the cmdline call to the txfrm.exe.
In the custom Java code, the call to retrieve the data from ODWEK includes the <Transform 
Name> that is specified in the XML and looks like the following line:
"byte[] transformedDocument = ODHit.retrieve("MyTXFRM_EXE");
From this example definition, ODWEK calls the specified transform with the following cmdline 
executable file. Details for the items within “< >” are provided by ODWEK from the Content 
Manager OnDemand data definitions:
"c:/opt/txfrm.exe -lm <record len> -x <carriage control> -a <codepage> -o <output 
file name> -r PDF"