org.kuali.rice.krad.uif.view
Interface ViewModel

All Superinterfaces:
Serializable
All Known Implementing Classes:
CacheAdminForm, CourseOfferingForm, DocumentFormBase, IncidentReportForm, IngesterForm, InquiryForm, LookupForm, MaintenanceForm, RegistrationForm, StatsForm, UifComponentsTestForm, UifFormBase, UITestForm

public interface ViewModel
extends Serializable

Interface that must be implemented for clases the provide the backing data (model) for a View

Since the View relies on helper properties from the model it is necessary the backing object implement this interface. Note model objects can extend UifFormBase which implements this interface

Author:
Kuali Rice Team (rice.collab@kuali.org)

Method Summary
 Map<String,String> getActionParameters()
          Map of parameters sent for the invoked action
 Map<String,Object> getClientStateForSyncing()
          Map that is populated from the component state maintained on the client
 String getFormPostUrl()
          URL the form generated for the view should post to
 Map<String,Object> getNewCollectionLines()
          Holds instances for collection add lines.
 String getPageId()
          Id for the current page being displayed within the view
 View getPostedView()
          View instance for the page that made a request.
 List<String> getReadOnlyFieldsList()
          List of fields that should be read only on the view
 Map<String,Set<String>> getSelectedCollectionLines()
          Holds Set of String identifiers for lines that were selected in a collection
 View getView()
          View instance associated with the model.
 String getViewId()
          Unique Id for the View instance.
 String getViewName()
          Name for the View instance.
 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 isDefaultsApplied()
          Indicates whether the form has had default values from the configured View applied.
 void setActionParameters(Map<String,String> actionParameters)
          Setter for the action parameters map
 void setDefaultsApplied(boolean defaultsApplied)
          Setter for the defaults applied indicator
 void setFormPostUrl(String formPostUrl)
          Setter for the form post URL
 void setNewCollectionLines(Map<String,Object> newCollectionLines)
          Setter for the new collection lines Map
 void setPageId(String pageId)
          Setter for the current page id
 void setPostedView(View previousView)
          Setter for the previous view instance
 void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
          Setter for the list of read only fields
 void setSelectedCollectionLines(Map<String,Set<String>> selectedCollectionLines)
          Setter for the map that holds selected collection lines
 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 setViewRequestParameters(Map<String,String> viewRequestParameters)
          Setter for the view's request parameter map
 void setViewTypeName(UifConstants.ViewType viewTypeName)
          Setter for the view type name
 

Method Detail

getViewId

String getViewId()
Unique Id for the View instance. This is specified for a view in its definition by setting the 'id' property.

Returns:
String view id

setViewId

void setViewId(String viewId)
Setter for the unique view id

Parameters:
viewId -

getViewName

String getViewName()
Name for the 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)

Returns:
String view name

setViewName

void setViewName(String viewName)
Setter for the view name

Parameters:
viewName -

getViewTypeName

UifConstants.ViewType getViewTypeName()
Name for the type of view being requested. This can be used to find View instances by request parameters (not necessary the unique id)

Returns:
String view type name

setViewTypeName

void setViewTypeName(UifConstants.ViewType viewTypeName)
Setter for the view type name

Parameters:
viewTypeName -

getView

View getView()
View instance associated with the model. Used to render the user interface

Returns:
View

setView

void setView(View view)
Setter for the view instance

Parameters:
view -

getPostedView

View getPostedView()
View instance for the page that made a request. Since a new view instance gets initialized for each request before the controller logic is invoked, any state about the previous view is lost. This could be needed to read metadata from the view for such things as collection processing. When this is necessary the previous view instance can be retrieved

Returns:
View instance

setPostedView

void setPostedView(View previousView)
Setter for the previous view instance

Parameters:
previousView -

getPageId

String getPageId()
Id for the current page being displayed within the view

Returns:
String page id

setPageId

void setPageId(String pageId)
Setter for the current page id

Parameters:
pageId -

getFormPostUrl

String getFormPostUrl()
URL the form generated for the view should post to

Returns:
String form post URL

setFormPostUrl

void setFormPostUrl(String formPostUrl)
Setter for the form post URL

Parameters:
formPostUrl -

getViewRequestParameters

Map<String,String> getViewRequestParameters()
Map of parameters that was used to configured the View. Maintained on the form to rebuild the view on posts and session timeout

Returns:
Map view parameters
See Also:
org.kuali.rice.krad.uif.view.View.getViewRequestParameters()

setViewRequestParameters

void setViewRequestParameters(Map<String,String> viewRequestParameters)
Setter for the view's request parameter map

Parameters:
viewRequestParameters -

getReadOnlyFieldsList

List<String> getReadOnlyFieldsList()
List of fields that should be read only on the view

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

Returns:
List read only property names
See Also:
View.isSupportsReadOnlyFieldsOverride()

setReadOnlyFieldsList

void setReadOnlyFieldsList(List<String> readOnlyFieldsList)
Setter for the list of read only fields

Parameters:
readOnlyFieldsList -

getNewCollectionLines

Map<String,Object> getNewCollectionLines()
Holds instances for collection add lines. The key of the Map gives the collection name the line instance applies to, the Map value is an instance of the collection object class that holds the new line data

Returns:
Map new collection lines

setNewCollectionLines

void setNewCollectionLines(Map<String,Object> newCollectionLines)
Setter for the new collection lines Map

Parameters:
newCollectionLines -

getActionParameters

Map<String,String> getActionParameters()
Map of parameters sent for the invoked action

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.

Returns:
Map action parameters

setActionParameters

void setActionParameters(Map<String,String> actionParameters)
Setter for the action parameters map

Parameters:
actionParameters -

getClientStateForSyncing

Map<String,Object> getClientStateForSyncing()
Map that is populated from the component state maintained on the client

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.

Returns:
Map map where key is name of property or component id, and value is the property value or another map of component key/value pairs

getSelectedCollectionLines

Map<String,Set<String>> getSelectedCollectionLines()
Holds Set of String identifiers for lines that were selected in a collection

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.

Returns:
Map> map of collections and their selected lines
See Also:
DataObjectMetaDataService.getDataObjectIdentifierString(java.lang.Object)

setSelectedCollectionLines

void setSelectedCollectionLines(Map<String,Set<String>> selectedCollectionLines)
Setter for the map that holds selected collection lines

Parameters:
selectedCollectionLines -

isDefaultsApplied

boolean isDefaultsApplied()
Indicates whether the form has had default values from the configured View applied. This happens only once for each form instance

Returns:
boolean true if default values have been applied, false if not

setDefaultsApplied

void setDefaultsApplied(boolean defaultsApplied)
Setter for the defaults applied indicator

Parameters:
defaultsApplied -


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.