info.magnolia.templating.elements
Class AbstractContentTemplatingElement

java.lang.Object
  extended by info.magnolia.templating.elements.AbstractTemplatingElement
      extended by info.magnolia.templating.elements.AbstractContentTemplatingElement
All Implemented Interfaces:
TemplatingElement
Direct Known Subclasses:
AreaElement, ComponentElement, InitElement

public abstract class AbstractContentTemplatingElement
extends AbstractTemplatingElement

Abstract base class for elements that operate on a specified piece of content.

Version:
$Id$

Constructor Summary
AbstractContentTemplatingElement(ServerConfiguration server, RenderingContext renderingContext)
           
 
Method Summary
 javax.jcr.Node getContent()
           
 String getNodeIdentifier()
           
protected  String getNodePath(javax.jcr.Node node)
           
protected  javax.jcr.Node getPassedContent()
          Returns the content passed to the element (content or workspace/path attribute) or null if nothing was passed.
 String getPath()
           
 String getWorkspace()
           
protected  boolean renderComments()
          Override to set conditions for rendering of cms:comments.
protected  void restoreAttributesInWebContext(Map<String,Object> attributes, int scope)
          Restores the original values of attributes in web context under the specified scope.
protected  void setAttributesInWebContext(Map<String,Object> attributes, int scope)
          Sets attributes in web context under the specified scope.
 void setContent(javax.jcr.Node node)
           
 void setNodeIdentifier(String nodeIdentifier)
           
 void setPath(String path)
           
 void setWorkspace(String workspace)
           
 
Methods inherited from class info.magnolia.templating.elements.AbstractTemplatingElement
begin, currentContent, end, getDefinitionMessage, getInterfaceMessage, getRenderingContext, getServer, isAdmin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractContentTemplatingElement

public AbstractContentTemplatingElement(ServerConfiguration server,
                                        RenderingContext renderingContext)
Method Detail

getNodePath

protected String getNodePath(javax.jcr.Node node)
                      throws RenderException
Throws:
RenderException

getPassedContent

protected javax.jcr.Node getPassedContent()
                                   throws RenderException
Returns the content passed to the element (content or workspace/path attribute) or null if nothing was passed.

Throws:
RenderException

getContent

public javax.jcr.Node getContent()

setContent

public void setContent(javax.jcr.Node node)

getWorkspace

public String getWorkspace()

setWorkspace

public void setWorkspace(String workspace)

getNodeIdentifier

public String getNodeIdentifier()

setNodeIdentifier

public void setNodeIdentifier(String nodeIdentifier)

getPath

public String getPath()

setPath

public void setPath(String path)

setAttributesInWebContext

protected void setAttributesInWebContext(Map<String,Object> attributes,
                                         int scope)
Sets attributes in web context under the specified scope. If an attribute already exists its value will be overwritten with the new one and the old value saved for subsequent restore.

Parameters:
scope - one of Context.APPLICATION_SCOPE Context.SESSION_SCOPE Context.LOCAL_SCOPE.

restoreAttributesInWebContext

protected void restoreAttributesInWebContext(Map<String,Object> attributes,
                                             int scope)
Restores the original values of attributes in web context under the specified scope.

Parameters:
scope - one of Context.APPLICATION_SCOPE Context.SESSION_SCOPE Context.LOCAL_SCOPE.

renderComments

protected boolean renderComments()
Override to set conditions for rendering of cms:comments.



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