Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ru.gammalabs.ice.frontend.web.taglib.ie
Class IEContainerTag  view IEContainerTag download IEContainerTag.java

java.lang.Object
  extended byjavax.servlet.jsp.tagext.TagSupport
      extended byru.gammalabs.ice.frontend.web.taglib.ie.IEContainerTag
All Implemented Interfaces:
javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, ru.gammalabs.ice.frontend.PageableContainer, java.io.Serializable, javax.servlet.jsp.tagext.Tag

public class IEContainerTag
extends javax.servlet.jsp.tagext.TagSupport
implements ru.gammalabs.ice.frontend.PageableContainer

The class implements support of container tag, which is used in JSP pages to denote a container of information elements.

The tag only performs two tasks:
a) it searches for information elements using the given parameters;
b) in case the search returns one or more elements, the tag displays its body.

In detail:
- The tag tries to retrieve a SearchCriteria object with the given name, specified via searchCriteriaName mandatory parameter of this tag. All SearchCriteria objects are stored in the current RequestProcessor. In case the tag fails to retrieve the SearchCriteria object, no further processing is performed, and the tag doesn't display its body.
- The tag uses InformationElementManager and the retrieved SearchCriteria object to search for information elements. InformationElementManager only returns those information elements that the currently logged on user has access to (the user has enough permissions to view these information elements). In case there are no elements found, no further processing is performed, and the tag doesn't display its body.
- In case SearchCriteria contains paging parameters (recordsPerPage and firstRecordNumber), InformationElementManager retrieves only those information elements that match the current page.
- The tag neither analyzes the contents of the retrieved information elements, nor displays them in any way - it just stores them in the RequestData object, to make them available for IEIterationTag and IETag.

Both iteration tags (implemented by IEIterationTag) and information element tags (implemented by IETag) are valid to be used in a JSP page inside of the body of a container tag.

Container tags can't be nested.

Here is a valid example of a container tag used inside of a JSP page:
<div align="center">
<ie:container searchCriteriaName="uselessContainer">
<table>
<tr><td>This container tag is pretty useless,</td></tr>
<tr><td>because it doesn't contain iteration tags or information element tags within its body</td></tr>
</table>
</ie:container>
</div>

Version:
1.1

Field Summary
private  java.lang.Long currentPageNumber
           
private static org.apache.log4j.Category log
           
private  java.lang.Long numberOfPages
           
private  java.lang.Long numberOfRecords
           
private  java.lang.String searchCriteriaName
           
 
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
IEContainerTag()
           
 
Method Summary
 int doEndTag()
          Default processing of the end tag returning EVAL_PAGE.
 int doStartTag()
          Default processing of the start tag, returning SKIP_BODY.
 ru.gammalabs.ice.utils.http.Requestable getCriteriaForPageTurns(int pageTurns)
          Returns "criteria" object that represents page that is pageTurns away from currently displayed page.
 java.lang.String getCriteriaId()
          Returns unique string identifier for this list's "criteria" object.
 int getCurrentPageNumber()
          Returns current page number.
 int getPagesNumber()
          Returns total number of pages contained in this list.
 long getRecordsNumber()
          Returns total number of records contained in this list.
 java.lang.String getSearchCriteriaName()
           
 void setSearchCriteriaName(java.lang.String searchCriteriaName)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, 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

log

private static org.apache.log4j.Category log

searchCriteriaName

private java.lang.String searchCriteriaName

numberOfPages

private java.lang.Long numberOfPages

currentPageNumber

private java.lang.Long currentPageNumber

numberOfRecords

private java.lang.Long numberOfRecords
Constructor Detail

IEContainerTag

public IEContainerTag()
Method Detail

getSearchCriteriaName

public java.lang.String getSearchCriteriaName()

setSearchCriteriaName

public void setSearchCriteriaName(java.lang.String searchCriteriaName)

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Description copied from class: javax.servlet.jsp.tagext.TagSupport
Default processing of the start tag, returning SKIP_BODY.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Description copied from class: javax.servlet.jsp.tagext.TagSupport
Default processing of the end tag returning EVAL_PAGE.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag

getCriteriaForPageTurns

public ru.gammalabs.ice.utils.http.Requestable getCriteriaForPageTurns(int pageTurns)
                                                                throws ru.gammalabs.ice.frontend.NoSuchPageException
Returns "criteria" object that represents page that is pageTurns away from currently displayed page.

Specified by:
getCriteriaForPageTurns in interface ru.gammalabs.ice.frontend.PageableContainer

getCriteriaId

public java.lang.String getCriteriaId()
Returns unique string identifier for this list's "criteria" object.

Specified by:
getCriteriaId in interface ru.gammalabs.ice.frontend.PageableContainer

getPagesNumber

public int getPagesNumber()
Returns total number of pages contained in this list.

Specified by:
getPagesNumber in interface ru.gammalabs.ice.frontend.PageableContainer

getRecordsNumber

public long getRecordsNumber()
Returns total number of records contained in this list.

Specified by:
getRecordsNumber in interface ru.gammalabs.ice.frontend.PageableContainer

getCurrentPageNumber

public int getCurrentPageNumber()
Returns current page number.

Specified by:
getCurrentPageNumber in interface ru.gammalabs.ice.frontend.PageableContainer