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