|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.descriptors.AbstractModuleDescriptor<T>
com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor<WebPanel>
com.atlassian.plugin.web.descriptors.DefaultWebPanelModuleDescriptor
public class 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.
| Field Summary | |
|---|---|
static String |
XML_ELEMENT_NAME
Host applications should use this string when registering the web panel module descriptor. |
| Fields inherited from class com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor |
|---|
condition, contextProvider, element, label, params, tooltip, webInterfaceManager |
| Fields inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor |
|---|
moduleClass, moduleClassName, moduleFactory, plugin, resources, singleton |
| Fields inherited from interface com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor |
|---|
COMPOSITE_TYPE_AND, COMPOSITE_TYPE_OR |
| Constructor Summary | |
|---|---|
DefaultWebPanelModuleDescriptor(HostContainer hostContainer,
ModuleFactory moduleClassFactory,
WebInterfaceManager webInterfaceManager)
|
|
| Method Summary | |
|---|---|
void |
disabled()
Disables the module descriptor. |
void |
enabled()
Enables the descriptor by loading the module class. |
String |
getLocation()
Returns the location in the host application where the web panel should be embedded. |
WebPanel |
getModule()
The particular module object created by this plugin. |
int |
getWeight()
|
void |
init(Plugin plugin,
org.dom4j.Element element)
Initialise a module given it's parent plugin and the XML element representing the module. |
protected void |
provideValidationRules(ValidationPattern pattern)
Provides validation rules for the pattern |
| Methods inherited from class com.atlassian.plugin.web.descriptors.AbstractWebFragmentModuleDescriptor |
|---|
equals, getCondition, getContextProvider, getTooltip, getWebLabel, getWebParams, hashCode, makeCondition, makeConditions, makeConditions, makeContextProvider, setWebInterfaceManager |
| Methods inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor |
|---|
assertModuleClassImplements, destroy, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation, isEnabledByDefault, isSingleton, isSingletonByDefault, isSystemModule, loadClass, loadClass, satisfiesMinJavaVersion, setPlugin, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.atlassian.plugin.web.descriptors.WebFragmentModuleDescriptor |
|---|
getCondition, getTooltip, getWebLabel, getWebParams |
| Methods inherited from interface com.atlassian.plugin.ModuleDescriptor |
|---|
destroy, equals, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, hashCode, isEnabledByDefault, isSystemModule, satisfiesMinJavaVersion |
| Methods inherited from interface com.atlassian.plugin.Resourced |
|---|
getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation |
| Methods inherited from interface com.atlassian.plugin.web.descriptors.ContextAware |
|---|
getContextProvider |
| Field Detail |
|---|
public static final String XML_ELEMENT_NAME
| Constructor Detail |
|---|
public DefaultWebPanelModuleDescriptor(HostContainer hostContainer,
ModuleFactory moduleClassFactory,
WebInterfaceManager webInterfaceManager)
| Method Detail |
|---|
public void init(Plugin plugin,
org.dom4j.Element element)
throws PluginParseException
ModuleDescriptor
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
AbstractModuleDescriptor.enabled()
method instead.
init in interface ModuleDescriptor<WebPanel>init in class AbstractWebFragmentModuleDescriptor<WebPanel>plugin - The plugin that the module belongs to. Must not be null.element - XML element representing the module. Must not be null.
PluginParseException - Can be thrown if an error occurs while
parsing the XML element.protected void provideValidationRules(ValidationPattern pattern)
AbstractModuleDescriptor
provideValidationRules in class AbstractModuleDescriptor<WebPanel>pattern - The validation patternpublic String getLocation()
WebPanelModuleDescriptor
getLocation in interface WebPanelModuleDescriptorpublic int getWeight()
getWeight in interface WebFragmentModuleDescriptor<WebPanel>getWeight in interface WeightedDescriptorgetWeight in class AbstractWebFragmentModuleDescriptor<WebPanel>public WebPanel getModule()
ModuleDescriptor
getModule in interface ModuleDescriptor<WebPanel>getModule in class AbstractModuleDescriptor<WebPanel>ModuleDescriptor.getModuleClass()public void enabled()
AbstractModuleDescriptor
enabled in interface StateAwareenabled in class AbstractWebFragmentModuleDescriptor<WebPanel>public void disabled()
AbstractModuleDescriptor
disabled in interface StateAwaredisabled in class AbstractWebFragmentModuleDescriptor<WebPanel>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||