public class VelocityServiceImpl extends Object implements VelocityService
| Constructor and Description |
|---|
VelocityServiceImpl(PortalManager portalManager,
DynamicPageCache pageCache)
Construct and configure the Velocity service.
|
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getResource(String resourcePath)
Gets a Velocity resource.
|
InputStream |
getResource(String portalId,
String resourceName)
Gets a Velocity resource.
|
void |
renderTemplate(String portalId,
String templateName,
org.apache.velocity.context.Context context,
Writer writer)
Renders a Velocity template with the given context.
|
String |
resourceExists(String portalId,
String resourceName)
Resolves the given resource to a valid Velocity resource if possible.
|
public VelocityServiceImpl(PortalManager portalManager, DynamicPageCache pageCache)
portalManager - PortalManager instancepageCache - DynamicPageCache instancepublic InputStream getResource(String resourcePath)
getResource in interface VelocityServiceresourcePath - valid Velocity resource pathpublic InputStream getResource(String portalId, String resourceName)
getResource in interface VelocityServiceportalId - the portal to get the resource fromresourceName - the resource to getpublic String resourceExists(String portalId, String resourceName)
resourceExists in interface VelocityServiceportalId - the portal to get the resource fromresourceName - the resource to checkpublic void renderTemplate(String portalId, String templateName, org.apache.velocity.context.Context context, Writer writer) throws Exception
renderTemplate in interface VelocityServiceportalId - the portal to render the resource fromtemplateName - the template to rendercontext - the Velocity context to renderwriter - a writer to output the render result toException - if an error occurred while rendering the templateCopyright © 2009-2016. All Rights Reserved.