plugin-dependencies.dita 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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
  13. <indexterm>prerequisites</indexterm>
  14. <indexterm>dependencies</indexterm>
  15. <indexterm>order</indexterm>
  16. <indexterm><xmlelement>require</xmlelement></indexterm></indexterm>
  17. <indexterm>XSLT
  18. <index-see-also>plug-ins</index-see-also></indexterm>
  19. </keywords>
  20. </metadata>
  21. </prolog>
  22. <conbody>
  23. <draft-comment author="Kristen Eberlein" time="24 February 2016">
  24. <p>I'm not entirely happy with this topic as it currently is, but want to move forward with the overall
  25. rework.</p>
  26. <p>The original topic was quite a mixture of task, concept, and reference. While it could have been reworked as a
  27. task topic, it really was about working with a <filepath>plugin.xml</filepath> file, not using an extension
  28. point.</p>
  29. <p>I still wonder whether this topic would be better of as a reference topic in the reference section for the
  30. topic cluster.</p>
  31. </draft-comment>
  32. <section>
  33. <p>The <xmlelement>require</xmlelement> element in the <filepath>plugin.xml</filepath> file specifies whether the
  34. plug-in has dependencies. Use <xmlelement>require</xmlelement> elements to specify prerequisite plug-ins, in
  35. order from most general to most specific.</p>
  36. <p>If a prerequisite plug-in is missing, DITA-OT prints a warning during installation. To suppress the warning but
  37. keep the installation order if both plug-ins are present, add <codeph>importance="optional"</codeph> to the
  38. <xmlelement>require</xmlelement> element. </p>
  39. <!--<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>-->
  40. <p>If a plug-in can depend on any one of several optional plug-ins, separate the plug-in IDs with a vertical bar.
  41. This is most useful when combined with <codeph>importance="optional"</codeph>.</p>
  42. </section>
  43. <example>
  44. <title>Example: Plug-in with a prerequisite plug-in</title>
  45. <p>The following plug-in will only be installed if the plug-in with the ID <codeph>com.example.primary</codeph> is
  46. available. If that plug-in is not available, a warning is generated and the installation operation fails.</p>
  47. <codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace">&lt;plugin id="com.example.builds-on-primary">
  48. &lt;!-- ... Extensions here -->
  49. &lt;require plugin="com.example.primary"/>
  50. &lt;/plugin></codeblock>
  51. </example>
  52. <example>
  53. <title>Example: Plug-in that has optional plug-ins</title>
  54. <p>The following plug-in will only be installed if either the plug-in with the ID <codeph>pluginA</codeph> or the
  55. plug-in with the ID <codeph>pluginB</codeph> is available. If neither of those plug-ins are installed, a warning
  56. is generated but the installation operation is completed.</p>
  57. <codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace">&lt;plugin id="pluginC">
  58. &lt;!-- ...extensions here -->
  59. &lt;require plugin="pluginA|pluginB" importance="optional"/>
  60. &lt;/plugin></codeblock>
  61. <draft-comment author="Kristen Eberlein" time="24 February 2016">
  62. <p>We need to check this example against the toolkit. Text in the original topic was wrong, but I have not
  63. tested this.</p>
  64. </draft-comment>
  65. </example>
  66. </conbody>
  67. </concept>