org.opencms.jsp
Class CmsJspTagContentCheck

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by org.opencms.jsp.CmsJspTagContentCheck
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class CmsJspTagContentCheck
extends javax.servlet.jsp.tagext.TagSupport

Used to check the availablity of an XML content item for conditional display.

Since:
6.0.0
Version:
$Revision: 1.25 $
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
CmsJspTagContentCheck()
           
 
Method Summary
static boolean contentCheckTagAction(java.lang.String elementList, java.lang.String prefix, boolean checkall, boolean checknone, I_CmsXmlDocument content, java.util.Locale locale)
          Internal action method to check the elements from the provided XML content item.
 int doEndTag()
           
 int doStartTag()
           
 java.lang.String getIfexists()
          Returns the list of elements to check.
 java.lang.String getIfexistsall()
          Returns the list of elements to check.
 java.lang.String getIfexistsnone()
          Returns the list of elements to check.
 java.lang.String getIfexistsone()
          Returns the list of elements to check.
 java.lang.String getLocale()
          Returns the locale used for checking.
 void release()
           
 void setIfexists(java.lang.String elementList)
          Sets the list of elements to check for.
 void setIfexistsall(java.lang.String elementList)
          Sets the list of elements to check for.
 void setIfexistsnone(java.lang.String elementList)
          Sets the list of elements to check for.
 void setIfexistsone(java.lang.String elementList)
          Sets the list of elements to check for.
 void setLocale(java.lang.String locale)
          Sets the locale used for checking.
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, 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

CmsJspTagContentCheck

public CmsJspTagContentCheck()
Method Detail

contentCheckTagAction

public static boolean contentCheckTagAction(java.lang.String elementList,
                                            java.lang.String prefix,
                                            boolean checkall,
                                            boolean checknone,
                                            I_CmsXmlDocument content,
                                            java.util.Locale locale)
Internal action method to check the elements from the provided XML content item.

Parameters:
elementList - the list of elements to check for
prefix - the Xpath prefix to append the elements to (in case of nested schemas)
checkall - flag to indicate that all elements should be checked
checknone - flag to indicate that the check is done for nonexisting elements
content - the XML content document to check the elements from
locale - the locale to check the element for
Returns:
true if the test succeeds, false if the test fails

doEndTag

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

doStartTag

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

getIfexists

public java.lang.String getIfexists()
Returns the list of elements to check.

Returns:
the list of elements to check

getIfexistsall

public java.lang.String getIfexistsall()
Returns the list of elements to check.

Returns:
the list of elements to check

getIfexistsnone

public java.lang.String getIfexistsnone()
Returns the list of elements to check.

Returns:
the list of elements to check

getIfexistsone

public java.lang.String getIfexistsone()
Returns the list of elements to check.

Returns:
the list of elements to check

getLocale

public java.lang.String getLocale()
Returns the locale used for checking.

Returns:
the locale used for checking

release

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

setIfexists

public void setIfexists(java.lang.String elementList)
Sets the list of elements to check for.

Parameters:
elementList - the list of elements to check for

setIfexistsall

public void setIfexistsall(java.lang.String elementList)
Sets the list of elements to check for.

Parameters:
elementList - the list of elements to check for

setIfexistsnone

public void setIfexistsnone(java.lang.String elementList)
Sets the list of elements to check for.

Parameters:
elementList - the list of elements to check for

setIfexistsone

public void setIfexistsone(java.lang.String elementList)
Sets the list of elements to check for.

Parameters:
elementList - the list of elements to check for

setLocale

public void setLocale(java.lang.String locale)
Sets the locale used for checking.

Parameters:
locale - the locale to set