org.opencms.jsp
Class CmsJspTagContentLoop

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byorg.opencms.jsp.CmsJspTagContentLoop
All Implemented Interfaces:
I_CmsXmlContentContainer, javax.servlet.jsp.tagext.IterationTag, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class CmsJspTagContentLoop
extends javax.servlet.jsp.tagext.TagSupport
implements I_CmsXmlContentContainer

Used to loop through the element values of an XML content item.

Since:
6.0.0
Version:
$Revision: 1.18 $
Author:
Alexander Kandzior
See Also:
Serialized Form

Field Summary
 
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
CmsJspTagContentLoop()
          Empty constructor, required for JSP tags.
CmsJspTagContentLoop(I_CmsXmlContentContainer container, java.lang.String element)
          Constructor used when using contentloop from scriptlet code.
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
           
 int doStartTag()
           
 java.lang.String getCollectorName()
          Returns the name of the currently used XML content collector.
 java.lang.String getCollectorParam()
          Returns the parameters of the currently used XML content collector.
 java.util.List getCollectorResult()
          Returns the list of all currently loaded XML content documents (instances of I_CmsXmlDocument).
 java.lang.String getElement()
          Returns the name of the content node element to show.
 java.lang.String getResourceName()
          Returns the resource name in the VFS for the currently loaded XML content document.
 I_CmsXmlDocument getXmlDocument()
          Returns the currently loaded OpenCms XML content document.
 java.lang.String getXmlDocumentElement()
          Returns the currently selected element name in the loaded XML content document.
 java.util.Locale getXmlDocumentLocale()
          Returns the currently selected locale used for acessing the content in the loaded XML content document.
 boolean hasMoreContent()
          Content iteration method to be used by JSP scriptlet code.
protected  void init(I_CmsXmlContentContainer container)
          Initializes this content loop tag.
 boolean isPreloader()
          Returns true if this container is used as a content preloader.
 void release()
           
 void setElement(java.lang.String element)
          Sets the name of the content node element to show.
 
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
 

Constructor Detail

CmsJspTagContentLoop

public CmsJspTagContentLoop()
Empty constructor, required for JSP tags.


CmsJspTagContentLoop

public CmsJspTagContentLoop(I_CmsXmlContentContainer container,
                            java.lang.String element)
Constructor used when using contentloop from scriptlet code.

Parameters:
container - the parent content container that provides the content element to loop
element - the element to loop in the content
Method Detail

doAfterBody

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

doEndTag

public int doEndTag()
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
See Also:
Tag.doEndTag()

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Throws:
javax.servlet.jsp.JspException
See Also:
Tag.doStartTag()

getCollectorName

public java.lang.String getCollectorName()
Description copied from interface: I_CmsXmlContentContainer
Returns the name of the currently used XML content collector.

Specified by:
getCollectorName in interface I_CmsXmlContentContainer
Returns:
the name of the currently used XML content collector
See Also:
I_CmsXmlContentContainer.getCollectorName()

getCollectorParam

public java.lang.String getCollectorParam()
Description copied from interface: I_CmsXmlContentContainer
Returns the parameters of the currently used XML content collector.

Specified by:
getCollectorParam in interface I_CmsXmlContentContainer
Returns:
the parameters of the currently used XML content collector
See Also:
I_CmsXmlContentContainer.getCollectorParam()

getCollectorResult

public java.util.List getCollectorResult()
Description copied from interface: I_CmsXmlContentContainer
Returns the list of all currently loaded XML content documents (instances of I_CmsXmlDocument).

Specified by:
getCollectorResult in interface I_CmsXmlContentContainer
Returns:
the list of all currently loaded XML content documents
See Also:
I_CmsXmlContentContainer.getCollectorResult()

getElement

public java.lang.String getElement()
Returns the name of the content node element to show.

Returns:
the name of the content node element to show

getResourceName

public java.lang.String getResourceName()
Description copied from interface: I_CmsXmlContentContainer
Returns the resource name in the VFS for the currently loaded XML content document.

Specified by:
getResourceName in interface I_CmsXmlContentContainer
Returns:
the resource name in the VFS for the currently loaded XML content document
See Also:
I_CmsXmlContentContainer.getResourceName()

getXmlDocument

public I_CmsXmlDocument getXmlDocument()
Description copied from interface: I_CmsXmlContentContainer
Returns the currently loaded OpenCms XML content document.

Specified by:
getXmlDocument in interface I_CmsXmlContentContainer
Returns:
the currently loaded OpenCms XML content document
See Also:
I_CmsXmlContentContainer.getXmlDocument()

getXmlDocumentElement

public java.lang.String getXmlDocumentElement()
Description copied from interface: I_CmsXmlContentContainer
Returns the currently selected element name in the loaded XML content document.

Specified by:
getXmlDocumentElement in interface I_CmsXmlContentContainer
Returns:
the currently selected element name in the loaded XML content document
See Also:
I_CmsXmlContentContainer.getXmlDocumentElement()

getXmlDocumentLocale

public java.util.Locale getXmlDocumentLocale()
Description copied from interface: I_CmsXmlContentContainer
Returns the currently selected locale used for acessing the content in the loaded XML content document.

Specified by:
getXmlDocumentLocale in interface I_CmsXmlContentContainer
Returns:
the currently selected locale used for acessing the content in the loaded XML content document
See Also:
I_CmsXmlContentContainer.getXmlDocumentLocale()

hasMoreContent

public boolean hasMoreContent()
Description copied from interface: I_CmsXmlContentContainer
Content iteration method to be used by JSP scriptlet code.

Calling this method will insert "direct edit" HTML to the output page (if required).

Specified by:
hasMoreContent in interface I_CmsXmlContentContainer
Returns:
true if more content is to be iterated
See Also:
I_CmsXmlContentContainer.hasMoreContent()

isPreloader

public boolean isPreloader()
Description copied from interface: I_CmsXmlContentContainer
Returns true if this container is used as a content preloader.

A content preloader is used to load content without looping through it.

Specified by:
isPreloader in interface I_CmsXmlContentContainer
Returns:
true if this container is used as a content preloader
See Also:
I_CmsXmlContentContainer.isPreloader()

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
See Also:
Tag.release()

setElement

public void setElement(java.lang.String element)
Sets the name of the content node element to show.

Parameters:
element - the name of the content node element to show

init

protected void init(I_CmsXmlContentContainer container)
Initializes this content loop tag.

Parameters:
container - the parent content container that provides the content element to loop