plugin-dependencies.dita 3.4 KB

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