Confluence Docs 2.10 : Module Type Plugins
This page last changed on Dec 02, 2008 by smaddox.
On this page: Error formatting macro: toc: java.lang.NullPointerException
Purpose of this Module TypeModule Type plugin modules allow you to dynamically add new plugin module types to the plugin framework, generally building on other plugin modules. For example, a plugin developer could create a <dictionary> plugin module that is used to feed a dictionary service used by still other plugins. ConfigurationThe root element for the Module Type plugin module is module-type. It allows the following attributes and child elements for configuration: Attributes
Elements
ExampleHere is an example atlassian-plugin.xml file containing a plugin module type: <atlassian-plugin name="Hello World" key="example.plugin.helloworld" pluginsVersion="2"> <plugin-info> <description>A dictionary module type test</description> <vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/> <version>1.0</version> </plugin-info> <module-type key="dictionary" class="example.plugin.DictionaryModuleDescriptor" /> </atlassian-plugin> The Java code for DictionaryModuleDescriptor could look like this: public class DictionaryModuleDescriptor extends AbstractModuleDescriptor<Dictionary> { private String language; @Override public void init(Plugin plugin, Element element) throws PluginParseException { super.init(plugin, element); language = element.attributeValue("lang"); } public Dictionary getModule() { return (Dictionary)((AutowireCapablePlugin)plugin).autowire(getModuleClass()); } public String getLanguage() { return language; } } This will add the new module type 'dictionary' to the plugin framework, allowing other plugins to use the new module type. Here is a plugin that uses the new 'dictionary' module type: <atlassian-plugin name="Hello World" key="example.plugin.helloworld" pluginsVersion="2"> <plugin-info> <description>An english dictionary</description> <vendor name="Atlassian Software Systems" url="http://www.atlassian.com"/> <version>1.0</version> </plugin-info> <dictionary key="english" class="example.plugin.english.MyDictionary" /> </atlassian-plugin> NotesSome information to be aware of when developing or configuring a Module Type plugin module:
RELATED TOPICSWriting Confluence Plugins |
![]() |
Document generated by Confluence on Dec 03, 2008 15:14 |