Package wt.filter

Interface NavigationFilterDelegate2

All Known Implementing Classes:
wt.filter.AbstractNavigationFilterDelegate2, ASBPathFilterDelegate, AttributeStructFilterDelegate, DefaultServiceEffectivityDelegate, com.ptc.windchill.baseserver.filter.pathfilter.PathFilterDelegate

public interface NavigationFilterDelegate2
The interface defining a set of common operations that need to be implemented per filter type. Anywhere a filter needs to be handled in a filter-type-specific way this delegate will be retrieved to do the work. These operations are intended to be used exclusively by the Collector service and the Navigation Criteria and Filter Services.

Supported API: true

Extendable: false
  • Method Details

    • filter

      void filter(NavigationUnit navUnit, NavigationFilter2 navFilter, FilterCache filterCache, String stage) throws WTException
      Processes a navigation unit according to the criteria specified by the given navigation filter and marks nodes on the unit as filtered accordingly.

      Supported API: true
      Parameters:
      navUnit - A navigation unit to be filtered.
      navFilter - A navigation filter to be used for filtering the navigation unit.
      filterCache - A cache for data pertinent to multiple calls of the method.
      stage - A string indicating to the delegate the stage of the collecting.
      Throws:
      WTException
    • filter

      <T extends NavigationUnit> void filter(Collection<T> navUnits, NavigationFilter2 navFilter, FilterCache filterCache, String stage) throws WTException
      Processes a collections of navigation units according to the criteria specified by the given navigation filter and marks nodes on the units as filtered accordingly.

      Supported API: true
      Type Parameters:
      T - A type that implements NavigationUnit
      Parameters:
      navUnits - A collection of navigation units to be filtered.
      navFilter - A navigation filter to be used for filtering the navigation units.
      filterCache - A cache for data pertinent to multiple calls of the method.
      stage - A string indicating to the delegate the stage of the collecting.
      Throws:
      WTException
    • saveInDB

      NavigationFilter2 saveInDB(NavigationFilter2 navFilter) throws WTException
      Saves a navigation filter and any of its related persistent objects in the database. Since some filters have related persistent objects we need this method to correctly store the filter.

      Supported API: true
      Parameters:
      navFilter - - the NavigationFilter2 object to be saved in Database
      Returns:
      NavigationFilter2 saved in the database.
      Throws:
      WTException - when unable to save the API in Database
    • getJSONFromFilter

      String getJSONFromFilter(NavigationFilter2 navFilter) throws WTException
      Gets a JSON string representation of the navigation filter to be passed to the client because the client will not be holding onto the full object.

      Supported API: true
      Parameters:
      navFilter - - A NavigationFilter2 Object
      Returns:
      String - JSON string representation. The format of JSON:
        {
          "type": "wt.structfilter.rule.attribute.AttributeStructFilterDelegateType.PART",
          "Rules": [
             {
               "linkTypeIdentifier": "wt.part.WTPartUsageLink",
               "action_DISPLAY": "Include",
               "ruleOrder": 1,
               "action": "wt.structfilter.rule.StructFilterAction.INCLUDE",
               "objectTypeIdentifier": "WCTYPE|wt.part.WTPart",
               "Expressions": [
                  {
                    "comparison": "wt.structfilter.rule.attribute.AttributeStructFilterComparison.NOT_EQUAL",
                    "display": "display Name",
                    "expressionOrder": 0,
                    "attribute": "WCTYPE|wt.part.WTPart~MBA|masterReference^WCTYPE|wt.part.WTPartMaster~MBA|name",
                    "value": "attribute Value",
                    "attribute_DISPLAY": "attribute Name"
                  }
                ],
          "objectTypeIdentifier_DISPLAY": "Part"
              }
          ]
        }  
        
      Throws:
      WTException
    • getFilterFromJSON

      NavigationFilter2 getFilterFromJSON(String json) throws WTException
      Constructs a navigation filter from a JSON string representation.

      Supported API: true
      Parameters:
      json - - JSON string representation. JSON format is similar to the one shown in getJSONFromFilter method.
      Returns:
      NavigationFilter2
      Throws:
      WTException
    • getFilterFromJSON

      default NavigationFilter2 getFilterFromJSON(NavigationCriteria nc, String json) throws WTException
      Constructs a navigation filter from a JSON string representation. Some filters like VSEDFilter need access to NavigationCriteria to build the filter

      Supported API: true
      Parameters:
      nc - - NavigationCriteria Object
      json - - JSON string representation. JSON format is similar to the one shown in getJSONFromFilter method.
      Returns:
      NavigationFilter2
      Throws:
      WTException
    • updateFilterFromJSON

      NavigationFilter2 updateFilterFromJSON(NavigationFilter2 navFilter, String json) throws WTException
      Updates a navigation filter from a JSON string representation.

      Supported API: true
      Parameters:
      navFilter - - A NavigationFilter2 object which has to be updated
      json - - JSON string representation. JSON format is similar to the one shown in getJSONFromFilter method.
      Returns:
      NavigationFilter2
      Throws:
      WTException
    • updateFilterFromJSON

      default NavigationFilter2 updateFilterFromJSON(NavigationCriteria nc, NavigationFilter2 navFilter, String json) throws WTException
      Updates a navigation filter from a JSON string representation. Some filters like VSEDFilter need access to NavigationCriteria to build the filter

      Supported API: true
      Parameters:
      nc - - NavigationCriteria Object
      navFilter - - A NavigationFilter2 object which has to be updated
      json - - JSON string representation. JSON format is similar to the one shown in getJSONFromFilter method.
      Returns:
      NavigationFilter2
      Throws:
      WTException