plugin-dependencies.html 6.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE html
  2. SYSTEM "about:legacy-compat">
  3. <html lang="en-us"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2016"><meta name="DC.rights.owner" content="(C) Copyright 2016"><meta name="DC.Type" content="concept"><meta name="description" content="A DITA-OT plug-in can be dependent on other plug-ins. Prerequisite plug-ins are installed first, which ensures that the DITA-OT handles XSLT overrides correctly."><meta name="DC.Relation" scheme="URI" content="../dev_ref/plugins-overview.html"><meta name="DC.Format" content="XHTML"><meta name="DC.Identifier" content="plugin-dependencies"><meta name="DC.Language" content="en-US"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Plug-in dependencies</title></head><body id="plugin-dependencies"><header role="banner"><div class="header">
  4. <p>DITA Open Toolkit</p>
  5. <hr>
  6. </div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 2.3</a></li><li><a href="../release-notes/index.html">Release Notes</a></li><li><a href="../getting-started/index.html">Getting Started</a></li><li><a href="../user-guide/index.html">User Guide</a></li><li><a href="../parameters/index.html">Parameter Reference</a></li><li><a href="../dev_ref/index.html">Developer Reference</a><ul><li><a href="../dev_ref/DITA-OTArchitecture.html">DITA-OT Architecture</a></li><li><a href="../dev_ref/extending-the-ot.html">Extending the DITA-OT</a></li><li><a href="../dev_ref/plugin-creating.html">Creating plug-ins</a><ul><li><a href="../dev_ref/plugins-overview.html">Overview of plug-ins</a><ul><li><a href="../dev_ref/plugin-benefits.html">Benefits of plug-ins</a></li><li><a href="../dev_ref/plugin-configfile.html">Plug-in descriptor file</a></li><li class="active"><a href="../dev_ref/plugin-dependencies.html">Plug-in dependencies</a></li></ul></li><li><a href="../dev_ref/plugin-xmlcatalog.html">Extending an XML catalog file</a></li><li><a href="../dev_ref/plugin-anttarget.html">Adding a new target to the Ant build process</a></li><li><a href="../dev_ref/plugin-antpreprocess.html">Adding an Ant target to the pre-processing pipeline</a></li><li><a href="../dev_ref/plugin-newtranstype.html">Adding a new transformation type</a></li><li><a href="../dev_ref/plugin-overridestyle.html">Overriding an XSLT-processing step</a></li><li><a href="../dev_ref/using-plugin-URI-extension.html">Referencing files from other plug-ins</a></li><li><a href="../dev_ref/plugin-addgeneratedtext.html">Modifying or adding generated text</a></li><li><a href="../dev_ref/plugin-xsltparams.html">Adding parameters to existing XSLT steps</a></li><li><a href="../dev_ref/plugin-javalib.html">Adding a Java library to the DITA-OT classpath parameter</a></li><li><a href="../dev_ref/plugin-messages.html">Adding new diagnostic messages</a></li><li><a href="../dev_ref/plugin-newextensions.html">Creating a new plug-in extension point</a></li><li><a href="../dev_ref/plugin-sample.html">Example plugin.xml file</a></li></ul></li><li><a href="../dev_ref/plugin-extension-points.html">Extension points</a></li><li><a href="../dev_ref/pdf-customization.html">Customizing PDF output</a></li><li><a href="../dev_ref/migration.html">Migrating customizations</a></li></ul></li><li><a href="../user-guide/dita-and-dita-ot-resources.html">DITA Resources</a></li></ul></nav><main role="main"><article role="article" aria-labelledby="ariaid-title1">
  7. <h1 class="title topictitle1" id="ariaid-title1">Plug-in dependencies</h1>
  8. <div class="body conbody"><p class="shortdesc">A DITA-OT plug-in can be dependent on other plug-ins. Prerequisite plug-ins are installed first, which
  9. ensures that the DITA-OT handles XSLT overrides correctly.</p>
  10. <section class="section">
  11. <p class="p">The <code class="keyword markupname xmlelement">&lt;require&gt;</code> element in the <span class="ph filepath">plugin.xml</span> file specifies whether the
  12. plug-in has dependencies. Use <code class="keyword markupname xmlelement">&lt;require&gt;</code> elements to specify prerequisite plug-ins, in
  13. order from most general to most specific.</p>
  14. <p class="p">If a prerequisite plug-in is missing, the DITA-OT prints a warning during installation. To suppress the warning
  15. but keep the installation order if both plug-ins are present, add <code class="ph codeph">importance="optional"</code> to the
  16. <code class="keyword markupname xmlelement">&lt;require&gt;</code> element. </p>
  17. <p class="p">If a plug-in can depend on any one of several optional plug-ins, separate the plug-in IDs with a vertical bar.
  18. This is most useful when combined with <code class="ph codeph">importance="optional"</code>.</p>
  19. </section>
  20. <div class="example"><h2 class="title sectiontitle">Example: Plug-in with a prerequisite plug-in</h2>
  21. <p class="p">The following plug-in will only be installed if the plug-in with the ID <code class="ph codeph">com.example.primary</code> is
  22. available. If that plug-in is not available, a warning is generated and the installation operation fails.</p>
  23. <pre class="pre codeblock"><code>&lt;plugin id="com.example.builds-on-primary"&gt;
  24. &lt;!-- ... Extensions here --&gt;
  25. &lt;require plugin="com.example.primary"/&gt;
  26. &lt;/plugin&gt;</code></pre>
  27. </div>
  28. <div class="example"><h2 class="title sectiontitle">Example: Plug-in that has optional plug-ins</h2>
  29. <p class="p">The following plug-in will only be installed if either the plug-in with the ID <code class="ph codeph">pluginA</code> or the
  30. plug-in with the ID <code class="ph codeph">pluginB</code> is available. If neither of those plug-ins are installed, a warning
  31. is generated but the installation operation is completed.</p>
  32. <pre class="pre codeblock"><code>&lt;plugin id="pluginC"&gt;
  33. &lt;!-- ...extensions here --&gt;
  34. &lt;require plugin="pluginA|pluginB" importance="optional"/&gt;
  35. &lt;/plugin&gt;</code></pre>
  36. </div>
  37. </div>
  38. <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../dev_ref/plugins-overview.html" title="Plug-ins enable users to extend the functionality of the DITA-OT. This might entail adding support for specialized document types, integrating processing overrides, or defining new output transformations.">Overview of plug-ins</a></div></div></nav></article></main></body></html>