com.ptc.windchill.enterprise.change2.forms.populators
Class ChangeRequestAttributePopulator

java.lang.Object
  extended by com.ptc.core.components.forms.DefaultAttributePopulator
      extended by com.ptc.windchill.enterprise.change2.forms.populators.ChangeRequestAttributePopulator
All Implemented Interfaces:
com.ptc.core.components.forms.AttributePopulator, Externalizable, Serializable

public class ChangeRequestAttributePopulator
extends com.ptc.core.components.forms.DefaultAttributePopulator
implements Serializable

Populator class used for populating a change request from a problem report or variance. If ths propagation component is not enabled this class will not have any effect.

Supported API: true

Extendable: true

See Also:
Serialized Form

Method Summary
 void clearAttribute(ChangeIssue issue, String key, TypeInstance ti, AttributeIdentifier ai)
          Method responsible for processing the specified attribute against the current variance and problem report and clearing the attribute value in the TypeInstance.
 List<String> getAttributeList()
          Retrieve the list of attributes which are to be processed.
 boolean isTypeOverridable()
          Specify the type is overridable.
 TypeInstance prePopulateAttributeDisplayValues(TypeInstance ti, NmCommandBean cb)
          Prepopulate the TypeInstance of the Change Request based on the launching variance or problem report.
 void processAttribute(ChangeIssue issue, String key, TypeInstance ti, AttributeIdentifier ai)
          Method responsible for processing the specified attribute against the current variance and problem report and storing this attribute value in the TypeInstance.
protected  void setAttribute(TypeInstance ti, AttributeIdentifier ai, Object value)
          Set the value specified against the attribute identifier in the TypeInstance.
 void setAttributeList(List<String> atts)
          Set the attribute list to process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAttributeList

public List<String> getAttributeList()
Retrieve the list of attributes which are to be processed.

Supported API: true

Returns:
List The list of attributes which require processing.

setAttributeList

public void setAttributeList(List<String> atts)
Set the attribute list to process.

Supported API: true

Parameters:
atts - The attribute list to process

isTypeOverridable

public boolean isTypeOverridable()
Specify the type is overridable.

Supported API: true

Overrides:
isTypeOverridable in class com.ptc.core.components.forms.DefaultAttributePopulator

prePopulateAttributeDisplayValues

public TypeInstance prePopulateAttributeDisplayValues(TypeInstance ti,
                                                      NmCommandBean cb)
Prepopulate the TypeInstance of the Change Request based on the launching variance or problem report. If the launching point object is not a variance or problem report, this method will return the unmodified TypeInstance. If the launch point object is of a correct type, this code will only modify the TypeInstance if the Propagation Component is enabled (through preferences)
If additional fields are desired, the getAttributeList() and processAttribute() methods should be overloaded and provided with the additional implementation.

Supported API: true

Overrides:
prePopulateAttributeDisplayValues in class com.ptc.core.components.forms.DefaultAttributePopulator
Parameters:
ti - The type instance returned prior to creating attributes step.
cb - The current command bean.
Returns:
the modified type instance if the conditions above are satisfied.

processAttribute

public void processAttribute(ChangeIssue issue,
                             String key,
                             TypeInstance ti,
                             AttributeIdentifier ai)
                      throws WTException
Method responsible for processing the specified attribute against the current variance and problem report and storing this attribute value in the TypeInstance. Overriding this method in a subclass can override the attributes which are propagated. Currently the following attributes are handled: The method setAttribute(TypeInstance,AttributeIdentifier,Object) is used to store the attribute in the type instance only if the current state of the attribute is State.UNITIALIZED or State.DEFAULT

Supported API: true

Parameters:
issue - The change issue used to obtain the values
key - The attribute value.
ti - The TypeInstance to store the value in.
ai - The attribute identifer representing the attribute defined by the key
Throws:
WTException

clearAttribute

public void clearAttribute(ChangeIssue issue,
                           String key,
                           TypeInstance ti,
                           AttributeIdentifier ai)
                    throws WTException
Method responsible for processing the specified attribute against the current variance and problem report and clearing the attribute value in the TypeInstance. Overriding this method in a subclass can override the attributes which are cleared which propagation is unselected. Currently the following attributes are handled: The method setAttribute(TypeInstance,AttributeIdentifier,Object) is used to store the attribute in the type instance only if the current state of the attribute is State.UNITIALIZED or State.DEFAULT

Supported API: true

Parameters:
issue - The change issue used to obtain the values
key - The attribute value.
ti - The TypeInstance to store the value in.
ai - The attribute identifer representing the attribute defined by the key
Throws:
WTException

setAttribute

protected void setAttribute(TypeInstance ti,
                            AttributeIdentifier ai,
                            Object value)
                     throws WTException
Set the value specified against the attribute identifier in the TypeInstance. The value will only be set if the state of the attribute in the TypeInstance is set to State.UNINITIALIZED or State.DEFAULT. Upon setting the value in the TypeInstance, the state of the attribute will be set to State.DEFAULT.

Supported API: true

Parameters:
ti - The type instance.
ai - The attribute to set in the type instance
value - The value to set to attribute in the type instance to.
Throws:
WTException