IPublishPostProcessPlugin - IshFindFile
Finds the file in the DITA-OT output folder based on a certain file pattern matching rule.
Plugin Input
Plugin configuration parameters
| Parameter | Required | Default value | Allowed values | Description |
|---|---|---|---|---|
| FolderContextItemsKey | Yes | Valid key name, present in items collection | Item key of the item containing the full file path DITA-OT output folder. | |
| FilePattern | No | Valid file pattern | The file pattern to match the output file. | |
| FoundFileContextItemsKey | Yes | Valid key name, present in items collection | Item 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 Key | Typical Value | Item Value Type | Description |
|---|---|---|---|
| FoundFileContextItemsKey | String | The 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
FoundFileContextItemsKeyparameter. - 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
InfoShareInvalidOperationExceptionexception.