com.atlassian.plugin.web.model
Class EmbeddedTemplateWebPanel

java.lang.Object
  extended by com.atlassian.plugin.web.model.AbstractWebPanel
      extended by com.atlassian.plugin.web.model.EmbeddedTemplateWebPanel
All Implemented Interfaces:
WebPanel

public class EmbeddedTemplateWebPanel
extends AbstractWebPanel

This class is used for web panel declaration that do not have a custom class attribute in their descriptor, nor a location attribute in their resource child element.

This class reads the web panel's content from the resource element's content.

Since:
2.5.0
See Also:
DefaultWebPanelModuleDescriptor

Field Summary
 
Fields inherited from class com.atlassian.plugin.web.model.AbstractWebPanel
plugin
 
Constructor Summary
EmbeddedTemplateWebPanel(PluginAccessor pluginAccessor)
           
 
Method Summary
 String getHtml(Map<String,Object> context)
          Returns the HTML that will be placed in the host application's page.
 void setTemplateBody(String templateBody)
           
 void writeHtml(Writer writer, Map<String,Object> context)
          Default implementation of WebPanel.writeHtml(java.io.Writer, java.util.Map) that delegates to WebPanel.getHtml(java.util.Map).
 
Methods inherited from class com.atlassian.plugin.web.model.AbstractWebPanel
getRenderer, setPlugin, setResourceType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmbeddedTemplateWebPanel

public EmbeddedTemplateWebPanel(PluginAccessor pluginAccessor)
Method Detail

setTemplateBody

public void setTemplateBody(String templateBody)
Parameters:
templateBody - the body of the web panel (may contain any content type such as velocity or just static HTML) that was inlined in atlassian-plugin.xml

writeHtml

public void writeHtml(Writer writer,
                      Map<String,Object> context)
               throws IOException
Description copied from class: AbstractWebPanel
Default implementation of WebPanel.writeHtml(java.io.Writer, java.util.Map) that delegates to WebPanel.getHtml(java.util.Map). This method is provided for backwards compatibility with pre-2.11 implementations of WebPanel. Panels SHOULD be upgraded to support this method natively for performance reasons.

Specified by:
writeHtml in interface WebPanel
Overrides:
writeHtml in class AbstractWebPanel
Parameters:
writer - the writer to append the panel output to
context - the contextual information that can be used during rendering. Context elements are not standardized and are application-specific, so refer to your application's documentation to learn what is available.
Throws:
IOException - if there is some problem writing to the supplied writer

getHtml

public String getHtml(Map<String,Object> context)
Description copied from interface: WebPanel
Returns the HTML that will be placed in the host application's page.

Parameters:
context - the contextual information that can be used during rendering. Context elements are not standardized and are application-specific, so refer to your application's documentation to learn what is available.
Returns:
the HTML that will be placed in the host application's page.


Copyright © 2013 Atlassian. All Rights Reserved.