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
Extendable: true
Supported API: true
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal voidevaluate(MassChangeFilterState mcFilterState) Evaluate mass change target objects to determine which are filtered out of the mass change operation.protected voidfilterAdminLock(MassChangeFilterState mcFilterState) Filter out mass change target objects with administrative locks.protected voidfilterAssociationType(MassChangeFilterState mcFilterState, TypeIdentifier linkType, TypeIdentifier roleBType) Filter out mass change target objects constrained against association with the specified object.protected voidfilterPermission(MassChangeFilterState mcFilterState) Filter out mass change target objects for which the current principal does not have modify permission.protected voidfilterType(MassChangeFilterState mcFilterState) Filter out mass change target objects based on type.protected WTKeyedMapgetAssociationLinkTypeMap(WTSet targets) Get map of mass change target objects to their association link types.protected NmCommandBeanGet the command bean for use in the filter delegate.protected FormResultreturn the formResult
Supported API: trueprotected abstract booleanisSupportedSourceType(Changeable2 sourceObject) This method returns true if the passed-in source object is a supported object for mass change operations.protected voidpostEvaluate(MassChangeFilterState mcFilterState) Default implementation.protected voidpostProcessOperation(MassChangeFilterState mcFilterState) Post-process the mass change operation for all non-excluded target objects.protected voidpreEvaluate(MassChangeFilterState mcFilterState) Filter out mass change target objects for the following conditions: Target object type is not supported. Target object is administratively locked. Current principal does not have modify permission for target object. Filtered objects will be marked as excluded.protected voidpreProcessOperation(MassChangeFilterState mcFilterState) Pre-process the mass change operation for all non-excluded target objects.final voidprocessOperation(MassChangeFilterState mcFilterState) Process the mass change operation for all non-excluded target objects.voidSet the command bean for use in the filter delegate.
-
Field Details
-
RESOURCE
Resource for mass change client.
Supported API: true- See Also:
-
-
Method Details
-
setCommandBean
Set the command bean for use in the filter delegate.
Supported API: true- Specified by:
setCommandBeanin interfaceMassChangeFilterDelegate- Parameters:
cb-
-
getCommandBean
Get the command bean for use in the filter delegate.
Supported API: true- Returns:
- commandBean
-
getFormResult
return the formResult
Supported API: true- Returns:
- FormResult
-
isSupportedSourceType
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
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:
evaluatein interfaceMassChangeFilterDelegate- Parameters:
mcFilterState- MassChangeFilterState object populated with mass change target objects.- Throws:
WTException
-
preEvaluate
Filter out mass change target objects for the following conditions:- Target object type is not supported.
- Target object is administratively locked.
- Current principal does not have modify permission for target object.
Overridden methods must have first line:super.preEvaluate(mcFilterState)- Parameters:
mcFilterState- MassChangeFilterState object populated with mass change target objects.- Throws:
WTException
-
postEvaluate
Default implementation.
Overridden methods must have last line:super.postEvaluate(mcFilterState)- Parameters:
mcFilterState- MassChangeFilterState object populated with mass change target objects.- Throws:
WTException
-
filterType
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]
- replacePartUsage
- addPartUsage
- removePartUsage
- changePartUsage
- addDocumentUsage
- removeDocumentUsage
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
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
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 methodgetAssociationLinkTypeMap(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
Get map of mass change target objects to their association link types. This method must be overridden by any extended class that callsfilterAssociationType(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
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:
processOperationin interfaceMassChangeFilterDelegate- Parameters:
mcFilterState- MassChangeFilterState object populated with mass change target objects.- Throws:
WTException
-
preProcessOperation
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
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
-