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

public class DefaultObjectFormProcessor extends Object implements ObjectFormProcessor


Supported API: true

Extendable: true
  • 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:
      doOperation in interface ObjectFormProcessor
      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:
      postProcess in interface ObjectFormProcessor
      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:
      postTransactionProcess in interface ObjectFormProcessor
      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:
      preProcess in interface ObjectFormProcessor
      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:
      setResultNextAction in interface ObjectFormProcessor
      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

      protected boolean continueProcessing(FormResult result)
      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

      protected FormResult mergeIntermediateResult(FormResult sourceResult, FormResult targetResult)
      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 from
      targetResult - - FormResult to merge to
      Returns:
      FormResult - merged result
    • getDelegates

      public List<ObjectFormProcessorDelegate> 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

      public FeedbackMessage getSuccessFeedbackMessage(List<ObjectBean> objects) throws WTException
      The message is:
       
       CONFIRMATION: Create successful
       The object was created successfully.
       <Object_Icon><Object_Type>Identity of Object if any.
       
       
      This method may be overridden by subclasses desiring different behavior.
      • 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

      public FeedbackMessage getSuccessFeedbackMessage() throws WTException
      The message is:
       
       CONFIRMATION: Create successful
       The object was created successfully.
       
       
      This method may be overridden by subclasses desiring different behavior.
      • 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

      public WTMessage getSuccessMessageTitle()
      The title for the inline success message for object creation such as "Create Successful"
      Supported API: true
    • getSuccessMessageBody

      public WTMessage 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

      public WTMessage getSuccessMessageBodyForMulti()
      Gets called when there is more than 1 object. Could return a message such as:
      "Object(s) created successfully"

      Supported API: true