org.hdpagination.web.jsf
Class PaginateDefinition

java.lang.Object
  extended by org.hdpagination.web.jsf.PaginateDefinition
All Implemented Interfaces:
org.springframework.beans.factory.BeanNameAware

public class PaginateDefinition
extends java.lang.Object
implements org.springframework.beans.factory.BeanNameAware

This class defines configuration properties which are used in pagination search under JSF environment.

Since:
1.1
Author:
Liangfeng Ren

Constructor Summary
PaginateDefinition()
           
 
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()
          Outcome of action method execute in PaginateFacesAction.
 java.lang.Integer getPageSize()
          How many records should be displayed in one page
 QueryTemplate getQueryTemplate()
          The query execution engine.
 ResultHandler getResultHandler()
          Return the handler to deal with the search result.
 boolean isCacheRecordsCount()
          Flag to indicate whether the count of total records should be cached to improve performance.
 java.lang.String retrievePageKey()
          Return the page key, which will be used as the attribute name to save an instance of Page in session.
 void setAttributeName4Data(java.lang.String attributeName4Data)
          Set the name of attribute which holds the search result in the specified scope.
 void setBeanName(java.lang.String name)
           
 void setCacheRecordsCount(boolean cacheRecordsCount)
          Flag to indicate whether the count of total records should be cached to improve performance.
 void setDataScope(java.lang.String dataScope)
          Set the scope where the search result is to be stored.
 void setForwardPath(java.lang.String forwardPath)
          Set outcome of action method execute in PaginateFacesAction.
 void setPageSize(java.lang.Integer pageSize)
          Set page size which specifies how many records should be displayed in one page.
 void setQueryTemplate(QueryTemplate queryTemplate)
          Set the query execution engine.
 void setResultHandler(ResultHandler searchResultHandler)
          Set the handler to deal with the search result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PaginateDefinition

public PaginateDefinition()
Method Detail

retrievePageKey

public java.lang.String retrievePageKey()
Return the page key, which will be used as the attribute name to save an instance of Page in session. Related Pagination Tags rely on this instance to retrieve corresponding pagination information (such as "number of total records", "page number of current page"). This method is only for internal use by framework.

Returns:

getPageSize

public java.lang.Integer getPageSize()
How many records should be displayed in one page

Returns:

setPageSize

public void setPageSize(java.lang.Integer pageSize)
Set page size which specifies how many records should be displayed in one page.

Parameters:
pageSize -

getForwardPath

public java.lang.String getForwardPath()
Outcome of action method execute in PaginateFacesAction. The outcome value eventually determines the JSF navigation flow. As specified by JSF, if the value (outcome) is not defined (null), the same page is redisplayed, which covers the majority of cases where search input shares the same page with search result.

Returns:

setForwardPath

public void setForwardPath(java.lang.String forwardPath)
Set outcome of action method execute in PaginateFacesAction. The outcome value eventually determines the JSF navigation flow. As specified by JSF, if the value (outcome) is not defined (null), the same page is redisplayed, which covers the majority of cases where search input shares the same page with search result.

Parameters:
forwardPath -

getQueryTemplate

public 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:

setQueryTemplate

public void setQueryTemplate(QueryTemplate queryTemplate)
Set 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.

Parameters:
queryTemplate -

getDataScope

public 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:

setDataScope

public void setDataScope(java.lang.String dataScope)
Set 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.

Parameters:
dataScope -

getAttributeName4Data

public 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:

setAttributeName4Data

public void setAttributeName4Data(java.lang.String attributeName4Data)
Set the name of attribute which holds the search result in the specified scope. The default attribute name is defined in Globals.QUERY_RESULT_KEY

Parameters:
attributeName4Data -

setBeanName

public void setBeanName(java.lang.String name)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware

getResultHandler

public ResultHandler getResultHandler()
Return the handler to deal with the search result. In some special circumstances, it's necessary to save the search result in a custom way rather than relying on framework to save it in specified scope (request or session). This method is to cater for this requirement, allowing user to plug-in Custom Result Handler implementation class to handle result. A example of this would be to the integration with Seam to use its Out-jection to store search result.

Returns:

setResultHandler

public void setResultHandler(ResultHandler searchResultHandler)
Set the handler to deal with the search result. In some special circumstances, it's necessary to save the search result in a custom way rather than relying on framework to save it in specified scope (request or session). This method is to cater for this requirement, allowing user to plug-in Custom Result Handler implementation class to handle result. An example of this would be to the integration with Seam to use its Out-jection to store search result.

Parameters:
searchResultHandler -

isCacheRecordsCount

public 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:

setCacheRecordsCount

public void setCacheRecordsCount(boolean cacheRecordsCount)
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

Parameters:
cacheRecordsCount -


Copyright © 2008 HDPagination All Rights Reserved.