org.ikasan.framework.web.controller
Class MasterDetailControllerUtil

java.lang.Object
  extended by org.ikasan.framework.web.controller.MasterDetailControllerUtil

public class MasterDetailControllerUtil
extends Object

Common utility functions used by MVC controllers that deal with paged Master/Detail search functions

Author:
The Ikasan Development Team

Constructor Summary
MasterDetailControllerUtil()
           
 
Method Summary
static void addPagedModelAttributes(String orderBy, Boolean orderAsc, org.springframework.ui.ModelMap model, int pageNo, PagedSearchResult<?> pagedResult, javax.servlet.http.HttpServletRequest request, Map<String,Object> searchParams)
          Adds all standard control attributes to the model for displaying the search results page
static void addParam(Map<String,Object> searchParams, String paramName, Object paramValue)
          Adds a parameter to the searchParams map, only if it has a value
static boolean defaultFalse(Boolean input)
          Standardises the orderAsc field to use false if otherwise not supplied
static int defaultZero(Integer input)
          Returns the input value if not null, otherwise 0
static String nullForEmpty(String input)
          Returns the input value or null for an empty String
static String resolveOrderBy(String orderBy)
          Returns the input value if not null, otherwise "id"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MasterDetailControllerUtil

public MasterDetailControllerUtil()
Method Detail

addParam

public static void addParam(Map<String,Object> searchParams,
                            String paramName,
                            Object paramValue)
Adds a parameter to the searchParams map, only if it has a value

Parameters:
searchParams -
paramName -
paramValue -

addPagedModelAttributes

public static void addPagedModelAttributes(String orderBy,
                                           Boolean orderAsc,
                                           org.springframework.ui.ModelMap model,
                                           int pageNo,
                                           PagedSearchResult<?> pagedResult,
                                           javax.servlet.http.HttpServletRequest request,
                                           Map<String,Object> searchParams)
Adds all standard control attributes to the model for displaying the search results page

Parameters:
orderBy -
orderAsc -
model -
pageNo -
pagedResult -
request -
searchParams -

defaultFalse

public static boolean defaultFalse(Boolean input)
Standardises the orderAsc field to use false if otherwise not supplied

Parameters:
orderAsc -
Returns:

resolveOrderBy

public static String resolveOrderBy(String orderBy)
Returns the input value if not null, otherwise "id"

Parameters:
orderBy -
Returns:
orderBy or default to ids

defaultZero

public static int defaultZero(Integer input)
Returns the input value if not null, otherwise 0

Parameters:
input -
Returns:

nullForEmpty

public static String nullForEmpty(String input)
Returns the input value or null for an empty String

Parameters:
input -
Returns:


Copyright © 2007-2011 Ikasan. All Rights Reserved.