Class ViewPostMetadata
- All Implemented Interfaces:
Serializable
When an action is requested on a view (for example add/delete line, field query, so on), it might be necessary to read configuration from the view that was rendered to cary out the action. However, the rendered view is not stored, and the new view is not rendered until after the controller completes. Therefore it is necessary to provide this mechanism.
The post metadata is retrieved in the controller though the UifFormBase
instance
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor that takes the view id. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAccessibleBindingPath(String accessibleBindingPath) Adds a path to the set of accessible binding paths.voidaddAccessibleMethodToCall(String methodToCall) Adds a method to the set of accessible controller methods.voidaddAvailableMethodToCall(String methodToCall) Adds a method to the set of available controller methods.voidaddComponentPostData(String componentId, String key, Object value) Adds post data for the given component id (this is a convenience method for add component post metadata).voidaddComponentPostData(Component component, String key, Object value) Adds post data for the given component (this is a convenience method for add component post metadata).voidaddFieldPropertyEditor(String propertyPath, PropertyEditor propertyEditor) Associates a property editor instance with the given property path.voidaddRenderedPropertyPath(String propertyPath) Adds a property path to the list of rendered property paths.voidaddSecureFieldPropertyEditor(String propertyPath, PropertyEditor propertyEditor) Associates a secure property editor instance with the given property path.voidInvoked after the lifecycle is complete to perform an necessary cleaning.Set of property paths from the view that will allow binding to (by default).Set of method to calls configured within the view that access should be allowed for.The collection objects that were added during the current controller call, these will be emptied after the lifecycle process is run.Set of property paths that have been rendered as part of the lifecycle.Set of available methods to call.getComponentPostData(String componentId, String key) Retrieves post data that has been stored for the given component id and key.getComponentPostMetadata(String componentId) Gets the component post metadata for the given component id.Iterates over the componentPostMetadataMap to find a componentPostMetadata which matches the path given.Map containing post metadata for a component keyed by the component id.getFieldEditor(String propertyName) Look up a field editor.Maintains configuration of properties that have been configured for the view (if render was set to true) and there corresponding PropertyEdtior (if configured).getId()Id for the view the post metadata is associated with.Set of ids for all input fields rendered with the view.Set the metadata of the lookup criteria.Maintains configuration of secure properties that have been configured for the view (if render was set to true) and there corresponding PropertyEdtior (if configured).initializeComponentPostMetadata(String componentId) Initializes a component post metadata instance for the given component id.initializeComponentPostMetadata(Component component) Initializes a component post metadata instance for the given component.voidsetAccessibleBindingPaths(Set<String> accessibleBindingPaths) voidsetAccessibleMethodToCalls(Set<String> accessibleMethodToCalls) voidsetAddedCollectionObjects(Map<String, List<Object>> addedCollectionObjects) voidsetAllRenderedPropertyPaths(Set<String> allRenderedPropertyPaths) voidsetAvailableMethodToCalls(Set<String> availableMethodToCalls) voidsetComponentPostMetadataMap(Map<String, ComponentPostMetadata> componentPostMetadataMap) voidvoidsetInputFieldIds(Set<String> inputFieldIds) void
-
Constructor Details
-
ViewPostMetadata
public ViewPostMetadata() -
ViewPostMetadata
Constructor that takes the view id.- Parameters:
id- id for the view
-
-
Method Details
-
cleanAfterLifecycle
public void cleanAfterLifecycle()Invoked after the lifecycle is complete to perform an necessary cleaning. -
getId
Id for the view the post metadata is associated with.- Returns:
- view id
-
setId
- See Also:
-
getComponentPostMetadataMap
Map containing post metadata for a component keyed by the component id.- Returns:
- post metadata map, key is component id and value is post metadata
-
setComponentPostMetadataMap
- See Also:
-
getComponentPostMetadata
Gets the component post metadata for the given component id.- Parameters:
componentId- id for the component whose post metadata should be retrieved- Returns:
- post metadata object
-
addComponentPostData
Adds post data for the given component (this is a convenience method for add component post metadata).- Parameters:
component- component instance the data should be added forkey- key for the post data, this will be used to retrieve the valuevalue- value for the post data
-
addComponentPostData
Adds post data for the given component id (this is a convenience method for add component post metadata).- Parameters:
componentId- id for the component the data should be added forkey- key for the post data, this will be used to retrieve the valuevalue- value for the post data
-
getComponentPostData
Retrieves post data that has been stored for the given component id and key.- Parameters:
componentId- id for the component the data should be retrieved forkey- key for the post data to retrieve- Returns:
- value for the data, or null if the data does not exist
-
initializeComponentPostMetadata
Initializes a component post metadata instance for the given component.- Parameters:
component- component instance to initialize post metadata for- Returns:
- post metadata instance
-
initializeComponentPostMetadata
Initializes a component post metadata instance for the given component id.- Parameters:
componentId- id for the component to initialize post metadata for- Returns:
- post metadata instance
-
getComponentPostMetadataForPath
Iterates over the componentPostMetadataMap to find a componentPostMetadata which matches the path given.- Parameters:
path- the path of the component to find componentPostMetadata for- Returns:
- returns the componentPostMetadata that matches the path, null if not found or metadata for path not found
-
getFieldPropertyEditors
Maintains configuration of properties that have been configured for the view (if render was set to true) and there corresponding PropertyEdtior (if configured).Information is pulled out of the View during the lifecycle so it can be used when a form post is done from the View. Note if a field is secure, it will be placed in the
getSecureFieldPropertyEditors()map instead- Returns:
- map of property path (full) to PropertyEditor
-
addFieldPropertyEditor
Associates a property editor instance with the given property path.- Parameters:
propertyPath- path for the property the editor should be associated withpropertyEditor- editor instance to use when binding data for the property
-
getSecureFieldPropertyEditors
Maintains configuration of secure properties that have been configured for the view (if render was set to true) and there corresponding PropertyEdtior (if configured).Information is pulled out of the View during the lifecycle so it can be used when a form post is done from the View. Note if a field is non-secure, it will be placed in the
getFieldPropertyEditors()map instead- Returns:
- map of property path (full) to PropertyEditor
-
addSecureFieldPropertyEditor
Associates a secure property editor instance with the given property path.- Parameters:
propertyPath- path for the property the editor should be associated withpropertyEditor- secure editor instance to use when binding data for the property
-
getInputFieldIds
Set of ids for all input fields rendered with the view.- Returns:
- set of id strings
-
setInputFieldIds
- See Also:
-
getAllRenderedPropertyPaths
Set of property paths that have been rendered as part of the lifecycle.Note this will include all property paths (of data fields) that were rendered as part of the last full lifecycle and any component refreshes since then. It will not contain all paths of a view (which would include all pages)
- Returns:
- set of property paths as strings
-
setAllRenderedPropertyPaths
- See Also:
-
addRenderedPropertyPath
Adds a property path to the list of rendered property paths.- Parameters:
propertyPath- property path to add- See Also:
-
getAddedCollectionObjects
The collection objects that were added during the current controller call, these will be emptied after the lifecycle process is run.Note: If a list is empty this means that a collection had an addLine call occur and a new line must be initialized for the collection.
- Returns:
- the collection objects that were added during the current controller call if added through a process other than the collection's own addLine call
- See Also:
-
setAddedCollectionObjects
- See Also:
-
getLookupCriteria
Set the metadata of the lookup criteria.The lookup criteria property name is the key of the map. The value is a map of criteria attributes as specified by
UifConstants.LookupCriteriaPostMetadata. Not all criteria attribute types need to be specified. A missing boolean attribute equals to false. -
setLookupCriteria
- See Also:
-
getAccessibleBindingPaths
Set of property paths from the view that will allow binding to (by default).Used by the UIF web infrastructure to provide security during the binding process. By default, binding will only occur for properties within the view configuration (for properties that allow updating).
- Returns:
- Set of property paths
-
setAccessibleBindingPaths
- See Also:
-
addAccessibleBindingPath
Adds a path to the set of accessible binding paths.- Parameters:
accessibleBindingPath- path to add as accessible- See Also:
-
getAccessibleMethodToCalls
Set of method to calls configured within the view that access should be allowed for.Used by the UIF web infrastructure to provide security for invoking controller methods. By default, only methods within the view configuration can be called.
- Returns:
- Set of method names
-
setAccessibleMethodToCalls
- See Also:
-
addAccessibleMethodToCall
Adds a method to the set of accessible controller methods.- Parameters:
methodToCall- method to add as accessible- See Also:
-
getAvailableMethodToCalls
Set of available methods to call.If a methodToCall belongs to the set of available methods to call, then binding will be allowed only if the methodToCall, either, has the @MethodAccessible notation, or, is listed as one of the accessible methods to call on the view.
- Returns:
- Set of method names
-
setAvailableMethodToCalls
- See Also:
-
addAvailableMethodToCall
Adds a method to the set of available controller methods.- Parameters:
methodToCall- method to add as accessible- See Also:
-
getFieldEditor
Look up a field editor.- Parameters:
propertyName- name of the property to find field and editor for
-