Class UIValidationCriteria

java.lang.Object
com.ptc.core.ui.validation.UIValidationCriteria
All Implemented Interfaces:
FormDataHolder, Serializable

public class UIValidationCriteria extends Object implements FormDataHolder, Serializable
UIValidationCriteria objects serve as wrappers for data to be passed to the APIs on the UIComponentValidationService. A client of the UIComponentValidationService would instantiate a UIValidationCriteria object, and populate as many attributes in that object as it is aware of. The validators called by the UIComponentValidationService will use the attributes specified in a UIValidationCriteria object to perform validation operations. Implementations of the UIComponentValidator Interface should make it clear which attributes of a UIValidationCriteria they are expecting to have populated. That way, if a caller of the validation service knows which validator(s) will be performing their validation, they can populate the UIValidationCriteria appropriately. In many cases, the Validation service will call a series of Validators. If one Validator has to calculate one or more attributes of the UIValidationCriteria, and that attribute may be useful for other Validators, the initial Validator may add/update the values of the UIValidationCriteria, and those updated values will be available to subsequent Validators. In the unlikely case that a Validator wants to ensure that the data they get has not been provided by another Validator, they can call the getClientCriteria method to get the original, unchanged, UIValidationCriteria specified by a client.

Supported API: true

Extendable: false
See Also:
  • Method Details

    • newInstance

      public static UIValidationCriteria newInstance()
      Creates a new (empty) instance of a UIValidationCriteria object
      Returns:
      an empty UIValidationCriteria object

      Supported API: true
    • newInstance

      public static UIValidationCriteria newInstance(NmCommandBean commandBean)
      Creates a new instance of A UIValidationCriteria object whose properties are initialized by the NmCommandBean argument *

      Supported API: true
      Parameters:
      commandBean - an NmCommandBean used to initialize the UIValidationCriteria's properties
      Returns:
      a UIValidationCriteria object, intialized using the commandBean argument
    • addNmCommandBean

      public void addNmCommandBean(NmCommandBean commandBean)
      This is a helper method that allows a caller of the validation service to add all of the content of the NmCommandBean to the UIValidationCriteria. There is no getter for the NmCommandBean, since we do not want the Validators to have dependencies on the Netmarkets infrastructure. Validators should access the content of the NmCommandBean via the getters for the individual fields defined in the UIValidationCriteria.

      Supported API: true
      Parameters:
      commandBean -
    • getAccessPermissionSet

      public wt.access.AccessPermissionSet getAccessPermissionSet(AccessControlled acObj) throws WTException
      Returns cached access control permissions for a given persistable if already cached, or retrieves the AccessPermissionSet for the object and caches it. *

      Supported API: true
      Parameters:
      acObj -
      Returns:
      AccessPermissionSet
      Throws:
      WTException
    • getAddedItemsByName

      public List getAddedItemsByName(String param_name)


      Supported API: true
      Specified by:
      getAddedItemsByName in interface FormDataHolder
      Parameters:
      param_name -
      Returns:
      List
    • getChangedComboBox

      public Map<String,List<String>> getChangedComboBox()
      Gets the comboboxes that have changed. Name -> new value

      Supported API: true
      Specified by:
      getChangedComboBox in interface FormDataHolder
      Returns:
      Map
    • getChangedRadio

      public Map<String,String> getChangedRadio()
      Returns a Map of any radio buttons that have changed. Radio buttons needed to have been rendered by gui-comopnents.

      Supported API: true
      Specified by:
      getChangedRadio in interface FormDataHolder
      Returns:
      Map
    • getChangedText

      public Map<String,String> getChangedText()
      Gets the textboxes that have changed. Name -> new value

      Supported API: true
      Specified by:
      getChangedText in interface FormDataHolder
      Returns:
      Map
    • getChangedTextArea

      public Map<String,String> getChangedTextArea()
      Gets the TextAreas that have changed. Name -> new value

      Supported API: true
      Specified by:
      getChangedTextArea in interface FormDataHolder
      Returns:
      Map
    • getChecked

      public Map<String,List<String>> getChecked()
      Gets the value of the attribute: checked; The CheckBoxes that are checked on this posted request object

      Supported API: true
      Specified by:
      getChecked in interface FormDataHolder
      Returns:
      Map
    • getClientType

      public com.ptc.core.ui.resources.ClientType getClientType()
      Gets the value of the attribute: clientType.

      Supported API: true
      Returns:
      ClientType
    • getClipped

      public List getClipped()


      Supported API: true
      Returns:
      List
    • getComboBox

      public Map<String,List<String>> getComboBox()
      Gets the value of the attribute: comboBox; The ComboBoxes that are posted on this request object

      Supported API: true
      Specified by:
      getComboBox in interface FormDataHolder
      Returns:
      Map
    • getCompContext

      public String getCompContext()
      Gets the value of the attribute: compContext.

      Supported API: true
      Returns:
      String
    • getComponentMode

      public ComponentMode getComponentMode()
      Gets the value of the attribute: componentMode.

      Supported API: true
      Returns:
      ComponentMode
    • getComponentType

      public ComponentType getComponentType()
      Gets the value of the attribute: componentType.

      Supported API: true
      Returns:
      ComponentType
    • getComponentContext

      public ComponentContext getComponentContext()
      Gets the value of the attribute: componentContext.

      Supported API: true
      Returns:
      ComponentType
    • getContextObject

      public WTReference getContextObject()
      Gets the value of the attribute: contextObject; The contextObject WTReference can be used to indcate which object should be used to perfrom validation. contextObject should be used in cases where validation is always being performed against a single object. If the requested validation could be performed against multiple objects, the targetObjects attribute should be used instead.

      Supported API: true
      Returns:
      WTReference
    • getContextObject_nonPersistable

      public Object getContextObject_nonPersistable()
      Gets the value of the attribute: contextObject_nonPersistable; The contextObject WTReference can be used to indcate which object should be used to perfrom validation. contextObject should be used in cases where validation is always being performed against a single object. If the requested validation could be performed against multiple objects, the targetObjects attribute should be used instead.

      Supported API: true
      Returns:
      Object
    • getFormData

      public Map<String,Object> getFormData()
      Gets the value of the attribute: formData; The formData attribute can be used to pass a Map of form data (e.g., from a form being submitted) to the validation service.

      Supported API: true
      Returns:
      Map
    • getInitialItemsByName

      public List<NmOid> getInitialItemsByName(String param_name)
      Returns the list of initial NmOids for objects which are associated to the component with the name param_name.


      Supported API: true
      Specified by:
      getInitialItemsByName in interface FormDataHolder
      Parameters:
      param_name - The name of the component with the initial items (for example: table ID)
      Returns:
      a list of initial oids that are from the component.

      Supported API: true
    • getInWorkspace

      public Boolean getInWorkspace()
      Gets the value of the attribute: inWorkspace; The inWorkspace attribute can be used to specify whether or not the validation is being performed for an action or component in a Windchill workspace.

      Supported API: true
      Returns:
      Boolean
    • getNewChecked

      public Map<String,List<String>> getNewChecked() throws WTException


      Supported API: true
      Specified by:
      getNewChecked in interface FormDataHolder
      Returns:
      Map<String,List>
      Throws:
      WTException
    • getParameterMap

      public HashMap<String,Object> getParameterMap()


      Supported API: true
      Specified by:
      getParameterMap in interface FormDataHolder
      Returns:
      HashMap<String,Object>
    • getParentContainer

      public WTContainerRef getParentContainer()
      Gets the value of the attribute: parentContainer; The parentContainer attribute can be used to indcate which container should be used to perfrom validation.

      Supported API: true
      Returns:
      WTContainerRef
    • getParentOrg

      public WTPrincipalReference getParentOrg()
      Gets the value of the attribute: parentOrg; The parentOrg attribute can be used to indcate which organization should be used to perfrom validation.

      Supported API: true
      Returns:
      WTPrincipalReference
    • getRadio

      public Map<String,String> getRadio()


      Supported API: true
      Specified by:
      getRadio in interface FormDataHolder
      Returns:
      Map
    • getRemovedItemsByName

      public List getRemovedItemsByName(String param_name)


      Supported API: true
      Specified by:
      getRemovedItemsByName in interface FormDataHolder
      Parameters:
      param_name -
      Returns:
      List
    • getRequestDataParameterMap

      public Map getRequestDataParameterMap()
      This method returns the equivalent of calling NmCommandBean.getRequestData().getParameterMap()

      Supported API: true
      Returns:
      Map
    • getCgiData

      public Properties getCgiData()
      This method returns the equivalent of calling NmCommandBean.getRequestData().getCgiData()

      Supported API: true
      Returns:
      Properties
    • getSelected

      public List getSelected()


      Supported API: true
      Returns:
      List
    • getSelectedInOpener

      public List getSelectedInOpener()


      Supported API: true
      Returns:
      List
    • getSelectedOidForPopup

      public List getSelectedOidForPopup() throws WTException


      Supported API: true
      Returns:
      List
      Throws:
      WTException
    • getSelectedRowObject

      public WTReference getSelectedRowObject()
      Gets the value of the attribute: selectedRowObject; The selectedRowObject WTReference is used to represent the row object in a table where a table row (icon) action is selected. This attribute would likely only be used in the validateSelectedAction method.

      Supported API: true
      Returns:
      WTReference
    • getSelectedRowObjectID

      public String getSelectedRowObjectID()
      Gets the value of the attribute: selectedRowObjectID; The selectedRowObjectID String is used to represent the non-persistable row object in a table where a table row (icon) action is selected. This attribute would likely only be used in the validateSelectedAction method where the table row objects are not Persistable.

      Supported API: true
      Returns:
      String
    • getTargetObjects

      public WTCollection getTargetObjects()
      Gets the value of the attribute: targetObjects; The targetObjects WTCollection can be used to indcate which object(s) should be used to perfrom validation. targetObjects should be used in cases where validation could be performed against multiple objects. If the requested validation is always being performed against a single object, the contextObject attribute should be used instead.

      Supported API: true
      Returns:
      WTCollection
    • getText

      public Map<String,String> getText()
      Gets the value of the attribute: text; You can stick any data you want into this map to communicate them to the server side. Please use ArrayList to communicate more than one value for a given key. A suggested usage is similar to the one of request attributes container.

      Supported API: true
      Specified by:
      getText in interface FormDataHolder
      Returns:
      Map
    • getTextArea

      public Map<String,String> getTextArea()
      * Gets the value of the attribute: textArea; The text areas that are posted on this request object

      Supported API: true
      Specified by:
      getTextArea in interface FormDataHolder
      Returns:
      Map
    • getTextParameter

      public String getTextParameter(String key)
      Returns the value of the form data element specified by the key argument.

      Supported API: true
      Specified by:
      getTextParameter in interface FormDataHolder
      Parameters:
      key -
      Returns:
      String
    • getTextParameterValues

      public String[] getTextParameterValues(String key)
      Returns the values of the form data element specified by the key argument.

      Supported API: true
      Specified by:
      getTextParameterValues in interface FormDataHolder
      Parameters:
      key -
      Returns:
      String[]
    • getUnChecked

      public Map<String,List<String>> getUnChecked() throws WTException


      Supported API: true
      Specified by:
      getUnChecked in interface FormDataHolder
      Returns:
      Map
      Throws:
      WTException
    • getUser

      public WTPrincipalReference getUser()
      Gets the value of the attribute: user; The user attribute can be used to indcate which user should be used to perfrom validation.

      Supported API: true
      Returns:
      WTPrincipalReference
    • getUserAgent

      public UserAgent getUserAgent()
      Gets the value of the attribute: userAgent from the request data.

      Supported API: true
      Returns:
      UserAgent