com.atlassian.plugin.web.renderer
Interface WebPanelRenderer

All Known Implementing Classes:
StaticWebPanelRenderer

public interface WebPanelRenderer

This interface allows the plugin system to be extended by adding new renderers for new markup formats. Currently the atlassian-template-renderer project provides a velocity implementation.

Since:
2.5.0
See Also:
com.atlassian.plugin.web.descriptors.WebPanelRendererModuleDescriptor#getModule()}

Method Summary
 java.lang.String getResourceType()
           
 void render(java.lang.String templateName, Plugin plugin, java.util.Map<java.lang.String,java.lang.Object> context, java.io.Writer writer)
          Renders the template to the writer.
 java.lang.String renderFragment(java.lang.String fragment, Plugin plugin, java.util.Map<java.lang.String,java.lang.Object> context)
          Renders the fragment using the given context and adding I18nResolver and WebResourceManager.
 

Method Detail

getResourceType

java.lang.String getResourceType()
Returns:
the name of the resource type supported by this renderer. <resource> elements defined in plugin descriptors to be rendered by this renderer should specify this String as their type attribute.

render

void render(java.lang.String templateName,
            Plugin plugin,
            java.util.Map<java.lang.String,java.lang.Object> context,
            java.io.Writer writer)
            throws RendererException,
                   java.io.IOException
Renders the template to the writer.

Parameters:
templateName - file name of the template to render
plugin - the context plugin. Used, for example, to resolve templates and other resources from the classpath via Plugin.getClassLoader()
context - Map of objects to make available in the template rendering process
writer - where to write the rendered template
Throws:
RendererException - thrown if there is an internal exception when rendering the template
java.io.IOException - thrown if there is a problem reading the template file or writing to the writer

renderFragment

java.lang.String renderFragment(java.lang.String fragment,
                                Plugin plugin,
                                java.util.Map<java.lang.String,java.lang.Object> context)
                                throws RendererException
Renders the fragment using the given context and adding I18nResolver and WebResourceManager.

Parameters:
fragment - template fragment to render
plugin - the context plugin. Used, for example, to resolve templates and other resources from the classpath via Plugin.getClassLoader()
context - Map of objects to make available in the template rendering process
Returns:
rendered template
Throws:
RendererException - thrown if there is an internal exception when rendering the template


Copyright © 2010 Atlassian. All Rights Reserved.