
Xerlin Plugin Development GuideVersion 1.0July 7, 2002
Table of Contents1 Introduction2 Plugin Overview 2.1 Configuration 2.2 Classes 3 DTD Plugins 3.1 dtd-plugin 3.2 name 3.3 longName 3.4 version 3.5 author 3.6 url 3.7 dtd 3.7.1 file 3.7.2 doctype 3.7.3 publicID 3.7.4 systemID 3.8 editor 3.8.1 class 3.8.1.1 MerlotDOMEditor interface 3.8.2 element 3.9 defaultEditor 3.9.1 class 3.10 icon 3.10.1 element 3.11 tree-table 3.11.1 column 3.12 display-text 3.12.1 default-property-order 3.12.1.1 attribute-type 4 Action Plugins 4.1 action 4.1.1 menu 4.1.2 class 4.1.3 icon 4.1.4 tooltip 4.1.5 config 4.1.5.1 configitem AppendicesA ReferencesB DTD Plugin DTD C Action Plugin DTD 1 IntroductionThis document describes the Xerlin Plugin architecture, and how developers can use it to extend Xerlin with their own implementations. The plugin architecture is still rather new, so make sure you have the latest version of this document which matches the latest version of Xerlin you are using. Throughout this document, we will use examples from existing Xerlin plugins. 2 Plugin OverviewPlugins for Xerlin are provided in a bundled jar format similar to Web Applications [SERVLET]. These jar files contain the configuration of the plugin, its classes, and any resources such as icons and DTD files the plugin requires. 2.1 ConfigurationAlthough Xerlin supports different plugin types, all Xerlin plugins contain a "plugin.xml" file, which contains all of the configuration for that plugin. 2.2 Classes
There are two different ways to supply classes in a plugin.
Individual classes can be stored in a 3 DTD PluginsA DTD plugin allows you to customize Xerlin to support your specific DTD. These customizations include custom editors and icons that map to elements of the DTD. This section defines all of the different settings in plugin.xml for a DTD plugin. 3.1 dtd-plugin
The <file>dtd/vxml.dtd</file>
would be found in 3.2 name
The <name>VoiceXML</name> 3.3 longName
The <longName>Voice eXtensible Modeling Language Plugin for Xerlin</longName> 3.4 version
The <version>1.0</version> 3.5 author
The <author>Tim McCune</author> 3.6 url
The <url>http://www.xerlin.org</url> 3.7 dtd
The 3.7.1 file
The <file>dtd/vxml.dtd</file> 3.7.2 doctype
The <doctype>vxml</doctype> 3.7.3 publicID
The <publicID>-//VoiceXML Forum//Voice eXtensible Markup Language 1.0//EN</publicID> 3.7.4 systemID
The <systemID>http://www.voicexml.org/dtd/vxml1.0.dtd</systemID> 3.8 editor
The 3.8.1 class
The <class>org.merlotxml.merlot.plugins.vxml.AudioEditor</class> 3.8.1.1 MerlotDOMEditor interfaceCustom attribute editors must implement this interface. You can also extend GenericDOMEditor and/or GenericDOMEditPanel if you don't want to implement all the methods required by this interface. Look at GenericDOMEditor for an example of how to use this interface. Also look at the examples given in the example plugins in CVS. 3.8.2 element
The <element>audio</element> 3.9 defaultEditor
The 3.9.1 class
The <class>org.merlotxml.merlot.plugins.vxml.AudioEditor</class> 3.10 icon
The 3.10.1 element
The <icon source="icons/audio.gif" smallSource="icons/audio_s.gif"> <element>audio</element> </icon>
The following graphic demonstrates an editor from the VoiceXML
DTD plugin.
3.11 tree-table
The 3.11.1 column
The <tree-table>
<column name="Description" attribute="~"/>
<column name="Condition" attribute="condition"/>
</tree-table>
3.12 display-text
The 3.12.1 default-property-order
The 3.12.1.1 attribute-type
The <display-text>
<default-property-order>
<attribute-type name="CDATA"/>
<attribute-type name="IDREF"/>
<attribute-type name="CHILD_TEXT"/>
</default-property-order>
</display-text>
4 Action Plugins
A DTD plugin allows you to specify a custom action that will be
performed on the XML document that you are editing in Xerlin.
The 4.1 action
The 4.1.1 menu
The <menu>XSLT Processor</menu> 4.1.2 class
The <class>org.merlotxml.merlot.plugins.action.xslt.Plugin</class> 4.1.3 icon
The 4.1.4 tooltip
The 4.1.5 config
The 4.1.5.1 configitem
The <configitem name="output-extension">html</configitem> A References
B DTD Plugin DTD<!ELEMENT dtd-plugin (name, longName?, version?, author?, url?, (dtd | editor | icon)*, tree-table?, display-text?>
<!ELEMENT name (#PCDATA)>
<!ELEMENT longName (#PCDATA)>
<!ELEMENT version (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT url (#PCDATA)>
<!ELEMENT dtd (file, doctype, publicID, systemID)>
<!ELEMENT file (#PCDATA)>
<!ELEMENT doctype (#PCDATA)>
<!ELEMENT publicID (#PCDATA)>
<!ELEMENT systemID (#PCDATA)>
<!ELEMENT editor (class, element*)>
<!ELEMENT defaultEditor (class)>
<!ELEMENT class (#PCDATA)>
<!ELEMENT element (#PCDATA)>
<!ELEMENT icon (element*)>
<!ATTLIST icon source CDATA #REQUIRED
smallSource CDATA #REQUIRED>
<!ELEMENT tree-table (column+)>
<!ELEMENT column EMPTY>
<!ATTLIST column name CDATA #REQUIRED
attribute CDATA #REQUIRD>
<!ELEMENT display-text (default-property-order)>
<!ELEMENT default-property-order (attribute-type+)>
<!ELEMENT attribute-type EMPTY>
<!ATTLIST attribute-type name NMTOKEN #REQUIRED>
C Action Plugin DTD<!ELEMENT action-plugin (name, longName?, version?, author?, url?, action*)> <!ELEMENT name (#PCDATA)> <!ELEMENT longName (#PCDATA)> <!ELEMENT version (#PCDATA)> <!ELEMENT author (#PCDATA)> <!ELEMENT url (#PCDATA)> <!ELEMENT action (menu, class, icon?, tooltip?, config?)> <!ELEMENT menu (#PCDATA)> <!ELEMENT class (#PCDATA)> <!ELEMENT icon (#PCDATA)> <!ELEMENT tooltip (#PCDATA)> <!ELEMENT config (configitem*)> <!ELEMENT configitem (#PCDATA)> <!ATTLIST configitem name CDATA #REQUIRED> |