info.magnolia.cms.taglibs
Class ContentNodeIterator

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by info.magnolia.cms.taglibs.BaseContentTag
          extended by info.magnolia.cms.taglibs.ContentNodeIterator
All Implemented Interfaces:
Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class ContentNodeIterator
extends BaseContentTag

Iterate over contentNode collection. contentNodeIterator is used whenever you want to loop over content, typically paragraphs. A parameter contentNodeCollectionName will contain the name of the contentNode you are looping over. contentNodeCollectionName is created by providing a newBar with the corresponding name. This will result in elements being created within that contentNode, and thus allow you to loop over these.

Version:
$Revision: 41137 $ ($Author: gjoseph $)
Author:
Sameer Charles, Fabrizio Giustina, David Smith
See Also:
Serialized Form

Field Summary
protected  int begin
          Tag attribute.
static String CONTENT_NODE_COLLECTION_NAME
          Deprecated.  
protected  int count
           
protected  Object current
           
protected static String CURRENT_INDEX
          Deprecated. use the varStatus tag attribute to get a reference to a javax.servlet.jsp.jstl.core.LoopTagStatus instance.
protected  Integer end
          Tag attribute.
protected  int index
           
protected  int size
           
protected static String SIZE
          Deprecated. use the varStatus tag attribute to get a reference to a javax.servlet.jsp.jstl.core.LoopTagStatus instance.
protected  int step
          Tag attribute.
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
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
ContentNodeIterator()
           
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
           
 int doStartTag()
           
protected  javax.servlet.jsp.jstl.core.LoopTagStatus getLoopStatus()
           
 void reset()
           
 void setBegin(int index)
          Zero-based index of first item to process, inclusive.
 void setContentNodeName(String name)
          TODO : provide relevant doc for this attribute -- only overriden to do so.
 void setEnd(Integer index)
          Zero-based index of last item to process, inclusive.
 void setItems(Collection items)
          if this attribute is set, the tag will iterate on the collection directly passed here instead of fetching the collection named by contentNodeCollectionName.
 void setNodeDataName(String name)
          Set the node data name, e.g.
 void setStep(int step)
          Process every stepth element (e.g 2 = every second element).
 void setVarStatus(String varStatus)
          Name of variable to hold the loop status with the following properties: index: position of the current item; count: number of times through the loop (starting with 1); first: boolean indicator if this is the first iteration; last: boolean indicator if this is the last iteration.
 
Methods inherited from class info.magnolia.cms.taglibs.BaseContentTag
getContentNode, getContentNodeCollectionName, getContentNodeName, getCurrentPage, getFirstMatchingNode, getFirtMatchingNode, getNodeDataName, getPath, getRepository, getUuid, isActpage, release, resolveNode, setActpage, setContentNode, setContentNodeCollectionName, setInherit, setPath, setRepository, setUuid
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTENT_NODE_COLLECTION_NAME

public static final String CONTENT_NODE_COLLECTION_NAME
Deprecated. 
See Also:
Constant Field Values

CURRENT_INDEX

protected static final String CURRENT_INDEX
Deprecated. use the varStatus tag attribute to get a reference to a javax.servlet.jsp.jstl.core.LoopTagStatus instance.
See Also:
Constant Field Values

SIZE

protected static final String SIZE
Deprecated. use the varStatus tag attribute to get a reference to a javax.servlet.jsp.jstl.core.LoopTagStatus instance.
See Also:
Constant Field Values

begin

protected int begin
Tag attribute.


end

protected Integer end
Tag attribute.


step

protected int step
Tag attribute.


size

protected int size

count

protected int count

index

protected int index

current

protected Object current
Constructor Detail

ContentNodeIterator

public ContentNodeIterator()
Method Detail

setBegin

public void setBegin(int index)
Zero-based index of first item to process, inclusive.


setEnd

public void setEnd(Integer index)
Zero-based index of last item to process, inclusive.


setStep

public void setStep(int step)
Process every stepth element (e.g 2 = every second element).


setVarStatus

public void setVarStatus(String varStatus)
Name of variable to hold the loop status with the following properties: index: position of the current item; count: number of times through the loop (starting with 1); first: boolean indicator if this is the first iteration; last: boolean indicator if this is the last iteration.


setItems

public void setItems(Collection items)
if this attribute is set, the tag will iterate on the collection directly passed here instead of fetching the collection named by contentNodeCollectionName. This collection must contains info.magnolia.cms.core.Content items.


setNodeDataName

public void setNodeDataName(String name)
Description copied from class: BaseContentTag
Set the node data name, e.g. "mainText".

Overrides:
setNodeDataName in class BaseContentTag

setContentNodeName

public void setContentNodeName(String name)
TODO : provide relevant doc for this attribute -- only overriden to do so.

Overrides:
setContentNodeName in class BaseContentTag

getLoopStatus

protected javax.servlet.jsp.jstl.core.LoopTagStatus getLoopStatus()

doStartTag

public int doStartTag()
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport

doAfterBody

public int doAfterBody()
Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.TagSupport

doEndTag

public int doEndTag()
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport

reset

public void reset()


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