public class ViewPostMetadata extends Object implements 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
Constructor and Description |
---|
ViewPostMetadata()
Default constructor.
|
ViewPostMetadata(String id)
Constructor that takes the view id.
|
Modifier and Type | Method and Description |
---|---|
void |
addAccessibleBindingPath(String accessibleBindingPath)
Adds a path to the set of accessible binding paths.
|
void |
addAccessibleMethodToCall(String methodToCall)
Adds a method to the set of accessible controller methods.
|
void |
addAvailableMethodToCall(String methodToCall)
Adds a method to the set of available controller methods.
|
void |
addComponentPostData(Component component,
String key,
Object value)
Adds post data for the given component (this is a convenience method for add component post metadata).
|
void |
addComponentPostData(String componentId,
String key,
Object value)
Adds post data for the given component id (this is a convenience method for add component post metadata).
|
void |
addFieldPropertyEditor(String propertyPath,
PropertyEditor propertyEditor)
Associates a property editor instance with the given property path.
|
void |
addRenderedPropertyPath(String propertyPath)
Adds a property path to the list of rendered property paths.
|
void |
addSecureFieldPropertyEditor(String propertyPath,
PropertyEditor propertyEditor)
Associates a secure property editor instance with the given property path.
|
void |
cleanAfterLifecycle()
Invoked after the lifecycle is complete to perform an necessary cleaning.
|
Set<String> |
getAccessibleBindingPaths()
Set of property paths from the view that will allow binding to (by default).
|
Set<String> |
getAccessibleMethodToCalls()
Set of method to calls configured within the view that access should be allowed for.
|
Map<String,List<Object>> |
getAddedCollectionObjects()
The collection objects that were added during the current controller call, these will be emptied after
the lifecycle process is run.
|
Set<String> |
getAllRenderedPropertyPaths()
Set of property paths that have been rendered as part of the lifecycle.
|
Set<String> |
getAvailableMethodToCalls()
Set of available methods to call.
|
Object |
getComponentPostData(String componentId,
String key)
Retrieves post data that has been stored for the given component id and key.
|
ComponentPostMetadata |
getComponentPostMetadata(String componentId)
Gets the component post metadata for the given component id.
|
ComponentPostMetadata |
getComponentPostMetadataForPath(String path)
Iterates over the componentPostMetadataMap to find a componentPostMetadata which matches the path given.
|
Map<String,ComponentPostMetadata> |
getComponentPostMetadataMap()
Map containing post metadata for a component keyed by the component id.
|
PropertyEditor |
getFieldEditor(String propertyName)
Look up a field editor.
|
Map<String,PropertyEditor> |
getFieldPropertyEditors()
Maintains configuration of properties that have been configured for the view (if render was
set to true) and there corresponding PropertyEdtior (if configured).
|
String |
getId()
Id for the view the post metadata is associated with.
|
Set<String> |
getInputFieldIds()
Set of ids for all input fields rendered with the view.
|
Map<String,Map<String,Object>> |
getLookupCriteria()
Set the metadata of the lookup criteria.
|
Map<String,PropertyEditor> |
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).
|
ComponentPostMetadata |
initializeComponentPostMetadata(Component component)
Initializes a component post metadata instance for the given component.
|
ComponentPostMetadata |
initializeComponentPostMetadata(String componentId)
Initializes a component post metadata instance for the given component id.
|
void |
setAccessibleBindingPaths(Set<String> accessibleBindingPaths) |
void |
setAccessibleMethodToCalls(Set<String> accessibleMethodToCalls) |
void |
setAddedCollectionObjects(Map<String,List<Object>> addedCollectionObjects) |
void |
setAllRenderedPropertyPaths(Set<String> allRenderedPropertyPaths) |
void |
setAvailableMethodToCalls(Set<String> availableMethodToCalls) |
void |
setComponentPostMetadataMap(Map<String,ComponentPostMetadata> componentPostMetadataMap) |
void |
setId(String id) |
void |
setInputFieldIds(Set<String> inputFieldIds) |
void |
setLookupCriteria(Map<String,Map<String,Object>> lookupCriteria) |
public ViewPostMetadata()
public ViewPostMetadata(String id)
id
- id for the viewpublic void cleanAfterLifecycle()
public Map<String,ComponentPostMetadata> getComponentPostMetadataMap()
public void setComponentPostMetadataMap(Map<String,ComponentPostMetadata> componentPostMetadataMap)
getComponentPostMetadataMap()
public ComponentPostMetadata getComponentPostMetadata(String componentId)
componentId
- id for the component whose post metadata should be retrievedpublic void addComponentPostData(Component component, String key, Object value)
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 datapublic void addComponentPostData(String componentId, String key, Object value)
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 datapublic Object getComponentPostData(String componentId, String key)
componentId
- id for the component the data should be retrieved forkey
- key for the post data to retrievepublic ComponentPostMetadata initializeComponentPostMetadata(Component component)
component
- component instance to initialize post metadata forpublic ComponentPostMetadata initializeComponentPostMetadata(String componentId)
componentId
- id for the component to initialize post metadata forpublic ComponentPostMetadata getComponentPostMetadataForPath(String path)
path
- the path of the component to find componentPostMetadata forpublic Map<String,PropertyEditor> getFieldPropertyEditors()
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
public void addFieldPropertyEditor(String propertyPath, PropertyEditor propertyEditor)
propertyPath
- path for the property the editor should be associated withpropertyEditor
- editor instance to use when binding data for the propertypublic Map<String,PropertyEditor> getSecureFieldPropertyEditors()
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
public void addSecureFieldPropertyEditor(String propertyPath, PropertyEditor propertyEditor)
propertyPath
- path for the property the editor should be associated withpropertyEditor
- secure editor instance to use when binding data for the propertypublic Set<String> getInputFieldIds()
public void setInputFieldIds(Set<String> inputFieldIds)
getInputFieldIds()
public Set<String> getAllRenderedPropertyPaths()
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)
public void setAllRenderedPropertyPaths(Set<String> allRenderedPropertyPaths)
getAllRenderedPropertyPaths()
public void addRenderedPropertyPath(String propertyPath)
propertyPath
- property path to addgetAllRenderedPropertyPaths()
public Map<String,List<Object>> getAddedCollectionObjects()
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.
CollectionGroupBase
public void setAddedCollectionObjects(Map<String,List<Object>> addedCollectionObjects)
getAddedCollectionObjects()
public Map<String,Map<String,Object>> getLookupCriteria()
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.
public void setLookupCriteria(Map<String,Map<String,Object>> lookupCriteria)
getLookupCriteria()
public Set<String> getAccessibleBindingPaths()
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).
public void setAccessibleBindingPaths(Set<String> accessibleBindingPaths)
getAccessibleBindingPaths()
public void addAccessibleBindingPath(String accessibleBindingPath)
accessibleBindingPath
- path to add as accessiblegetAccessibleBindingPaths()
public Set<String> getAccessibleMethodToCalls()
Used by the UIF web infrastructure to provide security for invoking controller methods. By default, only methods within the view configuration can be called.
public void setAccessibleMethodToCalls(Set<String> accessibleMethodToCalls)
getAccessibleMethodToCalls()
public void addAccessibleMethodToCall(String methodToCall)
methodToCall
- method to add as accessiblegetAccessibleMethodToCalls()
public Set<String> getAvailableMethodToCalls()
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.
public void setAvailableMethodToCalls(Set<String> availableMethodToCalls)
getAvailableMethodToCalls()
public void addAvailableMethodToCall(String methodToCall)
methodToCall
- method to add as accessiblegetAvailableMethodToCalls()
public PropertyEditor getFieldEditor(String propertyName)
propertyName
- name of the property to find field and editor forCopyright © 2005–2016 The Kuali Foundation. All rights reserved.