Documentation Center

IPublishPostProcessPlugin - IshRunDITAOT

Runs the DITA-OT transformation process by executing the ishrunditaot.cmd command. If files were changed in the DITA-OT or Doctypes folders, the command ant -f integrator is executed beforehand to rebuild the files needed by DITA-OT.

Plugin Input

Plugin configuration parameters
ParameterRequiredDefault valueAllowed valuesDescription
DITAOTParentFolderYes Valid folder path.The path to the parent folder of the DITA-OT folder. Most of the time this is "%ISHPROJECTAPPPATH%\Utilities".
DITAOTOutDirectoryContextItemKeyYesThe name of key of output parameter to set the full directory name of the out directory generated by DITA-OTThe output value with the full directory name of the out directory generated by DITA-OT will be added to the context.Items collection.
CopyImagesAndOtherFilesToOutputFolderNoyesBooleanIndicate whether the plugin should copy all Image and Other type of objects to the DITA-OT output folder
StoreEntireDITAOTLogFileNonoBoolean.Indicates whether to store the entire DITA-OT log file for a successful publish in the event logging. If false only the last 1000 lines will be stored. For a failed publish all log lines are always stored.
BuildDITAOTFilesNoyesBoolean.Indicates whether whether DITA-OT build files need to be regenerated or not.
AntHomeFolderNo Valid folder path.The path to ANT_HOME folder.
NumberOfDITAOTLinesNo1000Number.Indicates number of lines for logging.

Input expected in the context.Items collection: None

Plugin Outcome

Changes made to the file system: Unknown, as the external process can be anything.

Values set in the context as a result: None.

Values set in the context.Items collection as a result:
Item KeyTypical ValueItem Value TypeDescription
The name of key is specified in the parameter DITAOTOutDirectoryContextItemKeystringThe out folder of DITA-OT

plugin name="ISHRUNDITAOT" example


<plugin name="ISHRUNDITAOT" handler="IshRunDITAOT">
	<description>
		Runs the DITA-OT transformation process by executing the "ishrunditaot.cmd" command. 
		If files were changed in the DITA-OT or Doctypes folders, the command "ant -f integrator" is executed beforehand to rebuild the files needed by DITA-OT.</description>
	<initialize>
		<parameters>
			<parameter name="DITAOTOutDirectoryContextItemKey">DITAOTOutDirectory</parameter>
			<parameter name="DITAOTParentFolder">%ISHPROJECTAPPPATH%\Utilities</parameter>
			<parameter name="NumberOfDITAOTLines">1000</parameter>
		</parameters>
	</initialize>
</plugin>

Plugin flow

The IshRunDITAOT does the following:
  • If BuildDITAOTFiles=yes
    • checks if files are changed in the DITA-OT or Doctypes folder by calculating checksums for the files in those folders and comparing them to the checksum files of the previous publish. The previous checksums are stored in the DITA-OT\<styleprocessor> folder.
    • If one of the files has changed, the command ant -f integrator is executed to rebuild the build files needed by DITA-OT
  • Creates the out, temp and log folders below the language folder available in the publishpostprocesscontext passed to the plugin
  • If CopyImagesAndOtherFilesToOutputFolder=yes
    • reads the filenames of the Image and Other type objects and copies the files to the out folder
  • Starts a process that executes the ishrunditaot.cmd command with the correct set of parameters (including the location of the DITA Map file, the output directory, temp directory, log filename, etc.)
  • The output of the process and the DITA OT logfiles are gathered, parsed and saved in the Event Log detail records. The status of the output is set depending whether errors/warning were encountered or not.
  • The values of the context that need to be changed are set.