|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.tigris.scarab.services.email.VelocityEmail
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);
| Constructor Summary | |
VelocityEmail()
|
|
| Method Summary | |
protected static VelocityEmailService |
getService()
Utility method for accessing the service implementation |
static java.lang.String |
handleRequest(org.apache.velocity.context.Context context,
java.lang.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. |
static void |
handleRequest(org.apache.velocity.context.Context context,
java.lang.String template,
java.io.OutputStream out)
Process the request and fill in the template with the values you set in the Context. |
static void |
handleRequest(org.apache.velocity.context.Context context,
java.lang.String template,
java.io.OutputStream out,
java.lang.String charset,
java.lang.String encoding)
Process the request and fill in the template with the values you set in the Context. |
java.lang.String |
handleRequest(org.apache.velocity.context.Context context,
java.lang.String template,
java.lang.String charset,
java.lang.String encoding)
|
static void |
handleRequest(org.apache.velocity.context.Context context,
java.lang.String filename,
java.io.Writer writer)
|
static void |
handleRequest(org.apache.velocity.context.Context context,
java.lang.String filename,
java.io.Writer writer,
java.lang.String encoding)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public VelocityEmail()
| Method Detail |
protected static VelocityEmailService getService()
public static java.lang.String handleRequest(org.apache.velocity.context.Context context,
java.lang.String template)
throws java.lang.Exception
context - A Context.template - The path to the template file.
java.lang.Exception - Error processing template.
public java.lang.String handleRequest(org.apache.velocity.context.Context context,
java.lang.String template,
java.lang.String charset,
java.lang.String encoding)
throws java.lang.Exception
java.lang.ExceptionVelocityEmailService.handleRequest(Context,
String, String, String)
public static void handleRequest(org.apache.velocity.context.Context context,
java.lang.String template,
java.io.OutputStream out)
throws java.lang.Exception
context - A Context.out - A OutputStream where we will write the process template as
a String.
java.lang.Exception - Error processing template.VelocityEmailService.handleRequest(Context,
String, OutputStream)
public static void handleRequest(org.apache.velocity.context.Context context,
java.lang.String template,
java.io.OutputStream out,
java.lang.String charset,
java.lang.String encoding)
throws java.lang.Exception
context - A Context.template - The path to the template file.out - A OutputStream where we will write the process template as
a String.charset - The character set to use when writing the result.encoding - The encoding to use when merging context and template.
java.lang.Exception - Error processing template.VelocityEmailService.handleRequest(Context,
String, OutputStream)
public static void handleRequest(org.apache.velocity.context.Context context,
java.lang.String filename,
java.io.Writer writer)
throws org.apache.fulcrum.ServiceException
org.apache.fulcrum.ServiceExceptionVelocityEmailService.handleRequest(Context,
String, Writer)
public static void handleRequest(org.apache.velocity.context.Context context,
java.lang.String filename,
java.io.Writer writer,
java.lang.String encoding)
throws org.apache.fulcrum.ServiceException
org.apache.fulcrum.ServiceExceptionVelocityEmailService.handleRequest(Context,
String, Writer, String)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||