Class ComponentPostMetadata

java.lang.Object
org.kuali.rice.krad.uif.lifecycle.ComponentPostMetadata
All Implemented Interfaces:
Serializable

public class ComponentPostMetadata extends Object implements Serializable
Holds data about a component that might be needed to handle a post request.
Author:
Kuali Rice Team (rice.collab@kuali.org)
See Also:
  • Constructor Details

    • ComponentPostMetadata

      public ComponentPostMetadata(String id)
      Constructor taking the id for the component to store metadata for.
      Parameters:
      id - component id
  • Method Details

    • getId

      public String getId()
      Id for the component the post metadata is associated with.

      The id can be used to retrieve the component post metadata from the view post metadata

      Returns:
      component id
    • setId

      public void setId(String id)
      See Also:
    • getPath

      public String getPath()
      Path of the component within the view structure (tree).

      This is set during the lifecycle process and used to retrieve the component for refresh calls

      Returns:
      path from view
    • setPath

      public void setPath(String path)
      See Also:
    • getPhasePathMapping

      public Map<String,String> getPhasePathMapping()
      Map containing the path for the component at each lifecycle phase.

      Note this is only stored if the path of the component is different from the getPath() at any of the phases

      Returns:
      map where key is the phase name and the value is the component's path
    • setPhasePathMapping

      public void setPhasePathMapping(Map<String,String> phasePathMapping)
      See Also:
    • getRefreshPathMappings

      public Map<String,List<String>> getRefreshPathMappings()
      Map of property paths whose lifecycle will be run when the component is refreshed.

      Each map entry contains a tree of paths to process for each of the lifecycle phases. This is so parents of the component (in each phase) are picked up during the refresh process

      Returns:
      map of refresh paths
    • setRefreshPathMappings

      public void setRefreshPathMappings(Map<String,List<String>> refreshPathMappings)
      See Also:
    • isDetachedComponent

      public boolean isDetachedComponent()
      Indicates whether the component is detached from the view (not in the view's structure, but an external component, for example a dialog).

      This is used by the component refresh process to determine whether it can get the component instance by its path from the view (in the case of the component being attached), or if it must use its id (in the case of the component being detached).

      Returns:
      boolean true if the component is detached, false if not
    • setDetachedComponent

      public void setDetachedComponent(boolean isDetachedComponent)
      See Also:
      • isDetachedComponent
    • getData

      public Map<String,Object> getData()
      General post data that has been stored for the component.

      Holds the general post data for a component. Any piece of data can be added to this map and then retrieved on a post call (for example in a controller method)

      Note map returned is unmodifiable. Use addData(java.lang.String, java.lang.Object) to add new data entries

      Returns:
      unmodifiable map of data
    • setData

      public void setData(Map<String,Object> data)
      See Also:
    • addData

      public void addData(String key, Object value)
      Adds a new data entry to the components post data.
      Parameters:
      key - key for data, which is used to retrieve the data
      value - data value
      See Also:
    • getData

      public Object getData(String key)
      Retrieves a post data value for the component.
      Parameters:
      key - key for the data value to retrieve
      Returns:
      data value, or null if data does not exist
      See Also:
    • getRootObjectPath

      public String getRootObjectPath()
      Get the path of the first object in this components path.
      Returns:
      the top most parent object's path for this component