|
PAJES 2.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.pajes.db.entity.MaintenanceDisplayElement
org.pajes.db.entity.Lister
org.pajes.db.entity.PagingLister
Abstract super-class of all classes that create a Paje with a list of Entity objects, that support
showing a subset of all Entity objects and paging through the subsets.
All sub-classes MUST have a no-parameter constructor.
| Field Summary | |
static java.lang.String |
FIRST_LIST_VALUE
The value ("f") of the LIST_PARAMETER that indicates that the
request is to display the first page of the list. |
static java.lang.String |
LAST_LIST_VALUE
The value ("l") of the LIST_PARAMETER that indicates that the
request is to display the last page of the list. |
static java.lang.String |
LIST_PARAMETER
The name ("_l_") of the request parameter that determines which subset of the Entity objects will be displayed on this invocation. |
static java.lang.String |
NEXT_LIST_VALUE
The value ("n") of the LIST_PARAMETER that indicates that the
request is to display the next page of the list. |
static java.lang.String |
PREVIOUS_LIST_VALUE
The value ("p") of the LIST_PARAMETER that indicates that the
request is to display the previous page of the list. |
static java.lang.String |
ROWS_PARAMETER
The name ("rows_parameter") of the request parameter that determines the number of Entity objects will be displayed on a page. |
| Fields inherited from class org.pajes.db.entity.Lister |
SEARCH_ATTRIBUTE_SUFFIX, SEARCH_PARAMETER, SEARCH_PARAMETER_VALUE, SORT_ATTRIBUTE_SUFFIX, SORT_PARAMETER |
| Constructor Summary | |
PagingLister()
|
|
| Method Summary | |
protected int |
getFirstIndex()
Returns the index in the result set of the first Entity to be
displayed on the page. |
protected int |
getLastIndex()
Returns the index in the result set of the last Entity displayed
on the page. |
protected int |
getLastPageNumber()
Convenience method to return the last page number. |
protected int |
getPageNumber()
Convenience method to return the current page number. |
protected int |
getPageSize()
Returns the maximum number of rows that will be displayed on each page. |
protected int |
getSetSize()
Returns the number of rows in the total result set. |
void |
init(Manager manager,
javax.servlet.ServletContext context)
Initialises the PagingLister. |
protected Entity[] |
retrieveSet()
Returns the set of Entity objects to be displayed in the list. |
protected void |
setFirstIndex(int first)
Places the index in the result set of the first Entity displayed
on the page into the HttpSession. |
protected void |
setPageSize(int rows)
Sets the number of rows that will be displayed on each page. |
| Methods inherited from class org.pajes.db.entity.Lister |
build, getAnchor, getBaseAnchor, getHeaderRowCount, getPaje, getRow, getScope, getSearchAttributeName, getSortAttributeName, init, onCell, onFirstRow, onLastRow, onRow, setNullDisplay, useQualifiedColumnNamesInScope |
| Methods inherited from class org.pajes.db.entity.MaintenanceDisplayElement |
clone, getManager, getRequest, getServletContext, init, isInitialised, setRequest |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String FIRST_LIST_VALUE
LIST_PARAMETER that indicates that the
request is to display the first page of the list.
public static final java.lang.String LAST_LIST_VALUE
LIST_PARAMETER that indicates that the
request is to display the last page of the list.
public static final java.lang.String LIST_PARAMETER
Entity objects will be displayed on this invocation.
The parameter value must be one of:
FIRST_LIST_VALUE
LAST_LIST_VALUE
NEXT_LIST_VALUE
PREVIOUS_LIST_VALUE
public static final java.lang.String NEXT_LIST_VALUE
LIST_PARAMETER that indicates that the
request is to display the next page of the list. If no LIST_PARAMETER is specified, this is the default.
public static final java.lang.String PREVIOUS_LIST_VALUE
LIST_PARAMETER that indicates that the
request is to display the previous page of the list.
public static final java.lang.String ROWS_PARAMETER
Entity objects will be displayed on a page.
| Constructor Detail |
public PagingLister()
| Method Detail |
public void init(Manager manager,
javax.servlet.ServletContext context)
throws java.io.IOException
Sub-classes should not over-ride this method. Instead, sub-classes
should over-ride the Lister.init(org.pajes.db.entity.Manager, javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest) method, which is called
automatically by this method. If this method is over-rdden, the
sub-class MUST call super.init(manager, context,
request) to correctly iniitalise the lister.
init in class Listermanager - the Manager that manages the Entity objects to be
listed.context - the ServletContext.
java.io.IOException - if an IO exception occurs.
protected void setFirstIndex(int first)
throws java.lang.IndexOutOfBoundsException,
java.sql.SQLException
Entity displayed
on the page into the HttpSession.
first - the index in the result set of the first Entity to
be displayed.
java.lang.IndexOutOfBoundsException - if the argument is less than 1.
java.sql.SQLException - if an error occurs determining the set size.
protected int getFirstIndex()
throws java.sql.SQLException
Entity to be
displayed on the page.
Entity to be
displayed.
java.sql.SQLException - if an error occurs determining the set size.
protected int getLastIndex()
throws java.sql.SQLException
Entity displayed
on the page.
Entity
displayed.
java.sql.SQLException - if an error occurs determining the set size.
protected int getLastPageNumber()
throws java.sql.SQLException
return (this.getSetSize()/this.getPageSize()) + 1;
java.sql.SQLException - if an error occurs determining the set size.
protected int getPageNumber()
throws java.sql.SQLException
return (this.getFirstIndex()/this.getPageSize()) + 1;
java.sql.SQLException - if an error occurs determining the set size.protected void setPageSize(int rows)
This default value may be over-ridden in the web application deployment
descriptor. To set the default value, create a
<context-param> with a
<param-name> of
org.pajes.db.entity.PagingLister.pageSize and a
<param-value> containing the text. For example:
<context-param>
<param-name>org.pajes.db.entity.PagingLister.pageSize</param-name>
<param-value>20</param-value>
</context-param>
rows - The new page size value.protected int getPageSize()
protected int getSetSize()
throws java.sql.SQLException
java.sql.SQLException - if an error occurs determining the set size.
protected Entity[] retrieveSet()
throws java.sql.SQLException
Entity objects to be displayed in the list.
The default implementation returns a maximum of getPageSize()
entities that meet the scope, starting with the
getFirstIndex(). It then updates the
HttpSession with getFirstIndex().
retrieveSet in class Listerjava.sql.SQLException - if an error occurs retrieving the Entity
objects.Lister.getScope()
|
PAJES 2.3.9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||