com.googlecode.fascinator.portal.services
Interface VelocityService

All Known Implementing Classes:
VelocityServiceImpl

public interface VelocityService

Service to render and retrieve resources from Velocity.

Author:
Oliver Lucido

Method Summary
 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)
          Gets the resolved path to the specified resource.
 

Method Detail

getResource

InputStream getResource(String resourcePath)
Gets a Velocity resource.

Parameters:
resourcePath - a valid Velocity resource
Returns:
resource stream or null if not found

getResource

InputStream getResource(String portalId,
                        String resourceName)
Gets a Velocity resource.

Parameters:
portalId - the portal to get the resource from
resourceName - the resource to get
Returns:
resource stream or null if not found

resourceExists

String resourceExists(String portalId,
                      String resourceName)
Gets the resolved path to the specified resource.

Parameters:
portalId - the portal to get the resource from
resourceName - the resource to check for
Returns:
the fully resolved resourcePath if the resource exists, null otherwise

renderTemplate

void renderTemplate(String portalId,
                    String templateName,
                    org.apache.velocity.context.Context context,
                    Writer writer)
                    throws Exception
Renders a Velocity template with the given context.

Parameters:
portalId - the portal to render the resource from
templateName - the template to render
context - the Velocity context to render
writer - a writer to output the render result to
Throws:
Exception - if an error occurred while rendering the template


Copyright © 2009-2013. All Rights Reserved.