java.lang.Object | |||
↳ | com.atlassian.plugin.descriptors.AbstractModuleDescriptor<T> | ||
↳ | com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor<T> | ||
↳ | com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor |
The web panel module declares a single web panel in atlassian-plugin.xml. Its XML element contains a location string that should match existing locations in the host application where web panels can be embedded.
A web panel also contains a single resource child element that contains the contents of the web panel. This can be plain HTML, or a (velocity) template to provide dynamic content.
A resource element's type
attribute identifies the format of the
panel's content (currently "static" and "velocity" are supported) which
allows the plugin framework to use the appropriate
WebPanelRenderer
.
A web panel's resource element can either contain its contents embedded in
the resource element itself, as part of the atlassian-plugin.xml
file, or it can link to a file on the classpath when the
location
attribute is used.
A web panel that contains static, embedded HTML:
<web-panel key="myPanel" location="general"> <resource name="view" type="static"><![CDATA[<b>Hello World!</b>]]></resource> </web-panel>
A web panel that contains an embedded velocity template:
<web-panel key="myPanel" location="general"> <resource name="view" type="velocity"><![CDATA[#set($name = 'foo')My name is $name]]></resource> </web-panel>
A web panel that contains uses a velocity template that is on the classpath (part of the plugin's jar file):
<web-panel key="myPanel" location="general"> <resource name="view" type="velocity" location="templates/pie.vm"/> </web-panel>
Finally it is also possible to provide your own custom class that is
responsible for producing the panel's HTML, by using the descriptor's
class
attribute:
<web-panel key="myPanel" location="general" class="com.example.FooWebPanel"/>Note that
FooWebPanel
must implement
WebPanel
.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | XML_ELEMENT_NAME | Host applications should use this string when registering the web panel module descriptor. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor
|
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor
| |||||||||||
From class
com.atlassian.plugin.descriptors.AbstractModuleDescriptor
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Disables the module descriptor.
| |||||||||||
Enables the descriptor by loading the module class.
| |||||||||||
Returns the location in the host application where the web panel should be embedded.
| |||||||||||
The particular module object created by this plugin.
| |||||||||||
Initialise a module given it's parent plugin and the XML element
representing the module.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Provides validation rules for the pattern
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor
| |||||||||||
From class
com.atlassian.plugin.descriptors.AbstractModuleDescriptor
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.plugin.ModuleDescriptor
| |||||||||||
From interface
com.atlassian.plugin.Resourced
| |||||||||||
From interface
com.atlassian.plugin.StateAware
| |||||||||||
From interface
com.atlassian.plugin.web.descriptors.ConditionalDescriptor
| |||||||||||
From interface
com.atlassian.plugin.web.descriptors.ContextAware
| |||||||||||
From interface
com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor
| |||||||||||
From interface
com.atlassian.plugin.web.descriptors.WebPanelModuleDescriptor
| |||||||||||
From interface
com.atlassian.plugin.web.descriptors.WeightedDescriptor
|
Host applications should use this string when registering the web panel module descriptor.
Disables the module descriptor. Classes overriding this method MUST call super.disabled() after their own disabling code.
Enables the descriptor by loading the module class. Classes overriding this method MUST call super.enabled() before their own enabling code.
Returns the location in the host application where the web panel should be embedded.
The particular module object created by this plugin.
Initialise a module given it's parent plugin and the XML element representing the module.
Since atlassian-plugins v2.2, you can no longer load classes from the
plugin in this method, because the OSGi bundle that they will live in is
not built yet. Load classes in the
enabled()
method instead.
plugin | The plugin that the module belongs to. Must not be null. |
---|---|
element | XML element representing the module. Must not be null. |
PluginParseException |
---|
Provides validation rules for the pattern
pattern | The validation pattern |
---|