1 | <?xml version="1.0" encoding="utf-8"?>
|
---|
2 | <!-- This file is part of the DITA Open Toolkit project hosted on
|
---|
3 | Sourceforge.net. See the accompanying license.txt file for
|
---|
4 | applicable licenses.-->
|
---|
5 | <!-- (C) Copyright IBM Corporation 2005, 2006. All Rights Reserved. -->
|
---|
6 | <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN"
|
---|
7 | "..\..\..\dtd\task.dtd">
|
---|
8 | <task id="createnewp" xml:lang="en-us">
|
---|
9 | <title>Create new plug-in</title>
|
---|
10 | <taskbody>
|
---|
11 | <steps>
|
---|
12 | <step><cmd>Create a new directory in <filepath>/plugins</filepath> directory, such as
|
---|
13 | <userinput>/plugin/pluginA</userinput>.</cmd>
|
---|
14 | <info>Under the created directory, include the following
|
---|
15 | subdirectories:<lines>plugins/
|
---|
16 | pluginA/
|
---|
17 | dtd
|
---|
18 | schema
|
---|
19 | catalog
|
---|
20 | xsl
|
---|
21 | lib</lines><note>Not
|
---|
22 | all above subdirectories are required. However, it is strongly suggested to use the
|
---|
23 | structure and those subdirectories above to make all files systematically. You also can
|
---|
24 | create files under other directories, such as python/ or vb/.</note></info></step>
|
---|
25 | <step><cmd>Specify the types of topic, such as task, reference or concept.</cmd>
|
---|
26 | <substeps>
|
---|
27 | <substep><cmd>Put the dtd files into dtd directory.</cmd></substep>
|
---|
28 | <substep><cmd>Put schema files into schema directory.</cmd></substep>
|
---|
29 | </substeps>
|
---|
30 | </step>
|
---|
31 | <step><cmd>Put the necessary catalog information about the plug-in from your
|
---|
32 | own catalog file into catalog directory.</cmd></step>
|
---|
33 | <step><cmd>Define the transformation for the new specialization and put it
|
---|
34 | into xsl directory.</cmd></step>
|
---|
35 | <step><cmd>Provide the Ant script to use the xsl file with preprocess with
|
---|
36 | default ant script template, and put it into pluginA root directory.</cmd>
|
---|
37 | </step>
|
---|
38 | <step><cmd>Put the complied necessary JAR files into lib directory.</cmd>
|
---|
39 | </step>
|
---|
40 | <step><cmd>Provide a description file named puglin.xml in pluginA root directory.
|
---|
41 | It informs the toolkit how to integrate the function of the new plug-in.</cmd>
|
---|
42 | <info>This file is an xml file. It's not validated by either dtd file or schema
|
---|
43 | file. Following specification shows you how to write the description file: </info>
|
---|
44 | <substeps>
|
---|
45 | <substep><cmd>An example of the plugin.xml is shown below:</cmd><stepxmp><lines><plugin id="org.dita.dost.pluginA">
|
---|
46 | <require plugin="base_pluginA"/>
|
---|
47 | <feature extension="dita.conductor.lib.import" value="pluginA.jar" type="file"/>
|
---|
48 | <feature extension="dita.conductor.transtype.check" value="newoutput" type="txt"/>
|
---|
49 | <feature extension="dita.conductor.target" value="pluginA_antscript.xml" type="file"/>
|
---|
50 | <feature extension="dita.specialization.catalog" value="pluginA_catalog-dita.xml" type="file"/>
|
---|
51 | <feature extension="dita.xsl.xhtml" value="xsl/pluginA2xhtml.xsl" type="file"/>
|
---|
52 | </plugin>
|
---|
53 | </lines></stepxmp></substep>
|
---|
54 | <substep><cmd>Use <plugin></plugin> tagsto define the root element for
|
---|
55 | plugin.xml. Set the id attribute, which is uniqute and necessary for each
|
---|
56 | plug-in.</cmd></substep>
|
---|
57 | <substep><cmd>Under <plugin> element, use <require> element to specify
|
---|
58 | which plug-in is needed by pluginA. The plugin attribute is used to specify
|
---|
59 | the ID of the plug-in which is needed by pluginA. </cmd><info>This element
|
---|
60 | is not necessary if pluginA is loaded as an independent plug-in. However,
|
---|
61 | pluginA might not function after being loaded if another plug-in is needed,
|
---|
62 | which is not specified by a <require> element. </info></substep>
|
---|
63 | <substep><cmd>The <feature> tag specifies the extension point that is extended
|
---|
64 | and how it's extended in pluginA.</cmd><info> For example, <userinput><feature
|
---|
65 | extension="dita.xsl.xhtml" value="xsl/pluginA2xhtml.xsl" type="file"/></userinput> means
|
---|
66 | adding new specific logic transformed from DITA to xhtml into pluginA. The
|
---|
67 | logic is written in file xsl/pluginA2xhtml.xsl in pluginA directory. <userinput>type="file"</userinput> means
|
---|
68 | that the type of value is file name.</info><info>Another example, <userinput><feature
|
---|
69 | extension="dita.conductor.transtype.check" value="newoutput" type="txt"/></userinput> means
|
---|
70 | extending "dita.conductor.transtype.check" in pluginA. Another type of transformation
|
---|
71 | output for DITA-OT and the check logic for parameter transtype in DITA-OT
|
---|
72 | are to be added. The new transformation output is named <userinput>newoutput</userinput>. <userinput>type="txt"</userinput> means
|
---|
73 | the value is text not a file name.</info><info>There are certain <userinput>extension
|
---|
74 | point</userinput> which can be defined here. See <xref href="createplugin.xml#createplugin/extpoint"></xref> for
|
---|
75 | more details.</info></substep>
|
---|
76 | </substeps>
|
---|
77 | </step>
|
---|
78 | <step><cmd>Package all the subdirectories and files under pluginA to a zip
|
---|
79 | binary file. Create a DITA Open Toolkit plug-in file for distribution.</cmd>
|
---|
80 | </step>
|
---|
81 | <step><cmd>Test the usability of plug-in files when integrating into DITA
|
---|
82 | Opent Toolkit base.</cmd></step>
|
---|
83 | <step><cmd>Put the zip binary file on a Web site, such as the DITA OT SourceForge
|
---|
84 | Web site.</cmd></step>
|
---|
85 | </steps>
|
---|
86 | </taskbody>
|
---|
87 | </task>
|
---|