1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!--Arbortext, Inc., 1988-2011, v.4002-->
|
---|
3 | <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
|
---|
4 | "reference.dtd">
|
---|
5 | <?Pub Inc?>
|
---|
6 | <reference id="plugin-dependencies" xml:lang="en-us">
|
---|
7 | <title>Managing plug-in dependencies</title>
|
---|
8 | <shortdesc>The <codeph><require></codeph> element in a <filepath>plugin.xml</filepath> file
|
---|
9 | is used to create a dependency on another plug-in. The <codeph><require></codeph> element
|
---|
10 | requires the <codeph>plugin</codeph> attribute in order to reference
|
---|
11 | the dependency.</shortdesc>
|
---|
12 | <refbody>
|
---|
13 | <section> <p>If the current plug-in requires a plug-in with <codeph>id="plugin-id"</codeph> before
|
---|
14 | it can be installed, it would include the following: </p>
|
---|
15 | <codeblock><require plugin="<i>plugin-id</i>"></codeblock>
|
---|
16 | <p>Prerequisite plug-ins are integrated before the current plug-in
|
---|
17 | is integrated. This does the right thing with respect to XSLT
|
---|
18 | overrides. If your plug-in is a specialization of a specialization,
|
---|
19 | it should <codeph><require></codeph> its base plug-ins, in order
|
---|
20 | from general to specific. </p> <p>If a prerequisite
|
---|
21 | plug-in is missing, a warning will be printed during integration.
|
---|
22 | To suppress this, but keep the integration order if both plug-ins
|
---|
23 | are present, add <codeph>importance="optional"</codeph> to
|
---|
24 | the <codeph><require></codeph> element. </p> <p>If your plug-in
|
---|
25 | can depend on any one of several optional plug-ins, separate the plug-in
|
---|
26 | ids with a vertical bar. This is most useful when combined
|
---|
27 | with importance="optional": </p> </section>
|
---|
28 | <example><title>Example</title><p>The following plug-in will only
|
---|
29 | be installed if the plug-in with id="com.example.primary" is available.
|
---|
30 | If that one is not available, a warning will be generated during the
|
---|
31 | integration process.</p><codeblock><plugin id="com.example.builds-on-primary">
|
---|
32 | <!-- ...extensions here -->
|
---|
33 | <require plugin="com.example.primary"/>
|
---|
34 | </plugin></codeblock><p>The following plug-in will only be installed
|
---|
35 | if either the plug-in with id="pluginA" or the plug-in with id="pluginB"
|
---|
36 | are available. If neither of those are installed, the current plug-in
|
---|
37 | will be ignored.</p><codeblock><plugin id="pluginC">
|
---|
38 | <!-- ...extensions here -->
|
---|
39 | <require plugin="pluginA|pluginB" importance="optional"/>
|
---|
40 | </plugin></codeblock> </example>
|
---|
41 | </refbody>
|
---|
42 | </reference><?Pub Caret -3?>
|
---|
43 | <?Pub *0000002467?>
|
---|