Class LifecycleRefreshPathBuilder

java.lang.Object
org.kuali.rice.krad.uif.lifecycle.LifecycleRefreshPathBuilder

public class LifecycleRefreshPathBuilder extends Object
For components that can be refreshed, builds out the various paths the lifecycle needs to be run on when the component refresh process is run.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Constructor Details

    • LifecycleRefreshPathBuilder

      public LifecycleRefreshPathBuilder()
  • Method Details

    • processLifecycleElements

      public static void processLifecycleElements()
      Iterates through each LifecycleElement that has been collected in the view index and invokes refresh path processing.
    • processLifecycleElement

      protected static void processLifecycleElement(LifecycleElement element)
      Determines whether the given lifecycle element is capable of being refreshed, and if so invokes buildRefreshPathMappings(org.kuali.rice.krad.uif.util.LifecycleElement, org.kuali.rice.krad.uif.lifecycle.ComponentPostMetadata) to build the refresh paths.
      Parameters:
      element - lifecycle element to build refresh paths for (if necessary)
    • buildRefreshPathMappings

      protected static void buildRefreshPathMappings(LifecycleElement lifecycleElement, ComponentPostMetadata componentPostMetadata)
      Builds the refresh paths for the given lifecycle element and sets onto the post metadata for storage.

      For each lifecycle phase, a list of paths that the refresh lifecycle for the given should process is built. These are then stored on the component post metadata for retrieval on the refresh call

      Parameters:
      lifecycleElement - lifecycle element to build paths for
      componentPostMetadata - post metadata instance to store the paths
    • storePhasePathMapping

      protected static void storePhasePathMapping(LifecycleElement lifecycleElement, ComponentPostMetadata componentPostMetadata)
      Store phase path mapping for component if there are any paths different from the final path.
      Parameters:
      lifecycleElement - lifecycle element to store phase mapping for
      componentPostMetadata - post metadata instance to hold mapping
    • processElementPath

      protected static void processElementPath(String path, List<String> initializePaths, List<String> applyModelPaths, List<String> finalizePaths, Set<String> visitedPaths)
      Processes the element at the given path, and all its parents (given by properties within the path) adding their refresh paths to the lists being built.
      Parameters:
      path - path of the element to process
      initializePaths - list of refresh paths for the intialize phase
      applyModelPaths - list of refresh paths for the apply model phase
      finalizePaths - list of refresh paths for the finalize phase
      visitedPaths - list of paths that have already been processed
    • addElementRefreshPaths

      protected static void addElementRefreshPaths(String elementPath, List<String> initializePaths, List<String> applyModelPaths, List<String> finalizePaths, Set<String> visitedPaths)
      Retrieves the lifecycle element from the view index that has the given path, then adds its refresh paths to the given lists.

      If the lifecycle element had a different path in one the phases, a call is made back to processElementPath(java.lang.String, java.util.List<java.lang.String>, java.util.List<java.lang.String>, java.util.List<java.lang.String>, java.util.Set<java.lang.String>) to process any new parents.

      Parameters:
      elementPath - path of the element to add paths for
      initializePaths - list of refresh paths for the intialize phase
      applyModelPaths - list of refresh paths for the apply model phase
      finalizePaths - list of refresh paths for the finalize phase
      visitedPaths - list of paths that have already been processed
    • addElementRefreshPath

      protected static void addElementRefreshPath(String path, String phase, List<String> initializePaths, List<String> applyModelPaths, List<String> finalizePaths)
      Adds the given path to the refresh path list for the given phase.
      Parameters:
      path - path to add
      phase - phase for the list the path should be added to
      initializePaths - list of refresh paths for the intialize phase
      applyModelPaths - list of refresh paths for the apply model phase
      finalizePaths - list of refresh paths for the finalize phase