public class VelocityRender extends ServiceBase implements Service
Configuration parameters:
The velocity templates are run in a context with the following variables set.
| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIG_FILENAME |
static String |
FILTER_NAME |
protected boolean |
isProduction |
static String |
MACRO_FILE |
static String |
MANUAL_PARAM |
static String |
PLUGIN_PARAM |
protected com.hp.hpl.jena.shared.PrefixMapping |
prefixes |
static String |
PREFIXES_FILE |
static String |
PRODUCTION_PARAM |
static String |
ROOT_PARAM |
protected String |
rootURI |
protected File |
templateDir |
static String |
TEMPLATES_PARAM |
protected org.apache.velocity.app.VelocityEngine |
ve |
config| Constructor and Description |
|---|
VelocityRender() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.velocity.VelocityContext |
buildContext(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Map<String,Object> env) |
com.hp.hpl.jena.shared.PrefixMapping |
getPrefixes() |
void |
init(Map<String,String> config,
javax.servlet.ServletContext context) |
void |
postInit() |
boolean |
render(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Map<String,Object> env)
Find velocity template that matches the request path.
|
void |
render(String templateName,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Map<String,Object> env)
Render the given template,
|
javax.ws.rs.core.StreamingOutput |
render(String templateName,
String requestURI,
javax.servlet.ServletContext context,
javax.ws.rs.core.MultivaluedMap<String,String> parameters,
Object... args)
Variant of render suitable for use from jax-rs implementations.
|
void |
setPrefixes(com.hp.hpl.jena.shared.PrefixMapping pm) |
getFileParam, getNamedService, getRequiredFileParam, getRequiredIntParam, getRequiredParam, postPostInitclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpostPostInitpublic static final String TEMPLATES_PARAM
public static final String ROOT_PARAM
public static final String PRODUCTION_PARAM
public static final String CONFIG_FILENAME
public static final String PREFIXES_FILE
public static final String MACRO_FILE
public static final String FILTER_NAME
public static final String PLUGIN_PARAM
public static final String MANUAL_PARAM
protected org.apache.velocity.app.VelocityEngine ve
protected boolean isProduction
protected File templateDir
protected String rootURI
protected com.hp.hpl.jena.shared.PrefixMapping prefixes
public void init(Map<String,String> config, javax.servlet.ServletContext context)
init in interface Serviceinit in class ServiceBasepublic void postInit()
postInit in interface ServicepostInit in class ServiceBasepublic boolean render(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Map<String,Object> env)
public void render(String templateName, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Map<String,Object> env) throws org.apache.velocity.exception.ResourceNotFoundException, IOException
org.apache.velocity.exception.ResourceNotFoundExceptionIOExceptionpublic javax.ws.rs.core.StreamingOutput render(String templateName, String requestURI, javax.servlet.ServletContext context, javax.ws.rs.core.MultivaluedMap<String,String> parameters, Object... args)
templateName - the template to renderargs - an alternative sequence of names and java objects to inject into the environmentpublic void setPrefixes(com.hp.hpl.jena.shared.PrefixMapping pm)
public com.hp.hpl.jena.shared.PrefixMapping getPrefixes()
Copyright © 2014. All rights reserved.