org.mmbase.bridge.jsp.taglib.tree
Class TreeTag

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byjavax.servlet.jsp.tagext.BodyTagSupport
          extended byorg.mmbase.bridge.jsp.taglib.ContextReferrerTag
              extended byorg.mmbase.bridge.jsp.taglib.CloudReferrerTag
                  extended byorg.mmbase.bridge.jsp.taglib.NodeReferrerTag
                      extended byorg.mmbase.bridge.jsp.taglib.AbstractNodeProviderTag
                          extended byorg.mmbase.bridge.jsp.taglib.tree.TreeTag
All Implemented Interfaces:
BodyTag, ContainerReferrer, ContextProvider, DepthProvider, FunctionContainerOrNodeProvider, IterationTag, ListProvider, LoopTag, NodeProvider, QueryContainerReferrer, Serializable, Tag, TagIdentifier, TreeProvider

public class TreeTag
extends AbstractNodeProviderTag
implements TreeProvider, QueryContainerReferrer

Implements mm:tree. Which works about like this

 <mm:relatednodescontainer type="object" searchdirs="destination">
  <mm:tree type="object" searchdir="destination" maxdepth="8">
    <mm:grow>
      <ul class="<mm:depth" />"><mm:onshrink></ul></mm:onshrink>
    </mm:grow>
    <li><mm:depth />: <mm:nodeinfo type="guitype" />: <mm:field name="number" /> <mm:function name="gui" escape="none" />

    <mm:onshrink></li></mm:onshrink>

    <mm:shrink />

    <mm:last>SIZE : <mm:size /></mm:last>

  </mm:tree>
</mm:relatednodescontainer>

Since:
MMBase-1.7
Version:
$Id: TreeTag.java,v 1.17 2006/06/29 14:32:15 michiel Exp $
Author:
Michiel Meeuwissen
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.mmbase.bridge.jsp.taglib.ListProvider
ListProvider.ListProviderLoopTagStatus
 
Field Summary
protected  Attribute container
           
protected  Attribute directions
           
protected  Attribute max
           
protected  Attribute maxDepth
           
protected  Attribute nodeManager
           
protected  Attribute orderby
           
protected  Attribute role
           
protected  Attribute searchDir
           
protected  int timerHandle
           
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.AbstractNodeProviderTag
fieldEscaper, nodeHelper
 
Fields inherited from class org.mmbase.bridge.jsp.taglib.NodeReferrerTag
parentNodeId
 
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.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
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
 
Constructor Summary
TreeTag()
           
 
Method Summary
 int doAfterBody()
          Does everything needed on the afterbody tag of every NodeProvider.
 int doEndTag()
           
 void doInitBody()
           
 int doStartTag()
          Performs the search
 ContextContainer getContextContainer()
           
 Object getCurrent()
           
 int getDepth()
          Returns the 'size' of the current cluster node (the number of steps (minus the relation steps))
 int getIndex()
           
 int getIndexOffset()
           
 LoopTagStatus getLoopStatus()
           
 int getNextDepth()
           
 int getPreviousDepth()
           
 Stack getShrinkStack()
           
 boolean isChanged()
           
protected  void noSpecification()
           
 void remove()
          Removes the current item from the list.
 void setContainer(String c)
          If it should not use parent container
 void setDirections(String d)
           
 void setMax(String m)
           
 void setMaxdepth(String md)
           
 void setOrderby(String o)
           
 void setRole(String r)
           
 void setSearchdir(String sd)
           
 void setType(String n)
           
 int size()
           
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.AbstractNodeProviderTag
fillVars, getGeneratingQuery, getNodeVar, release, setCommitonclose, setFieldescape, setJspvar, setNodeVar
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.NodeReferrerTag
fillStandardParameters, findNodeProvider, findNodeProvider, getLocale, getNode, setElement, setNode
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.CloudReferrerTag
findCloudProvider, findCloudProvider, getCloudContext, getCloudVar, getNode, getNodeOrNull, setCloud
 
