Interface ModelAndViewService
- All Known Implementing Classes:
ModelAndViewServiceImpl
ModelAndView instances
and also other controller helper methods such as showing a dialog, a message view, or redirecting.- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.ModelAndViewcheckForm(UifFormBase form) Handles the check form action to validate the given form data.org.springframework.web.servlet.ModelAndViewgetMessageView(UifFormBase form, String headerText, String messageText) Builds a message view from the given header and message text then forwards the UIF model and view.org.springframework.web.servlet.ModelAndViewgetModelAndView(UifFormBase form) Configures the Spring model and view instance containing the form data and pointing to the generic Uif view.org.springframework.web.servlet.ModelAndViewgetModelAndView(UifFormBase form, String pageId) Configures the Spring model and view instance containing the form data and pointing to the generic Uif view, and also changes the current page to the given page id.org.springframework.web.servlet.ModelAndViewgetModelAndView(UifFormBase form, Map<String, Object> additionalViewAttributes) Configures the Spring model and view instance containing the form data and pointing to the generic Uif view, and also adds the given attributes (which can be referenced in the view templates).org.springframework.web.servlet.ModelAndViewgetModelAndViewWithInit(UifFormBase form, String viewId) Initialize a new view instance for the given view id, then configures the Spring model and view instance containing the form data and pointing to the generic Uif view.org.springframework.web.servlet.ModelAndViewgetModelAndViewWithInit(UifFormBase form, String viewId, String pageId) Initialize a new view instance for the given view id, then configures the Spring model and view instance containing the form data and pointing to the generic Uif view.org.springframework.web.servlet.ModelAndViewperformRedirect(UifFormBase form, String redirectUrl) Builds a model and view instance configured to redirect to the given URL.org.springframework.web.servlet.ModelAndViewperformRedirect(UifFormBase form, String baseUrl, Properties urlParameters) Builds an URL from the given base URL and parameters, then builds a model and view instance configured to redirect to the built URL.voidprepareView(javax.servlet.http.HttpServletRequest request, 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.org.springframework.web.servlet.ModelAndViewshowDialog(String dialogId, boolean confirmation, UifFormBase form) Invoked by controller methods to show a dialog to the user.
-
Method Details
-
checkForm
Handles the check form action to validate the given form data.- Parameters:
form- instance containing the model data- Returns:
- ModelAndView instance for rendering the view
-
showDialog
org.springframework.web.servlet.ModelAndView showDialog(String dialogId, boolean confirmation, UifFormBase form) Invoked by controller methods to show a dialog to the user.This will return back to the view and display the dialog to the user. When the users chooses a response, the initial action that triggered the controller method (which called showDialog) will be triggered again. The response will be captured in the form property
UifFormBase.getDialogResponses(). In the case of a confirmation, if 'false' (typically labeled cancel) is choosen the initial action will simply not be triggered again.- Parameters:
dialogId- id for the dialog group to showconfirmation- whether the dialog should be shown as a confirmation, in this case it is expected the options are true (continue) or false (stop). In addition, if the user selects the false option, the dialog answer will not be resubmitted to the server, instead the user will remain on the viewform- instance containing the model data- Returns:
- ModelAndView instance for rendering the view
-
performRedirect
org.springframework.web.servlet.ModelAndView performRedirect(UifFormBase form, String baseUrl, Properties urlParameters) Builds an URL from the given base URL and parameters, then builds a model and view instance configured to redirect to the built URL.- Parameters:
form- form instance containing the model databaseUrl- base URL to redirect tourlParameters- parameters to add to the base URL- Returns:
- ModelAndView instance configured to redirect to the built URL
-
performRedirect
Builds a model and view instance configured to redirect to the given URL.- Parameters:
form- instance containing the model dataredirectUrl- URL to redirect to- Returns:
- ModelAndView instance configured to redirect to the given URL
-
getMessageView
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.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
- Parameters:
form- instance containing the model dataheaderText- header text for the message view (can be blank)messageText- text for the message to display- Returns:
- instance for rendering the view
-
getModelAndView
Configures the Spring model and view instance containing the form data and pointing to the generic Uif view.The view and page to render is assumed to be set in the given form object.
- Parameters:
form- form instance containing the model data- Returns:
- ModelAndView instance for rendering the view
-
getModelAndView
Configures the Spring model and view instance containing the form data and pointing to the generic Uif view, and also changes the current page to the given page id.The view to render is assumed to be set in the given form object.
- Parameters:
form- form instance containing the model datapageId- page id within the view to render- Returns:
- ModelAndView instance for rendering the view
-
getModelAndView
org.springframework.web.servlet.ModelAndView getModelAndView(UifFormBase form, Map<String, Object> additionalViewAttributes) Configures the Spring model and view instance containing the form data and pointing to the generic Uif view, and also adds the given attributes (which can be referenced in the view templates).The view and page to render is assumed to be set in the given form object.
- Parameters:
form- form instance containing the model dataadditionalViewAttributes- additional attributes to add to the returned model and view- Returns:
- ModelAndView instance for rendering the view
-
getModelAndViewWithInit
org.springframework.web.servlet.ModelAndView getModelAndViewWithInit(UifFormBase form, String viewId) Initialize a new view instance for the given view id, then configures the Spring model and view instance containing the form data and pointing to the generic Uif view.This can be used by controllers to render a different view from the one initially requested (if any)
- Parameters:
form- form instance containing the model dataviewId- id for the view to initialize- Returns:
- ModelAndView instance for rendering the view
-
getModelAndViewWithInit
org.springframework.web.servlet.ModelAndView getModelAndViewWithInit(UifFormBase form, String viewId, String pageId) Initialize a new view instance for the given view id, then configures the Spring model and view instance containing the form data and pointing to the generic Uif view.This can be used by controllers to render a different view from the one initially requested (if any)
- Parameters:
form- form instance containing the model dataviewId- id for the view to initializepageId- page id within the view to render- Returns:
- ModelAndView instance for rendering the view
-
prepareView
void prepareView(javax.servlet.http.HttpServletRequest request, 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.- Parameters:
request- servlet requestmodelAndView- model and view
-