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(info.magnolia.cms.beans.config.ServerConfiguration server, info.magnolia.rendering.context.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  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(info.magnolia.cms.beans.config.ServerConfiguration server,
                                        info.magnolia.rendering.context.RenderingContext renderingContext)
Method Detail

getNodePath

protected String getNodePath(javax.jcr.Node node)
                      throws info.magnolia.rendering.engine.RenderException
Throws:
info.magnolia.rendering.engine.RenderException

getPassedContent

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

Throws:
info.magnolia.rendering.engine.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.


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