Class LookupControllerServiceImpl

java.lang.Object
org.kuali.rice.krad.web.service.impl.ControllerServiceImpl
org.kuali.rice.krad.lookup.LookupControllerServiceImpl
All Implemented Interfaces:
LookupControllerService, ControllerService

public class LookupControllerServiceImpl extends ControllerServiceImpl implements LookupControllerService
Default implementation of the lookup controller service.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Constructor Details

    • LookupControllerServiceImpl

      public LookupControllerServiceImpl()
  • Method Details

    • start

      public org.springframework.web.servlet.ModelAndView start(UifFormBase form)
      Initial method called when requesting a new view instance.
      Specified by:
      start in interface ControllerService
      Overrides:
      start in class ControllerServiceImpl
      Parameters:
      form - form instance containing the model data
      Returns:
      ModelAndView instance for rendering the view
    • checkForModuleLookupRedirect

      protected org.springframework.web.servlet.ModelAndView checkForModuleLookupRedirect(LookupForm lookupForm, javax.servlet.http.HttpServletRequest request)
      Checks for a module service that claims the lookup class as an EBO, and if found redirects to the URL given by the module service.
      Parameters:
      lookupForm - form instance containing the lookup data
      request - http request being handled
      Returns:
      ModelAndView instance for redirecting to the lookup, or null if a redirect is not needed
    • search

      public org.springframework.web.servlet.ModelAndView search(LookupForm lookupForm)
      Carries out the search action by invoking the
      invalid @link
      {@link Lookupable#performSearch)
      } method on the configured lookupable (view helper) and then setting the results onto the given form. Executes a search using the provided criteria and builds a list of results to return to the user.
      Specified by:
      search in interface LookupControllerService
      Parameters:
      lookupForm - form instance containing the lookup data
      Returns:
      ModelAndView instance for rendering the view
    • clearValues

      public org.springframework.web.servlet.ModelAndView clearValues(LookupForm lookupForm)
      Carries out the clear values action by invoking the
      invalid @link
      {@link Lookupable#performClear)
      } method on the configured lookupable (view helper) and then setting the cleared criteria onto the given form. Performs a reset (or clear) on the lookup criteria values.
      Specified by:
      clearValues in interface LookupControllerService
      Parameters:
      lookupForm - form instance containing the lookup data
      Returns:
      ModelAndView instance for rendering the view
    • selectAllPages

      public org.springframework.web.servlet.ModelAndView selectAllPages(LookupForm lookupForm)
      Loops through all the lookup results generating the line identifier for each and adding the resulting set of identifies to the form property UifFormBase.getSelectedLookupResultsCache(). Handles the select all pages action on the lookup results.
      Specified by:
      selectAllPages in interface LookupControllerService
      Parameters:
      lookupForm - form instance containing the lookup data
      Returns:
      ModelAndView instance for rendering the view
    • deselectAllPages

      public org.springframework.web.servlet.ModelAndView deselectAllPages(LookupForm lookupForm)
      Clears the form property UifFormBase.getSelectedLookupResultsCache() and the selected lines property. Handles the deselect all pages action on the lookup results.
      Specified by:
      deselectAllPages in interface LookupControllerService
      Parameters:
      lookupForm - form instance containing the lookup data
      Returns:
      ModelAndView instance for rendering the view
    • returnSelected

      public String returnSelected(LookupForm lookupForm, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
      Builds the URL for returning back to the calling view and passing the selected line values.

      We attempt to pass back all the selected line identifiers as a request parameter on the return URL. However, this could result in an URL longer than the max length supported by browsers (the most restrictive is used). If this happens, for local lookups we use Spring flash attributes. In the case of a remote lookup, there is nothing we can do and return an error message.

      Invoked from the UI to return the selected lookup results lines back to the calling view.
      Specified by:
      returnSelected in interface LookupControllerService
      Parameters:
      lookupForm - form instance containing the lookup data
      redirectAttributes - spring provided redirect attributes
      Returns:
      String url for redirecting back to the lookup caller
    • buildReturnSelectedParameters

      protected Properties buildReturnSelectedParameters(LookupForm lookupForm)
      Builds all the request parameters for the return URL.
      Parameters:
      lookupForm - form instance containing the lookup data
      Returns:
      Properties contains the request parameters key/value pairs
    • getMultiValueReturnFields

      protected String getMultiValueReturnFields(LookupForm lookupForm)
      Builds a string containing the names of the fields being returned separated by a comma.
      Parameters:
      lookupForm - form instance containing the lookup data
      Returns:
      String names of return fields separated by a comma
    • getSelectedLineValues

      protected String getSelectedLineValues(LookupForm lookupForm)
      Builds a string containing the selected line identifiers separated by a comma.
      Parameters:
      lookupForm - form instance containing the lookup data
      Returns:
      String selected line identifiers separated by a comma
    • getModelAndViewService

      protected ModelAndViewService getModelAndViewService()
      Instance of model and view service to use within the collection service.
      Overrides:
      getModelAndViewService in class ControllerServiceImpl
      Returns:
      ModelAndViewService instance
    • setModelAndViewService

      public void setModelAndViewService(ModelAndViewService modelAndViewService)
      Overrides:
      setModelAndViewService in class ControllerServiceImpl
      See Also: