|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.module.templating.AbstractRenderer
public abstract class AbstractRenderer
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
Constructor Summary | |
---|---|
AbstractRenderer()
|
Method Summary | |
---|---|
protected java.lang.String |
determineTemplatePath(Content content,
RenderableDefinition definition,
RenderingModel model,
java.lang.String actionResult)
|
protected AggregationState |
getAggregationStateSafely()
This gets the aggregation state without throwing an exception if the current context is not a WebContext. |
protected AggregationState |
getAggrigationStateSafely()
Deprecated. since 4.3 - typo, use getAggregationStateSafely() |
protected MagnoliaTemplatingUtilities |
getMagnoliaTemplatingUtilities()
|
protected Content |
getMainContentSafely(Content current)
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 java.lang.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 abstract java.util.Map |
newContext()
Create a new context object which is a map. |
RenderingModel |
newModel(Content content,
RenderableDefinition definition,
RenderingModel parentModel)
Creates the model for this rendering process. |
protected abstract void |
onRender(Content content,
RenderableDefinition definition,
java.io.Writer out,
java.util.Map ctx,
java.lang.String templatePath)
Finally execute the rendering. |
protected void |
render(Content content,
RenderableDefinition definition,
java.io.Writer out)
|
protected void |
restoreContext(java.util.Map ctx,
java.util.Map state)
|
protected void |
saveAttribute(java.util.Map ctx,
java.util.Map state,
java.lang.String name)
|
protected java.util.Map |
saveContextState(java.util.Map ctx)
|
protected java.lang.Object |
setContextAttribute(java.util.Map ctx,
java.lang.String name,
java.lang.Object value)
|
protected void |
setupContext(java.util.Map ctx,
Content content,
RenderableDefinition definition,
RenderingModel model,
java.lang.Object actionResult)
|
protected Content |
wrapNodeForModel(Content currentContent,
Content mainContent)
Wraps the current content node before passing it to the model. |
protected Content |
wrapNodeForTemplate(Content currentContent,
Content mainContent)
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 |
---|
public AbstractRenderer()
Method Detail |
---|
protected void render(Content content, RenderableDefinition definition, java.io.Writer out) throws RenderException
RenderException
protected java.lang.String determineTemplatePath(Content content, RenderableDefinition definition, RenderingModel model, java.lang.String actionResult)
public RenderingModel newModel(Content content, RenderableDefinition definition, RenderingModel parentModel) throws RenderException
newModel
in interface RenderingModelBasedRenderer
RenderException
protected java.util.Map saveContextState(java.util.Map ctx)
protected void saveAttribute(java.util.Map ctx, java.util.Map state, java.lang.String name)
protected void restoreContext(java.util.Map ctx, java.util.Map state)
protected void setupContext(java.util.Map ctx, Content content, RenderableDefinition definition, RenderingModel model, java.lang.Object actionResult)
protected Content getMainContentSafely(Content current)
protected AggregationState getAggrigationStateSafely()
protected AggregationState getAggregationStateSafely()
protected MagnoliaTemplatingUtilities getMagnoliaTemplatingUtilities()
protected Content wrapNodeForModel(Content currentContent, Content mainContent)
currentContent
- the actual contentmainContent
- the current "main content" or "page", which might be needed in certain wrapping situationsprotected Content wrapNodeForTemplate(Content currentContent, Content mainContent)
currentContent
- the actual content being exposed to the templatemainContent
- the current "main content" or "page", which might be needed in certain wrapping situationsTODO : return an Object instance instead - more flexibility for the template engine ?
protected java.lang.Object setContextAttribute(java.util.Map ctx, java.lang.String name, java.lang.Object value)
protected java.lang.String getPageAttributeName()
protected abstract java.util.Map newContext()
protected abstract void onRender(Content content, RenderableDefinition definition, java.io.Writer out, java.util.Map ctx, java.lang.String templatePath) throws RenderException
content
- TODO
RenderException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |