IPublishPostProcessPlugin - DitaDeliveryExtendNavEntryMetadata
Determines which naventry elements in the toc or index refer to a certain page or binary and adds the ids of the found naventry elements into the JSON metadata of the referenced page or binary.
Plugin Input
Plugin configuration parameters: None
Input expected in the
context.Items collection
| Item Key | Required | Default value | Item Value Type | Description |
|---|---|---|---|---|
| TransportPackageRootDirectory | Yes | string | The root transport package folder (typically ...\Data\Publish\Data\[RANDOMFOLDERNAME]\work\TP). | |
| ExtendedOverallPackageObjectFilePath | Yes | string | File path of the XML that contains an overview of all the files that need to be transported to Dynamic Delivery (typically full file path to __packages.xml). |
Changes made to the file system:
- The JSON metadata files for page or binary objects that are referenced from the
tocorindexare extended with:- The id of the toc navroot element that refers to the object is put in
tocnavroot.generated.value - The id of the toc naventry elements that refer to the object is put in
tocnaventries.generated.value - The ids of the index navroot element that refers to the object is put in
indexnavroot.generated.value - The ids of the index naventry elements that refer to the object is put in
indexnaventries.generated.value
- The id of the toc navroot element that refers to the object is put in
- The json schema file for the page or binary metadata is adapted when needed as well.
Values set in the context as a result: None.
Values set in the context.Items collection as a result: None.
plugin name="ISHDITADELIVERYEXTENDNAVENTRYMETADATA" example
<plugin name="ISHDITADELIVERYEXTENDNAVENTRYMETADATA" handler="DitaDeliveryExtendNavEntryMetadata">
<description>
Adds fields to the page or binary JSON metadata files that reflect which toc and index items refer to them.
</description>
<initialize/>
</plugin>
Example of an extended page metadata file.
{
"page_meta": {
"properties": {
"ishlogicalref.object.id": 164151,
"ishversionref.object.id": 164152,
"ishlngref.object.id": 164155,
"ishref.object.value": "GUID-03AB2EA1-F81B-4A22-8149-710094BE1081",
"ishtype.object.value": "ISHModule",
"FTITLE.logical.value": "connectors overview",
...
"tocnavroot.generated.value": "ish:1420746-1-512",
"tocnaventries.generated.value": ["ish:1420746-6-1024"],
"indexnavroot.generated.value": "ish:1420746-100000000-512",
"indexnaventries.generated.value": ["ish:1420746-100000012-1024", "ish:1420746-100000031-1024"]
}
}
}
Example of an extended page schema file
{
"page_meta": {
"properties": {
"ishlogicalref.object.id": {
"type": "integer",
"searchable": "no"
},
"ishversionref.object.id": {
"type": "integer",
"searchable": "no"
},
"ishlngref.object.id": {
"type": "integer",
"searchable": "no"
},
"ishref.object.value": {
"type": "string",
"searchable": "no"
},
"ishtype.object.value": {
"type": "string",
"searchable": "no"
},
"FTITLE.logical.value": {
"type": "string",
"searchable": "no"
},
...
"tocnavroot.generated.value": {
"type": "string",
"searchable": "no"
},
"tocnaventries.generated.value": {
"type": "array",
"items": { "type": "string" },
"searchable": "no"
},
"indexnavroot.generated.value": {
"type": "string",
"searchable": "no"
},
"indexnaventries.generated.value": {
"type": "string",
"searchable": "no"
}
}
}
}
Plugin flow
The DitaDeliveryExtendNavEntryMetadata does the following:
- Every toc and index file in the __packages.xml is loaded as XML in memory, parsed, and a list is build with the navroot id and all the naventry elements together with the object ids they are referencing.
- A lookup is done in the __packages.xml with every object id that is referenced to find the corresponding metadata file.
- The corresponding JSON metadata files are opened and the ids of the referencing navroot and naventry elements are added and saved.
- The appropriate metadata schema files are extended as well.