Class CreateObjectFormProcessor

java.lang.Object
com.ptc.core.components.forms.DefaultObjectFormProcessor
com.ptc.core.components.forms.CreateObjectFormProcessor
All Implemented Interfaces:
ObjectFormProcessor
Direct Known Subclasses:
CEActivityFormProcessor, CreateAuditFormProcessor, CreateAuditTemplateFormProcessor, CreateCapaChangeInvestigationFormProcessor, CreateCEDecontaminationFormProcessor, CreateCEProductInvestigationFormProcessor, CreateCEReviewFormProcessor, CreateChangeDirectiveFormProcessor, CreateChangeItemFormProcessor, CreateCustomerExperienceEvaluationFormProcessor, CreateDispositionPlanFormProcessor, CreateDistributionTargetFormProcessor, CreateNCReviewFormProcessor, CreatePartFormProcessor, CreatePartFromWorkspaceFormProcessor, CreatePromotionRequestFormProcessor, CreateQMSContactFormProcessor, CreateRRDSubmissionFormProcessor, CreateUDIPackagingFormProcessor, CreateUDISubmissionFormProcessor, CreateUDISubmissionTemplateFormProcessor

public class CreateObjectFormProcessor extends DefaultObjectFormProcessor
A form processor that generically creates one or more Persistables from the form data submitted in an HTML wizard and stores them in the database.

Supported API: true

Extendable: true
  • Method Details

    • doOperation

      public FormResult doOperation(NmCommandBean clientData, List<ObjectBean> objectBeans) throws WTException
      Stores the object(s) contained in the "object" attribute(s) of the given ObjectBeans 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 DefaultObjectFormProcessor
      Parameters:
      clientData - - Contains all of the request form data and other wizard context information. Input.
      objectBeans - - The "object" attribute of these beans contain the object instances to be stored. 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
      Creates one object instance for each given ObjectBean and sets their attributes. After creating the instance calls the preProcess() method of all ObjectFormProcessorDelegates for the wizard, in no particular order. This method is called by the DefaultFormProcessorController and is the first wizard processing phase.

      For wizards that have Define Object and Set Attributes steps, this method is also called after the user completes each of these steps 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 DefaultObjectFormProcessor
      Parameters:
      clientData - Contains request form data and other context information. Input. Required.
      objectBeans - Contain the form data for each object to be created. 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 - the result of this operation.
      Throws:
      WTException
    • createItemInstance

      protected Object createItemInstance(NmCommandBean clientData, ObjectBean objBean, FormResult result) throws WTException
      Creates an instance of the object represented by the form data in the given ObjectBean and validates the attribute values submitted for it. Returns the object instance and sets it as the "object" attribute in the ObjectBean.

      Supported API: true
      Parameters:
      clientData - Contains form data and other context information. Input.
      objBean - - Contains the form data for one object to be created. On exit, the "object" attribute of the bean will be set to the created object instance. Input and output.
      result - The return status of the method. Output, but must be instantiated on entry.
      Returns:
      Object - the object instance created
      Throws:
      WTException
    • getSuccessMessageTitle

      public WTMessage getSuccessMessageTitle()
      Returns the body (firstline) of the message that should be displayed if the create operation is successful. The body is:

      Supported API: true
      Overrides:
      getSuccessMessageTitle in class DefaultObjectFormProcessor
    • getSuccessMessageBody

      public WTMessage getSuccessMessageBody()
      Returns the body (second line) of the message that should be displayed if the create operation is successful. The body is:

          The object was created successfully.

      This method may be overridden by subclasses desiring a different message.

      Supported API: true
      Overrides:
      getSuccessMessageBody in class DefaultObjectFormProcessor
    • getSuccessMessageBodyForMulti

      public WTMessage getSuccessMessageBodyForMulti()
      Returns the title (first line) of the message that should be displayed if the create operation is successful for multiple objects. The body is:

          Following Objects created successfully:

      This method may be overridden by subclasses desiring a different message.

      Supported API: true
      Overrides:
      getSuccessMessageBodyForMulti in class DefaultObjectFormProcessor