public class

AtlassianWikiRenderer

extends Object
implements JiraRendererPlugin DisposableBean
java.lang.Object
   ↳ com.atlassian.jira.issue.fields.renderer.wiki.AtlassianWikiRenderer

Class Overview

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

Summary

Constants
String ISSUE_CONTEXT_KEY
String RENDERER_TYPE
Public Constructors
AtlassianWikiRenderer(EventPublisher eventPublisher, VelocityRequestContextFactory velocityRequestContextFactory)
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.fields.renderer.JiraRendererPlugin
From interface org.springframework.beans.factory.DisposableBean

Constants

public static final String ISSUE_CONTEXT_KEY

Constant Value: "jira.issue"

public static final String RENDERER_TYPE

Constant Value: "atlassian-wiki-renderer"

Public Constructors

public AtlassianWikiRenderer (EventPublisher eventPublisher, VelocityRequestContextFactory velocityRequestContextFactory)

Public Methods

public void destroy ()

Throws
Exception

public JiraRendererModuleDescriptor getDescriptor ()

Simple accessor method for the module descriptor.

Returns
  • the module descriptor that spawned this renderer.

public String getRendererType ()

Returns a unique identifier for this renderer plugin.

Returns
  • the unique identifier for this renderer plugin implmentation.

public void init (JiraRendererModuleDescriptor jiraRendererModuleDescriptor)

This allows a plugin to get a handle on the module descriptor that spawned the plugin.

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.

public String render (String value, IssueRenderContext context)

This will render the provided value within the provided context and produce a rendered output.

Parameters
value the raw value to render.
context the issue context for this rendering
Returns
  • the transformed value having passed through the rendering process.

public 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.

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.

public Object transformForEdit (Object rawValue)

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.

Parameters
rawValue is the value stored in the system, before transform.
Returns
  • the value in a form that the renderers edit control expects.

public Object transformFromEdit (Object editValue)

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.

Parameters
editValue is the value produced by the edit control.
Returns
  • the value in a form that the system expects to store.