net.mlw.vlh
Class ValueListInfo

java.lang.Object
  extended bynet.mlw.vlh.ValueListInfo
All Implemented Interfaces:
PagingInfo, Serializable

public class ValueListInfo
extends Object
implements Serializable, PagingInfo

This bean holds all the information needed to retrieve a ValueList. This information is needed to allow for server side sorting, paging and focusing.

Version:
$Revision: 1.20 $ $Date: 2006/03/29 19:47:49 $
Author:
Matthew L. Wilson, Andrej Zachar
See Also:
Serialized Form

Field Summary
static Integer ASCENDING
          Constant for an ascending order.
static Integer DESCENDING
          Constant for an descending order.
static String DO_FOCUS
          The string name of the attribute that should be used in Map backed transports, such as a Request Object.
static byte FOCUS_FOUND
          Focus value was founded.
static byte FOCUS_NOT_FOUND
          Focus value was not founded.
static String FOCUS_PARAM_PREFIX
          General prefix for focus's parameters, DO_FOCUS has different
static String FOCUS_PROPERTY
          The string name of the attribute that should be used in Map backed transports, such as a Request Object.
static byte FOCUS_STATUS_NOT_DEFINED
          Focus status when is not used.
static byte FOCUS_TOO_MANY_ITEMS
          Focusing is not possible, because in ResultSet are too many items - rows.
static String FOCUS_VALUE
          The string name of the attribute that should be used in Map backed transports, such as a Request Object.
static String PAGING_NUMBER_PER
          The string name of the attribute that should be used in Map backed transports, such as a Request Object.
static String PAGING_PAGE
          The string name of the attribute that should be used in Map backed transports, such as a Request Object.
static String PAGING_PARAM_PREFIX
          General prefix for paging's parameters.
static String SORT_COLUMN
          The string name of the attribute that should be used in Map backed transports, such as a Request Object.
static String SORT_DIRECTION
          The string name of the attribute that should be used in Map backed transports, such as a Request Object.
static String SORT_PARAM_PREFIX
          General prefix for sorting's parameters.
static String VALUE_LIST_NAME
          The name of the ValueList requested.
 
Constructor Summary
ValueListInfo()
          Default constructor.
ValueListInfo(Map parameters)
          Default constructor.
ValueListInfo(String primaryColumn, Integer primaryDirection)
          Creates a new ValueListInfo that contains sorting information
ValueListInfo(String primaryColumn, Integer primaryDirection, Map filters)
          Creates a new ValueListInfo that contains sorting information
 
Method Summary
protected  String getFilterParameterAsString(String key)
          Extracts a value with the given key from filters and converts it to a String.
 Map getFilters()
          Getter for property filters.
 int getFocusedRowNumberInTable()
           
 String getFocusProperty()
           
 byte getFocusStatus()
           
 String getFocusValue()
           
 int getPagingNumberPer()
          Getter for the number of VOs per page.
 int getPagingPage()
          Getter for the curent page to display.
 String getSortingColumn()
          Returns an array of column (property) names.
 Integer getSortingDirection()
          Returns an array of directions.
 int getTotalNumberOfEntries()
          Getter for the total number VOs.
 int getTotalNumberOfPages()
          Getter for the total number of pages.
 boolean isDoFocus()
           
 boolean isDoFocusAgain()
          Used for generating links, if any errors found, doFocus is set to false for next retrieving of the valueList.
 boolean isFocusEnabled()
          Return true if the focusing is enabled.
 void resetSorting()
           
 void setDoFocus(boolean enabled)
           
 void setFilters(Map filters)
          The map to build the query.
 void setFocusedRowNumberInTable(int absolutPositionInResultSet)
          Set the certain row in table to be focused.
 void setFocusProperty(String focusProperty)
          Set focusProperty, if null, remove FOCUS_PROPERTY AND FOCUS_VALUE
 void setFocusStatus(byte status)
          Acceptable values: FOUND, NOT_FOUND, TOO_MANY_ITEMS
 void setFocusValue(String focusValue)
           
 void setPagingNumberPer(int numberPerPage)
          Sets the number of items per page.
 void setPagingPage(int pageNumber)
          Sets the current page number.
 void setPagingPageFromRowNumber(int resultSetRowNumber)
          The resultSetRowNumber starts from 0.
 void setPrimarySortColumn(String column)
           
 void setPrimarySortDirection(Integer direction)
           
 void setTotalNumberOfEntries(int totalNumberOfEntries)
          Sets the total number of items that meet the filter.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUE_LIST_NAME

