Package org.kuali.rice.krad.lookup
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PropertiesbuildReturnSelectedParameters(LookupForm lookupForm) Builds all the request parameters for the return URL.protected org.springframework.web.servlet.ModelAndViewcheckForModuleLookupRedirect(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.org.springframework.web.servlet.ModelAndViewclearValues(LookupForm lookupForm) Carries out the clear values action by invoking the} method on the configured lookupable (view helper) and then setting the cleared criteria onto the given form.invalid @link
{@link Lookupable#performClear)org.springframework.web.servlet.ModelAndViewdeselectAllPages(LookupForm lookupForm) Clears the form propertyUifFormBase.getSelectedLookupResultsCache()and the selected lines property.protected ModelAndViewServiceInstance of model and view service to use within the collection service.protected StringgetMultiValueReturnFields(LookupForm lookupForm) Builds a string containing the names of the fields being returned separated by a comma.protected StringgetSelectedLineValues(LookupForm lookupForm) Builds a string containing the selected line identifiers separated by a comma.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.org.springframework.web.servlet.ModelAndViewsearch(LookupForm lookupForm) Carries out the search action by invoking the} method on the configured lookupable (view helper) and then setting the results onto the given form.invalid @link
{@link Lookupable#performSearch)org.springframework.web.servlet.ModelAndViewselectAllPages(LookupForm lookupForm) Loops through all the lookup results generating the line identifier for each and adding the resulting set of identifies to the form propertyUifFormBase.getSelectedLookupResultsCache().voidsetModelAndViewService(ModelAndViewService modelAndViewService) org.springframework.web.servlet.ModelAndViewstart(UifFormBase form) Initial method called when requesting a new view instance.Methods inherited from class org.kuali.rice.krad.web.service.impl.ControllerServiceImpl
cancel, checkViewAuthorization, getNavigationControllerService, sessionTimeout, setNavigationControllerServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.kuali.rice.krad.web.service.ControllerService
cancel, checkViewAuthorization, sessionTimeout
-
Constructor Details
-
LookupControllerServiceImpl
public LookupControllerServiceImpl()
-
-
Method Details
-
start
Initial method called when requesting a new view instance.- Specified by:
startin interfaceControllerService- Overrides:
startin classControllerServiceImpl- 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 datarequest- http request being handled- Returns:
- ModelAndView instance for redirecting to the lookup, or null if a redirect is not needed
-
search
Carries out the search action by invoking the} 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.invalid @link
{@link Lookupable#performSearch)- Specified by:
searchin interfaceLookupControllerService- Parameters:
lookupForm- form instance containing the lookup data- Returns:
- ModelAndView instance for rendering the view
-
clearValues
Carries out the clear values action by invoking the} 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.invalid @link
{@link Lookupable#performClear)- Specified by:
clearValuesin interfaceLookupControllerService- Parameters:
lookupForm- form instance containing the lookup data- Returns:
- ModelAndView instance for rendering the view
-
selectAllPages
Loops through all the lookup results generating the line identifier for each and adding the resulting set of identifies to the form propertyUifFormBase.getSelectedLookupResultsCache(). Handles the select all pages action on the lookup results.- Specified by:
selectAllPagesin interfaceLookupControllerService- Parameters:
lookupForm- form instance containing the lookup data- Returns:
- ModelAndView instance for rendering the view
-
deselectAllPages
Clears the form propertyUifFormBase.getSelectedLookupResultsCache()and the selected lines property. Handles the deselect all pages action on the lookup results.- Specified by:
deselectAllPagesin interfaceLookupControllerService- 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:
returnSelectedin interfaceLookupControllerService- Parameters:
lookupForm- form instance containing the lookup dataredirectAttributes- spring provided redirect attributes- Returns:
- String url for redirecting back to the lookup caller
-
buildReturnSelectedParameters
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
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
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
Instance of model and view service to use within the collection service.- Overrides:
getModelAndViewServicein classControllerServiceImpl- Returns:
- ModelAndViewService instance
-
setModelAndViewService
- Overrides:
setModelAndViewServicein classControllerServiceImpl- See Also:
-