public interface

WebFragmentHelper

com.atlassian.plugin.web.WebFragmentHelper

Class Overview

Provides application specific methods to build/render web fragments

Summary

Public Methods
abstract String getI18nValue(String key, List<?> arguments, Map<String, Object> context)
Look up a message key in the application
abstract Condition loadCondition(String className, Plugin plugin)
Creates a condition instance.
abstract ContextProvider loadContextProvider(String className, Plugin plugin)
Creates a context provider instance.
abstract String renderVelocityFragment(String fragment, Map<String, Object> context)
Renders the string fragment as a Velocity template

Public Methods

public abstract String getI18nValue (String key, List<?> arguments, Map<String, Object> context)

Look up a message key in the application

Parameters
key The message key
arguments The arguments to use to replace tokens with any expressions already processed
context The context (optional)
Returns
  • The text message

public abstract Condition loadCondition (String className, Plugin plugin)

Creates a condition instance. The following process should be used:

  1. Load the class via the plugin instance
  2. Instantiate the class using the plugin if it implements AutowireCapablePlugin
  3. If not, instantiate the class with the host container
Parameters
className the condition class name
plugin the plugin from which the condition came
Returns
  • the condition instance
Throws
ConditionLoadingException If the condition was unable to be created

public abstract ContextProvider loadContextProvider (String className, Plugin plugin)

Creates a context provider instance. The following process should be used:

  1. Load the class via the plugin instance
  2. Instantiate the class using the plugin if it implements AutowireCapablePlugin
  3. If not, instantiate the class with the host container
Parameters
className the context provider class name
plugin the plugin from which the context provider came
Returns
  • the context provider instance
Throws
ConditionLoadingException If the context provider was unable to be created

public abstract String renderVelocityFragment (String fragment, Map<String, Object> context)

Renders the string fragment as a Velocity template

Parameters
fragment The string fragment to render
context The context to use as the base of the Velocity context
Returns
  • The rendered string