1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
2 | <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
|
---|
3 | <reference id="extension-points">
|
---|
4 | <title>Extension points for plug-ins to the DITA Open Toolkit</title>
|
---|
5 | <titlealts>
|
---|
6 | <navtitle>Plug-in extension points</navtitle>
|
---|
7 | </titlealts>
|
---|
8 | <shortdesc>Extensions to the DITA Open Toolkit are supported through a plug-in extension mechanism.</shortdesc>
|
---|
9 | <refbody>
|
---|
10 | <section>
|
---|
11 | <p>Plug-ins may do a number of things, such as adding support for specialized DTDs or Schemas,
|
---|
12 | integrating processing overrides, or providing entirely new output transforms. Extensions
|
---|
13 | are integrated using a file named <filepath>plugin.xml</filepath>, located in the plug-in's
|
---|
14 | root directory; the plug-in directory itself is generally located within the
|
---|
15 | <filepath>plugins/</filepath> directory inside of the DITA-OT. This document describes all
|
---|
16 | recognized extension points that are available for use within the
|
---|
17 | <filepath>plugin.xml</filepath> file.</p>
|
---|
18 | </section>
|
---|
19 | </refbody>
|
---|
20 | <reference id="topic_yxv_wov_kc">
|
---|
21 | <title>Plugin configuration file</title>
|
---|
22 | <refbody>
|
---|
23 | <section>
|
---|
24 | <p>The root element of the plugin.xml file is <codeph><plugin></codeph>, and must
|
---|
25 | specify an <codeph>id</codeph> attribute. The <codeph>id</codeph> attribute is used to
|
---|
26 | identify the plugin, as well as to identify whether pre-requisite plugins are available. The
|
---|
27 | <codeph>id</codeph> attribute should follow the syntax rules:</p>
|
---|
28 | <codeblock>id ::= token('.'token)*
|
---|
29 | token ::= ( [0..9] | [a..zA..Z] | ’_’ | ’-’ )+</codeblock>
|
---|
30 | <p>The <codeph><plugin></codeph> element supports the following child elements: </p>
|
---|
31 | <ul>
|
---|
32 | <li>
|
---|
33 | <p><codeph><feature></codeph> defines an <i>extension</i> to contribute to a defined
|
---|
34 | <i>extension point</i>. The following attributes are supported:</p>
|
---|
35 | <simpletable keycol="1">
|
---|
36 | <sthead>
|
---|
37 | <stentry>Attribute</stentry>
|
---|
38 | <stentry>Description</stentry>
|
---|
39 | <stentry>Required</stentry>
|
---|
40 | </sthead>
|
---|
41 | <strow>
|
---|
42 | <stentry><codeph>extension</codeph></stentry>
|
---|
43 | <stentry>extension point identifier</stentry>
|
---|
44 | <stentry>yes</stentry>
|
---|
45 | </strow>
|
---|
46 | <strow>
|
---|
47 | <stentry><codeph>value</codeph></stentry>
|
---|
48 | <stentry>comma separated string value of the extension</stentry>
|
---|
49 | <stentry>either <codeph>value</codeph> or <codeph>file</codeph></stentry>
|
---|
50 | </strow>
|
---|
51 | <strow>
|
---|
52 | <stentry><codeph>file</codeph></stentry>
|
---|
53 | <stentry>file path value of the extension, relative to
|
---|
54 | <filepath>plugin.xml</filepath></stentry>
|
---|
55 | <stentry>either <codeph>value</codeph> or <codeph>file</codeph></stentry>
|
---|
56 | </strow>
|
---|
57 | <strow>
|
---|
58 | <stentry><codeph>type</codeph></stentry>
|
---|
59 | <stentry>type of the <codeph>value</codeph> attribute</stentry>
|
---|
60 | <stentry>no</stentry>
|
---|
61 | </strow>
|
---|
62 | </simpletable>
|
---|
63 | </li>
|
---|
64 | <li>
|
---|
65 | <p><codeph><require></codeph> defines plug-in dependencies. The following attributes
|
---|
66 | are supported:</p>
|
---|
67 | <simpletable keycol="1">
|
---|
68 | <sthead>
|
---|
69 | <stentry>Attribute</stentry>
|
---|
70 | <stentry>Description</stentry>
|
---|
71 | <stentry>Required</stentry>
|
---|
72 | </sthead>
|
---|
73 | <strow>
|
---|
74 | <stentry><codeph>plugin</codeph></stentry>
|
---|
75 | <stentry>vertical bar separated list of plug-ins that are required </stentry>
|
---|
76 | <stentry>yes</stentry>
|
---|
77 | </strow>
|
---|
78 | <strow>
|
---|
79 | <stentry><codeph>important</codeph></stentry>
|
---|
80 | <stentry>flag whether plug-in is required or optional</stentry>
|
---|
81 | <stentry>no</stentry>
|
---|
82 | </strow>
|
---|
83 | </simpletable>
|
---|
84 | </li>
|
---|
85 | <li>
|
---|
86 | <p><codeph><template></codeph> defines files that should be treated as
|
---|
87 | <i>templates</i>. The following attributes are supported:</p>
|
---|
88 | <simpletable keycol="1">
|
---|
89 | <sthead>
|
---|
90 | <stentry>Attribute</stentry>
|
---|
91 | <stentry>Description</stentry>
|
---|
92 | <stentry>Required</stentry>
|
---|
93 | </sthead>
|
---|
94 | <strow>
|
---|
95 | <stentry><codeph>file</codeph></stentry>
|
---|
96 | <stentry>file path to the template, relative to <filepath>plugin.xml</filepath></stentry>
|
---|
97 | <stentry>yes</stentry>
|
---|
98 | </strow>
|
---|
99 | </simpletable>
|
---|
100 | </li>
|
---|
101 | <li>
|
---|
102 | <p><codeph><meta></codeph> defines metadata. The following attributes are
|
---|
103 | supported:</p>
|
---|
104 | <simpletable keycol="1">
|
---|
105 | <sthead>
|
---|
106 | <stentry>Attribute</stentry>
|
---|
107 | <stentry>Description</stentry>
|
---|
108 | <stentry>Required</stentry>
|
---|
109 | </sthead>
|
---|
110 | <strow>
|
---|
111 | <stentry><codeph>type</codeph></stentry>
|
---|
112 | <stentry>metadata name </stentry>
|
---|
113 | <stentry>yes</stentry>
|
---|
114 | </strow>
|
---|
115 | <strow>
|
---|
116 | <stentry><codeph>value</codeph></stentry>
|
---|
117 | <stentry>metadata value</stentry>
|
---|
118 | <stentry>yes</stentry>
|
---|
119 | </strow>
|
---|
120 | </simpletable>
|
---|
121 | </li>
|
---|
122 | </ul>
|
---|
123 | <p>Any extension that is not recognized by the DITA-OT is ignored; all elements other than
|
---|
124 | <codeph><plugin></codeph> are optional. Since version 1.5.3 multiple extension
|
---|
125 | definitions within a plugin configuration file are combined; in older versions only the last
|
---|
126 | extension definition is used. </p>
|
---|
127 | </section>
|
---|
128 | </refbody>
|
---|
129 | <related-links>
|
---|
130 | <link href="#topic_vcw_wov_kc"></link>
|
---|
131 | </related-links>
|
---|
132 | </reference>
|
---|
133 | <reference id="topic_myv_wov_kc">
|
---|
134 | <title>XML catalogs</title>
|
---|
135 | <refbody>
|
---|
136 | <section>
|
---|
137 | <p>The XML Catalogs extension point is used to update the XML Catalogs used to resolve DTD or
|
---|
138 | Schema document types, or to add URI mappings. To do this, first create a catalog with only
|
---|
139 | your new values, using the OASIS Catalog format, and place that in your plugin.</p>
|
---|
140 | <dl>
|
---|
141 | <dlentry>
|
---|
142 | <dt><codeph>dita.specialization.catalog.relative</codeph></dt>
|
---|
143 | <dt importance="deprecated"><codeph>dita.specialization.catalog</codeph></dt>
|
---|
144 | <dd>
|
---|
145 | <p>Adds the content of the catalog file defined in <codeph>file</codeph> attribute to
|
---|
146 | main DITA-OT catalog file.</p>
|
---|
147 | <note type="remember">The <codeph>dita.specialization.catalog</codeph> extension is
|
---|
148 | deprecated. Use <codeph>dita.specialization.catalog.relative</codeph> instead.</note>
|
---|
149 | </dd>
|
---|
150 | </dlentry>
|
---|
151 | <dlentry>
|
---|
152 | <dt><codeph>org.dita.pdf2.catalog.relative</codeph></dt>
|
---|
153 | <dd>
|
---|
154 | <p>Adds the content of the catalog file defined in <codeph>file</codeph> attribute to
|
---|
155 | main PDF plug-in catalog file.</p>
|
---|
156 | </dd>
|
---|
157 | </dlentry>
|
---|
158 | </dl>
|
---|
159 | </section>
|
---|
160 | <example>
|
---|
161 | <codeblock><feature extension="dita.specialization.catalog.relative" file="catalog-dita.xml"/></codeblock>
|
---|
162 | </example>
|
---|
163 | </refbody>
|
---|
164 | </reference>
|
---|
165 | <reference id="topic_uyv_wov_kc">
|
---|
166 | <title>New Ant targets</title>
|
---|
167 | <refbody>
|
---|
168 | <section>
|
---|
169 | <p>The Ant conductor extension point is used to make new targets available to Ant
|
---|
170 | processing.</p>
|
---|
171 | <dl>
|
---|
172 | <dlentry>
|
---|
173 | <dt><codeph>dita.conductor.target.relative</codeph></dt>
|
---|
174 | <dt importance="deprecated"><codeph>dita.conductor.target</codeph></dt>
|
---|
175 | <dd>
|
---|
176 | <p>Add Ant import to main Ant build file.</p>
|
---|
177 | <note type="remember">The <codeph>dita.conductor.target</codeph> extension is
|
---|
178 | deprecated. Use <codeph>dita.conductor.target.relative</codeph> instead.</note>
|
---|
179 | </dd>
|
---|
180 | </dlentry>
|
---|
181 | </dl>
|
---|
182 | </section>
|
---|
183 | <example>
|
---|
184 | <p>To do this, first place your extensions in an Ant project file within your plugin, such
|
---|
185 | as myAntStuff.xml. Create a small wrapper file <filepath>myAntStuffWrapper.xml</filepath>
|
---|
186 | in the same directory: </p>
|
---|
187 | <codeblock><dummy> <import file="myAntStuff.xml"/> </dummy></codeblock>
|
---|
188 | <p>Then create the following feature: </p>
|
---|
189 | <codeblock><feature extension="dita.conductor.target.relative" file="myAntStuffWrapper.xml"/></codeblock>
|
---|
190 | </example>
|
---|
191 | </refbody>
|
---|
192 | </reference>
|
---|
193 | <reference id="topic_dzv_wov_kc">
|
---|
194 | <title>Add Ant targets to the preprocess pipeline</title>
|
---|
195 | <refbody>
|
---|
196 | <section>
|
---|
197 | <p>There are extension points to execute an Ant target before or after all preprocessing. </p>
|
---|
198 | <dl>
|
---|
199 | <dlentry><dt><codeph>depend.preprocess.pre</codeph></dt><dd>Preprocessing pre-target</dd></dlentry>
|
---|
200 | <dlentry><dt><codeph>depend.preprocess.post</codeph></dt><dd>Preprocessing post-target</dd></dlentry>
|
---|
201 | </dl>
|
---|
202 | <p>In addition, there are extension points to execute an Ant target before a given
|
---|
203 | preprocessing step.</p>
|
---|
204 | <dl>
|
---|
205 | <dlentry><dt><codeph>depend.preprocess.clean-temp.pre</codeph></dt><dd>Clean temp pre-target</dd></dlentry>
|
---|
206 | <dlentry><dt><codeph>depend.preprocess.gen-list.pre</codeph></dt><dd>Generate list pre-target</dd></dlentry>
|
---|
207 | <dlentry><dt><codeph>depend.preprocess.debug-filter.pre</codeph></dt><dd>Debug and filter pre-target</dd></dlentry>
|
---|
208 | <dlentry><dt><codeph>depend.preprocess.conrefpush.pre</codeph></dt><dd>Content reference push pre-target</dd></dlentry>
|
---|
209 | <dlentry><dt><codeph>depend.preprocess.move-meta-entries.pre</codeph></dt><dd>Move meta entries pre-target</dd></dlentry>
|
---|
210 | <dlentry><dt><codeph>depend.preprocess.conref.pre</codeph></dt><dd>Content reference pre-target</dd></dlentry>
|
---|
211 | <dlentry><dt><codeph>depend.preprocess.coderef.pre</codeph></dt><dd>Code reference pre-target</dd></dlentry>
|
---|
212 | <dlentry><dt><codeph>depend.preprocess.mapref.pre</codeph></dt><dd>Map reference pre-target</dd></dlentry>
|
---|
213 | <dlentry><dt><codeph>depend.preprocess.keyref.pre</codeph></dt><dd>Key reference pre-target</dd></dlentry>
|
---|
214 | <dlentry><dt><codeph>depend.preprocess.mappull.pre</codeph></dt><dd>Map pull pre-target</dd></dlentry>
|
---|
215 | <dlentry><dt><codeph>depend.preprocess.chunk.pre</codeph></dt><dd>Chunking pre-target</dd></dlentry>
|
---|
216 | <dlentry><dt><codeph>depend.preprocess.maplink.pre</codeph></dt><dd>Map link pre-target</dd></dlentry>
|
---|
217 | <dlentry><dt><codeph>depend.preprocess.move-links.pre</codeph></dt><dd>Move links pre-target</dd></dlentry>
|
---|
218 | <dlentry><dt><codeph>depend.preprocess.topicpull.pre</codeph></dt><dd>Topic pull pre-target</dd></dlentry>
|
---|
219 | <dlentry><dt><codeph>depend.preprocess.copy-files.pre</codeph></dt><dd>Copy files pre-target</dd></dlentry>
|
---|
220 | <dlentry><dt><codeph>depend.preprocess.copy-image.pre</codeph></dt><dd>Copy images pre-target</dd></dlentry>
|
---|
221 | <dlentry><dt><codeph>depend.preprocess.copy-html.pre</codeph></dt><dd>Copy HTML pre-target</dd></dlentry>
|
---|
222 | <dlentry><dt><codeph>depend.preprocess.copy-flag.pre</codeph></dt><dd>Copy flag pre-target</dd></dlentry>
|
---|
223 | <dlentry><dt><codeph>depend.preprocess.copy-subsidiary.pre</codeph></dt><dd>Copy subsidiary pre-target</dd></dlentry>
|
---|
224 | <dlentry><dt><codeph>depend.preprocess.copy-generated-files.pre</codeph></dt><dd>Copy generated files pre-target</dd></dlentry>
|
---|
225 | </dl>
|
---|
226 | </section>
|
---|
227 | <example>
|
---|
228 | <p>The following feature adds "myAntTargetBeforeChunk" Ant target to be executed before the
|
---|
229 | chunk step in preprocessing: </p>
|
---|
230 | <codeblock><feature extension="depend.preprocess.chunk.pre" value="myAntTargetBeforeChunk"/></codeblock>
|
---|
231 | </example>
|
---|
232 | </refbody>
|
---|
233 | </reference>
|
---|
234 | <reference id="topic_lzv_wov_kc">
|
---|
235 | <title>New transtype</title>
|
---|
236 | <refbody>
|
---|
237 | <section>
|
---|
238 | <p>The transtype extension point is used to define a new "transtype", or transform type, which
|
---|
239 | makes use of targets in your Ant extensions.</p>
|
---|
240 | <dl>
|
---|
241 | <dlentry>
|
---|
242 | <dt><codeph>dita.conductor.transtype.check</codeph></dt>
|
---|
243 | <dd>Add new value to list of valid transformation type names.</dd>
|
---|
244 | </dlentry>
|
---|
245 | <dlentry>
|
---|
246 | <dt><codeph>dita.transtype.print</codeph></dt>
|
---|
247 | <dd>Declare transtype as a print type.</dd>
|
---|
248 | </dlentry>
|
---|
249 | </dl>
|
---|
250 | </section>
|
---|
251 | <example>The following feature defines a transform type of "newtext" and declare it as a print
|
---|
252 | type; using this transform type will cause the build to look for a target
|
---|
253 | <codeph>dita2newtext</codeph>, defined previously in your Ant extension:
|
---|
254 | <codeblock><feature extension="dita.conductor.transtype.check" value="newtext"/>
|
---|
255 | <feature extension="dita.transtype.print" value="newtext"/></codeblock></example>
|
---|
256 | </refbody>
|
---|
257 | </reference>
|
---|
258 | <reference id="topic_tzv_wov_kc">
|
---|
259 | <title>XSLT overrides</title>
|
---|
260 | <refbody>
|
---|
261 | <section>
|
---|
262 | <p>The XSLT import extension points are used to override various steps of XSLT processing. For
|
---|
263 | this, the extension attribute indicates the step that the override applies to; the value
|
---|
264 | attribute is a relative path to the override within the current plugin; the type attribute
|
---|
265 | should be set to "file". The plugin installer will add an XSL import statement to the
|
---|
266 | default code, so that your override becomes a part of the normal build. The following XSLT
|
---|
267 | steps are available to override in the core toolkit: </p>
|
---|
268 | <dl>
|
---|
269 | <dlentry>
|
---|
270 | <dt><codeph>dita.xsl.xhtml</codeph></dt>
|
---|
271 | <dd>Override default (X)HTML output (including HTML Help and Eclipse Help) with the
|
---|
272 | following</dd>
|
---|
273 | </dlentry>
|
---|
274 | <dlentry>
|
---|
275 | <dt><codeph>dita.xsl.xslfo</codeph></dt>
|
---|
276 | <dd>Override default PDF output (formerly known as PDF2) with the following</dd>
|
---|
277 | </dlentry>
|
---|
278 | <dlentry>
|
---|
279 | <dt><codeph>dita.xsl.docbook</codeph></dt>
|
---|
280 | <dd>Override default DocBook output with the following</dd>
|
---|
281 | </dlentry>
|
---|
282 | <dlentry>
|
---|
283 | <dt><codeph>dita.xsl.rtf</codeph></dt>
|
---|
284 | <dd>Override default RTF output with the following</dd>
|
---|
285 | </dlentry>
|
---|
286 | <dlentry>
|
---|
287 | <dt><codeph>dita.xsl.eclipse.plugin</codeph></dt>
|
---|
288 | <dd>Override the step that generates plugin.xml for Eclipse with the following</dd>
|
---|
289 | </dlentry>
|
---|
290 | <dlentry>
|
---|
291 | <dt><codeph>dita.xsl.conref</codeph></dt>
|
---|
292 | <dd>Override conref processing</dd>
|
---|
293 | </dlentry>
|
---|
294 | <dlentry>
|
---|
295 | <dt><codeph>dita.xsl.topicpull</codeph></dt>
|
---|
296 | <dd>Override topicpull processing (the step that pulls text into <xref> elements,
|
---|
297 | among other things)</dd>
|
---|
298 | </dlentry>
|
---|
299 | <dlentry>
|
---|
300 | <dt><codeph>dita.xsl.mapref</codeph></dt>
|
---|
301 | <dd>Override mapref processing (the step that resolves references to other maps)</dd>
|
---|
302 | </dlentry>
|
---|
303 | <dlentry>
|
---|
304 | <dt><codeph>dita.xsl.mappull</codeph></dt>
|
---|
305 | <dd>Override mappull processing (the step that updates navtitles in maps and causes
|
---|
306 | attributes to cascade)</dd>
|
---|
307 | </dlentry>
|
---|
308 | <dlentry>
|
---|
309 | <dt><codeph>dita.xsl.maplink</codeph></dt>
|
---|
310 | <dd>Override maplink processing (the step that generates map-based links)</dd>
|
---|
311 | </dlentry>
|
---|
312 | <dlentry importance="deprecated">
|
---|
313 | <dt><codeph>dita.xsl.fo</codeph></dt>
|
---|
314 | <dd>Override the (now deprecated) original PDF output with the following</dd>
|
---|
315 | </dlentry>
|
---|
316 | </dl>
|
---|
317 | </section>
|
---|
318 | <example>
|
---|
319 | <codeblock><feature extension="dita.xsl.xhtml" file="xsl/modifyXhtml.xsl"/></codeblock>
|
---|
320 | </example>
|
---|
321 | </refbody>
|
---|
322 | </reference>
|
---|
323 | <reference id="topic_gaw_wov_kc">
|
---|
324 | <title>Generated text </title>
|
---|
325 | <refbody>
|
---|
326 | <section>
|
---|
327 | <p>The generated text extension point is used to add new strings to the default set of
|
---|
328 | Generated Text.</p>
|
---|
329 | <dl>
|
---|
330 | <dlentry>
|
---|
331 | <dt><codeph>dita.xsl.strings</codeph></dt>
|
---|
332 | <dd>Add new strings to generated text file. </dd>
|
---|
333 | </dlentry>
|
---|
334 | </dl>
|
---|
335 | </section>
|
---|
336 | <example>
|
---|
337 | <p>Copy the file <filepath>xsl/common/strings.xml</filepath> to your plugin, and edit it to
|
---|
338 | contain the languages that you are providing translations for ("en-us" must be present).
|
---|
339 | Copy the file <filepath>xsl/common/strings-en-us.xml</filepath> to your plugin, and
|
---|
340 | replace the content with your own strings, being sure to give them unique name attributes.
|
---|
341 | Do the same for each language that you are providing a translation for. </p>
|
---|
342 | <p>Use the following extension code to include your strings in the set of generated text: </p>
|
---|
343 | <codeblock><feature extension="dita.xsl.strings" file="xsl/common/strings.xml"/></codeblock>
|
---|
344 | <p>The string is now available to the XSLT "getString" template. </p>
|
---|
345 | </example>
|
---|
346 | </refbody>
|
---|
347 | </reference>
|
---|
348 | <reference id="topic_oaw_wov_kc">
|
---|
349 | <title>Pass parameters to XSLT</title>
|
---|
350 | <refbody>
|
---|
351 | <section>
|
---|
352 | <p>You can pass parameters from the Ant build to XSLT pipeline stages, usually to have those
|
---|
353 | parameters avalable as global <xsl:param> values in your XSLT overrides. Create a
|
---|
354 | file insertParameters.xml which contains one or more Ant <param> elements: </p>
|
---|
355 | <codeblock><dummy>
|
---|
356 | <!-- Any Ant code allowed in xslt task is possible. Common example: -->
|
---|
357 | <param name="paramNameinXSLT" expression="${antProperty}" if="antProperty"/>
|
---|
358 | </dummy></codeblock>
|
---|
359 | <p>Pass the value using the following extensions: </p>
|
---|
360 | <dl>
|
---|
361 | <dlentry>
|
---|
362 | <dt><codeph>dita.conductor.html.param</codeph></dt>
|
---|
363 | <dd>Pass parameters to HTML and HTML Help XSLT</dd>
|
---|
364 | </dlentry>
|
---|
365 | <dlentry>
|
---|
366 | <dt><codeph>dita.conductor.xhtml.param</codeph></dt>
|
---|
367 | <dd>Pass parameters to XHTML and Eclipse Help XSLT</dd>
|
---|
368 | </dlentry>
|
---|
369 | <dlentry>
|
---|
370 | <dt><codeph>dita.preprocess.conref.param</codeph></dt>
|
---|
371 | <dd>Pass parameters to conref XSLT</dd>
|
---|
372 | </dlentry>
|
---|
373 | <dlentry>
|
---|
374 | <dt><codeph>dita.preprocess.mapref.param</codeph></dt>
|
---|
375 | <dd>Pass parameters to mapref XSLT</dd>
|
---|
376 | </dlentry>
|
---|
377 | <dlentry>
|
---|
378 | <dt><codeph>dita.preprocess.mappull.param</codeph></dt>
|
---|
379 | <dd>Pass parameters to mappull XSLT</dd>
|
---|
380 | </dlentry>
|
---|
381 | <dlentry>
|
---|
382 | <dt><codeph>dita.preprocess.maplink.param</codeph></dt>
|
---|
383 | <dd>Pass parameters to maplink XSLT</dd>
|
---|
384 | </dlentry>
|
---|
385 | <dlentry>
|
---|
386 | <dt><codeph>dita.preprocess.topicpull.param</codeph></dt>
|
---|
387 | <dd>Pass parameters to topicpull XSLT</dd>
|
---|
388 | </dlentry>
|
---|
389 | <dlentry>
|
---|
390 | <dt><codeph>dita.conductor.pdf2.param</codeph></dt>
|
---|
391 | <dd>Pass parameters to PDF2 XSLT</dd>
|
---|
392 | </dlentry>
|
---|
393 | </dl>
|
---|
394 | </section>
|
---|
395 | <example>
|
---|
396 | <codeblock><feature extension="dita.conductor.html.param" file="insertParameters.xml"/></codeblock>
|
---|
397 | </example>
|
---|
398 | </refbody>
|
---|
399 | </reference>
|
---|
400 | <reference id="topic_bbw_wov_kc">
|
---|
401 | <title>Add Java libraries to the classpath</title>
|
---|
402 | <refbody>
|
---|
403 | <section>
|
---|
404 | <p>If your Ant or XSLT extensions require additional Java libraries in the classpath, you can
|
---|
405 | add them to the global Ant classpath. </p>
|
---|
406 | <dl>
|
---|
407 | <dlentry>
|
---|
408 | <dt><codeph>dita.conductor.lib.import</codeph></dt>
|
---|
409 | <dd>Add Java libraries to DITA-OT classpath.</dd>
|
---|
410 | </dlentry>
|
---|
411 | </dl>
|
---|
412 | </section>
|
---|
413 | <example>
|
---|
414 | <codeblock><feature extension="dita.conductor.lib.import" file="myJavaLibrary.jar"/></codeblock>
|
---|
415 | </example>
|
---|
416 | </refbody>
|
---|
417 | </reference>
|
---|
418 | <reference id="topic_jbw_wov_kc">
|
---|
419 | <title>Add diagnostic messages</title>
|
---|
420 | <refbody>
|
---|
421 | <section>
|
---|
422 | <p>Plug-in specific warning and error messages can be added to the set of messages supplied by
|
---|
423 | DITA-OT.</p>
|
---|
424 | <dl>
|
---|
425 | <dlentry>
|
---|
426 | <dt><codeph>dita.xsl.messages</codeph></dt>
|
---|
427 | <dd>Add new messages to diagnostic message file.</dd>
|
---|
428 | </dlentry>
|
---|
429 | </dl>
|
---|
430 | </section>
|
---|
431 | <example>
|
---|
432 | <p>To add your own messages, create the message in an XML file
|
---|
433 | <filepath>myMessages.xml</filepath>: </p>
|
---|
434 | <codeblock><dummy>
|
---|
435 | <!-- See resource/messages.xml for the details. -->
|
---|
436 | <message id="myMessageId" type="WARN">
|
---|
437 | <reason>...</reason>
|
---|
438 | <response>...</response>
|
---|
439 | </message>
|
---|
440 | </dummy></codeblock>
|
---|
441 | <p>And incorporate them with the extension: </p>
|
---|
442 | <codeblock><feature extension="dita.xsl.messages" file="myMessages.xml"/></codeblock>
|
---|
443 | </example>
|
---|
444 | </refbody>
|
---|
445 | </reference>
|
---|
446 | <reference id="topic_tbw_wov_kc">
|
---|
447 | <title>Manage plugin dependencies </title>
|
---|
448 | <refbody>
|
---|
449 | <section>
|
---|
450 | <p>The <codeph><require></codeph> element requires the <codeph>plugin</codeph>
|
---|
451 | attribute. It is used to identify pre-requisite plug-ins. If the current plugin requires a
|
---|
452 | plugin with <codeph>id="plugin-id"</codeph> before it can be installed, it would include the
|
---|
453 | following: </p>
|
---|
454 | <codeblock><require plugin="<i>plugin-id</i>"></codeblock>
|
---|
455 | <p>Prerequisite plugins are integrated before the current plugin is integrated. This does the
|
---|
456 | right thing with respect to XSLT overrides. If your plugin is a specialization of a
|
---|
457 | specialization, it should <codeph><require></codeph> its base plugins, in order from
|
---|
458 | general to specific. </p>
|
---|
459 | <p>If a prerequisite plugin is missing, a warning will be printed during integration. To
|
---|
460 | suppress this, but keep the integration order if both plugins are present, add
|
---|
461 | <codeph>importance="optional"</codeph> to the <codeph><require> </codeph>element. </p>
|
---|
462 | <p>If your plugin can depend on any one of several optional plugins, separate the plugin ids
|
---|
463 | with a vertical bar. This is most useful when combined with importance="optional": </p>
|
---|
464 | </section>
|
---|
465 | <example>
|
---|
466 | <codeblock><require plugin="pluginA|pluginB" importance="optional"/></codeblock>
|
---|
467 | </example>
|
---|
468 | </refbody>
|
---|
469 | </reference>
|
---|
470 | <reference id="topic_dcw_wov_kc">
|
---|
471 | <title>Version and support information</title>
|
---|
472 | <refbody>
|
---|
473 | <section>
|
---|
474 | <p>The following extension points are used by convention to define version and support info
|
---|
475 | within a plugin:</p>
|
---|
476 | <ul id="ul_jxr_hlv_mc">
|
---|
477 | <li><codeph>package.support.name</codeph></li>
|
---|
478 | <li><codeph>package.support.email</codeph></li>
|
---|
479 | <li><codeph>package.version</codeph></li>
|
---|
480 | </ul>
|
---|
481 | <note>
|
---|
482 | <p>The toolkit does not currently do anything with these values, but may do so in the
|
---|
483 | future.</p>
|
---|
484 | </note>
|
---|
485 | <p>The <codeph>package.version</codeph> value should follow the syntax rules:</p>
|
---|
486 | <codeblock>version ::= major ( '.' minor ( '.' micro ( '.' qualifier )? )? )?
|
---|
487 |
|
---|
488 | major ::= number
|
---|
489 | minor ::= number
|
---|
490 | micro ::= number
|
---|
491 | qualifier ::= ( [0..9] | [a..zA..Z] | ’_’ | '-' )+</codeblock>
|
---|
492 | <p>The default value is <codeph>0.0.0</codeph>.</p>
|
---|
493 | </section>
|
---|
494 | <example>
|
---|
495 | <codeblock><feature extension="package.support.name" value="Joe the Author"/>
|
---|
496 | <feature extension="package.support.email" value="[email protected]"/>
|
---|
497 | <feature extension="package.version" value="1.2.3"/></codeblock>
|
---|
498 | </example>
|
---|
499 | </refbody>
|
---|
500 | </reference>
|
---|
501 | <reference id="topic_mcw_wov_kc">
|
---|
502 | <title>Create your own extension points</title>
|
---|
503 | <refbody>
|
---|
504 | <section>
|
---|
505 | <p>If your plugin needs to define its own extension point in an XML file, add the string
|
---|
506 | "<codeph>_template</codeph>" to the filename before the file suffix. During integration,
|
---|
507 | this file will be processed like the built-in DITA-OT templates. To mark the file as a
|
---|
508 | template file, use the <codeph><template></codeph> element.</p>
|
---|
509 | </section>
|
---|
510 | <example><codeblock><template file="myTemplateFile_template.xsl"/></codeblock></example>
|
---|
511 | </refbody>
|
---|
512 | </reference>
|
---|
513 | <reference id="topic_vcw_wov_kc">
|
---|
514 | <title>Example plugin.xml file</title>
|
---|
515 | <refbody>
|
---|
516 | <section>
|
---|
517 | <p>The following is a sample of a plugin.xml file. This file adds support for a new set of
|
---|
518 | specialized DTDs, and includes an override for the XHTML output processor. It would go into
|
---|
519 | a directory such as <filepath>DITA-OT\plugins\music\</filepath> and referenced supporting
|
---|
520 | files would also exist in that directory. A more extensive sample using these values is
|
---|
521 | available in the actual music plug-in, available at the <xref format="html"
|
---|
522 | href="http://sourceforge.net/projects/dita-ot/files/" scope="external">DITA-OT download
|
---|
523 | page</xref> at SourceForge </p>
|
---|
524 | </section>
|
---|
525 | <example><codeblock><plugin id="org.metadita.specialization.music">
|
---|
526 | <feature extension="dita.specialization.catalog.relative" file="catalog-dita.xml">
|
---|
527 | <feature extension="dita.xsl.xhtml" file="xsl/music2xhtml.xsl"/>
|
---|
528 | </plugin></codeblock></example>
|
---|
529 | </refbody>
|
---|
530 | </reference>
|
---|
531 | </reference>
|
---|