public interface

WebFragmentHelper

com.atlassian.plugin.web.WebFragmentHelper

Class Overview

Provides application specific methods to build/render web fragments

Summary

Public Methods
String getI18nValue(String key, List<?> arguments, Map<StringObject> context)
Look up a message key in the application
Condition loadCondition(String className, Plugin plugin)
This method is deprecated. Since 2.7.0, will use HostContainer.create in future versions
ContextProvider loadContextProvider(String className, Plugin plugin)
Creates a context provider instance.
String renderVelocityFragment(String fragment, Map<StringObject> context)
Renders the string fragment as a Velocity template

Public Methods

public String getI18nValue (String key, List<?> arguments, Map<StringObject> 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 Condition loadCondition (String className, Plugin plugin)

This method is deprecated.
Since 2.7.0, will use HostContainer.create in future versions

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 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 * @deprecated Since 2.7.0, will use HostContainer.create in future versions

public String renderVelocityFragment (String fragment, Map<StringObject> 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