Methods inherited from class org.mmbase.bridge.jsp.taglib.ContextReferrerTag
findLoopOrQuery, findParentTag, findParentTag, findParentTag, findParentTag, findWriter, findWriter, getAttribute, getAttributeBoolean, getAttributeInteger, getAttributeInteger, getAttributeValue, getContentTag, getContextProvider, getContextTag, getDefaultLocale, getEscapedValue, getId, getObject, getObjectConditional, getPageContext, getPageContextTag, getReferid, getString, getTaglibVersion, getTimeZone, getWriterValue, haveBody, setContext, setEscape, setId, setListdelimiter, setPageContext, setReferid, setVartype, setWrite, setWriter
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
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 org.mmbase.bridge.jsp.taglib.NodeProvider
getGeneratingQuery, getNodeVar, setCommitonclose, setJspvar
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.TagIdentifier
getId
 
Methods inherited from interface org.mmbase.bridge.jsp.taglib.ContextProvider
getPageContext
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, release, setPageContext, setParent
 

Field Detail

timerHandle

protected int timerHandle

container

protected Attribute container

nodeManager

protected Attribute nodeManager

role

protected Attribute role

searchDir

protected Attribute searchDir

maxDepth

protected Attribute maxDepth

orderby

protected Attribute orderby

directions

protected Attribute directions

max

protected Attribute max
Constructor Detail

TreeTag

public TreeTag()
Method Detail

setContainer

public void setContainer(String c)
                  throws JspTagException
Description copied from interface: ContainerReferrer
If it should not use parent container

Specified by:
setContainer in interface ContainerReferrer
Throws:
JspTagException

setType

public void setType(String n)
             throws JspTagException
Throws:
JspTagException

setRole

public void setRole(String r)
             throws JspTagException
Throws:
JspTagException

setSearchdir

public void setSearchdir(String sd)
                  throws JspTagException
Throws:
JspTagException

setMaxdepth

public void setMaxdepth(String md)
                 throws JspTagException
Throws:
JspTagException

setOrderby

public void setOrderby(String o)
                throws JspTagException
Throws:
JspTagException
Since:
MMBase 1.7.1

setDirections

public void setDirections(String d)
                   throws JspTagException
Throws:
JspTagException
Since:
MMBase 1.7.1

getShrinkStack

public Stack getShrinkStack()
Specified by:
getShrinkStack in interface TreeProvider

setMax

public void setMax(String m)
            throws JspTagException
Throws:
JspTagException

getContextContainer

public ContextContainer getContextContainer()
                                     throws JspTagException
Specified by:
getContextContainer in interface ContextProvider
Throws:
JspTagException

size

public int size()
Specified by:
size in interface ListProvider
Returns:
the size of the list

getIndex

public int getIndex()
Specified by:
getIndex in interface ListProvider
Returns:
the index of the current item in a list

getIndexOffset

public int getIndexOffset()
Specified by:
getIndexOffset in interface ListProvider
Returns:
The offset of the index (normally this will return 1)

isChanged

public boolean isChanged()
Specified by:
isChanged in interface ListProvider
Returns:
a boolean indicating wether the field on which was sorted is changed.

getCurrent

public Object getCurrent()
Specified by:
getCurrent in interface ListProvider
Returns:
the current item in a list

remove

public void remove()
Description copied from interface: ListProvider
Removes the current item from the list.

Specified by:
remove in interface ListProvider

getPreviousDepth

public int getPreviousDepth()
Specified by:
getPreviousDepth in interface TreeProvider

getDepth

public int getDepth()
Description copied from interface: DepthProvider
Returns the 'size' of the current cluster node (the number of steps (minus the relation steps))

Specified by:
getDepth in interface DepthProvider

getNextDepth

public int getNextDepth()
Specified by:
getNextDepth in interface TreeProvider

noSpecification

protected void noSpecification()
                        throws JspTagException
Throws:
JspTagException

doStartTag

public int doStartTag()
               throws JspTagException
Performs the search

Specified by:
doStartTag in interface Tag
Throws:
JspTagException

doInitBody

public void doInitBody()
                throws JspTagException
Specified by:
doInitBody in interface BodyTag
Throws:
JspTagException

doAfterBody

public int doAfterBody()
                throws JspTagException
Description copied from class: AbstractNodeProviderTag
Does everything needed on the afterbody tag of every NodeProvider. Normally this function would be overrided with one that has to call super.doAfterBody(). But not all servlet engines to call this function if there is no body. So, in that case it should be called from doEndTag, if the tag can do something without a body.

Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class AbstractNodeProviderTag
Throws:
JspTagException

doEndTag

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

getLoopStatus

public LoopTagStatus getLoopStatus()
Specified by:
getLoopStatus in interface LoopTag


MMBase build 1.8.1.20060716