com.ptc.core.components.forms
Class DefaultEditFormProcessor

java.lang.Object
  extended by com.ptc.core.components.forms.DefaultObjectFormProcessor
      extended by com.ptc.core.components.forms.DefaultEditFormProcessor
All Implemented Interfaces:
ObjectFormProcessor
Direct Known Subclasses:
EditWorkableFormProcessor

public class DefaultEditFormProcessor
extends com.ptc.core.components.forms.DefaultObjectFormProcessor

A form processor that generically updates one or more Persistables in the database from the form data submitted in an HTML wizard.

This class should only be used for updating nonWorkable objects. Use EditWorkableFormProcessor for Workable objects.

Supported API: true

Extendable: true


Method Summary
 FormResult doOperation(NmCommandBean clientData, List<ObjectBean> objectBeans)
          Updates the objects contained in the "object" attributes of the given ObjectBean(s) in the database.
 FormResult preProcess(NmCommandBean clientData, List<ObjectBean> objectBeans)
          Retrieves the objects being edited from the database and updates or sets their attributes from the form data.
 FormResult setResultNextAction(FormResult result, NmCommandBean clientData, List<ObjectBean> objectBeans)
          Sets the "nextAction" attribute on the given FormResult based on the processing status.
 
Methods inherited from class com.ptc.core.components.forms.DefaultObjectFormProcessor
continueProcessing, getDelegates, mergeIntermediateResult, postProcess, postTransactionProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

doOperation

public FormResult doOperation(NmCommandBean clientData,
                              List<ObjectBean> objectBeans)
                       throws WTException
Updates the objects contained in the "object" attributes of the given ObjectBean(s) in the database. On entry, the attributes of these object instances will reflect the values entered in the wizard form.

This method is called by the DefaultFormProcessorController after it calls the preProcess() method.

Before storing the object(s), this method calls the doOperation() method of all ObjectFormProcessorDelegates for the wizard. These are called in no particular order.

Supported API: true

Specified by:
doOperation in interface ObjectFormProcessor
Overrides:
doOperation in class com.ptc.core.components.forms.DefaultObjectFormProcessor
Parameters:
clientData - - Contains all the request form data and other wizard context information. Input. Required.
objectBeans - The "object" attribute of these beans contain the object instances to be updated. One bean per object. Input. Required.
Returns:
FormResult - the result of this method
Throws:
WTException

preProcess

public FormResult preProcess(NmCommandBean clientData,
                             List<ObjectBean> objectBeans)
                      throws WTException
Retrieves the objects being edited from the database and updates or sets their attributes from the form data. On exit, instances of the edited objects updated with the form values will be loaded into the "object" attribute of the given ObjectBean(s).

After updating the ObjectBeans, calls the preProcess() method of all ObjectFormProcessorDelegates for the wizard.

This method is called by the DefaultFormProcessorController and is the first wizard processing phase.

For wizards that have a Set Attributes step, this method is also called after the user completes that step to validate the user-entered attribute values. Therefore, this method should not perform any tasks that modify the database.

Supported API: true

Specified by:
preProcess in interface ObjectFormProcessor
Overrides:
preProcess in class com.ptc.core.components.forms.DefaultObjectFormProcessor
Parameters:
clientData - - Contains all the request form data and other wizard context information. Input. Required.
objectBeans - - On input, contain the form data for each object being edited. One bean per object. On exit, the "object" attribute of each ObjectBean is set to the object instance created from the form data. Input and output. Required.
Returns:
- FormResult indicating the outcome of this method
Throws:
WTException

setResultNextAction

public FormResult setResultNextAction(FormResult result,
                                      NmCommandBean clientData,
                                      List<ObjectBean> objectBeans)
                               throws WTException
Sets the "nextAction" attribute on the given FormResult based on the processing status.

If the status is SUCCESS or NON_FATAL_ERROR, the nextAction is set to REFRESH_OPENER. and information needed to dynamically refresh the parent window is returned in the FormResult also.

If the status is FAILURE, the nextAction is set to NONE.

This method may be overridden by subclasses desiring different behavior.

Supported API: true

Specified by:
setResultNextAction in interface ObjectFormProcessor
Overrides:
setResultNextAction in class com.ptc.core.components.forms.DefaultObjectFormProcessor
Parameters:
result - - The form result to update with the next action. Input and output. Required.
clientData - - Contains request form data and other wizard context information. Input. Required.
objectBeans - - Contain the objects that were updated (if success). Input. Required.
Returns:
FormResult - that has been updated with the next action
Throws:
WTException