org.mmbase.bridge.jsp.taglib
Class NodeReferrerTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended by org.mmbase.bridge.jsp.taglib.CloudReferrerTag
                  extended by org.mmbase.bridge.jsp.taglib.NodeReferrerTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
AbstractFunctionTag, AbstractNodeProviderTag, CountRelationsTag, CreateAliasTag, FieldReferrerTag, HasAliasTag, HasFieldTag, HasRelationsTag, InstanceOfTag, ListNodesContainerTag, ListRelationsContainerTag, MayWriteTag, NodeInfoTag, RelatedContainerTag, SetContextTag, StringListTag, TreeReferrerTag

public abstract class NodeReferrerTag
extends CloudReferrerTag

A tag which is a 'NodeReferrerTag's can be the child of a NodeProvider tag, which supplies a 'Node' to its child tags. For example the FieldTag, needs the use the Node of the parent NodeProviderTag and therefore would be a NodeReferrerTag.

Version:
$Id: NodeReferrerTag.java 41042 2010-02-15 22:48:06Z michiel $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Field Summary
protected  Attribute parentNodeId
           
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
cloudId
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
contextId, EVAL_BODY, helper, id, pageContextTag, referid, writerid
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
NodeReferrerTag()
           
 
Method Summary
 int doEndTag()
           
 int doStartTag()
           
 void fillStandardParameters(Parameters p)
          Fill standard parameters like request, response, language and locale
 Node findNode()
          As getNode() only with a different name, because taglib compilers can be confused otherwise.
 NodeProvider findNodeProvider()
          This method tries to find an ancestor object of type NodeProvider
 NodeProvider findNodeProvider(boolean throwexception)
          This method tries to find an ancestor object of type NodeProvider
 Cloud getCloudVar()
          Find the CloudProvider and return its cloud variable in one step.
 Locale getLocale()
          Get the locale which is defined by surrounding tags or the cloud
protected  Node getNode()
           
protected  Node getNode(boolean exception)
          Gets the Node variable from the parent NodeProvider.
protected  Node getNodeFromPageContext()
           
protected  void initTag()
           
 void setElement(String e)
          The element attribute is used to access elements of clusternodes.
 void setNode(String node)
          A NodeReferrer probably wants to supply the attribute 'node', to make it possible to refer to another node than the direct ancestor.
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
findCloudProvider, findCloudProvider, getCloudContext, getNode, getNodeOrNull, setCloud
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
appendMoreParameters, doCatch, doFinally, findLoopOrQuery, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getCurrentBlock, getDefaultLocale, getEscapedValue, getFormTag, getId, getLocaleFromContext, getObject, getObjectConditional, getPageContext, getPageContextTag, getQuery, getReferid, getString, getTaglibVersion, getThreadPageContext, getTimeZone, getWriterValue, haveBody, release, setContext, setEscape, setId, setJspvar, setListdelimiter, setPageContext, setPageContextOnly, setReferid, setVartype, setWrite, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setParent
 

Field Detail

parentNodeId

protected Attribute parentNodeId
Constructor Detail

NodeReferrerTag

public NodeReferrerTag()
Method Detail

setElement

public void setElement(String e)
                throws JspTagException
The element attribute is used to access elements of clusternodes.

Throws:
JspTagException
Since:
MMBase-1.7.4

setNode

public void setNode(String node)
             throws JspTagException
A NodeReferrer probably wants to supply the attribute 'node', to make it possible to refer to another node than the direct ancestor.

Throws:
JspTagException

findNodeProvider

public NodeProvider findNodeProvider()
                              throws JspTagException
This method tries to find an ancestor object of type NodeProvider

Returns:
the NodeProvider if found else an exception.
Throws:
JspTagException

findNodeProvider

public NodeProvider findNodeProvider(boolean throwexception)
                              throws JspTagException
This method tries to find an ancestor object of type NodeProvider

Returns:
the NodeProvider or null.
Throws:
JspTagException

getNodeFromPageContext

protected Node getNodeFromPageContext()
                               throws JspTagException
Throws:
JspTagException
Since:
MMBase-1.8.5

getNode

protected Node getNode()
                throws JspTagException
Throws:
JspTagException

getNode

protected Node getNode(boolean exception)
                throws JspTagException
Gets the Node variable from the parent NodeProvider.

Returns:
a org.mmbase.bridge.Node
Throws:
JspTagException
Since:
MMBase-1.8.7

findNode

public final Node findNode()
                    throws JspTagException
As getNode() only with a different name, because taglib compilers can be confused otherwise. (because of setNode(String))

Throws:
JspTagException
Since:
MMBase-1.8.6

getCloudVar

public Cloud getCloudVar()
                  throws JspTagException
Description copied from class: CloudReferrerTag
Find the CloudProvider and return its cloud variable in one step. And the result of findCloudProvider is stored, so invoking this function more often is better then invoking findCloudProvider every time.

Overrides:
getCloudVar in class CloudReferrerTag
Returns:
a Cloud
Throws:
JspTagException

fillStandardParameters

public void fillStandardParameters(Parameters p)
                            throws JspTagException
Description copied from class: ContextReferrerTag
Fill standard parameters like request, response, language and locale

Overrides:
fillStandardParameters in class CloudReferrerTag
Parameters:
p - the parameters
Throws:
JspTagException - when parent tag is not found

getLocale

public Locale getLocale()
                 throws JspTagException
Description copied from class: ContextReferrerTag
Get the locale which is defined by surrounding tags or the cloud

Overrides:
getLocale in class CloudReferrerTag
Returns:
a locale when defined or otherwise the mmbase locale.
Throws:
JspTagException - when parent tag is not found

initTag

protected void initTag()

doStartTag

public int doStartTag()
               throws JspException
Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspTagException
Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class ContextReferrerTag
Throws:
JspTagException


MMBase 2.0-SNAPSHOT - null