com.atlassian.jira.issue.fields.renderer.wiki
Class AtlassianWikiRenderer

java.lang.Object
  extended by com.atlassian.jira.issue.fields.renderer.wiki.AtlassianWikiRenderer
All Implemented Interfaces:
JiraRendererPlugin, org.springframework.beans.factory.DisposableBean

public class AtlassianWikiRenderer
extends Object
implements JiraRendererPlugin, org.springframework.beans.factory.DisposableBean

Implementation of the a renderer plugin that exposes the Wiki renderer within Jira.


Field Summary
static String ISSUE_CONTEXT_KEY
           
static String RENDERER_TYPE
           
 
Constructor Summary
AtlassianWikiRenderer(com.atlassian.event.api.EventPublisher eventPublisher, VelocityRequestContextFactory velocityRequestContextFactory)
           
 
Method Summary
 void destroy()
           
 JiraRendererModuleDescriptor getDescriptor()
          Simple accessor method for the module descriptor.
 String getRendererType()
          Returns a unique identifier for this renderer plugin.
 void init(JiraRendererModuleDescriptor jiraRendererModuleDescriptor)
          This allows a plugin to get a handle on the module descriptor that spawned the plugin.
 String render(String value, IssueRenderContext context)
          This will render the provided value within the provided context and produce a rendered output.
 String renderAsText(String value, IssueRenderContext context)
          This will render the provided value within the provided context and produce a rendered output that is text readable.
 Object transformForEdit(Object rawValue)
          This allows the renderer to perform a transformation on the raw value before populating an editable component with the value.
 Object transformFromEdit(Object editValue)
          This allows the renderer to perform a transformation on the submitted edit value before storing the value in the system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISSUE_CONTEXT_KEY

public static final String ISSUE_CONTEXT_KEY
See Also:
Constant Field Values

RENDERER_TYPE

public static final String RENDERER_TYPE
See Also:
Constant Field Values
Constructor Detail

AtlassianWikiRenderer

public AtlassianWikiRenderer(com.atlassian.event.api.EventPublisher eventPublisher,
                             VelocityRequestContextFactory velocityRequestContextFactory)
Method Detail

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface org.springframework.beans.factory.DisposableBean
Throws:
Exception

render

public String render(String value,
                     IssueRenderContext context)
Description copied from interface: JiraRendererPlugin
This will render the provided value within the provided context and produce a rendered output.

Specified by:
render in interface JiraRendererPlugin
Parameters:
value - the raw value to render.
context - the issue context for this rendering
Returns:
the transformed value having passed through the rendering process.

renderAsText

public String renderAsText(String value,
                           IssueRenderContext context)
Description copied from interface: JiraRendererPlugin
This will render the provided value within the provided context and produce a rendered output that is text readable.

Specified by:
renderAsText in interface JiraRendererPlugin
Parameters:
value - the raw value to render.
context - the issue context for this rendering
Returns:
the transformed value having passed through the rendering process, the value must be text readable.

getRendererType

public String getRendererType()
Description copied from interface: JiraRendererPlugin
Returns a unique identifier for this renderer plugin.

Specified by:
getRendererType in interface JiraRendererPlugin
Returns:
the unique identifier for this renderer plugin implmentation.

transformForEdit

public Object transformForEdit(Object rawValue)
Description copied from interface: JiraRendererPlugin
This allows the renderer to perform a transformation on the raw value before populating an editable component with the value. This can be useful if the value being stored is a different format (i.e. wiki markup), than the edit component expects (i.e. wysiwig edit control that expects html). NOTE: this method need not do anything if the edit control can handle the value as stored in the system.

Specified by:
transformForEdit in interface JiraRendererPlugin
Parameters:
rawValue - is the value stored in the system, before transform.
Returns:
the value in a form that the renderers edit control expects.

transformFromEdit

public Object transformFromEdit(Object editValue)
Description copied from interface: JiraRendererPlugin
This allows the renderer to perform a transformation on the submitted edit value before storing the value in the system. This can be useful if the value being submitted is a different format (i.e. html markup that the edit control generates), than the system expects to store (i.e. wiki markup). NOTE: this method need not do anything if the system is happy to store the value the edit control produces.

Specified by:
transformFromEdit in interface JiraRendererPlugin
Parameters:
editValue - is the value produced by the edit control.
Returns:
the value in a form that the system expects to store.

init

public void init(JiraRendererModuleDescriptor jiraRendererModuleDescriptor)
Description copied from interface: JiraRendererPlugin
This allows a plugin to get a handle on the module descriptor that spawned the plugin.

Specified by:
init in interface JiraRendererPlugin
Parameters:
jiraRendererModuleDescriptor - is the module descriptor that spawned the plugin. If the plugin uses resources, such as velocity templates, then access can be gained through this descriptor.

getDescriptor

public JiraRendererModuleDescriptor getDescriptor()
Description copied from interface: JiraRendererPlugin
Simple accessor method for the module descriptor.

Specified by:
getDescriptor in interface JiraRendererPlugin
Returns:
the module descriptor that spawned this renderer.


Copyright © 2002-2014 Atlassian. All Rights Reserved.