| java.lang.Object org.tigris.scarab.services.email.VelocityEmail
VelocityEmail | abstract public class VelocityEmail (Code) | | This is a simple static accessor to common Velocity tasks such as
getting an instance of a context as well as handling a request for
processing a template.
Context context = TurbineVelocity.getContext(data);
context.put("message", "Hello from Turbine!");
String results = TurbineVelocity.handleRequest(context, "helloWorld.vm");
data.getPage().getBody().addElement(results);
author: John D. McNally author: Jon S. Stevens author: Jason van Zyl author: Michael Stack version: $Id: VelocityEmail.java 7859 2003-05-03 22:12:58Z jon $ |
Method Summary | |
protected static VelocityEmailService | getService() | public static String | handleRequest(Context context, String template) This allows you to pass in a context and a path to a template
file and then grabs an instance of the velocity service and
processes the template and returns the results as a String
object.
Parameters: context - A Context. Parameters: template - The path to the template file. | public String | handleRequest(Context context, String template, String charset, String encoding) | public static void | handleRequest(Context context, String template, OutputStream out) Process the request and fill in the template with the values
you set in the Context. | public static void | handleRequest(Context context, String template, OutputStream out, String charset, String encoding) Process the request and fill in the template with the values
you set in the Context. | public static void | handleRequest(Context context, String filename, Writer writer) | public static void | handleRequest(Context context, String filename, Writer writer, String encoding) |
getService | protected static VelocityEmailService getService()(Code) | | Utility method for accessing the service
implementation
a VelocityEmailService implementation instance |
handleRequest | public static String handleRequest(Context context, String template) throws Exception(Code) | | This allows you to pass in a context and a path to a template
file and then grabs an instance of the velocity service and
processes the template and returns the results as a String
object.
Parameters: context - A Context. Parameters: template - The path to the template file. The processed template. exception: Exception - Error processing template. |
|
|