org.apache.beehive.netui.databinding.datagrid.runtime.util
Class JspFunctions

Object
  extended by JspFunctions

public final class JspFunctions
extends Object

This class contains utility methods that are callable as JSP functions by page authors. These are used to provide utility methods that can be accessed via JSP EL for invoking methods on various data grid state objects.


Method Summary
static Map buildQueryParamsMapForSortExpression(DataGridURLBuilder urlBuilder, String sortExpression)
           Utility method used to build a query parameter map which includes the list of parameters needed to change the direction of a sort related to the given sort expression.
static boolean isSortedAscending(SortModel sortModel, String sortExpression)
          Given a sort expression, check to see if the sort expression is sorted ascending in a data grid's SortModel.
static boolean isSortedDescending(SortModel sortModel, String sortExpression)
          Given a sort expression, check to see if the sort expression is sorted descending in a data grid's SortModel.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isSortedAscending

public static boolean isSortedAscending(SortModel sortModel,
                                        String sortExpression)
Given a sort expression, check to see if the sort expression is sorted ascending in a data grid's SortModel.

Parameters:
sortModel - a grid's sort model
sortExpression - the sort expression
Returns:
return true if a Sort is found whose sort expression matches the sort expression given here and whose direction is SortDirection.ASCENDING.

isSortedDescending

public static boolean isSortedDescending(SortModel sortModel,
                                         String sortExpression)
Given a sort expression, check to see if the sort expression is sorted descending in a data grid's SortModel.

Parameters:
sortModel - a grid's sort model
sortExpression - the sort expression
Returns:
return true if a Sort is found whose sort expression matches the sort expression given here and whose direction is SortDirection.DESCENDING.

buildQueryParamsMapForSortExpression

public static Map buildQueryParamsMapForSortExpression(DataGridURLBuilder urlBuilder,
                                                       String sortExpression)

Utility method used to build a query parameter map which includes the list of parameters needed to change the direction of a sort related to the given sort expression. This method uses a DataGridURLBuilder instance to call its DataGridURLBuilder.buildSortQueryParamsMap(String) method from JSP EL.

Parameters:
urlBuilder - the data grid URL builder associated with a DataGridState object that is used to build lists of query parameters
sortExpression - the sort expression whose direction to change
Returns:
a Map of key / value pairs for query parameters