org.hdpagination.web.action
Interface PaginationAction

All Known Implementing Classes:
AbstractCommandPaginationAction, AbstractPaginationAction

public interface PaginationAction

Base Action interface,representing a component processing one pagination based search request. Each custom Action class which is supposed to handle a pagination searching must implement this interface or extend from other abstract classes in this package. A few examples of those abstract classes includes: AbstractPaginationAction, AbstractCommandPaginationAction It is recommended to subclass from AbstractPaginationAction or AbstractCommandPaginationAction rather than implementing PaginationAction interface directly as they have already realized most of the methods.Custom action implements method getQueryCallback(HttpServletRequest request) of AbstractPaginationAction or getQueryCallback(HttpServletRequest request, Object command) of AbstractCommandPaginationAction. Then leverage Spring(IoC Container Framework) to inject configuration related properties.

Author:
Liangfeng Ren

Method Summary
 java.lang.String getAttributeName4Data()
          The name of attribute which holds the search result in the specified scope.
 java.lang.String getDataScope()
          The scope where the search result is to be stored.
 java.lang.String getForwardPath()
          The URL path to which it will forward after execution of query.
 java.lang.String getId()
          Identifier of each search processing Action instance.
 java.lang.String getInputPath()
          The URL of input page.
 int getPageSize()
          How many records should be displayed in one page
 QueryCallback getQueryCallback(javax.servlet.http.HttpServletRequest request)
          Generate a QueryCallback instance based on request parameters which will be executed by the back-end search execute engine.
 QueryTemplate getQueryTemplate()
          The query execution engine.
 SearchResultHandler getSearchResultHandler()
          The handler to deal with the search result.
 Validator getValidator()
          The validator to process the validation of input data before executing the search
 View getView()
          Get the view who is responsible for rendering page.
 boolean isCacheRecordsCount()
          Flag to indicate whether the count of total records should be cached to improve performance.
 

Method Detail

getId

java.lang.String getId()
Identifier of each search processing Action instance. It should be unique for each page or search functionality. The PaginationServlet relies on this property to match the action instance with coming request URL (ServletPath). Related Pagination Tags rely on it to retrieve corresponding pagination information (such as "number of total records", "page number of current page") from HttpSession which is recorded in HttpSession the first time the query was executed.

Returns:
Identifier of Action

getPageSize

int getPageSize()
How many records should be displayed in one page

Returns:

getForwardPath

java.lang.String getForwardPath()
The URL path to which it will forward after execution of query. However, if the view used in PaginationAction (It depends on view property of PaginationAction or GlobalConfig) is TilesView or Tiles2View, it is interpreted as name of Tiles definition

Returns:
See Also:
getView(), GlobalConfig.getView()

getInputPath

java.lang.String getInputPath()
The URL of input page. Like the property forwardPath, if the view used in PaginationAction (It depends on view property of PaginationAction or GlobalConfig) is TilesView or Tiles2View, it is interpreted as name of Tiles definition corresponding to the input page.

It's used for validation only. If validation fails it will forward back to input URL. Its default value is the same as forwardPath.

Returns:
See Also:
getView(), GlobalConfig.getView()

getQueryCallback

QueryCallback getQueryCallback(javax.servlet.http.HttpServletRequest request)
Generate a QueryCallback instance based on request parameters which will be executed by the back-end search execute engine.

Returns:

getQueryTemplate

QueryTemplate getQueryTemplate()
The query execution engine. It can be OR-Mapping (e.g. Hibernate), JPA or particular Database JDBC engine. Currently it supports Hibernate2,Hibernate3,JPA,Oracle JDBC,MySql JDBC.

Returns:

getDataScope

java.lang.String getDataScope()
The scope where the search result is to be stored. Valid scope value includes 'request', 'session' and 'application'. By default,data is stored in 'request' scope.

Returns:

getAttributeName4Data

java.lang.String getAttributeName4Data()
The name of attribute which holds the search result in the specified scope. The default attribute name is defined in Globals.QUERY_RESULT_KEY

Returns:

getSearchResultHandler

SearchResultHandler getSearchResultHandler()
The handler to deal with the search result.

Returns:

getValidator

Validator getValidator()
The validator to process the validation of input data before executing the search

Returns:

getView

View getView()
Get the view who is responsible for rendering page. If null is returned, the view returned from the method GlobalConfig.getView() is used to render page.

Returns:

isCacheRecordsCount

boolean isCacheRecordsCount()
Flag to indicate whether the count of total records should be cached to improve performance. It's not cached by default, which means total number of records is recounted against database when navigating to other pages or resorting the result

Returns:


Copyright © 2008 HDPagination All Rights Reserved.