plugin-dependencies.dita 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
  3. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  4. <concept id="plugin-dependencies" xml:lang="en-US">
  5. <title>Plug-in dependencies</title>
  6. <shortdesc>A DITA-OT plug-in can be dependent on other plug-ins. Prerequisite plug-ins are installed first, which
  7. ensures that DITA-OT handles XSLT overrides correctly.</shortdesc>
  8. <prolog>
  9. <metadata>
  10. <keywords>
  11. <indexterm><xmlelement>require</xmlelement></indexterm>
  12. <indexterm>plug-ins<indexterm>prerequisites</indexterm><indexterm>dependencies</indexterm><indexterm>order</indexterm><indexterm><xmlelement>require</xmlelement></indexterm></indexterm>
  13. <indexterm>XSLT<index-see-also>plug-ins</index-see-also></indexterm>
  14. </keywords>
  15. </metadata>
  16. </prolog>
  17. <conbody>
  18. <draft-comment author="Kristen Eberlein" time="24 February 2016">
  19. <p>I'm not entirely happy with this topic as it currently is, but want to move forward with the overall
  20. rework.</p>
  21. <p>The original topic was quite a mixture of task, concept, and reference. While it could have been reworked as a
  22. task topic, it really was about working with a <filepath>plugin.xml</filepath> file, not using an extension
  23. point.</p>
  24. <p>I still wonder whether this topic would be better of as a reference topic in the reference section for the
  25. topic cluster.</p>
  26. </draft-comment>
  27. <section>
  28. <p>The <xmlelement>require</xmlelement> element in the <filepath>plugin.xml</filepath> file specifies whether the
  29. plug-in has dependencies. Use <xmlelement>require</xmlelement> elements to specify prerequisite plug-ins, in
  30. order from most general to most specific.</p>
  31. <p>If a prerequisite plug-in is missing, DITA-OT prints a warning during installation. To suppress the warning but
  32. keep the installation order if both plug-ins are present, add <codeph>importance="optional"</codeph> to the
  33. <xmlelement>require</xmlelement> element. </p>
  34. <!--<p>If the current plug-in requires a plug-in with <codeph>id="plugin-id"</codeph> before it can be installed, it would include the following: </p><codeblock>&lt;require plugin="<i>plugin-id</i>"></codeblock>-->
  35. <p>If a plug-in can depend on any one of several optional plug-ins, separate the plug-in IDs with a vertical bar.
  36. This is most useful when combined with <codeph>importance="optional"</codeph>.</p>
  37. </section>
  38. <example>
  39. <title>Example: Plug-in with a prerequisite plug-in</title>
  40. <p>The following plug-in will only be installed if the plug-in with the ID <codeph>com.example.primary</codeph> is
  41. available. If that plug-in is not available, a warning is generated and the installation operation fails.</p>
  42. <codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace">&lt;plugin id="com.example.builds-on-primary">
  43. &lt;!-- ... Extensions here -->
  44. &lt;require plugin="com.example.primary"/>
  45. &lt;/plugin></codeblock>
  46. </example>
  47. <example>
  48. <title>Example: Plug-in that has optional plug-ins</title>
  49. <p>The following plug-in will only be installed if either the plug-in with the ID <codeph>pluginA</codeph> or the
  50. plug-in with the ID <codeph>pluginB</codeph> is available. If neither of those plug-ins are installed, a warning
  51. is generated but the installation operation is completed.</p>
  52. <codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace">&lt;plugin id="pluginC">
  53. &lt;!-- ...extensions here -->
  54. &lt;require plugin="pluginA|pluginB" importance="optional"/>
  55. &lt;/plugin></codeblock>
  56. <draft-comment author="Kristen Eberlein" time="24 February 2016">
  57. <p>We need to check this example against the toolkit. Text in the original topic was wrong, but I have not
  58. tested this.</p>
  59. </draft-comment>
  60. </example>
  61. </conbody>
  62. </concept>