info.magnolia.freemarker
Class FreemarkerUtil

java.lang.Object
  extended by info.magnolia.freemarker.FreemarkerUtil

public class FreemarkerUtil
extends java.lang.Object

A bunch of utility methods to render freemarker templates into Strings.

Version:
$Revision: $ ($Author: $)
Author:
Philipp Bracher, gjoseph
See Also:
FreemarkerHelper

Constructor Summary
FreemarkerUtil()
           
 
Method Summary
static java.lang.String createTemplateName(java.lang.Class klass, java.lang.String ext)
          Creates a template name based on the class name and adds the extension.
static java.lang.String createTemplateName(java.lang.Class klass, java.lang.String classifier, java.lang.String ext)
          Same as createTemplateName(Class, String) but adds the classifier between the template name and the extension.
static java.lang.String process(java.lang.Class klass, java.lang.Object thisObj)
          Uses the class to create the templates name and passes the object under the name 'this'.
static void process(java.lang.Class klass, java.lang.Object thisObj, java.io.Writer out)
           
static java.lang.String process(java.lang.Object thisObj)
          Uses the class of the object to create the templates name, passes the object under the name 'this' and returns the result in a String.
static java.lang.String process(java.lang.Object thisObj, java.lang.String classifier, java.lang.String ext)
          Same as process(Object) but adds the classifier and the extension to the template name.
static void process(java.lang.Object thisObj, java.lang.String classifier, java.lang.String ext, java.io.Writer out)
           
static void process(java.lang.Object thisObj, java.io.Writer out)
           
static java.lang.String process(java.lang.String name, java.util.Map data)
          Process this template with the passed data and returns the result in a String.
static void process(java.lang.String name, java.util.Map data, java.io.Writer writer)
          Process the template with the data and writes the result to the writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FreemarkerUtil

public FreemarkerUtil()
Method Detail

process

public static java.lang.String process(java.lang.Object thisObj)
Uses the class of the object to create the templates name, passes the object under the name 'this' and returns the result in a String. Used only in DialogMultiSelect - VersionCommentPopup - Inbox - SubPagesControl


process

public static void process(java.lang.Object thisObj,
                           java.io.Writer out)
See Also:
process(Object)

process

public static java.lang.String process(java.lang.Object thisObj,
                                       java.lang.String classifier,
                                       java.lang.String ext)
Same as process(Object) but adds the classifier and the extension to the template name.


process

public static void process(java.lang.Object thisObj,
                           java.lang.String classifier,
                           java.lang.String ext,
                           java.io.Writer out)
See Also:
process(Object, String, String)

process

public static java.lang.String process(java.lang.Class klass,
                                       java.lang.Object thisObj)
Uses the class to create the templates name and passes the object under the name 'this'. Uses "html" as template filename extension. Only used in AbstractSimpleSearchList and VersionsList.


process

public static void process(java.lang.Class klass,
                           java.lang.Object thisObj,
                           java.io.Writer out)
See Also:
process(Class, Object)

process

public static java.lang.String process(java.lang.String name,
                                       java.util.Map data)
Process this template with the passed data and returns the result in a String.


process

public static void process(java.lang.String name,
                           java.util.Map data,
                           java.io.Writer writer)
Process the template with the data and writes the result to the writer. TODO : move this to FreemarkerHelper


createTemplateName

public static java.lang.String createTemplateName(java.lang.Class klass,
                                                  java.lang.String ext)
Creates a template name based on the class name and adds the extension. If the class is org.mydomain.TheClass the returned name is /org/mydomain/TheClass.html.


createTemplateName

public static java.lang.String createTemplateName(java.lang.Class klass,
                                                  java.lang.String classifier,
                                                  java.lang.String ext)
Same as createTemplateName(Class, String) but adds the classifier between the template name and the extension.



Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.