info.magnolia.module.templating
Class AbstractRenderer

java.lang.Object
  extended by info.magnolia.module.templating.AbstractRenderer
All Implemented Interfaces:
RenderingModelBasedRenderer
Direct Known Subclasses:
AbstractParagraphRenderer, AbstractTemplateRenderer

Deprecated. since 4.5, replaced by AbstractRenderer FIXME remove most of the code and and try to extend the new AbstractRenderer

@Deprecated
public abstract class AbstractRenderer
extends Object
implements RenderingModelBasedRenderer

Abstract renderer which can be used to implement paragraph or template renderers. Sets up the context by providing the following objects: content, aggregationState, page, model, actionResult, mgnl

Version:
$Id: AbstractRenderer.java 48832 2011-08-31 08:22:48Z had $
Author:
pbracher

Constructor Summary
AbstractRenderer()
          Deprecated.  
 
Method Summary
protected  String determineTemplatePath(Content content, RenderableDefinition definition, RenderingModel model, String actionResult)
          Deprecated.  
protected  AggregationState getAggregationStateSafely()
          Deprecated. This gets the aggregation state without throwing an exception if the current context is not a WebContext.
protected  MagnoliaTemplatingUtilities getMagnoliaTemplatingUtilities()
          Deprecated.  
protected  Content getMainContentSafely(Content current)
          Deprecated. Gets the current main contain and treats the situation where the context is not a web context nicely by using the current content instead.
protected  String getPageAttributeName()
          Deprecated. Used to give JSP implementations to give the chance to use on other name than page which is a reserved name in JSPs.
protected abstract  Map newContext()
          Deprecated. Create a new context object which is a map.
 RenderingModel newModel(Content content, RenderableDefinition definition, RenderingModel parentModel)
          Deprecated. Creates the model for this rendering process.
protected abstract  void onRender(Content content, RenderableDefinition definition, Writer out, Map ctx, String templatePath)
          Deprecated. Finally execute the rendering.
protected  void render(Content content, RenderableDefinition definition, Writer out)
          Deprecated.  
protected  void restoreContext(Map ctx, Map state)
          Deprecated.  
protected  void saveAttribute(Map ctx, Map state, String name)
          Deprecated.  
protected  Map saveContextState(Map ctx)
          Deprecated.  
protected  Object setContextAttribute(Map ctx, String name, Object value)
          Deprecated.  
protected  void setupContext(Map ctx, Content content, RenderableDefinition definition, RenderingModel model, Object actionResult)
          Deprecated.  
protected  Content wrapNodeForModel(Content currentContent, Content mainContent)
          Deprecated. Wraps the current content node before passing it to the model.
protected  Content wrapNodeForTemplate(Content currentContent, Content mainContent)
          Deprecated. Wraps the current content node before exposing it to the template renderer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRenderer

public AbstractRenderer()
Deprecated. 
Method Detail

render

protected void render(Content content,
                      RenderableDefinition definition,
                      Writer out)
               throws RenderException
Deprecated. 
Throws:
RenderException

determineTemplatePath

protected String determineTemplatePath(Content content,
                                       RenderableDefinition definition,
                                       RenderingModel model,
                                       String actionResult)
Deprecated. 

newModel

public RenderingModel newModel(Content content,
                               RenderableDefinition definition,
                               RenderingModel parentModel)
                        throws RenderException
Deprecated. 
Creates the model for this rendering process. Will set the properties

Specified by:
newModel in interface RenderingModelBasedRenderer
Throws:
RenderException

saveContextState

protected Map saveContextState(Map ctx)
Deprecated. 

saveAttribute

protected void saveAttribute(Map ctx,
                             Map state,
                             String name)
Deprecated. 

restoreContext

protected void restoreContext(Map ctx,
                              Map state)
Deprecated. 

setupContext

protected void setupContext(Map ctx,
                            Content content,
                            RenderableDefinition definition,
                            RenderingModel model,
                            Object actionResult)
Deprecated. 

getMainContentSafely

protected Content getMainContentSafely(Content current)
Deprecated. 
Gets the current main contain and treats the situation where the context is not a web context nicely by using the current content instead.


getAggregationStateSafely

protected AggregationState getAggregationStateSafely()
Deprecated. 
This gets the aggregation state without throwing an exception if the current context is not a WebContext.


getMagnoliaTemplatingUtilities

protected MagnoliaTemplatingUtilities getMagnoliaTemplatingUtilities()
Deprecated. 

wrapNodeForModel

protected Content wrapNodeForModel(Content currentContent,
                                   Content mainContent)
Deprecated. 
Wraps the current content node before passing it to the model.

Parameters:
currentContent - the actual content
mainContent - the current "main content" or "page", which might be needed in certain wrapping situations

wrapNodeForTemplate

protected Content wrapNodeForTemplate(Content currentContent,
                                      Content mainContent)
Deprecated. 
Wraps the current content node before exposing it to the template renderer.

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 ?

setContextAttribute

protected Object setContextAttribute(Map ctx,
                                     String name,
                                     Object value)
Deprecated. 

getPageAttributeName

protected String getPageAttributeName()
Deprecated. 
Used to give JSP implementations to give the chance to use on other name than page which is a reserved name in JSPs.


newContext

protected abstract Map newContext()
Deprecated. 
Create a new context object which is a map.


onRender

protected abstract void onRender(Content content,
                                 RenderableDefinition definition,
                                 Writer out,
                                 Map ctx,
                                 String templatePath)
                          throws RenderException
Deprecated. 
Finally execute the rendering.

Parameters:
content - TODO
Throws:
RenderException


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