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
protected  RenderableDefinition getRenderableDefinitionFor(javax.jcr.Node content)
           
protected  Renderer getRendererFor(RenderableDefinition definition)
           
 RenderingContext getRenderingContext()
          Returns the current RenderingContext.
 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.
 
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


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