Package com.ptc.core.components.forms
Class DefaultObjectFormProcessor
java.lang.Object
com.ptc.core.components.forms.DefaultObjectFormProcessor
- All Implemented Interfaces:
ObjectFormProcessor
- Direct Known Subclasses:
AlternatesSubstitutesFormProcessor,ChangeLinkAttributeProcessor,CheckinObjectFormProcessor,CheckoutObjectFormProcessor,CreateContextLinkFormProcessor,CreateNetworkLinkFormProcessor,CreateObjectFormProcessor,CreatePartConfigurationFormProcessor,DefaultEditFormProcessor,DispositionTaskFormProcessor,EditLicenseCountFormProcessor,EditModifyContentOnlyProcessor,EditReportDistributionFormProcessor,ModifyChangeActionStatusFormProcessor,NoRefreshFormProcessor,PurgeAuditLogFormProcessor,RelContextSendOwnerNotificationFormProcessor,RepopPartConfigurationFormProcessor,SaveAsPartConfigurationFormProcessor,SaveReportQueryFormProcessor,ScheduleReportFormProcessor,SendRelContextNotificationFormProcessor,SendToDistributionTargetFormProcessor,UDIBulkApprovalFormProcessor,UpdateContextLinkFormProcessor
Supported API: true
Extendable: true
-
Method Summary
Modifier and TypeMethodDescriptionprotected booleancontinueProcessing(FormResult result) Determines whether processing should abort or continue based on the contents of a FormResult object returned by a processing task.doOperation(NmCommandBean clientData, List<ObjectBean> objectBeans) Calls the doOperation() methods of the wizard's ObjectFormProcessorDelegates.Gets the value of the attribute: delegates.The message is:getSuccessFeedbackMessage(List<ObjectBean> objects) The message is:Gets called when there is a single object or no objects.Gets called when there is more than 1 object.The title for the inline success message for object creation such as "Create Successful"
Supported API: trueprotected FormResultmergeIntermediateResult(FormResult sourceResult, FormResult targetResult) Adds the messages, exceptions, javascript, nextAction, etc from a source FormResult to a target FormResult.postProcess(NmCommandBean clientData, List<ObjectBean> objectBeans) Calls the postProcess() method of the wizard's ObjectFormProcessorDelegates.postTransactionProcess(NmCommandBean clientData, List<ObjectBean> objectBeans) Calls the postTransactionProcess() methods of the wizard's ObjectFormProcessorDelegates Delegates are called in no particular order.preProcess(NmCommandBean clientData, List<ObjectBean> objectBeans) Calls the preProcess() methods of the wizard's ObjectFormProcessorDelegates.protected FormResultprocessDelegates(int phase, NmCommandBean clientData, List<ObjectBean> objectBeanList) Calls the preProcess(), doOperation(), postProcess(), or postTransactionProcess() method of the ObjectFormProcessorDelegates for this wizard according to the value given in the phase argument.setResultNextAction(FormResult result, NmCommandBean clientData, List<ObjectBean> objectBeans) Sets the "nextAction" attribute on the given FormResult based on the processing status.
-
Method Details
-
doOperation
public FormResult doOperation(NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException Calls the doOperation() methods of the wizard's ObjectFormProcessorDelegates. Delegates are called in no particular order.
Supported API: true- Specified by:
doOperationin interfaceObjectFormProcessor- Parameters:
clientData- - Contains all the request form data and other wizard context information. Input.objectBeans- - Contain the form data for each target object of the wizard. One bean per object. Input.- Returns:
- FormResult - the result of this method
- Throws:
WTException
-
postProcess
public FormResult postProcess(NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException Calls the postProcess() method of the wizard's ObjectFormProcessorDelegates. Delegates are called in no particular order.
Supported API: true- Specified by:
postProcessin interfaceObjectFormProcessor- Parameters:
clientData- - Contains all the request form data and other wizard context information. Input.objectBeans- - Contain the form data for each target object of the wizard. One bean per object. Input.- Returns:
- FormResult - the result of this method
- Throws:
WTException
-
postTransactionProcess
public FormResult postTransactionProcess(NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException Calls the postTransactionProcess() methods of the wizard's ObjectFormProcessorDelegates Delegates are called in no particular order.
Supported API: true- Specified by:
postTransactionProcessin interfaceObjectFormProcessor- Parameters:
clientData- - Contains all the request form data and other wizard context information. Input.objectBeans- - Contain the form data for each target object of the wizard. One bean per object. Input.- Returns:
- FormResult - the result of this method
- Throws:
WTException
-
preProcess
public FormResult preProcess(NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException Calls the preProcess() methods of the wizard's ObjectFormProcessorDelegates. Delegates are called in no particular order.
Supported API: true- Specified by:
preProcessin interfaceObjectFormProcessor- Parameters:
clientData- - Contains all the request form data and other wizard context information. Input.objectBeans- - Contain the form data for each target object of the wizard. One bean per object. Input.- Returns:
- FormResult - the result 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 setRefreshInfo() is called to set the information needed to dynamically refresh the parent page.
This method may be overridden by subclasses desiring different behavior.
Supported API: true- Specified by:
setResultNextActionin interfaceObjectFormProcessor- Parameters:
result- - The FormResult to which the action info should be added. Input and output. Required.clientData- - Contains all the form data and other wizard context information. Input. Required.objectBeans- - Contain the form data for each target object and, typically, instances of those objects. Input. Required.- Returns:
- FormResult - the nextAction attribute is set; the refreshInfo attribute may also be set
- Throws:
WTException
-
continueProcessing
Determines whether processing should abort or continue based on the contents of a FormResult object returned by a processing task.
The default behavior is to return false if the status in the given FormResult is FormProcessingStatus.FAILURE or true otherwise.
This method may be overridden if different behavior is desired.
Supported API: true- Parameters:
result- - Contains the status attribute set by a processing task. Input. Required.- Returns:
- boolean - true if processing should continue; false if it should be aborted.
-
mergeIntermediateResult
Adds the messages, exceptions, javascript, nextAction, etc from a source FormResult to a target FormResult. Typically, the source result represents the outcome of a form processing task or phase and the target result is a cumulative result for multiple tasks or phases.
The default behavior is to call the FormResult.mergeResults() method.
Supported API: true- Parameters:
sourceResult- - FormResult to merge fromtargetResult- - FormResult to merge to- Returns:
- FormResult - merged result
-
getDelegates
Gets the value of the attribute: delegates.
Supported API: true- Returns:
- List
-
processDelegates
protected FormResult processDelegates(int phase, NmCommandBean clientData, List<ObjectBean> objectBeanList) throws WTException Calls the preProcess(), doOperation(), postProcess(), or postTransactionProcess() method of the ObjectFormProcessorDelegates for this wizard according to the value given in the phase argument. The delegates are called in no particular order.
This method allows a subclass to call the delegates when the subclass is not able to call the super of one of the processing methods: preProcess(), doOperation(), postProcess(), postTransactionProcess().
Supported API: true- Parameters:
phase- - The process phase: PRE_PROCESS, DO_OPERATION, POST_PROCESS, or POST_TRANSACTION_PROCESS. Input. Required.clientData- - Contains all the form data and other wizard context information. Input. Required.objectBeans- - Contain the form data for each object. One bean per object. Input. Required.- Returns:
- FormResult - The outcome of this method.
- Throws:
WTException
-
getSuccessFeedbackMessage
The message is:
This method may be overridden by subclasses desiring different behavior.CONFIRMATION: Create successful The object was created successfully. <Object_Icon><Object_Type>Identity of Object if any.- To modify the first line (the title) override getSuccessMessageTitle().
- To modify just the second line of the message (the body), override the method getSuccessMessageBody() for single object creation OR for multi-object create override getSuccessMessageBodyForMulti().
- The icon/type/identity will be generated by the FeedbackMessage based on the objects given to it.
Supported API: true- Parameters:
objects-- Returns:
- FeedbackMessage with the identity of the object created that should be displayed if an object creation operation is successful.
- Throws:
WTException
-
getSuccessFeedbackMessage
The message is:
This method may be overridden by subclasses desiring different behavior.CONFIRMATION: Create successful The object was created successfully.- To modify the first line (the title) override getSuccessMessageTitle().
- To modify just the second line of the message (the body), override the method getSuccessMessageBody().
Supported API: true- Returns:
- FeedbackMessage that should be displayed if an object creation operation is successful.
- Throws:
WTException
-
getSuccessMessageTitle
The title for the inline success message for object creation such as "Create Successful"
Supported API: true -
getSuccessMessageBody
Gets called when there is a single object or no objects. Could return a message such as:
"The object was created successfully."
Supported API: true -
getSuccessMessageBodyForMulti
Gets called when there is more than 1 object. Could return a message such as:
"Object(s) created successfully"
Supported API: true
-