info.magnolia.module.templating.renderers
Class JspTemplateRenderer

java.lang.Object
  extended by info.magnolia.module.templating.AbstractRenderer
      extended by info.magnolia.module.templating.renderers.AbstractTemplateRenderer
          extended by info.magnolia.module.templating.renderers.JspTemplateRenderer
All Implemented Interfaces:
RenderingModelBasedRenderer, TemplateRenderer

public class JspTemplateRenderer
extends AbstractTemplateRenderer

Simple jsp template renderer, mapped to template type jsp. The only valid attribute jsp templates is path, which specify the jsp/servlet path to forward to.

Version:
$Revision: 39442 $ ($Author: pbaerfuss $)
Author:
Fabrizio Giustina

Constructor Summary
JspTemplateRenderer()
           
 
Method Summary
protected  String getPageAttributeName()
          Used to give JSP implementations to give the chance to use on other name than page which is a reserved name in JSPs.
protected  Map newContext()
          Create a new context object which is a map.
protected  void onRender(info.magnolia.cms.core.Content content, RenderableDefinition definition, Writer out, Map ctx, String templatePath)
          Finally execute the rendering.
protected  info.magnolia.cms.core.Content wrapNodeForTemplate(info.magnolia.cms.core.Content currentContent, info.magnolia.cms.core.Content mainContent)
          We expose nodes as Map instances in JSPs.
 
Methods inherited from class info.magnolia.module.templating.renderers.AbstractTemplateRenderer
renderTemplate, renderTemplate
 
Methods inherited from class info.magnolia.module.templating.AbstractRenderer
determineTemplatePath, getAggregationStateSafely, getAggrigationStateSafely, getMagnoliaTemplatingUtilities, getMainContentSafely, newModel, render, restoreContext, saveAttribute, saveContextState, setContextAttribute, setupContext, wrapNodeForModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JspTemplateRenderer

public JspTemplateRenderer()
Method Detail

onRender

protected void onRender(info.magnolia.cms.core.Content content,
                        RenderableDefinition definition,
                        Writer out,
                        Map ctx,
                        String templatePath)
                 throws RenderException
Description copied from class: AbstractRenderer
Finally execute the rendering.

Specified by:
onRender in class AbstractRenderer
Parameters:
content - TODO
Throws:
RenderException

wrapNodeForTemplate

protected info.magnolia.cms.core.Content wrapNodeForTemplate(info.magnolia.cms.core.Content currentContent,
                                                             info.magnolia.cms.core.Content mainContent)
We expose nodes as Map instances in JSPs.

Overrides:
wrapNodeForTemplate in class AbstractRenderer
Parameters:
currentContent - the actual content being exposed to the template
mainContent - the current "main content" or "page", which might be needed in certain wrapping situations
See Also:
TODO : return an Object instance instead - more flexibility for the template engine ?

newContext

protected Map newContext()
Description copied from class: AbstractRenderer
Create a new context object which is a map.

Specified by:
newContext in class AbstractRenderer

getPageAttributeName

protected String getPageAttributeName()
Description copied from class: AbstractRenderer
Used to give JSP implementations to give the chance to use on other name than page which is a reserved name in JSPs.

Overrides:
getPageAttributeName in class AbstractRenderer


Copyright © 2003-2010 Magnolia International Ltd.. All Rights Reserved.