public interface ViewModel extends Serializable
View
.
Since the View relies on helper properties from the model it is necessary the backing object implement the
ViewModel interface. Note model objects can extend UifFormBase
which implements
the ViewModel interface.
Modifier and Type | Method and Description |
---|---|
Map<String,Boolean> |
getActionFlags()
Copy of the action flags on the view to be used by subsequent requests (so they don't need to be
evaluated on each request).
|
Map<String,String> |
getActionParameters()
Map of parameters sent for the invoked action
|
String |
getAjaxReturnType()
Gets the return type for the ajax call
|
Map<String,Object> |
getClientStateForSyncing()
Map that is populated from the component state maintained on the client
|
Map<String,String> |
getDialogExplanations()
Contains values for dialog explanation fields present on the page.
|
DialogResponse |
getDialogResponse(String dialogId)
Helper method to get a dialog response for the given dialog id.
|
Map<String,DialogResponse> |
getDialogResponses()
Map containing dialog responses for a request 'conversation'.
|
Map<String,Boolean> |
getEditModes()
Copy of the edit modes on the view to be used by subsequent requests (so they don't need to be
evaluated on each request).
|
Map<String,Object> |
getExtensionData()
A generic map for framework pieces (such as component modifiers) that need to dynamically store
data to the form
|
String |
getFormPostUrl()
URL the form generated for the view should post to
|
String |
getGrowlScript()
Script that will run on render (view or component) for generating growl messages
|
Map<String,Object> |
getNewCollectionLines()
Holds instances for collection add lines.
|
String |
getPageId()
Id for the current page being displayed within the view
|
List<String> |
getReadOnlyFieldsList()
List of fields that should be read only on the view
|
String |
getRequestJsonTemplate()
Template the will be invoked to return a JSON string
|
Map<String,Set<String>> |
getSelectedCollectionLines()
Holds Set of String identifiers for lines that were selected in a collection from a single page.
|
String |
getState()
Gets the state.
|
String |
getTriggerActionId()
When the request has been triggered by an action component, gives the id for the action.
|
Component |
getUpdateComponent()
Component instance that been built for a refresh/disclosure request.
|
String |
getUpdateComponentId()
Id for the component that should be updated for a component refresh process
|
View |
getView()
View instance associated with the model.
|
ViewHelperService |
getViewHelperService()
Returns the view helper service instance that was configured for the current view.
|
String |
getViewId()
Unique Id for the
View instance. |
String |
getViewName()
Name for the
View instance. |
ViewPostMetadata |
getViewPostMetadata()
Gets the
ViewPostMetadata that has been built up from processing
of a view. |
Map<String,String> |
getViewRequestParameters()
Map of parameters that was used to configured the
View . |
UifConstants.ViewType |
getViewTypeName()
Name for the type of view being requested.
|
boolean |
isAjaxRequest()
Indicates whether the request was made by an ajax call
|
boolean |
isApplyDefaultValues()
Indicates whether default values should be applied.
|
Boolean |
isCanEditView()
Copy of the edit view flag to be used by subsequent requests (so they don't need to be
evaluated on each request).
|
boolean |
isCollectionPagingRequest()
Indicates whether the request is for paging a collection (or sorting).
|
boolean |
isEvaluateFlagsAndModes()
Determines whether edit modes and action flags should be evaluated.
|
boolean |
isJsonRequest()
Indicates whether the request should return a JSON string
|
boolean |
isUpdateComponentRequest()
Indicates whether the request is to update a component (only applicable for ajax requests)
|
boolean |
isUpdateDialogRequest()
Indicates whether the request is to update a dialog (only applicable for ajax requests)
|
boolean |
isUpdateNoneRequest()
Indicates whether the request is for a non-update of the view (only applicable for ajax requests)
|
boolean |
isUpdatePageRequest()
Indicates whether the request is to update a page (only applicable for ajax requests)
|
void |
postBind(javax.servlet.http.HttpServletRequest request)
Called after Spring binds the request to the form and before the controller method is invoked
|
void |
preBind(javax.servlet.http.HttpServletRequest request)
Called before Spring binds the request to the form to allow for pre-processing before setting values.
|
void |
preRender(javax.servlet.http.HttpServletRequest request)
Called after the controller has finished executing, but before rendering occurs.
|
void |
setActionFlags(Map<String,Boolean> actionFlags) |
void |
setActionParameters(Map<String,String> actionParameters)
Setter for the action parameters map
|
void |
setAjaxRequest(boolean ajaxRequest)
Set the ajaxRequest
|
void |
setAjaxReturnType(String ajaxReturnType)
Setter for the type of ajax return
|
void |
setApplyDefaultValues(boolean applyDefaultValues)
Set whether default values should be applied to the view
|
void |
setCanEditView(Boolean canEditView) |
void |
setCollectionPagingRequest(boolean collectionPagingRequest) |
void |
setDialogExplanations(Map<String,String> dialogExplanations) |
void |
setDialogResponses(Map<String,DialogResponse> dialogResponses) |
void |
setEditModes(Map<String,Boolean> editModes) |
void |
setEvaluateFlagsAndModes(boolean evaluateFlagsAndModes) |
void |
setExtensionData(Map<String,Object> extensionData)
Setter for the generic extension data map
|
void |
setFormPostUrl(String formPostUrl)
Setter for the form post URL
|
void |
setGrowlScript(String growlScript)
Setter for the script that generates growls on render
|
void |
setNewCollectionLines(Map<String,Object> newCollectionLines)
Setter for the new collection lines Map
|
void |
setPageId(String pageId)
Setter for the current page id
|
void |
setReadOnlyFieldsList(List<String> readOnlyFieldsList)
Setter for the list of read only fields
|
void |
setRequestJsonTemplate(String requestJsonTemplate)
Setter for the template to render for the request
|
void |
setSelectedCollectionLines(Map<String,Set<String>> selectedCollectionLines)
Setter for the map that holds selected collection lines
|
void |
setState(String state)
Set the state
|
void |
setTriggerActionId(String triggerActionId) |
void |
setUpdateComponent(Component updateComponent) |
void |
setUpdateComponentId(String updateComponentId)
Setter for the component id that should be refreshed
|
void |
setView(View view)
Setter for the view instance
|
void |
setViewId(String viewId)
Setter for the unique view id
|
void |
setViewName(String viewName)
Setter for the view name
|
void |
setViewPostMetadata(ViewPostMetadata viewPostMetadata) |
void |
setViewRequestParameters(Map<String,String> viewRequestParameters)
Setter for the view's request parameter map
|
void |
setViewTypeName(UifConstants.ViewType viewTypeName)
Setter for the view type name
|
void preBind(javax.servlet.http.HttpServletRequest request)
request
- request object containing the query parametersvoid postBind(javax.servlet.http.HttpServletRequest request)
request
- request object containing the query parametersvoid preRender(javax.servlet.http.HttpServletRequest request)
request
- request object containing the query parametersString getViewId()
View
instance. This is specified for a
view in its definition by setting the 'id' property.String getViewName()
View
instance. This is specified for a view in
its definition by setting the 'id' property. The name is not necessary
unique and cannot be used by itself to retrieve a view. Typically it is
used with other parameters to identify a view with a certain type (view
type)void setViewName(String viewName)
viewName
- UifConstants.ViewType getViewTypeName()
View
instances by request parameters (not necessary the
unique id)void setViewTypeName(UifConstants.ViewType viewTypeName)
viewTypeName
- View getView()
ViewHelperService getViewHelperService() throws IllegalAccessException, InstantiationException
IllegalAccessException
InstantiationException
ViewPostMetadata getViewPostMetadata()
ViewPostMetadata
that has been built up from processing
of a view.
The view post metadata is used to read information about the view that was rendered when a post occurs. For example, you might need to check whether a particular flag was enabled for the rendered view when processing the post logic
void setViewPostMetadata(ViewPostMetadata viewPostMetadata)
getViewPostMetadata()
String getPageId()
String getFormPostUrl()
void setFormPostUrl(String formPostUrl)
formPostUrl
- Map<String,String> getViewRequestParameters()
View
.
Maintained on the form to rebuild the view on posts and session timeoutorg.kuali.rice.krad.uif.view.View.getViewRequestParameters()
void setViewRequestParameters(Map<String,String> viewRequestParameters)
viewRequestParameters
- map of request parametersList<String> getReadOnlyFieldsList()
If the view being rendered supports request setting of read-only fields, the readOnlyFields request parameter can be sent to mark fields as read only that might not have been otherwise
Note the paths specified should be the simple property names (not the full binding path). Therefore if the property name appears multiple times in the view, all instances will be set as read only
View.isSupportsRequestOverrideOfReadOnlyFields()
void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
readOnlyFieldsList
- Map<String,Object> getNewCollectionLines()
void setNewCollectionLines(Map<String,Object> newCollectionLines)
newCollectionLines
- String getTriggerActionId()
void setTriggerActionId(String triggerActionId)
getTriggerActionId()
Map<String,String> getActionParameters()
Many times besides just setting the method to call actions need to send
additional parameters. For instance the method being called might do a
redirect, in which case the action needs to send parameters for the
redirect URL. An example of this is redirecting to a Lookup
view. In some cases the parameters that need to be sent conflict with
properties already on the form, and putting all the action parameters as
form properties would grow massive (in addition to adds an additional
step from the XML config). So this general map solves those issues.
void setActionParameters(Map<String,String> actionParameters)
actionParameters
- Map<String,Object> getClientStateForSyncing()
Used when a request is made that refreshes part of the view. The current state for components (which
have state that can be changed on the client), is populated into this map which is then used by the
ViewHelperService
to update the components so that the state is maintained when they render.
Map<String,Set<String>> getSelectedCollectionLines()
When the select field is enabled for a CollectionGroup
, the framework will be
default bind the selected identifier strings to this property. The key of the map uniquely identifies the
collection by the full binding path to the collection, and the value is a set of Strings for the checked
lines.
LegacyDataAppAdapter.getDataObjectIdentifierString(java.lang.Object)
void setSelectedCollectionLines(Map<String,Set<String>> selectedCollectionLines)
selectedCollectionLines
- boolean isApplyDefaultValues()
Default field values of a view need to be applied after the view life cycle completes. Otherwise, they risk getting over written.
void setApplyDefaultValues(boolean applyDefaultValues)
applyDefaultValues
- boolean isEvaluateFlagsAndModes()
Initially this will be true causing edit modes and action flags to be evaluated on the initial request to a view. If these need to be reevaluated at some point (for a particular view instance), this flag can be set to true and causing the authorization to be reevaluated during the lifecycle.
void setEvaluateFlagsAndModes(boolean evaluateFlagsAndModes)
isEvaluateFlagsAndModes()
Boolean isCanEditView()
If null, edit check will be performed
void setCanEditView(Boolean canEditView)
isCanEditView()
Map<String,Boolean> getActionFlags()
void setActionFlags(Map<String,Boolean> actionFlags)
getActionFlags()
Map<String,Boolean> getEditModes()
void setEditModes(Map<String,Boolean> editModes)
getEditModes()
String getGrowlScript()
void setGrowlScript(String growlScript)
growlScript
- String getState()
String getUpdateComponentId()
void setUpdateComponentId(String updateComponentId)
updateComponentId
- Component getUpdateComponent()
This is generally set by org.kuali.rice.krad.uif.lifecycle.ViewLifecycle#performComponentLifecycle(org.kuali.rice.krad.uif.view.View, java.lang.Object, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.kuali.rice.krad.uif.lifecycle.ViewPostMetadata, java.lang.String) after processing the lifecycle. The form property provides access to the rendering layer.
void setUpdateComponent(Component updateComponent)
getUpdateComponent()
boolean isAjaxRequest()
Depending on whether the request was made via ajax (versus standard browser submit) the response will be handled different. For example with an ajax request we can send back partial page updates, which cannot be done with standard submits
If this indicator is true, getAjaxReturnType()
will be used to determine how to handling
the ajax return
void setAjaxRequest(boolean ajaxRequest)
ajaxRequest
- String getAjaxReturnType()
The ajax return type indicates how the response content will be handled in the client. Typical examples include updating a component, the page, or doing a redirect.
UifConstants.AjaxReturnTypes
void setAjaxReturnType(String ajaxReturnType)
ajaxReturnType
- boolean isUpdateComponentRequest()
boolean isUpdatePageRequest()
boolean isUpdateDialogRequest()
boolean isUpdateNoneRequest()
Examples of requests that do not update the view are ajax queries or requests that download a file
boolean isJsonRequest()
When this indicator is true, the rendering process will invoke the template
given by getRequestJsonTemplate()
which should return a JSON string
For JSON requests the view is not built, however a component can be retrieved and
exported in the request by setting getUpdateComponentId()
String getRequestJsonTemplate()
Certain templates can be rendered to build JSON for a JSON request. The template set here (by a controller) will be rendered
void setRequestJsonTemplate(String requestJsonTemplate)
requestJsonTemplate
- boolean isCollectionPagingRequest()
void setCollectionPagingRequest(boolean collectionPagingRequest)
isCollectionPagingRequest()
Map<String,String> getDialogExplanations()
Since multiple dialogs can be present on the same page using the generic explanation field, the values are maintained in this map using the dialog id as the key. Values are cleared on each request.
void setDialogExplanations(Map<String,String> dialogExplanations)
getDialogExplanations()
Map<String,DialogResponse> getDialogResponses()
When a controller methods requests a dialog, the response is collected on the return call and placed into this map. The key to the map is the id for the dialog. Since a single controller method can spawn multiple dialogs in a single conversation (these are actually multiple requests/responses, but part of the same action request), the responses are collected in this map. Whenever a request is encountered that is not a return, the map is cleared. This means the responses will be cleared in case the action is triggered action.
DialogResponse getDialogResponse(String dialogId)
dialogId
- id of the dialog to get response forgetDialogResponses()
void setDialogResponses(Map<String,DialogResponse> dialogResponses)
getDialogResponses()
Map<String,Object> getExtensionData()
void setExtensionData(Map<String,Object> extensionData)
extensionData
- Copyright © 2005–2015 The Kuali Foundation. All rights reserved.