org.kuali.rice.krad.web.controller
Class UifControllerHelper

java.lang.Object
  extended by org.kuali.rice.krad.web.controller.UifControllerHelper

public class UifControllerHelper
extends Object

Provides helper methods that will be used during the request lifecycle

Created to avoid duplication of the methods used by the UifHandlerExceptionResolver

Author:
Kuali Rice Team (rice.collab@kuali.org)

Constructor Summary
UifControllerHelper()
           
 
Method Summary
static org.springframework.web.servlet.ModelAndView getUIFModelAndView(UifFormBase form, String pageId)
          Configures the ModelAndView instance containing the form data and pointing to the UIF generic spring view
static String getViewIdFromRequest(javax.servlet.http.HttpServletRequest request)
          Attempts to resolve a view id from the given request
protected static ViewService getViewService()
           
static void postControllerHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, org.springframework.web.servlet.ModelAndView modelAndView)
          After the controller logic is executed, the form is placed into session and the corresponding view is prepared for rendering
static void prepareViewForRendering(javax.servlet.http.HttpServletRequest request, UifFormBase form)
          Prepares the View instance contained on the form for rendering
static void removeUnusedBreadcrumbs(UifFormManager uifFormManager, String formKey, String lastFormKey)
          Remove unused forms from breadcrumb history
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UifControllerHelper

public UifControllerHelper()
Method Detail

getViewIdFromRequest

public static String getViewIdFromRequest(javax.servlet.http.HttpServletRequest request)
Attempts to resolve a view id from the given request

First an attempt will be made to find the view id as a request parameter. If no such request parameter is found, the request will be looked at for view type information and a call will be made to the view service to find the view id by type

If a view id is found it is stuck in the request as an attribute (under the key UifParameters.VIEW_ID) for subsequent retrieval

Parameters:
request - instance to resolve view id for
Returns:
view id if one is found, null if not found

getUIFModelAndView

public static org.springframework.web.servlet.ModelAndView getUIFModelAndView(UifFormBase form,
                                                                              String pageId)
Configures the ModelAndView instance containing the form data and pointing to the UIF generic spring view

Parameters:
form - - Form instance containing the model data
pageId - - Id of the page within the view that should be rendered, can be left blank in which the current or default page is rendered
Returns:
ModelAndView object with the contained form

postControllerHandle

public static void postControllerHandle(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response,
                                        Object handler,
                                        org.springframework.web.servlet.ModelAndView modelAndView)
                                 throws Exception
After the controller logic is executed, the form is placed into session and the corresponding view is prepared for rendering

Throws:
Exception

prepareViewForRendering

public static void prepareViewForRendering(javax.servlet.http.HttpServletRequest request,
                                           UifFormBase form)
Prepares the View instance contained on the form for rendering

Parameters:
request - - request object
form - - form instance containing the data and view instance

removeUnusedBreadcrumbs

public static void removeUnusedBreadcrumbs(UifFormManager uifFormManager,
                                           String formKey,
                                           String lastFormKey)
Remove unused forms from breadcrumb history

When going back in the breadcrumb history some forms become unused in the breadcrumb history. Here the unused forms are being determine and removed from the server to free memory.

Parameters:
uifFormManager -
formKey - of the current form
lastFormKey - of the last form

getViewService

protected static ViewService getViewService()


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.