com.ptc.windchill.enterprise.change2.forms.processors
Class EditChangeItemFormProcessor

java.lang.Object
  extended by com.ptc.core.components.forms.DefaultObjectFormProcessor
      extended by com.ptc.core.components.forms.EditObjectFormProcessor
          extended by com.ptc.windchill.enterprise.change2.forms.processors.EditChangeItemFormProcessor
All Implemented Interfaces:
ObjectFormProcessor
Direct Known Subclasses:
EditChangeNoticeFormProcessor, EditChangeRequestFormProcessor, EditChangeTaskFormProcessor, EditProblemReportFormProcessor, EditVarianceFormProcessor

public abstract class EditChangeItemFormProcessor
extends com.ptc.core.components.forms.EditObjectFormProcessor

A class for handling general change management edit wizard processing. This class implements the preProcess, doOperation, postProcess methods in order to process a transaction for different change object wizards such as Problem Reports, Variances, Change Requests, Change Notices, and Change Tasks.

Supported API: true

Extendable: true


Method Summary
 FormResult doOperation(NmCommandBean clientData, List<ObjectBean> objectBeanList)
          Saves the change object that was initialized in the preProcess() method which stored in each ObjectBean that is in the passed in object bean list.
protected abstract  LocalizableMessage getProcessorErrorMessage()
          Required when extending EditChangeItemFormProcessor.
 FormResult postProcess(NmCommandBean clientData, List<ObjectBean> objectBeanList)
          Post Process using the wizard form data per ObjectBean in the object bean list checks to see if the if the user chose to submit now.
 FormResult preProcess(NmCommandBean clientData, List<ObjectBean> objectBeanList)
          Gets and initailizes the change object from the wizard form data.
protected abstract  WTList saveChangeItem(WTList changeItems)
          Required when extending EditChangeItemFormProcessor.
 FormResult setResultNextAction(FormResult result, NmCommandBean clientData, List<ObjectBean> objectBeans)
          If the Check In button was clicked and processing was successful, returns javascript to open a check in dialog window.
 
Methods inherited from class com.ptc.core.components.forms.DefaultObjectFormProcessor
continueProcessing, getDelegates, mergeIntermediateResult, postTransactionProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

preProcess

public FormResult preProcess(NmCommandBean clientData,
                             List<ObjectBean> objectBeanList)
                      throws WTException
Gets and initailizes the change object from the wizard form data. This method invokes super to initialize the change objects inside each of the object beans in the ObjectBean list. This method then checks to see if the name field for the change object has been modified and stores the value in a renameNameList.

Supported API: true

Specified by:
preProcess in interface ObjectFormProcessor
Overrides:
preProcess in class com.ptc.core.components.forms.EditObjectFormProcessor
Parameters:
clientData - The original wizard form data. This in general should not be used to get wizard form data. The wizard form data should be retrieved from each ObjectBean in the ObjectBean list that is passed in.
objectBeans - The List of object beans that have been initialized with the appropriate wizard from data for each individual ObjectBean.
Returns:
A form result that indicates if the operation was succesful or not.
Throws:
WTException - is thrown if initailizing the change object fails
See Also:
EditObjectFormProcessor#preProcess(NmCommandBean, List)}

doOperation

public FormResult doOperation(NmCommandBean clientData,
                              List<ObjectBean> objectBeanList)
                       throws WTException
Saves the change object that was initialized in the preProcess() method which stored in each ObjectBean that is in the passed in object bean list.

Supported API: true

Specified by:
doOperation in interface ObjectFormProcessor
Overrides:
doOperation in class com.ptc.core.components.forms.EditObjectFormProcessor
Parameters:
clientData - The original wizard form data. This in general should not be used to get wizard form data. The wizard form data should be retrieved from each ObjectBean in the ObjectBean list that is passed in.
objectBeans - The List of object beans that have the appropriate wizard from data for each individual ObjectBean and the initialized object for each ObjectBean from the previous call to the preProcess method.
Returns:
A form result that indicates if the operation was succesful or not.
Throws:
WTException
See Also:
EditObjectFormProcessor#doOperation(NmCommandBean, List)}

postProcess

public FormResult postProcess(NmCommandBean clientData,
                              List<ObjectBean> objectBeanList)
                       throws WTException
Post Process using the wizard form data per ObjectBean in the object bean list checks to see if the if the user chose to submit now.

Supported API: true

Specified by:
postProcess in interface ObjectFormProcessor
Overrides:
postProcess in class com.ptc.core.components.forms.DefaultObjectFormProcessor
Parameters:
clientData - The original wizard form data. This in general should not be used to get wizard form data. The wizard form data should be retrieved from each ObjectBean in the ObjectBean list that is passed in.
objectBeans - The List of object beans that have been saved with the appropriate wizard from data for each individual ObjectBean.
Returns:
A form result that indicates if the operation was succesful or not.
Throws:
WTException

setResultNextAction

public FormResult setResultNextAction(FormResult result,
                                      NmCommandBean clientData,
                                      List<ObjectBean> objectBeans)
                               throws WTException
If the Check In button was clicked and processing was successful, returns javascript to open a check in dialog window. If the Save button was clicked and processing was successful, returns javascript to close the wizard and refresh the launching window. If processing failed, sets next action to NONE.

Supported API: true

Specified by:
setResultNextAction in interface ObjectFormProcessor
Overrides:
setResultNextAction in class com.ptc.core.components.forms.EditObjectFormProcessor
Parameters:
clientData - The original wizard form data. This in general should not be used to get wizard form data. The wizard form data should be retrieved from each ObjectBean in the ObjectBean list that is passed in.
objectBeans - The current List of object beans.
result - - The FormResult to which the action info should be added. Input and output. Required.
Returns:
A form result that indicates if the operation was succesful or not.
Throws:
WTException

getProcessorErrorMessage

protected abstract LocalizableMessage getProcessorErrorMessage()
Required when extending EditChangeItemFormProcessor. The purpose of this method is to handle error messaging that is unique to the change object type.
An example implementaton would look like the following:
private static final String RESOURCE = "com.ptc.windchill.enterprise.change2.change2ClientResource"; private static final LocalizableMessage ECN_ERROR_MSG = new WTMessage(RESOURCE, change2ClientResource.EDITCHANGENOTICE_PROCESSING_ERROR, null);


saveChangeItem

protected abstract WTList saveChangeItem(WTList changeItems)
                                  throws WTException
Required when extending EditChangeItemFormProcessor. The purpose of this method is to handle persistance for the different types change objects. All change objects in the list that is passed in are of the same type. The order of the list needs to be maintained and return in the same order as a list of persisted change objects.

Supported API: true

Parameters:
changeItems - The list of change objects to be persisted.
Returns:
The list of change objects that have been persisted.
Throws:
WTException - is thrown if saving the change object fails.