com.googlecode.fascinator.portal.services.impl
Class CachingDynamicPageServiceImpl

java.lang.Object
  extended by com.googlecode.fascinator.portal.services.impl.CachingDynamicPageServiceImpl
All Implemented Interfaces:
DynamicPageService

public class CachingDynamicPageServiceImpl
extends Object
implements DynamicPageService

Author:
Oliver Lucido

Constructor Summary
CachingDynamicPageServiceImpl(PortalManager portalManager, VelocityService velocityService)
          Constructs and configures the service.
 
Method Summary
 InputStream getResource(String resourcePath)
          Deprecated. 
 InputStream getResource(String portalId, String resourceName)
          Deprecated. 
 String render(String portalId, String pageName, OutputStream out, FormData formData, JsonSessionState sessionState)
          Renders the Velocity template with the specified form data.
 String renderObject(org.apache.velocity.context.Context context, String template, IndexAndPayloadComposite metadata)
           
 String renderObject(org.apache.velocity.context.Context context, String template, SolrDoc metadata)
          Renders a display template.
 String resourceExists(String portalId, String resourceName)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingDynamicPageServiceImpl

public CachingDynamicPageServiceImpl(PortalManager portalManager,
                                     VelocityService velocityService)
Constructs and configures the service.

Parameters:
portalManager - PortalManager instance
velocityService - VelocityService instance
Method Detail

getResource

@Deprecated
public InputStream getResource(String resourcePath)
Deprecated. 

Gets a Velocity resource. This method is deprecated, please use VelocityService.getResource() instead.

Specified by:
getResource in interface DynamicPageService
Parameters:
resourcePath - valid Velocity resource path
Returns:
resource stream or null if not found

getResource

@Deprecated
public InputStream getResource(String portalId,
                                          String resourceName)
Deprecated. 

Gets a Velocity resource. This method is deprecated, please use VelocityService.getResource() instead.

Specified by:
getResource in interface DynamicPageService
Parameters:
portalId - the portal to get the resource from
resourceName - the resource to get
Returns:
resource stream or null if not found

resourceExists

@Deprecated
public String resourceExists(String portalId,
                                        String resourceName)
Deprecated. 

Resolves the given resource to a valid Velocity resource if possible. This method is deprecated, please use VelocityService.resourceExists() instead.

Specified by:
resourceExists in interface DynamicPageService
Parameters:
portalId - the portal to get the resource from
resourceName - the resource to check
Returns:
a valid Velocity resource path or null if not found

render

public String render(String portalId,
                     String pageName,
                     OutputStream out,
                     FormData formData,
                     JsonSessionState sessionState)
Renders the Velocity template with the specified form data.

Specified by:
render in interface DynamicPageService
Parameters:
portalId - the portal to get the template from
pageName - the page template to render
out - render results will be written to this output stream
formData - request form data
sessionState - current session
Returns:
MIME type of the response

renderObject

public String renderObject(org.apache.velocity.context.Context context,
                           String template,
                           IndexAndPayloadComposite metadata)
Specified by:
renderObject in interface DynamicPageService

renderObject

public String renderObject(org.apache.velocity.context.Context context,
                           String template,
                           SolrDoc metadata)
Renders a display template. This is generally used by calling the #parseDisplayTemplate() method in the portal-library.vm.

Specified by:
renderObject in interface DynamicPageService
Parameters:
context - Velocity context
template - display template name
metadata - Solr metadata
Returns:
rendered content


Copyright © 2009-2014. All Rights Reserved.