{"id":55676,"date":"2022-10-04T15:42:14","date_gmt":"2022-10-04T10:12:14","guid":{"rendered":"https:\/\/www.tothenew.com\/blog\/?p=55676"},"modified":"2024-06-10T15:38:52","modified_gmt":"2024-06-10T10:08:52","slug":"integrating-and-using-the-custom-dita-ot-plugin","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/integrating-and-using-the-custom-dita-ot-plugin\/","title":{"rendered":"Integrating and Using the Custom DITA-OT Plugin"},"content":{"rendered":"<h2><b>Introduction<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">In my recent project, I encountered a scenario where I had to incorporate a custom DITA-OT plugin into the XML Add-On. In my following article, I\u2019ll guide you through the steps to integrate the plugin.<\/span><\/p>\n<h2><b>Prerequisite<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">For this, you\u2019ll need<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">AEM 6.4 with the XML Documentation Add-On 3.8.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Custom DITA-OT plugin zip file. (For our case, we will use <strong>DOCX<\/strong> or Word Plugin as an example)<\/span><\/li>\n<\/ol>\n<h2><b>What are we doing?<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Before moving directly into the steps, we will discuss what we are actually going to do. As we all know, the XML Add-On is based on top of the DITA-OT. So, we will first integrate the custom plugin with the DITA-OT and then configure the XML Add-On to use it.<\/span><\/p>\n<h2><b>Steps to integrate the plugin<\/b><\/h2>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">As a first step, we will download the <strong>DITA-OT.zip<\/strong> file that XML Add-On uses. It can be found at two locations, one at <em>\/apps\/fmdita\/dita_resources\/DITA-OT.zip<\/em> and another at <em>\/etc\/fmdita\/dita_resources\/DITA-OT.zip<\/em>. We\u2019ll be using the DITA-OT.zip, which is present under the <\/span><b>apps<\/b><span style=\"font-weight: 400;\"> folder, as AEM, by default, first uses the one under the apps folder.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Now that the zip is downloaded, we will integrate the custom plugin. To do that,<\/span>\n<ol type=\"a\">\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Unzip the DITA-OT.zip folder.<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Navigate to the ..\/DITA-OT\/bin<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Open the terminal in that location and execute the below DITA-OT command,<br \/>\n<em>dita &#8211;install &lt;plugin-path&gt;.zip<\/em><br \/>\nOnce the plugin is installed, it will show \u201c<b>Added com.elovirta.ooxml<\/b>&#8220;.<br \/>\nEg. dita &#8211;install ~\/Downloads\/com.elovirta.ooxml.zip<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-57559 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/1-1024x140.png\" alt=\"\" width=\"625\" height=\"85\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/1-1024x140.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/1-300x41.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/1-768x105.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/1-624x85.png 624w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/1.png 1238w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><\/span><\/li>\n<li><span style=\"font-weight: 400;\">Now zip\/compress the entire DITA-OT folder again.<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Upload\/Replace the new DITA-OT.zip folder to the exact same location in the AEM.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">We have now uploaded the DITA-OT zip folder with our custom plugin, but these changes are not yet in effect. To do so, follow the below steps,<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">In AEM, navigate to <\/span><b>Tools &gt; XML Documentation &gt; Dita Profiles<\/b><span style=\"font-weight: 400;\"> or use below link<\/span><a href=\"http:\/\/localhost:4502\/libs\/fmdita\/profiles\/profiles.html\"> <span style=\"font-weight: 400;\">http:\/\/localhost:4502\/libs\/fmdita\/profiles\/profiles.html<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Select the <strong>Default Profile<\/strong> or the desired profile, and click on the <strong>Edit Profile<\/strong> option\u00a0from the top rail.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Click <strong>Done<\/strong> for changes to take effect.<\/span><\/li>\n<\/ol>\n<h2><strong>How to use it?<\/strong><\/h2>\n<p><span style=\"font-weight: 400;\">The custom DITA-OT plugin is in place. Now to use it, we can add the preset for the custom plugin individually for each ditamap or for all the ditamaps at once globally. Below I\u2019ll be showing you the steps for the latter one.<\/span><\/p>\n<h3><b>Adding Output Preset Globally (Configuring the Plugin for use)<\/b><\/h3>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">In AEM, navigate to <\/span><b>Tools &gt; XML Documentation &gt; Folder Profiles<\/b><span style=\"font-weight: 400;\"> or use the below link<\/span><a href=\"http:\/\/localhost:4502\/libs\/fmdita\/folderprofiles\/profiles.html\"> <span style=\"font-weight: 400;\">http:\/\/localhost:4502\/libs\/fmdita\/folderprofiles\/profiles.html<\/span><\/a><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Click open the <strong>Global Profile<\/strong> or the desired profile and navigate to the <\/span><b>Output Preset<\/b><span style=\"font-weight: 400;\"> section.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">From the top rail, select <strong>Create<\/strong> option which will add a new preset to configure.<br \/>\n<\/span><\/p>\n<ol type=\"a\">\n<li><span style=\"font-weight: 400;\">For the <\/span><b>Output Type<\/b><span style=\"font-weight: 400;\"> select the <\/span><b><b>Custom<\/b><\/b> option\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-57560 size-large\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/2-1024x513.png\" alt=\"\" width=\"625\" height=\"313\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/2-1024x513.png 1024w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/2-300x150.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/2-768x385.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/2-1536x770.png 1536w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/2-624x313.png 624w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/2.png 1920w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/li>\n<li><span style=\"font-weight: 400;\">Enter the transformation name for your plugin in the <em>Transformation Name<\/em>\u00a0field. In our case, it is \u201c<\/span><b>docx<\/b><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u201d.\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-57557 size-medium\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/3-300x80.png\" alt=\"\" width=\"300\" height=\"80\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/3-300x80.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/3.png 473w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/span><\/span><\/li>\n<li><span style=\"font-weight: 400;\">Update the <\/span><em>Destination Path <\/em>field<span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">,\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-57558\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/4-300x73.png\" alt=\"\" width=\"300\" height=\"73\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/4-300x73.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/4.png 459w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/span><\/span><\/li>\n<li><span style=\"font-weight: 400;\">Enter the label name for this output preset in the <\/span><em>Setting Name<\/em><span style=\"font-weight: 400;\"> field, In our case, it is \u201c<\/span><b>DOCX<\/b><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u201d. Click Save.\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-57553\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/5-300x79.png\" alt=\"\" width=\"300\" height=\"79\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/5-300x79.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/5.png 484w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/span><\/span><\/li>\n<\/ol>\n<\/li>\n<li><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">To make that preset available on all of the ditamaps, select the checkbox next to the new preset (i.e DOCX) and click <strong>Apply Preset Changes<\/strong>\u00a0from the top rail.\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-57554\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/6-modified-300x127.png\" alt=\"\" width=\"300\" height=\"127\" data-wp-editing=\"1\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/6-modified-300x127.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/6-modified-768x325.png 768w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/6-modified-624x264.png 624w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/6-modified.png 850w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><br \/>\n<\/span><\/span><\/li>\n<li><span style=\"font-weight: 400;\">When you click on <\/span><b>Apply Preset Changes<\/b><span style=\"font-weight: 400;\"> button, you will get an <\/span>Apply Preset Changes<span style=\"font-weight: 400;\"> pop-up, on which select the <\/span><b>Ok <\/b>option\n<p><span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-57555\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/7-modified-300x159.png\" alt=\"\" width=\"300\" height=\"159\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/7-modified-300x159.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/7-modified-624x331.png 624w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/7-modified.png 679w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/span><\/span><\/li>\n<li><span style=\"font-weight: 400;\">When you do that, you will be presented with the <\/span><b>Confirm Action<\/b><span style=\"font-weight: 400;\"> pop-up, again select the <\/span><b>Ok <\/b>option<span style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">.<br \/>\n<\/span><\/span><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-57556\" src=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/8-300x115.png\" alt=\"\" width=\"300\" height=\"115\" srcset=\"\/blog\/wp-ttn-blog\/uploads\/2022\/10\/8-300x115.png 300w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/8-624x240.png 624w, \/blog\/wp-ttn-blog\/uploads\/2022\/10\/8.png 686w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><span style=\"font-weight: 400;\"><br \/>\n<b>Note: It will take some time. It depends on the number of ditamaps you have in the folder.<\/b><\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">Once the Apply Preset process is completed, you can open any ditamap and generate the output.<\/span><\/p>\n<h2><b>Conclusion<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">Following the above approach, you can integrate any custom DITA-OT plugin.\u00a0<\/span><\/p>\n<div class=\"ap-custom-wrapper\"><\/div><!--ap-custom-wrapper-->","protected":false},"excerpt":{"rendered":"<p>Introduction In my recent project, I encountered a scenario where I had to incorporate a custom DITA-OT plugin into the XML Add-On. In my following article, I\u2019ll guide you through the steps to integrate the plugin. Prerequisite For this, you\u2019ll need AEM 6.4 with the XML Documentation Add-On 3.8. Custom DITA-OT plugin zip file. (For [&hellip;]<\/p>\n","protected":false},"author":1383,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":78},"categories":[5868],"tags":[4847,5033,65,5034],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/55676"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/1383"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=55676"}],"version-history":[{"count":4,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/55676\/revisions"}],"predecessor-version":[{"id":57561,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/55676\/revisions\/57561"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=55676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=55676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=55676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}