blob: b2832aa5b685a908288e9e225c9cc6548e6250a5 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_14) on Mon Apr 26 10:16:15 PDT 2010 -->
<TITLE>
PagerTool (VelocityTools 2.0 Documentation)
</TITLE>
<META NAME="keywords" CONTENT="org.apache.velocity.tools.view.PagerTool class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="PagerTool (VelocityTools 2.0 Documentation)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/view/LinkTool.html" title="class in org.apache.velocity.tools.view"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/view/ParameterTool.html" title="class in org.apache.velocity.tools.view"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/velocity/tools/view/PagerTool.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="PagerTool.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.velocity.tools.view</FONT>
<BR>
Class PagerTool</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.velocity.tools.view.PagerTool</B>
</PRE>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/velocity/tools/view/tools/AbstractPagerTool.html" title="class in org.apache.velocity.tools.view.tools">AbstractPagerTool</A>, <A HREF="../../../../../org/apache/velocity/tools/view/AbstractSearchTool.html" title="class in org.apache.velocity.tools.view">AbstractSearchTool</A></DD>
</DL>
<HR>
<DL>
<DT><PRE><FONT SIZE="-1"><A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html" title="annotation in org.apache.velocity.tools.config">@DefaultKey</A>(<A HREF="../../../../../org/apache/velocity/tools/config/DefaultKey.html#value()">value</A>="pager")
<A HREF="../../../../../org/apache/velocity/tools/config/InvalidScope.html" title="annotation in org.apache.velocity.tools.config">@InvalidScope</A>(<A HREF="../../../../../org/apache/velocity/tools/config/InvalidScope.html#value()">value</A>={"application","session"})
</FONT>public class <B>PagerTool</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
<p>View tool for doing request-based pagination of
items in an a list.
</p>
<p><b>Usage:</b><br>
To use this class, you typically push a List of items to it
by putting it in the request attributes under the value returned by
<A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getNewItemsKey()"><CODE>getNewItemsKey()</CODE></A> (default is "new.items").
You can also set the list of items to be paged in a subclass
using the setItems(List) method, or you can always set the
item list at another point (even from within the template). This
need only happen once per session if a session is available, but the
item list can be (re)set as often as you like.
</p>
<p>
Here's an example of how your subclass would be used in a template:
<pre>
#if( $pager.hasItems() )
Showing $!pager.pageDescription&lt;br&gt;
#set( $i = $pager.index )
#foreach( $item in $pager.page )
${i}. $!item &lt;br&gt;
#set( $i = $i + 1 )
#end
&lt;br&gt;
#if ( $pager.pagesAvailable &gt; 1 )
#set( $pagelink = $link.self.param("show",$!pager.itemsPerPage) )
#if( $pager.prevIndex )
&lt;a href="$pagelink.param('index',$!pager.prevIndex)"&gt;Prev&lt;/a&gt;
#end
#foreach( $index in $pager.slip )
#if( $index == $pager.index )
&lt;b&gt;$pager.pageNumber&lt;/b&gt;
#else
&lt;a href="$pagelink.param('index',$!index)"&gt;$!pager.getPageNumber($index)&lt;/a&gt;
#end
#end
#if( $pager.nextIndex )
&lt;a href="$pagelink.param('index',$!pager.nextIndex)"&gt;Next&lt;/a&gt;
#end
#end
#else
No items in list.
#end
</pre>
The output of this might look like:<br><br>
Showing 1-5 of 8<br>
1. foo<br>
2. bar<br>
3. blah<br>
4. woogie<br>
5. baz<br><br>
<b>1</b> <a href="">2</a> <a href="">Next</a>
</p>
<p>
<b>Example tools.xml configuration:</b>
<pre>
&lt;tools&gt;
&lt;toolbox scope="request"&gt;
&lt;tool class="org.apache.velocity.tools.view.PagerTool"/&gt;
&lt;/toolbox&gt;
&lt;/tools&gt;
</pre>
</p>
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 2.0</DD>
<DT><B>Version:</B></DT>
<DD>$Revision: 595822 $ $Date: 2007-11-16 13:07:51 -0800 (Fri, 16 Nov 2007) $</DD>
<DT><B>Author:</B></DT>
<DD>Nathan Bubna</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#createSession">createSession</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_INDEX_KEY">DEFAULT_INDEX_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_ITEMS_PER_PAGE">DEFAULT_ITEMS_PER_PAGE</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the default number of items shown per page</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_ITEMS_PER_PAGE_KEY">DEFAULT_ITEMS_PER_PAGE_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_NEW_ITEMS_KEY">DEFAULT_NEW_ITEMS_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_SLIP_SIZE">DEFAULT_SLIP_SIZE</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the default max number of page indices to list</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#DEFAULT_SLIP_SIZE_KEY">DEFAULT_SLIP_SIZE_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#index">index</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#indexKey">indexKey</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;java.util.List</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#items">items</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#itemsPerPage">itemsPerPage</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#itemsPerPageKey">itemsPerPageKey</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#newItemsKey">newItemsKey</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;javax.servlet.http.HttpSession</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#session">session</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#slipSize">slipSize</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private &nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#slipSizeKey">slipSizeKey</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected static&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#STORED_ITEMS_KEY">STORED_ITEMS_KEY</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the key under which items are stored in session</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#PagerTool()">PagerTool</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getCreateSession()">getCreateSession</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getFirstIndex()">getFirstIndex</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index of the first item on the current page of results
(as determined by the current index, items per page, and
the number of items).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getIndex()">getIndex</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current search result index.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getIndexKey()">getIndexKey</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.List</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getItems()">getItems</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the item list.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getItemsPerPage()">getItemsPerPage</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the set number of items to be displayed per page of items</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getItemsPerPageKey()">getItemsPerPageKey</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getLastIndex()">getLastIndex</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index of the last item on the current page of results
(as determined by the current index, items per page, and
the number of items).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getNewItemsKey()">getNewItemsKey</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getNextIndex()">getNextIndex</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the index for the next page of items
(as determined by the current index, items per page, and
the number of items).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.List</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPage()">getPage</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current "page" of search items.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPageDescription()">getPageDescription</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a description of the current page.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPageNumber()">getPageNumber</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the "page number" for the current index.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPageNumber(int)">getPageNumber</A></B>(int&nbsp;i)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the "page number" for the specified index.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPagesAvailable()">getPagesAvailable</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of pages that can be made from this list
given the set number of items per page.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.Integer</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPrevIndex()">getPrevIndex</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the index for the previous page of items
(as determined by the current index, items per page, and
the number of items).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.util.List</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlip()">getSlip</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <b>S</b>liding <b>L</b>ist of <b>I</b>ndices for <b>P</b>ages
of items.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlipSize()">getSlipSize</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of result page indices <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlip()"><CODE>getSlip()</CODE></A>
will return per request (if available).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlipSizeKey()">getSlipSizeKey</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;java.util.List</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getStoredItems()">getStoredItems</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves stored search items (if any) from the user's
session attributes.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getTotal()">getTotal</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the total number of items available.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#hasItems()">hasItems</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks whether or not the result list is empty.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#reset()">reset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the item list to null, page index to zero, and
items per page to the default.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setCreateSession(boolean)">setCreateSession</A></B>(boolean&nbsp;createSession)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setIndex(int)">setIndex</A></B>(int&nbsp;index)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the index of the first result in the current page</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setIndexKey(java.lang.String)">setIndexKey</A></B>(java.lang.String&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setItems(java.util.List)">setItems</A></B>(java.util.List&nbsp;items)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the List to page through.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setItemsPerPage(int)">setItemsPerPage</A></B>(int&nbsp;itemsPerPage)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the number of items returned in a page of items</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setItemsPerPageKey(java.lang.String)">setItemsPerPageKey</A></B>(java.lang.String&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setNewItemsKey(java.lang.String)">setNewItemsKey</A></B>(java.lang.String&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setRequest(javax.servlet.http.HttpServletRequest)">setRequest</A></B>(javax.servlet.http.HttpServletRequest&nbsp;request)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Initializes this tool with the specified <CODE>HttpServletRequest</CODE>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setSlipSize(int)">setSlipSize</A></B>(int&nbsp;slipSize)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the number of result page indices for <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlip()"><CODE>getSlip()</CODE></A> to list.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setSlipSizeKey(java.lang.String)">setSlipSizeKey</A></B>(java.lang.String&nbsp;key)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setStoredItems(java.util.List)">setStoredItems</A></B>(java.util.List&nbsp;items)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Stores current search items in the user's session attributes
(if one currently exists) in order to do efficient result pagination.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#setup(javax.servlet.http.HttpServletRequest)">setup</A></B>(javax.servlet.http.HttpServletRequest&nbsp;request)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the index, itemsPerPage, and/or slipSize *if* they are set
in the request parameters.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="DEFAULT_NEW_ITEMS_KEY"><!-- --></A><H3>
DEFAULT_NEW_ITEMS_KEY</H3>
<PRE>
public static final java.lang.String <B>DEFAULT_NEW_ITEMS_KEY</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.view.PagerTool.DEFAULT_NEW_ITEMS_KEY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_INDEX_KEY"><!-- --></A><H3>
DEFAULT_INDEX_KEY</H3>
<PRE>
public static final java.lang.String <B>DEFAULT_INDEX_KEY</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.view.PagerTool.DEFAULT_INDEX_KEY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_ITEMS_PER_PAGE_KEY"><!-- --></A><H3>
DEFAULT_ITEMS_PER_PAGE_KEY</H3>
<PRE>
public static final java.lang.String <B>DEFAULT_ITEMS_PER_PAGE_KEY</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.view.PagerTool.DEFAULT_ITEMS_PER_PAGE_KEY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_SLIP_SIZE_KEY"><!-- --></A><H3>
DEFAULT_SLIP_SIZE_KEY</H3>
<PRE>
public static final java.lang.String <B>DEFAULT_SLIP_SIZE_KEY</B></PRE>
<DL>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.view.PagerTool.DEFAULT_SLIP_SIZE_KEY">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_ITEMS_PER_PAGE"><!-- --></A><H3>
DEFAULT_ITEMS_PER_PAGE</H3>
<PRE>
public static final int <B>DEFAULT_ITEMS_PER_PAGE</B></PRE>
<DL>
<DD>the default number of items shown per page
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.view.PagerTool.DEFAULT_ITEMS_PER_PAGE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="DEFAULT_SLIP_SIZE"><!-- --></A><H3>
DEFAULT_SLIP_SIZE</H3>
<PRE>
public static final int <B>DEFAULT_SLIP_SIZE</B></PRE>
<DL>
<DD>the default max number of page indices to list
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.velocity.tools.view.PagerTool.DEFAULT_SLIP_SIZE">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="STORED_ITEMS_KEY"><!-- --></A><H3>
STORED_ITEMS_KEY</H3>
<PRE>
protected static final java.lang.String <B>STORED_ITEMS_KEY</B></PRE>
<DL>
<DD>the key under which items are stored in session
<P>
<DL>
</DL>
</DL>
<HR>
<A NAME="newItemsKey"><!-- --></A><H3>
newItemsKey</H3>
<PRE>
private java.lang.String <B>newItemsKey</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="indexKey"><!-- --></A><H3>
indexKey</H3>
<PRE>
private java.lang.String <B>indexKey</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="itemsPerPageKey"><!-- --></A><H3>
itemsPerPageKey</H3>
<PRE>
private java.lang.String <B>itemsPerPageKey</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="slipSizeKey"><!-- --></A><H3>
slipSizeKey</H3>
<PRE>
private java.lang.String <B>slipSizeKey</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="createSession"><!-- --></A><H3>
createSession</H3>
<PRE>
private boolean <B>createSession</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="items"><!-- --></A><H3>
items</H3>
<PRE>
private java.util.List <B>items</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="index"><!-- --></A><H3>
index</H3>
<PRE>
private int <B>index</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="slipSize"><!-- --></A><H3>
slipSize</H3>
<PRE>
private int <B>slipSize</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="itemsPerPage"><!-- --></A><H3>
itemsPerPage</H3>
<PRE>
private int <B>itemsPerPage</B></PRE>
<DL>
<DL>
</DL>
</DL>
<HR>
<A NAME="session"><!-- --></A><H3>
session</H3>
<PRE>
protected javax.servlet.http.HttpSession <B>session</B></PRE>
<DL>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="PagerTool()"><!-- --></A><H3>
PagerTool</H3>
<PRE>
public <B>PagerTool</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="setRequest(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
setRequest</H3>
<PRE>
public void <B>setRequest</B>(javax.servlet.http.HttpServletRequest&nbsp;request)</PRE>
<DL>
<DD>Initializes this tool with the specified <CODE>HttpServletRequest</CODE>.
This is required for this tool to operate and will throw a
NullPointerException if this is not set or is set to <code>null</code>.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setup(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
setup</H3>
<PRE>
public void <B>setup</B>(javax.servlet.http.HttpServletRequest&nbsp;request)</PRE>
<DL>
<DD>Sets the index, itemsPerPage, and/or slipSize *if* they are set
in the request parameters. Likewise, this will set the item list
to be paged *if* there is a list pushed into the request attributes
under the <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getNewItemsKey()"><CODE>getNewItemsKey()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - the current HttpServletRequest</DL>
</DD>
</DL>
<HR>
<A NAME="setNewItemsKey(java.lang.String)"><!-- --></A><H3>
setNewItemsKey</H3>
<PRE>
public void <B>setNewItemsKey</B>(java.lang.String&nbsp;key)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getNewItemsKey()"><!-- --></A><H3>
getNewItemsKey</H3>
<PRE>
public java.lang.String <B>getNewItemsKey</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setIndexKey(java.lang.String)"><!-- --></A><H3>
setIndexKey</H3>
<PRE>
public void <B>setIndexKey</B>(java.lang.String&nbsp;key)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getIndexKey()"><!-- --></A><H3>
getIndexKey</H3>
<PRE>
public java.lang.String <B>getIndexKey</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setItemsPerPageKey(java.lang.String)"><!-- --></A><H3>
setItemsPerPageKey</H3>
<PRE>
public void <B>setItemsPerPageKey</B>(java.lang.String&nbsp;key)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getItemsPerPageKey()"><!-- --></A><H3>
getItemsPerPageKey</H3>
<PRE>
public java.lang.String <B>getItemsPerPageKey</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setSlipSizeKey(java.lang.String)"><!-- --></A><H3>
setSlipSizeKey</H3>
<PRE>
public void <B>setSlipSizeKey</B>(java.lang.String&nbsp;key)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getSlipSizeKey()"><!-- --></A><H3>
getSlipSizeKey</H3>
<PRE>
public java.lang.String <B>getSlipSizeKey</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setCreateSession(boolean)"><!-- --></A><H3>
setCreateSession</H3>
<PRE>
public void <B>setCreateSession</B>(boolean&nbsp;createSession)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getCreateSession()"><!-- --></A><H3>
getCreateSession</H3>
<PRE>
public boolean <B>getCreateSession</B>()</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="reset()"><!-- --></A><H3>
reset</H3>
<PRE>
public void <B>reset</B>()</PRE>
<DL>
<DD>Sets the item list to null, page index to zero, and
items per page to the default.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="setItems(java.util.List)"><!-- --></A><H3>
setItems</H3>
<PRE>
public void <B>setItems</B>(java.util.List&nbsp;items)</PRE>
<DL>
<DD>Sets the List to page through.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>items</CODE> - - the <CODE>List</CODE> of items to be paged through</DL>
</DD>
</DL>
<HR>
<A NAME="setIndex(int)"><!-- --></A><H3>
setIndex</H3>
<PRE>
public void <B>setIndex</B>(int&nbsp;index)</PRE>
<DL>
<DD>Sets the index of the first result in the current page
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>index</CODE> - the result index to start the current page with</DL>
</DD>
</DL>
<HR>
<A NAME="setItemsPerPage(int)"><!-- --></A><H3>
setItemsPerPage</H3>
<PRE>
public void <B>setItemsPerPage</B>(int&nbsp;itemsPerPage)</PRE>
<DL>
<DD>Sets the number of items returned in a page of items
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>itemsPerPage</CODE> - the number of items to be returned per page</DL>
</DD>
</DL>
<HR>
<A NAME="setSlipSize(int)"><!-- --></A><H3>
setSlipSize</H3>
<PRE>
public void <B>setSlipSize</B>(int&nbsp;slipSize)</PRE>
<DL>
<DD>Sets the number of result page indices for <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlip()"><CODE>getSlip()</CODE></A> to list.
(for google-ish result page links).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>slipSize</CODE> - - the number of result page indices to list<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlip()"><CODE>getSlip()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getItemsPerPage()"><!-- --></A><H3>
getItemsPerPage</H3>
<PRE>
public int <B>getItemsPerPage</B>()</PRE>
<DL>
<DD>Returns the set number of items to be displayed per page of items
<P>
<DD><DL>
<DT><B>Returns:</B><DD>current number of items shown per page</DL>
</DD>
</DL>
<HR>
<A NAME="getSlipSize()"><!-- --></A><H3>
getSlipSize</H3>
<PRE>
public int <B>getSlipSize</B>()</PRE>
<DL>
<DD>Returns the number of result page indices <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlip()"><CODE>getSlip()</CODE></A>
will return per request (if available).
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the number of result page indices <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getSlip()"><CODE>getSlip()</CODE></A>
will try to return</DL>
</DD>
</DL>
<HR>
<A NAME="getIndex()"><!-- --></A><H3>
getIndex</H3>
<PRE>
public int <B>getIndex</B>()</PRE>
<DL>
<DD>Returns the current search result index.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the index for the beginning of the current page</DL>
</DD>
</DL>
<HR>
<A NAME="hasItems()"><!-- --></A><H3>
hasItems</H3>
<PRE>
public boolean <B>hasItems</B>()</PRE>
<DL>
<DD>Checks whether or not the result list is empty.
<P>
<DD><DL>
<DT><B>Returns:</B><DD><code>true</code> if the result list is not empty.</DL>
</DD>
</DL>
<HR>
<A NAME="getItems()"><!-- --></A><H3>
getItems</H3>
<PRE>
public java.util.List <B>getItems</B>()</PRE>
<DL>
<DD>Returns the item list. This is guaranteed
to never return <code>null</code>.
<P>
<DD><DL>
<DT><B>Returns:</B><DD><CODE>List</CODE> of all the items</DL>
</DD>
</DL>
<HR>
<A NAME="getLastIndex()"><!-- --></A><H3>
getLastIndex</H3>
<PRE>
public java.lang.Integer <B>getLastIndex</B>()</PRE>
<DL>
<DD>Returns the index of the last item on the current page of results
(as determined by the current index, items per page, and
the number of items). If there is no current page, then null is
returned.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>index for the last item on this page or <code>null</code>
if none exists<DT><B>Since:</B></DT>
<DD>VelocityTools 1.3</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getNextIndex()"><!-- --></A><H3>
getNextIndex</H3>
<PRE>
public java.lang.Integer <B>getNextIndex</B>()</PRE>
<DL>
<DD>Returns the index for the next page of items
(as determined by the current index, items per page, and
the number of items). If no "next page" exists, then null is
returned.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>index for the next page or <code>null</code> if none exists</DL>
</DD>
</DL>
<HR>
<A NAME="getFirstIndex()"><!-- --></A><H3>
getFirstIndex</H3>
<PRE>
public java.lang.Integer <B>getFirstIndex</B>()</PRE>
<DL>
<DD>Returns the index of the first item on the current page of results
(as determined by the current index, items per page, and
the number of items). If there is no current page, then null is
returned. This is different than <A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getIndex()"><CODE>getIndex()</CODE></A> in that it
is adjusted to fit the reality of the items available and is not a
mere accessor for the current, user-set index value.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>index for the first item on this page or <code>null</code>
if none exists<DT><B>Since:</B></DT>
<DD>VelocityTools 1.3</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getPrevIndex()"><!-- --></A><H3>
getPrevIndex</H3>
<PRE>
public java.lang.Integer <B>getPrevIndex</B>()</PRE>
<DL>
<DD>Return the index for the previous page of items
(as determined by the current index, items per page, and
the number of items). If no "next page" exists, then null is
returned.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>index for the previous page or <code>null</code> if none exists</DL>
</DD>
</DL>
<HR>
<A NAME="getPagesAvailable()"><!-- --></A><H3>
getPagesAvailable</H3>
<PRE>
public int <B>getPagesAvailable</B>()</PRE>
<DL>
<DD>Returns the number of pages that can be made from this list
given the set number of items per page.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getPage()"><!-- --></A><H3>
getPage</H3>
<PRE>
public java.util.List <B>getPage</B>()</PRE>
<DL>
<DD>Returns the current "page" of search items.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>a <CODE>List</CODE> of items for the "current page"</DL>
</DD>
</DL>
<HR>
<A NAME="getPageNumber(int)"><!-- --></A><H3>
getPageNumber</H3>
<PRE>
public java.lang.Integer <B>getPageNumber</B>(int&nbsp;i)</PRE>
<DL>
<DD>Returns the "page number" for the specified index. Because the page
number is used for the user interface, the page numbers are 1-based.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>i</CODE> - the index that you want the page number for
<DT><B>Returns:</B><DD>the approximate "page number" for the specified index or
<code>null</code> if there are no items</DL>
</DD>
</DL>
<HR>
<A NAME="getPageNumber()"><!-- --></A><H3>
getPageNumber</H3>
<PRE>
public java.lang.Integer <B>getPageNumber</B>()</PRE>
<DL>
<DD>Returns the "page number" for the current index. Because the page
number is used for the user interface, the page numbers are 1-based.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the approximate "page number" for the current index or
<code>null</code> if there are no items</DL>
</DD>
</DL>
<HR>
<A NAME="getTotal()"><!-- --></A><H3>
getTotal</H3>
<PRE>
public int <B>getTotal</B>()</PRE>
<DL>
<DD>Returns the total number of items available.
<P>
<DD><DL>
<DT><B>Since:</B></DT>
<DD>VelocityTools 1.3</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getPageDescription()"><!-- --></A><H3>
getPageDescription</H3>
<PRE>
public java.lang.String <B>getPageDescription</B>()</PRE>
<DL>
<DD><p>Returns a description of the current page. This implementation
displays a 1-based range of result indices and the total number
of items. (e.g. "1 - 10 of 42" or "7 of 7") If there are no items,
this will return "0 of 0".</p>
<p>Sub-classes may override this to provide a customized
description (such as one in another language).</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD>a description of the current page</DL>
</DD>
</DL>
<HR>
<A NAME="getSlip()"><!-- --></A><H3>
getSlip</H3>
<PRE>
public java.util.List <B>getSlip</B>()</PRE>
<DL>
<DD>Returns a <b>S</b>liding <b>L</b>ist of <b>I</b>ndices for <b>P</b>ages
of items.
<p>Essentially, this returns a list of item indices that correspond
to available pages of items (as based on the set items-per-page).
This makes it relativly easy to do a google-ish set of links to
available pages.</p>
<p>Note that this list of Integers is 0-based to correspond with the
underlying result indices and not the displayed page numbers (see
<A HREF="../../../../../org/apache/velocity/tools/view/PagerTool.html#getPageNumber(int)"><CODE>getPageNumber(int)</CODE></A>).</p>
<P>
<DD><DL>
<DT><B>Returns:</B><DD><CODE>List</CODE> of Integers representing the indices of result
pages or empty list if there's one or less pages available</DL>
</DD>
</DL>
<HR>
<A NAME="getStoredItems()"><!-- --></A><H3>
getStoredItems</H3>
<PRE>
protected java.util.List <B>getStoredItems</B>()</PRE>
<DL>
<DD>Retrieves stored search items (if any) from the user's
session attributes.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the <CODE>List</CODE> retrieved from memory</DL>
</DD>
</DL>
<HR>
<A NAME="setStoredItems(java.util.List)"><!-- --></A><H3>
setStoredItems</H3>
<PRE>
protected void <B>setStoredItems</B>(java.util.List&nbsp;items)</PRE>
<DL>
<DD>Stores current search items in the user's session attributes
(if one currently exists) in order to do efficient result pagination.
<p>Override this to store search items somewhere besides the
HttpSession or to prevent storage of items across requests. In
the former situation, you must also override getStoredItems().</p>
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>items</CODE> - the <CODE>List</CODE> to be stored</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/view/LinkTool.html" title="class in org.apache.velocity.tools.view"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/velocity/tools/view/ParameterTool.html" title="class in org.apache.velocity.tools.view"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/velocity/tools/view/PagerTool.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="PagerTool.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright (c) 2003-2007 Apache Software Foundation
</BODY>
</HTML>