public static final String VALUE_LIST_NAME
The name of the ValueList requested. *

See Also:
Constant Field Values

DESCENDING

public static final Integer DESCENDING
Constant for an descending order.


ASCENDING

public static final Integer ASCENDING
Constant for an ascending order.


PAGING_PARAM_PREFIX

public static final String PAGING_PARAM_PREFIX
General prefix for paging's parameters.

See Also:
Constant Field Values

PAGING_PAGE

public static final String PAGING_PAGE
The string name of the attribute that should be used in Map backed transports, such as a Request Object.

See Also:
Constant Field Values

PAGING_NUMBER_PER

public static final String PAGING_NUMBER_PER
The string name of the attribute that should be used in Map backed transports, such as a Request Object.

See Also:
Constant Field Values

SORT_PARAM_PREFIX

public static final String SORT_PARAM_PREFIX
General prefix for sorting's parameters.

See Also:
Constant Field Values

SORT_COLUMN

public static final String SORT_COLUMN
The string name of the attribute that should be used in Map backed transports, such as a Request Object.

See Also:
Constant Field Values

SORT_DIRECTION

public static final String SORT_DIRECTION
The string name of the attribute that should be used in Map backed transports, such as a Request Object.

See Also:
Constant Field Values

DO_FOCUS

public static final String DO_FOCUS
The string name of the attribute that should be used in Map backed transports, such as a Request Object.

See Also:
Constant Field Values

FOCUS_PARAM_PREFIX

public static final String FOCUS_PARAM_PREFIX
General prefix for focus's parameters, DO_FOCUS has different

See Also:
Constant Field Values

FOCUS_VALUE

public static final String FOCUS_VALUE
The string name of the attribute that should be used in Map backed transports, such as a Request Object.

See Also:
Constant Field Values

FOCUS_PROPERTY

public static final String FOCUS_PROPERTY
The string name of the attribute that should be used in Map backed transports, such as a Request Object.

See Also:
Constant Field Values

FOCUS_STATUS_NOT_DEFINED

public static final byte FOCUS_STATUS_NOT_DEFINED
Focus status when is not used.

See Also:
Constant Field Values

FOCUS_FOUND

public static final byte FOCUS_FOUND
Focus value was founded.

See Also:
Constant Field Values

FOCUS_NOT_FOUND

public static final byte FOCUS_NOT_FOUND
Focus value was not founded.

See Also:
Constant Field Values

FOCUS_TOO_MANY_ITEMS

public static final byte FOCUS_TOO_MANY_ITEMS
Focusing is not possible, because in ResultSet are too many items - rows.

See Also:
Constant Field Values
Constructor Detail

ValueListInfo

public ValueListInfo()
Default constructor.


ValueListInfo

public ValueListInfo(Map parameters)
Default constructor.

Parameters:
parameters - The filters/parameters to initialize.

ValueListInfo

public ValueListInfo(String primaryColumn,
                     Integer primaryDirection)
Creates a new ValueListInfo that contains sorting information

Parameters:
primaryColumn - The column to sort by
primaryDirection - The direction to sort the ValueList by

ValueListInfo

public ValueListInfo(String primaryColumn,
                     Integer primaryDirection,
                     Map filters)
Creates a new ValueListInfo that contains sorting information

Parameters:
primaryColumn - The column to sort by
primaryDirection - The direction to sort the ValueList by
filters - The filters of search criteria.
Method Detail

getFilters

public Map getFilters()
Getter for property filters.

Returns:
Value of property filters.

getSortingColumn

public String getSortingColumn()
Returns an array of column (property) names.

Specified by:
getSortingColumn in interface PagingInfo
Returns:
a String array of column (property) names. null if no sorting information exists.

setPrimarySortColumn

public void setPrimarySortColumn(String column)

getSortingDirection

public Integer getSortingDirection()
Returns an array of directions.

