org.pentaho.platform.engine.services.runtime
Class TemplateUtil

java.lang.Object
  extended by org.pentaho.platform.engine.services.runtime.TemplateUtil

public class TemplateUtil
extends Object


Constructor Summary
TemplateUtil()
           
 
Method Summary
static void applyTableTemplate(String template, Properties inputs, Pattern parameterPattern, StringBuffer results)
           
static String applyTemplate(String template, IRuntimeContext context)
           
static String applyTemplate(String template, IRuntimeContext context, IParameterResolver resolver)
           
static String applyTemplate(String template, IRuntimeContext context, String parameterPatternStr)
           
static String applyTemplate(String template, Properties inputs, IParameterResolver resolver)
           
static String applyTemplate(String template, Properties inputs, Pattern parameterPattern, IParameterResolver resolver)
          Processes a template by processing the parameters declared in the template.
static String applyTemplate(String template, String name, String value)
           
static String applyTemplate(String template, String name, String[] value)
           
static String getSystemInput(String inputName, IRuntimeContext context)
           
static Properties parametersToProperties(IParameterProvider parameterProvider)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateUtil

public TemplateUtil()
Method Detail

getSystemInput

public static String getSystemInput(String inputName,
                                    IRuntimeContext context)

applyTemplate

public static String applyTemplate(String template,
                                   IRuntimeContext context,
                                   IParameterResolver resolver)

applyTemplate

public static String applyTemplate(String template,
                                   IRuntimeContext context)

applyTemplate

public static String applyTemplate(String template,
                                   IRuntimeContext context,
                                   String parameterPatternStr)

applyTemplate

public static String applyTemplate(String template,
                                   Properties inputs,
                                   IParameterResolver resolver)

applyTemplate

public static String applyTemplate(String template,
                                   Properties inputs,
                                   Pattern parameterPattern,
                                   IParameterResolver resolver)
Processes a template by processing the parameters declared in the template. The parameters to be replaced are enclosed in curly brackets. Parameters can be the input values (as specified by the name of the input value) or date expressions. Parameters that can not be processed are left in the template.

Parameters:
template - the template specification.
input - the input values communicated as a Properties.
locale - the locale to use for the formatting of date expression. If null, the locale for the thread is used. If no locale for the thread, then the default locale is used.
Throws:
IllegalArgumentException - if a date expression is illegal
See Also:
DateMath.calculateDateString(Calendar, String), PentahoSystem#getLocale(), PentahoSystem#getDefaultLocale()

applyTableTemplate

public static void applyTableTemplate(String template,
                                      Properties inputs,
                                      Pattern parameterPattern,
                                      StringBuffer results)

applyTemplate

public static String applyTemplate(String template,
                                   String name,
                                   String value)

applyTemplate

public static String applyTemplate(String template,
                                   String name,
                                   String[] value)

parametersToProperties

public static Properties parametersToProperties(IParameterProvider parameterProvider)