com.atlassian.plugin.web
Interface WebFragmentHelper


public interface WebFragmentHelper

Provides application specific methods to build/render web fragments


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

Method Detail

loadCondition

Condition loadCondition(String className,
                        Plugin plugin)
                        throws ConditionLoadingException
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

loadContextProvider

ContextProvider loadContextProvider(String className,
                                    Plugin plugin)
                                    throws ConditionLoadingException
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

getI18nValue

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

renderVelocityFragment

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


Copyright © 2010 Atlassian. All Rights Reserved.