public class ModelAndViewServiceImpl extends Object implements ModelAndViewService
Constructor and Description |
---|
ModelAndViewServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected String |
buildShowDialogScript(String dialogId,
boolean confirmation,
UifFormBase form)
Builds a JavaScript string for invoking the showDialog method with the given dialog parameters.
|
org.springframework.web.servlet.ModelAndView |
checkForm(UifFormBase form)
Invokes
ViewValidationService to validate the contents of the
given form instance. |
org.springframework.web.servlet.ModelAndView |
getMessageView(UifFormBase form,
String headerText,
String messageText)
Retrieves an instance of the view with id
UifConstants.MESSAGE_VIEW_ID
and sets the header and message from the given parameters. |
org.springframework.web.servlet.ModelAndView |
getModelAndView(UifFormBase form)
Configures the Spring model and view instance containing the form data and pointing to the
generic Uif view.
|
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).
|
org.springframework.web.servlet.ModelAndView |
getModelAndView(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.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.
|
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.
|
protected ViewService |
getViewService() |
ViewValidationService |
getViewValidationService() |
protected void |
invokeViewLifecycle(javax.servlet.http.HttpServletRequest request,
UifFormBase form)
Prepares the
View instance contained on the form for rendering. |
org.springframework.web.servlet.ModelAndView |
performRedirect(UifFormBase form,
String redirectUrl)
Builds a model and view instance configured to redirect to the given URL.
|
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.
|
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.
|
void |
setViewService(ViewService viewService) |
void |
setViewValidationService(ViewValidationService viewValidationService) |
org.springframework.web.servlet.ModelAndView |
showDialog(String dialogId,
boolean confirmation,
UifFormBase form)
Builds the dialog group with the given id then creates the script for showing the dialog once the
page reloads.
|
public ModelAndViewServiceImpl()
public org.springframework.web.servlet.ModelAndView checkForm(UifFormBase form)
ViewValidationService
to validate the contents of the
given form instance.
Handles the check form action to validate the given form data.checkForm
in interface ModelAndViewService
form
- instance containing the model datapublic org.springframework.web.servlet.ModelAndView showDialog(String dialogId, boolean confirmation, UifFormBase form)
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.
showDialog
in interface ModelAndViewService
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 dataprotected String buildShowDialogScript(String dialogId, boolean confirmation, UifFormBase form)
dialogId
- id for the dialog group to showconfirmation
- whether the dialog should be shown as a confirmationform
- instance containing the model datapublic org.springframework.web.servlet.ModelAndView performRedirect(UifFormBase form, String baseUrl, Properties urlParameters)
performRedirect
in interface ModelAndViewService
form
- form instance containing the model databaseUrl
- base URL to redirect tourlParameters
- parameters to add to the base URLpublic org.springframework.web.servlet.ModelAndView performRedirect(UifFormBase form, String redirectUrl)
performRedirect
in interface ModelAndViewService
form
- instance containing the model dataredirectUrl
- URL to redirect topublic org.springframework.web.servlet.ModelAndView getMessageView(UifFormBase form, String headerText, String messageText)
UifConstants.MESSAGE_VIEW_ID
and sets the header and message from the given parameters.
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
getMessageView
in interface ModelAndViewService
form
- instance containing the model dataheaderText
- header text for the message view (can be blank)messageText
- text for the message to displaypublic org.springframework.web.servlet.ModelAndView getModelAndView(UifFormBase form)
The view and page to render is assumed to be set in the given form object.
getModelAndView
in interface ModelAndViewService
form
- form instance containing the model datapublic org.springframework.web.servlet.ModelAndView getModelAndView(UifFormBase form, String pageId)
The view to render is assumed to be set in the given form object.
getModelAndView
in interface ModelAndViewService
form
- form instance containing the model datapageId
- page id within the view to renderpublic org.springframework.web.servlet.ModelAndView getModelAndView(UifFormBase form, Map<String,Object> additionalViewAttributes)
The view and page to render is assumed to be set in the given form object.
getModelAndView
in interface ModelAndViewService
form
- form instance containing the model dataadditionalViewAttributes
- additional attributes to add to the returned model and viewpublic org.springframework.web.servlet.ModelAndView getModelAndViewWithInit(UifFormBase form, String viewId)
This can be used by controllers to render a different view from the one initially requested (if any)
getModelAndViewWithInit
in interface ModelAndViewService
form
- form instance containing the model dataviewId
- id for the view to initializepublic org.springframework.web.servlet.ModelAndView getModelAndViewWithInit(UifFormBase form, String viewId, String pageId)
This can be used by controllers to render a different view from the one initially requested (if any)
getModelAndViewWithInit
in interface ModelAndViewService
form
- form instance containing the model dataviewId
- id for the view to initializepageId
- page id within the view to renderpublic void prepareView(javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.ModelAndView modelAndView)
prepareView
in interface ModelAndViewService
request
- servlet requestmodelAndView
- model and viewprotected void invokeViewLifecycle(javax.servlet.http.HttpServletRequest request, UifFormBase form)
View
instance contained on the form for rendering.request
- servlet requestform
- form instance containing the data and view instanceprotected ViewService getViewService()
public void setViewService(ViewService viewService)
public ViewValidationService getViewValidationService()
public void setViewValidationService(ViewValidationService viewValidationService)
Copyright © 2005–2014 The Kuali Foundation. All rights reserved.