org.apache.beehive.netui.databinding.datagrid.api
Class DataGridURLBuilder

Object
  extended by DataGridURLBuilder

public abstract class DataGridURLBuilder
extends Object

This abstract class provides methods that are used to build maps of URL parameters containing current ahd future data grid state. These are useful for building anchors and other kinds of requests that when clicked / submitted can move to the next or previous page of data or change the state of sorts or filters for a data grid.

Subclasses are free to implement the contents of the parameter map with whatever parameter key / values that make sense for a particular data grid. For example, some data grids may encode sort, filter, and paging information in the URL. Others may add information about row selection and not add sort / filter parameters. Be sure to check the documentation for a specific DataGridURLBuilder subclass to find out what specific parameters are available in the parameter maps.

Parameter maps produced by methods on this class should contain key / value pairs where the key is of type String and the values are of type String[]. The parameter maps should also include all of the additional "current" URL parameters in order to maintain the "current" view state and modifying only state associated with a single data grid. Subclasses are free to change this behavior.


Constructor Summary
DataGridURLBuilder()
           
 
Method Summary
abstract  Map buildSortQueryParamsMap(String sortExpression)
          Get a parameter map that contains the grid's current state with the sort matching the given sortExpression switched to the next available sort direction.
abstract  String[] getPagerParamValues()
          Get a String array that contains the values which can be used to reach any page in the data grid.
abstract  String getPagerRowQueryParamKey()
          Get the String for the pager query parameter key.
abstract  Map getQueryParams()
          Get a Map containing the current state of the data grid.
abstract  Map getQueryParamsForFirstPage()
          Get a parameter map that contains the grid's current state with a value that will set the current to the first page.
abstract  Map getQueryParamsForLastPage()
          Get a parameter map that contains the grid's current state with a value that will set the current page to the last page.
abstract  Map getQueryParamsForNextPage()
          Get a parameter map that contains the grid's current state with a value that will set the current page to the next page.
abstract  Map getQueryParamsForPreviousPage()
          Get a parameter map that contains the grid's current state with a value that will set the current page to the previous page.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataGridURLBuilder

public DataGridURLBuilder()
Method Detail

getQueryParams

public abstract Map getQueryParams()
Get a Map containing the current state of the data grid.

Returns:
the parameter map

getQueryParamsForFirstPage

public abstract Map getQueryParamsForFirstPage()
Get a parameter map that contains the grid's current state with a value that will set the current to the first page.

Returns:
the parameter map

getQueryParamsForPreviousPage

public abstract Map getQueryParamsForPreviousPage()
Get a parameter map that contains the grid's current state with a value that will set the current page to the previous page.

Returns:
the parameter map

getQueryParamsForNextPage

public abstract Map getQueryParamsForNextPage()
Get a parameter map that contains the grid's current state with a value that will set the current page to the next page.

Returns:
the parameter map

getQueryParamsForLastPage

public abstract Map getQueryParamsForLastPage()
Get a parameter map that contains the grid's current state with a value that will set the current page to the last page.

Returns:
the parameter map

getPagerParamValues

public abstract String[] getPagerParamValues()
Get a String array that contains the values which can be used to reach any page in the data grid.

Returns:
an array of the query parameter values for each page

getPagerRowQueryParamKey

public abstract String getPagerRowQueryParamKey()
Get the String for the pager query parameter key.

Returns:
the query parameter key for accessing the current page from the URL

buildSortQueryParamsMap

public abstract Map buildSortQueryParamsMap(String sortExpression)
Get a parameter map that contains the grid's current state with the sort matching the given sortExpression switched to the next available sort direction.

Parameters:
sortExpression - the sort expression whose sort value to change
Returns:
the parameter map