IPublishPostProcessPlugin - DitaDeliveryConvertIndex
Converts index.xml produced by DITA-OT to the agreed Transport package index.xml structure.
Plugin Input
Plugin configuration parameters
| Parameter | Required | Default value | Allowed values | Description |
|---|---|---|---|---|
| ObjectTypesToProcess | Yes | binary, page, binary_schema, toc, publication, publication_schema, page_schema, index | Which type of objects in the __packages.xml should be converted. Multiple types need to be separated with ", " (comma+space). |
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. |
The files that need to be parsed have to be present in the folder provided in the RootWorkDirectory property of the context and should contain XML.
Plugin Outcome
Changes made to the file system:
- All files that correspond to an
Objectwith a Type that is present inObjectTypesToProcessin the __packages.xml will be parsed and converted.
Values set in the context.Items collection as a result: None.
plugin name="ISHDITADELIVERYCONVERTINDEX" example
<plugin name="ISHDITADELIVERYCONVERTINDEX" handler="DitaDeliveryConvertIndex">
<description>Converts the index.xml produced by DITA_OT to the format defined for DITA Delivery</description>
<initialize>
<parameters>
<parameter name="ObjectTypesToProcess">index</parameter>
</parameters>
</initialize>
</plugin>
Example of an input index.xml file as created by DITA-OT and after running the DitaDeliveryConvertRefs plugin
<?xml version="1.0"?>
<index>
<entry keyword="Accepting calls">
<topic href="ish:1420746-164195-16" title="Answering or rejecting a call" />
</entry>
<entry keyword="Battery">
<entry keyword="Charge level">
<topic href="ish:1420746-164187-16#GUID-11DF4D0E-11C3-4C1E-946D-0950B6DFDC4F" title="Standby mode" />
</entry>
<entry keyword="Charging">
<topic href="ish:1420746-164290-16#GUID-87DD5F98-0359-4975-BBA2-3B494D82BE3C" title="Charging the battery" />
</entry>
<entry keyword="Installing">
<topic href="ish:1420746-164271-16" title="Installing the SIM card and the battery" />
</entry>
</entry>
<entry keyword="Battery charger">
<entry keyword="Connector">
<topic href="ish:1420746-164155-16#GUID-03AB2EA1-F81B-4A22-8149-710094BE1081" title="Connectors overview" />
</entry>
<see keyword="Battery" />
</entry>
<entry keyword="Bluetooth">
<entry keyword="Bluetooth Indicator">
<topic href="ish:1420746-164255-16#GUID-53925A2B-DCEE-48DB-BB47-623F13EA618F" title="Essential indicators in standby mode" />
</entry>
</entry>
<entry keyword="Calling">
<entry keyword="Accepting calls">
<topic href="ish:1420746-164195-16" title="Answering or rejecting a call" />
</entry>
</entry>
<entry keyword="Standby mode">
<topic href="ish:1420746-164255-16" title="Essential indicators in standby mode" />
<topic href="ish:1420746-164436-16" title="Screen saver" />
<entry keyword="Screen">
<topic href="ish:1420746-164187-16" title="Standby mode" />
</entry>
</entry>
</index>
Example of an output XML file
<?xml version="1.0" encoding="utf-8"?>
<navroot id="ish:1420746-100000000-512" version="1.0" xmlns:tcdl="http://www.sdl.com/web/DXA/Format">
<naventry id="ish:1420746-100000001-1024">
<title>Accepting calls</title>
<naventry id="ish:1420746-100000002-1024" ref="ish:1420746-164195-16">
<title>Answering or rejecting a call</title>
</naventry>
</naventry>
<naventry id="ish:1420746-100000003-1024">
<title>Battery</title>
<naventry id="ish:1420746-100000004-1024">
<title>Charge level</title>
<naventry id="ish:1420746-100000005-1024" ref="ish:1420746-164187-16" addanchor="GUID-11DF4D0E-11C3-4C1E-946D-0950B6DFDC4F">
<title>Standby mode</title>
</naventry>
</naventry>
<naventry id="ish:1420746-100000006-1024">
<title>Charging</title>
<naventry id="ish:1420746-100000007-1024" ref="ish:1420746-164290-16" addanchor="GUID-87DD5F98-0359-4975-BBA2-3B494D82BE3C">
<title>Charging the battery</title>
</naventry>
</naventry>
<naventry id="ish:1420746-100000008-1024">
<title>Installing</title>
<naventry id="ish:1420746-100000009-1024" ref="ish:1420746-164271-16">
<title>Installing the SIM card and the battery</title>
</naventry>
</naventry>
</naventry>
<naventry id="ish:1420746-100000010-1024">
<title>Battery charger</title>
<naventry id="ish:1420746-100000011-1024">
<title>Connector</title>
<naventry id="ish:1420746-100000012-1024" ref="ish:1420746-164155-16" addanchor="GUID-03AB2EA1-F81B-4A22-8149-710094BE1081">
<title>Connectors overview</title>
</naventry>
</naventry>
<naventry id="ish:1420746-100000013-1024" type="seenaventry" ref="ish:1420746-100000003-1024">
<title>Battery</title>
</naventry>
</naventry>
<naventry id="ish:1420746-100000014-1024">
<title>Bluetooth</title>
<naventry id="ish:1420746-100000015-1024">
<title>Bluetooth Indicator</title>
<naventry id="ish:1420746-100000016-1024" ref="ish:1420746-164255-16" addanchor="GUID-53925A2B-DCEE-48DB-BB47-623F13EA618F">
<title>Essential indicators in standby mode</title>
</naventry>
</naventry>
</naventry>
<naventry id="ish:1420746-100000017-1024">
<title>Calling</title>
<naventry id="ish:1420746-100000018-1024">
<title>Accepting calls</title>
<naventry id="ish:1420746-100000019-1024" ref="ish:1420746-164195-16">
<title>Answering or rejecting a call</title>
</naventry>
</naventry>
</naventry>
<naventry id="ish:1420746-100000030-1024">
<title>Standby mode</title>
<naventry id="ish:1420746-100000031-1024" ref="ish:1420746-164255-16">
<title>Essential indicators in standby mode</title>
</naventry>
<naventry id="ish:1420746-100000032-1024" ref="ish:1420746-164436-16">
<title>Screen saver</title>
</naventry>
<naventry id="ish:1420746-100000033-1024">
<title>Screen</title>
<naventry id="ish:1420746-100000034-1024" ref="ish:1420746-164187-16">
<title>Standby mode</title>
</naventry>
</naventry>
</naventry>
</navroot>
Plugin flow
DitaDeliveryConvertIndex does the following:
- Process every file specified in the overall package file provided in the Items collection of the context with the key
ExtendedOverallPackageObjectFilePaththat has type matching the value provided in theObjectTypesToProcessparameter. - Converts
indexelement intonavrootelement. - Converts every
entryelement intonaventryelement. - Converts
keywordattribute of theentryelement intotitleinner element of the newnaventryelement. - Converts
hrefattribute of theentryelement intorefattribute (and an optionaladdanchorattribute if thehrefcontains a#ELEMENTIDpart) and adds it to the newnaventryelement. - Converts every
seeelement intonaventryelement withrefattribute pointing to the relatednaventryelement.