com.atlassian.plugin.web
Interface WebFragmentHelper


public interface WebFragmentHelper

Provides application specific methods to build/render web fragments


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

Method Detail

loadCondition

Condition loadCondition(java.lang.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(java.lang.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

java.lang.String getI18nValue(java.lang.String key,
                              java.util.List<?> arguments,
                              java.util.Map<java.lang.String,java.lang.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

java.lang.String renderVelocityFragment(java.lang.String fragment,
                                        java.util.Map<java.lang.String,java.lang.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 © 2009 Atlassian Pty Ltd. All Rights Reserved.