|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.web.controller.UifControllerBase
public abstract class UifControllerBase
Base controller class for views within the KRAD User Interface Framework Provides common methods such as:
ModelAndView
View
and return the
ModelAndView
instance.
Constructor Summary | |
---|---|
UifControllerBase()
|
Method Summary | |
---|---|
org.springframework.web.servlet.ModelAndView |
addBlankLine(UifFormBase uifForm)
Called by the add blank line action for a new collection line |
org.springframework.web.servlet.ModelAndView |
addLine(UifFormBase uifForm,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called by the add line action for a new collection line. |
org.springframework.web.servlet.ModelAndView |
cancel(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Just returns as if return with no value was selected. |
org.springframework.web.servlet.ModelAndView |
checkForm(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Checks the form/view against all current and future validations and returns warnings for any validations that fail |
void |
checkViewAuthorization(UifFormBase form,
String methodToCall)
Invokes the configured ViewAuthorizer to verify the user has access to
open the view. |
org.springframework.web.servlet.ModelAndView |
close(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Just returns as if return with no value was selected. |
protected abstract UifFormBase |
createInitialForm(javax.servlet.http.HttpServletRequest request)
Called to create a new model(form) object when necessary. |
org.springframework.web.servlet.ModelAndView |
deleteLine(UifFormBase uifForm,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called by the delete line action for a model collection. |
protected boolean |
getBooleanDialogResponse(String dialogId,
UifFormBase form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles modal dialog interactions for a view controller When a controller method wishes to prompt the user for additional information before continuing to process the request. |
protected org.springframework.web.servlet.ModelAndView |
getMessageView(UifFormBase form,
String headerText,
String messageText)
Builds a message view from the given header and message text then forwards the UIF model and view |
protected String |
getStringDialogResponse(String dialogId,
UifFormBase form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles a modal dialog interaction with the client user when a String response is desired |
protected org.springframework.web.servlet.ModelAndView |
getUIFModelAndView(UifFormBase form)
|
protected 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 |
protected ViewService |
getViewService()
|
protected boolean |
hasDialogBeenAnswered(String dialogId,
UifFormBase form)
returns whether the dialog has already been answered by the user |
protected boolean |
hasDialogBeenDisplayed(String dialogId,
UifFormBase form)
returns whether this dialog has been displayed on the client |
UifFormBase |
initForm(javax.servlet.http.HttpServletRequest request)
Create/obtain the model(form) object before it is passed to the Binder/BeanWrapper. |
org.springframework.web.servlet.ModelAndView |
navigate(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles menu navigation between view pages |
AttributeQueryResult |
performFieldQuery(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Invoked to execute the AttributeQuery associated with a field given the query parameters
found in the request. |
AttributeQueryResult |
performFieldSuggest(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Invoked to provide the options for a suggest widget. |
org.springframework.web.servlet.ModelAndView |
performLookup(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Builds up a URL to the lookup view based on the given post action parameters and redirects |
protected org.springframework.web.servlet.ModelAndView |
performRedirect(UifFormBase form,
String baseUrl,
Properties urlParameters)
Builds a ModelAndView instance configured to redirect to the
URL formed by joining the base URL with the given URL parameters |
org.springframework.web.servlet.ModelAndView |
refresh(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
handles an ajax refresh |
org.springframework.web.servlet.ModelAndView |
returnFromLightbox(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Common return point for dialogs |
org.springframework.web.servlet.ModelAndView |
returnToHistory(UifFormBase form,
boolean homeFlag)
Invoked to navigate back to a history entry. |
org.springframework.web.servlet.ModelAndView |
returnToHub(UifFormBase form)
Invoked to navigate back to the first page in history. |
org.springframework.web.servlet.ModelAndView |
returnToPrevious(UifFormBase form)
Invoked to navigate back one page in history.. |
org.springframework.web.servlet.ModelAndView |
saveLine(UifFormBase uifForm,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called by the save line action for a new collection line. |
protected org.springframework.web.servlet.ModelAndView |
showDialog(String dialogId,
UifFormBase form,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Complete the response directly and launch lightbox with dialog content upon returning back to the client. |
org.springframework.web.servlet.ModelAndView |
start(UifFormBase form,
org.springframework.validation.BindingResult result,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initial method called when requesting a new view instance which checks authorization and forwards the view for rendering |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UifControllerBase()
Method Detail |
---|
@ModelAttribute(value="KualiForm") public UifFormBase initForm(javax.servlet.http.HttpServletRequest request)
request
- - the http request that was madeprotected abstract UifFormBase createInitialForm(javax.servlet.http.HttpServletRequest request)
request
- - the http request that was made@RequestMapping(params="methodToCall=start") public org.springframework.web.servlet.ModelAndView start(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public void checkViewAuthorization(UifFormBase form, String methodToCall) throws AuthorizationException
ViewAuthorizer
to verify the user has access to
open the view. An exception is thrown if access has not been granted
Note this method is invoked automatically by the controller interceptor for each request
form
- - form instance containing the request datamethodToCall
- - the request parameter 'methodToCall' which is used to determine the controller
method invoked
AuthorizationException
@RequestMapping(method=POST, params="methodToCall=addLine") public org.springframework.web.servlet.ModelAndView addLine(@ModelAttribute(value="KualiForm") UifFormBase uifForm, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@RequestMapping(method=POST, params="methodToCall=addBlankLine") public org.springframework.web.servlet.ModelAndView addBlankLine(@ModelAttribute(value="KualiForm") UifFormBase uifForm)
Method determines which collection the add action was selected for and invokes the view helper service to add the blank line.
uifForm
- - form instance containing the request data
@RequestMapping(method=POST, params="methodToCall=saveLine") public org.springframework.web.servlet.ModelAndView saveLine(@ModelAttribute(value="KualiForm") UifFormBase uifForm, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@RequestMapping(method=POST, params="methodToCall=deleteLine") public org.springframework.web.servlet.ModelAndView deleteLine(@ModelAttribute(value="KualiForm") UifFormBase uifForm, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@RequestMapping(params="methodToCall=cancel") public org.springframework.web.servlet.ModelAndView cancel(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@RequestMapping(params="methodToCall=close") public org.springframework.web.servlet.ModelAndView close(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@RequestMapping(params="methodToCall=returnToPrevious") public org.springframework.web.servlet.ModelAndView returnToPrevious(@ModelAttribute(value="KualiForm") UifFormBase form)
form
- - form object that should contain the history object@RequestMapping(params="methodToCall=returnToHub") public org.springframework.web.servlet.ModelAndView returnToHub(@ModelAttribute(value="KualiForm") UifFormBase form)
form
- - form object that should contain the history objectpublic org.springframework.web.servlet.ModelAndView returnToHistory(UifFormBase form, boolean homeFlag)
form
- - form object that should contain the history objecthomeFlag
- - if true will navigate back to first entry else will navigate to last entry
in the history@RequestMapping(method=POST, params="methodToCall=navigate") public org.springframework.web.servlet.ModelAndView navigate(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@RequestMapping(params="methodToCall=refresh") public org.springframework.web.servlet.ModelAndView refresh(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
The query form plugin activates this request via a form post, where on the JS side,
org.kuali.rice.krad.uif.UifParameters#RENDER_FULL_VIEW
is set to false
form
- - Holds properties necessary to determine the View
instance that will be used to
render
the UIresult
- - represents binding resultsrequest
- - http servlet request dataresponse
- - http servlet response object
Exception
@RequestMapping(method=POST, params="methodToCall=performLookup") public org.springframework.web.servlet.ModelAndView performLookup(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@RequestMapping(method=POST, params="methodToCall=checkForm") public org.springframework.web.servlet.ModelAndView checkForm(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
@RequestMapping(method=GET, params="methodToCall=performFieldSuggest") @ResponseBody public AttributeQueryResult performFieldSuggest(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
AttributeQuery
for the field containing the suggest widget. The controller method picks
out the query parameters from the request and calls AttributeQueryService
to perform the
suggest query and prepare the result object that will be exposed with JSON
@RequestMapping(method=GET, params="methodToCall=performFieldQuery") @ResponseBody public AttributeQueryResult performFieldQuery(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
AttributeQuery
associated with a field given the query parameters
found in the request. This controller method picks out the query parameters from the request and calls
AttributeQueryService
to perform the field query and prepare the result object
that will be exposed with JSON. The result is then used to update field values in the UI with client
script.
protected boolean hasDialogBeenDisplayed(String dialogId, UifFormBase form)
dialogId
- - the id of the dialogform
- - form instance containing the request data
protected boolean hasDialogBeenAnswered(String dialogId, UifFormBase form)
dialogId
- - identifier for the dialog groupform
- - form instance containing the request data
protected boolean getBooleanDialogResponse(String dialogId, UifFormBase form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
If this modal dialog has not yet been presented to the user, a redirect back to the client is performed to display the modal dialog as a Lightbox. The DialogGroup identified by the dialogId is used as the Lightbox content.
If the dialog has already been answered by the user. The boolean value representing the option chosen by the user is returned back to the calling controller
dialogId
- - identifier of the dialog groupform
- - form instance containing the request datarequest
- - the http requestresponse
- - the http response
Exception
protected String getStringDialogResponse(String dialogId, UifFormBase form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Similar to askYesOrNoQuestion() but returns a string instead of a boolean. The string value is the key string of the key/value pair assigned to the button that the user chose.
dialogId
- - identifier of the dialog groupform
- - form instance containing the request datarequest
- - the http requestresponse
- - the http response
Exception
protected org.springframework.web.servlet.ModelAndView showDialog(String dialogId, UifFormBase form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Need to build up the view/component properly as we would if we returned normally back to the DispatcherServlet from the controller method.
dialogId
- - id of the dialog or group to use as content in the lightbox.form
- - the form associated with the viewrequest
- - the http requestresponse
- - the http response
Exception
@RequestMapping(params="methodToCall=returnFromLightbox") public org.springframework.web.servlet.ModelAndView returnFromLightbox(@ModelAttribute(value="KualiForm") UifFormBase form, org.springframework.validation.BindingResult result, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws Exception
Determines the user responses to the dialog. Performs dialog management and then redirects to the original contoller method.
form
- - current formresult
- - binding resultrequest
- - http requestresponse
- - http response
Exception
protected org.springframework.web.servlet.ModelAndView performRedirect(UifFormBase form, String baseUrl, Properties urlParameters)
ModelAndView
instance configured to redirect to the
URL formed by joining the base URL with the given URL parameters
form
- - current form instancebaseUrl
- - base url to redirect tourlParameters
- - properties containing key/value pairs for the url parameters, if null or empty,
the baseUrl will be used as the full URL
protected org.springframework.web.servlet.ModelAndView getMessageView(UifFormBase form, String headerText, String messageText)
If an error or other type of interruption occurs during the request processing the controller can invoke this message to display the message to the user. This will abandon the view that was requested and display a view with just the message
form
- UIF form instanceheaderText
- header text for the message view (can be blank)messageText
- text for the message to display
protected org.springframework.web.servlet.ModelAndView getUIFModelAndView(UifFormBase form)
protected org.springframework.web.servlet.ModelAndView getUIFModelAndView(UifFormBase form, String pageId)
ModelAndView
instance containing the form
data and pointing to the UIF generic spring view
form
- - Form instance containing the model datapageId
- - Id of the page within the view that should be rendered, can
be left blank in which the current or default page is rendered
protected ViewService getViewService()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |