Add a custom preprocessor

Once you create the transformation target, you can define a new preprocessor for this target.

Preprocessors link the output type selected by the user in the Generate Output dialog to the conductor file used to transform the content. They also define system and user parameters that apply to the transformation process, such as the Ant conductor file, or the target to run.

IXIA CCMS provides preprocessors for all its system and user transformation scenarios. System administrators with programming knowledge can use the preprocessors as a template to create their own preprocessors.

New preprocessors are defined in the %OutputGenDir%/conf/client/preprocessors.xml file within a <preprocessor> element.
<preprocessor name="PDF" 
              class="com.ixiasoft.outputgenerator.preprocessor.AntProcessor" >
   <parameters>
      <system>
         <parameter name="buildfile" value="/conductor-client.xml"/>
         <parameter name="target" value="acme.dita2pdfwrapper"/>
         <parameter name="clean" value="job_postprocess"/>
         <parameter name="keep.log.files" value="true"/>
      </system>
      <user>
          <parameter name="param1" value="value1"/>
      </user>
   </parameters>
</preprocessor>

For each preprocessor, you must define several fields.

Table 1. Mandatory preprocessor definitions

Field

Description

name attribute

Names the preprocessor

class attribute

Determines which class to run when calling this preprocessor

Note: Enter com.ixiasoft.outputgenerator.preprocessor.AntProcessor.

<system> parameters

Runs the target associated with this preprocessor

Specify:

buildfile

Names the conductor file that contains the target to run for this preprocessor

Note: Specify a path relative to the %OutputGenDir%/data directory, such as /conductor-client.xml.

target

Names the target to run

Note: This target must exist in the file specified with the buildfile parameter.

clean

Cleans up the %OutputGenDir%/temp directory after running the job

Note: Set this parameter to job_postprocess to use the default job_postprocess target provided with the IXIA CCMS Output Generator. If you created your own clean target, specify its target name instead.

keep.log.files

(optional)

Specifies whether to return the transformation logs from the IXIA CCMS Output Generator and DITA Open Toolkit to the output .zip file using the true or false value

Note: Default value is true.

support.ditaval

(optional)

Specifies whether to display the ditaval selection option and the browse button, , to browse for options in the Generate Output dialog

Note: By default, the ditaval parameter is enabled or set to true, but set to false to disable it.

cust_sys_param

(optional)

Adds your custom system parameters that set values for use in your transformation scenario

Note: You could set a watermark parameter for inclusion of a watermark in your output.
<user> parameters

Adds user parameters to the IXIA CCMS Output Generator dialog

To add a custom preprocessor:

  1. If this is your first time to modify the preprocessors.xml file, open the preprocessors.xml.orig file and save it as preprocessors.xml after you remove the .orig suffix.
  2. Open the %OutputGenDir%/conf/client/preprocessors.xml file.
    Important: Always update the file in the conf/client directory. Do not update the outputtypes.xml file in the conf directory. This separation protects your customization from overwrite when you update the IXIA CCMS Output Generator.
    Important: Do not modify any existing output types, since they are system defaults and required as is.
  3. Under the <preprocessors> element, define a new preprocessor name and class.
    Create a preprocessor for the dita2pdf.custom target, which allows users to generate a custom PDF output.
    <preprocessors>
       <preprocessor name="dita2pdf.custom" 
        class="com.ixiasoft.outputgenerator.preprocessor.AntProcessor">
  4. Create a <parameters> and a <system> element. Then, create a <parameter> element and specify the conductor file.
    Create a parameter element that specifies your custom conductor file. You would replace the -acme with your company name.
    <parameter name="buildfile" value="/conductor-acme.xml" />           
  5. Specify the target to run in the conductor file.
    Specify a target that contains the Ant code to run the PDF transformation scenario.
    <parameter name="target" value="dita2pdf.custom.wrapper" />
  6. Specify the target to run to clean the job.dir directory of the current output.
    This particular target uses the job_postprocess target provided by the IXIA CCMS, which deletes the job.dir directory by adding the clean line.
    <parameter name="clean" value="job_postprocess" />
  7. Add a line to specify the output file parameter, so it packages the log files with the output file.
    Specify the log file parameter, setting it to true.
    <parameter name="keep.log.files" value="true"/>
  8. If required, enter custom system parameters.
    Add any custom system parameters.
    <parameter name="watermark" value="yes"/>
  9. Optional: Enter any <user> parameters to display in the Generate Output dialog. See the online 2.5.4 DITA Open Toolkit for some plugin options.
    The example final preprocessor definition contains user parameters, so only moderately resembles the default definition.
    <preprocessors>
       <preprocessor name="dita2pdf.custom" class="com.ixiasoft.outputgenerator.preprocessor.AntProcessor">
          <parameters>
             <system>
                <parameter name="buildfile" value="/conductor-acme.xml" />  
                <parameter name="target" value="dita2pdf.custom.wrapper" />
                <parameter name="clean" value="job_postprocess" /> 
                <parameter name="keep.log.files" value="true"/>
                <parameter name="watermark" value="yes"/>
             </system>
              <user>
                <parameter label="Chapter layout" name="dita2pdf.custom.args.chapter.layout" mandatory="false" type="choice">
                <value name="BASIC" _default="true">BASIC</value>
                <value name="MINITOC">MINITOC</value>
              </parameter>
              <parameter label="Draft comments" name="dita2pdf.custom.args.draft" mandatory="false" type="choice">
                <value name="no" _default="true">no</value>
                <value name="yes">yes</value>
              </parameter>
              <parameter label="Related links style" name="dita2pdf.custom.args.fo.rellinks" mandatory="false" type="choice">
                <value name="all" _default="true">all</value>
                <value name="nofamily">nofamily</value>
                <value name="noparent">noparent</value>
                <value name="none">none</value>
              </parameter>
            </user>      
          </parameters>
       </preprocessor> 
    </preprocessors>
  10. Save and close preprocessors.xml.
  11. Restart the IXIA CCMS Output Generator service to apply your changes.