public class DefaultWebPanelModuleDescriptor extends AbstractWebFragmentModuleDescriptor<WebPanel> implements WebPanelModuleDescriptor
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.
| Modifier and Type | Field and Description |
|---|---|
static String |
XML_ELEMENT_NAME
Host applications should use this string when registering the web panel
module descriptor.
|
condition, contextProvider, element, label, params, tooltip, webInterfaceManager| Constructor and Description |
|---|
DefaultWebPanelModuleDescriptor(com.atlassian.plugin.hostcontainer.HostContainer hostContainer,
com.atlassian.plugin.module.ModuleFactory moduleClassFactory,
WebInterfaceManager webInterfaceManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
disabled() |
void |
enabled() |
String |
getLocation()
Returns the location in the host application where the web panel should be embedded.
|
WebPanel |
getModule() |
int |
getWeight() |
void |
init(com.atlassian.plugin.Plugin plugin,
org.dom4j.Element element) |
protected void |
provideValidationRules(com.atlassian.plugin.util.validation.ValidationPattern pattern) |
equals, getCondition, getContextProvider, getTooltip, getWebLabel, getWebParams, hashCode, makeCondition, makeConditions, makeConditions, makeContextProvider, setWebInterfaceManagerassertModuleClassImplements, checkPermissions, destroy, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getModuleClassName, getName, getParams, getPlugin, getPluginKey, getRequiredPermissions, getResourceDescriptor, getResourceDescriptors, getResourceLocation, getScopeKey, isBroken, isEnabled, isEnabledByDefault, isSystemModule, loadClass, satisfiesMinJavaVersion, setBroken, setPlugin, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCondition, getTooltip, getWebLabel, getWebParamsdestroy, equals, getCompleteKey, getDescription, getDescriptionKey, getDisplayName, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, hashCode, isBroken, isEnabled, isEnabledByDefault, isSystemModule, satisfiesMinJavaVersion, setBrokengetResourceDescriptor, getResourceDescriptors, getResourceLocationgetContextProviderpublic static final String XML_ELEMENT_NAME
public DefaultWebPanelModuleDescriptor(com.atlassian.plugin.hostcontainer.HostContainer hostContainer,
com.atlassian.plugin.module.ModuleFactory moduleClassFactory,
WebInterfaceManager webInterfaceManager)
public void init(com.atlassian.plugin.Plugin plugin,
org.dom4j.Element element)
throws com.atlassian.plugin.PluginParseException
init in interface com.atlassian.plugin.ModuleDescriptor<WebPanel>init in class AbstractWebFragmentModuleDescriptor<WebPanel>com.atlassian.plugin.PluginParseExceptionprotected void provideValidationRules(com.atlassian.plugin.util.validation.ValidationPattern pattern)
provideValidationRules in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<WebPanel>public String getLocation()
WebPanelModuleDescriptorgetLocation in interface WebPanelModuleDescriptorpublic int getWeight()
getWeight in interface WebFragmentModuleDescriptor<WebPanel>getWeight in interface WeightedDescriptorgetWeight in class AbstractWebFragmentModuleDescriptor<WebPanel>public WebPanel getModule()
public void enabled()
enabled in interface com.atlassian.plugin.StateAwareenabled in class AbstractWebFragmentModuleDescriptor<WebPanel>public void disabled()
disabled in interface com.atlassian.plugin.StateAwaredisabled in class AbstractWebFragmentModuleDescriptor<WebPanel>Copyright © 2021 Atlassian. All rights reserved.