org.jasig.schedassist.web.owner.relationships
Class CalendarUserSearchFormController

java.lang.Object
  extended by org.jasig.schedassist.web.owner.relationships.CalendarUserSearchFormController

@Controller
@RequestMapping(value={"/owner/visitor-search.html","/delegate/visitor-search.html"})
@SessionAttributes(value="command")
public class CalendarUserSearchFormController
extends Object

Form controller implementation that invokes ICalendarAccountDao.searchForCalendarAccounts(String). Will only invoke the method if CalendarUserSearchFormBackingObject.getSearchText() has 3 or more characters. #formBackingObject(HttpServletRequest) and #isFormSubmission(HttpServletRequest) have been overriden to support invocation of #onSubmit(Object) if the "q" request parameter is set (and the request is a GET). The intent of these changes is to support a JQuery autocomplete plugin (which makes GET requests to "url?q=searchText").

Version:
$Id: CalendarUserSearchFormController.java 2050 2010-04-30 16:01:31Z npblair $
Author:
Nicholas Blair, nblair@doit.wisc.edu

Constructor Summary
CalendarUserSearchFormController()
           
 
Method Summary
protected  List<ICalendarAccount> filterForEligible(List<ICalendarAccount> matches)
          Filter out ICalendarAccount that return false for ICalendarAccount.isEligible().
 ICalendarAccountDao getCalendarAccountDao()
           
 String getIdentifyingAttributeName()
           
protected  String onGet(String qValue, org.springframework.ui.ModelMap model)
          If the qValue parameter is not blank, execute a search, and return the autocomplete results view name.
protected  String search(CalendarUserSearchFormBackingObject fbo, org.springframework.ui.ModelMap model)
           
 void setCalendarAccountDao(ICalendarAccountDao calendarAccountDao)
           
 void setIdentifyingAttributeName(String identifyingAttributeName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarUserSearchFormController

public CalendarUserSearchFormController()
Method Detail

setCalendarAccountDao

public void setCalendarAccountDao(ICalendarAccountDao calendarAccountDao)
Parameters:
calendarAccountDao - the calendarAccountDao to set

getCalendarAccountDao

public ICalendarAccountDao getCalendarAccountDao()
Returns:
the calendarAccountDao

setIdentifyingAttributeName

public void setIdentifyingAttributeName(String identifyingAttributeName)
Parameters:
identifyingAttributeName -

getIdentifyingAttributeName

public String getIdentifyingAttributeName()
Returns:
the attribute used to commonly uniquely identify an account

onGet

@RequestMapping(method=GET)
protected String onGet(@RequestParam(value="q",required=false)
                                      String qValue,
                                      org.springframework.ui.ModelMap model)
If the qValue parameter is not blank, execute a search, and return the autocomplete results view name. Otherwise, return the form view name.

Parameters:
qValue -
model -
Returns:

search

@RequestMapping(method=POST)
protected String search(@ModelAttribute(value="command")
                                       CalendarUserSearchFormBackingObject fbo,
                                       org.springframework.ui.ModelMap model)
Parameters:
fbo -
model -
Returns:

filterForEligible

protected List<ICalendarAccount> filterForEligible(List<ICalendarAccount> matches)
Filter out ICalendarAccount that return false for ICalendarAccount.isEligible().

Parameters:
matches -
Returns:


Copyright © 2012 Jasig. All Rights Reserved.