Class AbstractDefaultFilterDelegate

java.lang.Object
com.ptc.windchill.enterprise.massChange.filters.AbstractDefaultFilterDelegate
All Implemented Interfaces:
MassChangeFilterDelegate
Direct Known Subclasses:
AbstractWorkableFilterDelegate

public abstract class AbstractDefaultFilterDelegate extends Object implements MassChangeFilterDelegate
This class is responsible for implementing functionality common for processing the selected mass change operations. Handles the command bean and server excluded items.

Extendable: true

Supported API: true
See Also:
  • Field Details

    • RESOURCE

      protected static final String RESOURCE
      Resource for mass change client.

      Supported API: true
      See Also:
  • Method Details

    • setCommandBean

      public void setCommandBean(NmCommandBean cb)
      Set the command bean for use in the filter delegate.

      Supported API: true
      Specified by:
      setCommandBean in interface MassChangeFilterDelegate
      Parameters:
      cb -
    • getCommandBean

      protected NmCommandBean getCommandBean()
      Get the command bean for use in the filter delegate.

      Supported API: true
      Returns:
      commandBean
    • getFormResult

      protected FormResult getFormResult()
      return the formResult

      Supported API: true
      Returns:
      FormResult
    • isSupportedSourceType

      protected abstract boolean isSupportedSourceType(Changeable2 sourceObject)
      This method returns true if the passed-in source object is a supported object for mass change operations. The source object is the object picked to be updated or associated on all of the selected objects.

      Supported API: true
      Parameters:
      sourceObject -
      Returns:
      boolean - True if object is eligible for mass change
    • evaluate

      public final void evaluate(MassChangeFilterState mcFilterState) throws WTException
      Evaluate mass change target objects to determine which are filtered out of the mass change operation. Extending classes cannot override this method. This method is split into "pre" and "post" variations to provide better control of evaluation sequence. All preEvaluate() methods are completed before postEvaluate() methods begin.
      Specified by:
      evaluate in interface MassChangeFilterDelegate
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • preEvaluate

      protected void preEvaluate(MassChangeFilterState mcFilterState) throws WTException
      Filter out mass change target objects for the following conditions:
      1. Target object type is not supported.
      2. Target object is administratively locked.
      3. Current principal does not have modify permission for target object.
      Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.
      Overridden methods must have first line: super.preEvaluate(mcFilterState)
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • postEvaluate

      protected void postEvaluate(MassChangeFilterState mcFilterState) throws WTException
      Default implementation.
      Overridden methods must have last line: super.postEvaluate(mcFilterState)
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • filterType

      protected void filterType(MassChangeFilterState mcFilterState) throws WTException
      Filter out mass change target objects based on type. Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      The mass change operations are controlled by properties for supported and excluded types. Supported and excluded types for a specific mass change operation are registered in wt.properties. To specify the supported and excluded types for a mass change operation the following property naming convention should be followed:

      • massChange.{operationName}.supportedTypes=[list of supported types]
      • massChange.{operationName}.excludedTypes=[list of excluded types]
      To include or exclude an object type the external form of the type is used. For example, the external form for a part type is WCTYPE|wt.part.WTPart. If no supported types are specified for a mass change operation than all types are supported. The standard operation names are:

      • replacePartUsage
      • addPartUsage
      • removePartUsage
      • changePartUsage
      • addDocumentUsage
      • removeDocumentUsage
      Example, to support adding usage all types of parts except CustomPart1 and CustomPart2:
      massChange.addPartUsage.supportedTypes=WCTYPE|wt.part.WTPart
      massChange.addPartUsage.excludedTypes=WCTYPE|wt.part.WTPart|CustomPart1,WCTYPE|wt.part.WTPart|CustomPart2


      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • filterAdminLock

      protected void filterAdminLock(MassChangeFilterState mcFilterState) throws WTException
      Filter out mass change target objects with administrative locks. Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • filterPermission

      protected void filterPermission(MassChangeFilterState mcFilterState) throws WTException
      Filter out mass change target objects for which the current principal does not have modify permission. Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • filterAssociationType

      protected void filterAssociationType(MassChangeFilterState mcFilterState, TypeIdentifier linkType, TypeIdentifier roleBType) throws WTException
      Filter out mass change target objects constrained against association with the specified object. Filtered objects will be marked as excluded. Objects already excluded will not be evaluated.

      Supported API: true
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      linkType - Type of association link for all targets. If null then override-able method getAssociationLinkTypeMap(WTSet) is called to get a map of targets to their link types.
      roleBType - Type of role object (i.e., the targets are assumed to be role A objects).
      Throws:
      WTException
    • getAssociationLinkTypeMap

      protected WTKeyedMap getAssociationLinkTypeMap(WTSet targets) throws WTException
      Get map of mass change target objects to their association link types. This method must be overridden by any extended class that calls filterAssociationType(MassChangeFilterState,TypeIdentifier,TypeIdentifier) and passes null for the link type.

      Supported API: true
      Parameters:
      targets - Set of mass change target objects.
      Returns:
      Map of target object to its link TypeIdentifier object.
      Throws:
      WTException
    • processOperation

      public final void processOperation(MassChangeFilterState mcFilterState) throws WTException
      Process the mass change operation for all non-excluded target objects. Extending classes cannot override this method. This method is split into "pre" and "post" variations to provide better control of operation sequence. All preProcessOperation() methods are completed before postProcessOperation() methods begin.
      Specified by:
      processOperation in interface MassChangeFilterDelegate
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • preProcessOperation

      protected void preProcessOperation(MassChangeFilterState mcFilterState) throws WTException
      Pre-process the mass change operation for all non-excluded target objects.
      Overridden methods must have first line: super.preProcessOperation(mcFilterState)
      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException
    • postProcessOperation

      protected void postProcessOperation(MassChangeFilterState mcFilterState) throws WTException
      Post-process the mass change operation for all non-excluded target objects.
      Overridden methods must have last line: super.postProcessOperation(mcFilterState)

      Publish the mass changes to CAD.

      Parameters:
      mcFilterState - MassChangeFilterState object populated with mass change target objects.
      Throws:
      WTException