Documentation Center

IPublishPostProcessPlugin - IshFindFile

Finds the file in the DITA-OT output folder based on a certain file pattern matching rule.

Plugin Input

Plugin configuration parameters
ParameterRequiredDefault valueAllowed valuesDescription
FolderContextItemsKeyYesValid key name, present in items collectionItem key of the item containing the full file path DITA-OT output folder.
FilePatternNoValid file pattern

The file pattern to match the output file.

FoundFileContextItemsKeyYesValid key name, present in items collectionItem key of the item containing the full file path of the file that was found.

Plugin Outcome

Values set in the context.Items collection as a result
Item KeyTypical ValueItem Value TypeDescription
FoundFileContextItemsKey StringThe full path of the file matching the pattern.

plugin name="ISHFINDDITAOTRESULTFILE" example


<plugin name="ISHFINDDITAOTRESULTFILE" handler="IshFindFile">
  <description>Finds the file in the DITA-OT output folder based on a certain file pattern matching rule.</description>
  <initialize>
    <parameters>
      <parameter name="FolderContextItemsKey">DITAOTOutDirectory</parameter>
      <parameter name="FilePattern">*.chm</parameter>
      <parameter name="FoundFileContextItemsKey">DITAOTOutputFile</parameter>
    </parameters>
  </initialize>
</plugin>    

			

Plugin flow

IshFindFile searches the file in the folder provided in the item with the key passed in the FolderContextItemsKey parameter.
  • If there is only one file matching the pattern, the full file path is saved to the item with the key passed in the FoundFileContextItemsKey parameter.
  • If there is more than one file matching the pattern, the plugin selects the most recent file.
  • If there is no file found, plugin throws InfoShareInvalidOperationException exception.