Class AbstractTreeNavigatorImpl

java.lang.Object
com.ptc.windchill.esi.treenavigation.AbstractTreeNavigatorImpl
All Implemented Interfaces:
TreeNavigator
Direct Known Subclasses:
TreeNavigatorImpl

public abstract class AbstractTreeNavigatorImpl extends Object implements TreeNavigator
Performs the structure navigation and populates all the necessary collections which are to be used by ESI renderers.

Supported API: true

Extendable: true
  • Method Details

    • getRoot

      public Persistable getRoot()
      Gets the value of the attribute: root; The top-level object in the structure.

      Supported API: true
      Returns:
      Persistable
    • getNavigationCriteria

      public NavigationCriteria getNavigationCriteria()
      Gets the value of the attribute: navCriteria - the navigation criteria used for navigating the structure

      Supported API: true
      Returns:
      NavigationCriteria
    • getDepth

      public int getDepth()
      Gets the value of the attribute: depth - the number of levels to navigate.

      Supported API: true
      Returns:
      int
    • getAssemblyNodes

      public Collection<Persistable> getAssemblyNodes()
      Gets the value of the attribute: assemblyNodes - a collection of Persistable objects for all the non-leaf nodes in the tree that is traversed by this navigator.

      Supported API: true
      Specified by:
      getAssemblyNodes in interface TreeNavigator
      Returns:
      - The collection persistable object which are assembly nodes.
    • getLeafNodes

      public Collection<Persistable> getLeafNodes()
      Gets the value of the attribute: leafNodes - a collection of Persistable objects for all the leaf-nodes in the tree that is traversed by this navigator.

      Supported API: true
      Specified by:
      getLeafNodes in interface TreeNavigator
      Returns:
      - The collection persistable for all the leaf-nodes.
    • setData

      public void setData(Persistable root, int depth, NavigationCriteria navCriteria, Map<String,Object> navigationOptions) throws WTException
      Sets the data needed by this navigator for traversing the relevant tree or structure. Throws a WTException if:
      • the root argument is null
      • the depth argument is < 1
      • the navCriteria argument is null


      Supported API: true
      Specified by:
      setData in interface TreeNavigator
      Parameters:
      root - - The root object for the top-level structure
      depth - - The number of levels of the structure to navigate
      navCriteria - - The NavigationCriteria value to use when navigating the structure
      navigationOptions - Map containing options or settings that governs navigation of an structure.
      Example: Navigate reference to be fetched.
      Throws:
      WTException
    • processTree

      protected void processTree() throws WTException
      Calls validate() to insure that all attributes are in the correct state. Calls the API fetchStructure() which in turn invokes the collector service APIs to fetch the structure for the root part.

      Supported API: true
      Throws:
      WTException
    • validate

      protected void validate() throws WTException
      Ensures that all attributes needed to traverse a structure are in the correct state. Throws a WTException if:
      • the root attribute is null
      • the depth attribute is < 0
      • the navCriteria attribute is null


      Supported API: true
      Throws:
      WTException
    • fetchStructure

      protected void fetchStructure() throws WTException
      Does the following:


      Supported API: true
      Throws:
      WTException
    • filterNodes

      protected abstract void filterNodes(Collection<Persistable> assemblyNodes, Collection<Persistable> leafNodes) throws WTException
      Allows subclasses to fix the contents of assembly nodes and leaf nodes collections before those are returned to the renderer.

      Supported API: true
      Parameters:
      assemblyNodes - - Collection of assembly nodes.
      leafNodes - - Collection of leaf nodes.
      Throws:
      WTException