info.magnolia.rendering.engine
Class DefaultRenderingEngine

java.lang.Object
  extended by info.magnolia.rendering.engine.DefaultRenderingEngine
All Implemented Interfaces:
RenderingEngine

public class DefaultRenderingEngine
extends Object
implements RenderingEngine

Default implementation of RenderingEngine.

Version:
$Id$

Field Summary
protected static Map<String,Object> EMPTY_CONTEXT
           
 
Constructor Summary
protected DefaultRenderingEngine()
          Used to create an observed proxy object.
  DefaultRenderingEngine(RendererRegistry rendererRegistry, TemplateDefinitionAssignment templateDefinitionAssignment, RenderableVariationResolver variationResolver, javax.inject.Provider<RenderingContext> renderingContextProvider)
           
 
Method Summary
 Boolean getAutoPopulateFromRequest()
           
protected  RenderableDefinition getRenderableDefinitionFor(javax.jcr.Node content)
           
 Boolean getRenderEmptyAreas()
           
protected  Renderer getRendererFor(RenderableDefinition definition)
           
 RenderingContext getRenderingContext()
          Returns the current RenderingContext.
 void initListeners(OutputProvider output)
          Inits listeners.
 void render(javax.jcr.Node content, Map<String,Object> contextObjects, OutputProvider out)
          Renders the content with its assigned template and exposes the given context objects to the template script.
 void render(javax.jcr.Node content, OutputProvider out)
          Renders the content with its assigned template.
 void render(javax.jcr.Node content, RenderableDefinition definition, Map<String,Object> contextObjects, OutputProvider out)
          Uses a specific RenderableDefinition to render the content and exposes the given context objects to the template script.
 void setAutoPopulateFromRequest(Boolean autopopulateFromRequest)
           
 void setRenderEmptyAreas(Boolean renderEmptyAreas)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_CONTEXT

protected static final Map<String,Object> EMPTY_CONTEXT
Constructor Detail

DefaultRenderingEngine

protected DefaultRenderingEngine()
Used to create an observed proxy object.


DefaultRenderingEngine

public DefaultRenderingEngine(RendererRegistry rendererRegistry,
                              TemplateDefinitionAssignment templateDefinitionAssignment,
                              RenderableVariationResolver variationResolver,
                              javax.inject.Provider<RenderingContext> renderingContextProvider)
Method Detail

render

public void render(javax.jcr.Node content,
                   OutputProvider out)
            throws RenderException
Description copied from interface: RenderingEngine
Renders the content with its assigned template. Uses TemplateDefinitionAssignment to resolve the template assigned to the node.

Specified by:
render in interface RenderingEngine
Parameters:
content - the node to render
out - the OutputProvider to be used for output or null if the OutputProvider already set in RenderingContext should be used
Throws:
RenderException

render

public void render(javax.jcr.Node content,
                   Map<String,Object> contextObjects,
                   OutputProvider out)
            throws RenderException
Description copied from interface: RenderingEngine
Renders the content with its assigned template and exposes the given context objects to the template script. Uses TemplateDefinitionAssignment to resolve the template assigned to the node.

Specified by:
render in interface RenderingEngine
Parameters:
content - the node to render
contextObjects - objects to expose to the template script
out - the OutputProvider to be used for output or null if the OutputProvider already set in RenderingContext should be used
Throws:
RenderException

render

public void render(javax.jcr.Node content,
                   RenderableDefinition definition,
                   Map<String,Object> contextObjects,
                   OutputProvider out)
            throws RenderException
Description copied from interface: RenderingEngine
Uses a specific RenderableDefinition to render the content and exposes the given context objects to the template script.

Specified by:
render in interface RenderingEngine
Parameters:
content - the node to render
contextObjects - objects to expose to the template script
out - the OutputProvider to be used for output or null if the OutputProvider already set in RenderingContext should be used
Throws:
RenderException

getRenderableDefinitionFor

protected RenderableDefinition getRenderableDefinitionFor(javax.jcr.Node content)
                                                   throws RenderException
Throws:
RenderException

getRendererFor

protected Renderer getRendererFor(RenderableDefinition definition)
                           throws RenderException
Throws:
RenderException

getRenderingContext

public RenderingContext getRenderingContext()
Description copied from interface: RenderingEngine
Returns the current RenderingContext. FIXME is this the right place? should we use IoC

Specified by:
getRenderingContext in interface RenderingEngine

initListeners

public void initListeners(OutputProvider output)
Description copied from interface: RenderingEngine
Inits listeners. Should be called per request.

Specified by:
initListeners in interface RenderingEngine

getAutoPopulateFromRequest

public Boolean getAutoPopulateFromRequest()
Specified by:
getAutoPopulateFromRequest in interface RenderingEngine

setAutoPopulateFromRequest

public void setAutoPopulateFromRequest(Boolean autopopulateFromRequest)

getRenderEmptyAreas

public Boolean getRenderEmptyAreas()
Specified by:
getRenderEmptyAreas in interface RenderingEngine

setRenderEmptyAreas

public void setRenderEmptyAreas(Boolean renderEmptyAreas)


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.