Specified by:
getSortingDirection in interface PagingInfo
Returns:
an Integer array of directions. null if no sorting information exists.

setPrimarySortDirection

public void setPrimarySortDirection(Integer direction)

getPagingPage

public int getPagingPage()
Getter for the curent page to display.

Specified by:
getPagingPage in interface PagingInfo
Returns:
the curent page to display.

getTotalNumberOfPages

public int getTotalNumberOfPages()
Getter for the total number of pages.

Specified by:
getTotalNumberOfPages in interface PagingInfo
Returns:
the total number of pages.

getTotalNumberOfEntries

public int getTotalNumberOfEntries()
Getter for the total number VOs.

Specified by:
getTotalNumberOfEntries in interface PagingInfo
Returns:
the total number of VOs.

getPagingNumberPer

public int getPagingNumberPer()
Getter for the number of VOs per page. Integer.MAX_VALUE if it is not set.

Specified by:
getPagingNumberPer in interface PagingInfo
Returns:
the number of VOs per page.

setTotalNumberOfEntries

public void setTotalNumberOfEntries(int totalNumberOfEntries)
Sets the total number of items that meet the filter.

Parameters:
totalNumberOfEntries - The total number of items that meet the filter.

setFilters

public void setFilters(Map filters)
The map to build the query.

Parameters:
filters - Map to build the query

setPagingNumberPer

public void setPagingNumberPer(int numberPerPage)
Sets the number of items per page.

Parameters:
numberPerPage - The number of line items per page.

setPagingPage

public void setPagingPage(int pageNumber)
Sets the current page number.

Parameters:
pageNumber - The current page number.

getFocusValue

public String getFocusValue()
Specified by:
getFocusValue in interface PagingInfo
Returns:
Returns the focusValue.

setFocusValue

public void setFocusValue(String focusValue)
Parameters:
focusValue - The focusValue to set.

getFocusProperty

public String getFocusProperty()
Specified by:
getFocusProperty in interface PagingInfo
Returns:
Returns the focusProperty.

setFocusProperty

public void setFocusProperty(String focusProperty)
Set focusProperty, if null, remove FOCUS_PROPERTY AND FOCUS_VALUE

Parameters:
focusProperty - The focusProperty to set.

isFocusEnabled

public boolean isFocusEnabled()
Description copied from interface: PagingInfo
Return true if the focusing is enabled.

Specified by:
isFocusEnabled in interface PagingInfo
Returns:
true if getFocusProperty is not null

isDoFocus

public boolean isDoFocus()
Specified by:
isDoFocus in interface PagingInfo
Returns:
true if is set DoFocus true

isDoFocusAgain

public boolean isDoFocusAgain()
Used for generating links, if any errors found, doFocus is set to false for next retrieving of the valueList.

Specified by:
isDoFocusAgain in interface PagingInfo
Returns:
boolean

setDoFocus

public void setDoFocus(boolean enabled)
See Also:
net.mlw.vlh.PagingInfo#setFocusSucces(boolean)

setFocusedRowNumberInTable

public void setFocusedRowNumberInTable(int absolutPositionInResultSet)
Set the certain row in table to be focused.

Parameters:
absolutPositionInResultSet -

getFocusedRowNumberInTable

public int getFocusedRowNumberInTable()
Returns:
Returns the focusedRowNumberInTable.

setPagingPageFromRowNumber

public void setPagingPageFromRowNumber(int resultSetRowNumber)
The resultSetRowNumber starts from 0.


setFocusStatus

public void setFocusStatus(byte status)
Acceptable values: FOUND, NOT_FOUND, TOO_MANY_ITEMS


getFocusStatus

public byte getFocusStatus()
Specified by:
getFocusStatus in interface PagingInfo
Returns:
Returns the focusStatus.

toString

public String toString()
See Also:
Object.toString()

resetSorting

public void resetSorting()

getFilterParameterAsString

protected String getFilterParameterAsString(String key)
Extracts a value with the given key from filters and converts it to a String. If it isn't a String a warning is logged and null is returned.

Parameters:
key -
Returns:
The value stored under the key in filters or null if not present or not a String.


Copyright © 2003-2006 mlavilson. All Rights Reserved.