com.ptc.core.ui.validation
Class UIValidationCriteria

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

public class UIValidationCriteria
extends Object
implements com.ptc.core.components.beans.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:
Serialized Form

Method Summary
 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.
 wt.access.AccessPermissionSet getAccessPermissionSet(AccessControlled acObj)
          Returns cached access control permissions for a given persistable if already cached, or retrieves the AccessPermissionSet for the object and caches it.
 List getAddedItemsByName(String param_name)
          

Supported API: true
 Map<String,List<String>> getChangedComboBox()
          Gets the comboboxes that have changed.
 Map<String,String> getChangedRadio()
          Returns a Map of any radio buttons that have changed.
 Map<String,String> getChangedText()
          Gets the textboxes that have changed.
 Map<String,String> getChangedTextArea()
          Gets the TextAreas that have changed.
 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
 com.ptc.core.ui.resources.ClientType getClientType()
          Gets the value of the attribute: clientType.
 List getClipped()
          

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

Supported API: true
 String getCompContext()
          Gets the value of the attribute: compContext.
 ComponentContext getComponentContext()
          Gets the value of the attribute: componentContext.
 com.ptc.core.ui.resources.ComponentMode getComponentMode()
          Gets the value of the attribute: componentMode.
 ComponentType getComponentType()
          Gets the value of the attribute: componentType.
 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.
 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.
 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.
 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.
 Map<String,List<String>> getNewChecked()
          

Supported API: true
 HashMap<String,Object> getParameterMap()
          

Supported API: true
 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.
 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.
 Map<String,String> getRadio()
          

Supported API: true
 List getRemovedItemsByName(String param_name)
          

Supported API: true
 Map getRequestDataParameterMap()
          This method returns the equivalent of calling NmCommandBean.getRequestData().getParameterMap()

Supported API: true
 List getSelected()
          

Supported API: true
 List getSelectedInOpener()
          

Supported API: true
 List getSelectedOidForPopup()
          

Supported API: true
 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.
 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.
 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.
 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.
 Map<String,String> getTextArea()
          * Gets the value of the attribute: textArea; The text areas that are posted on this request object

Supported API: true
 String getTextParameter(String key)
          Returns the value of the form data element specified by the key argument.
 String[] getTextParameterValues(String key)
          Returns the values of the form data element specified by the key argument.
 Map<String,List<String>> getUnChecked()
          

Supported API: true
 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.
static UIValidationCriteria newInstance()
          Creates a new (empty) instance of a UIValidationCriteria object
static UIValidationCriteria newInstance(NmCommandBean commandBean)
          Creates a new instance of A UIValidationCriteria object whose properties are initialized by the NmCommandBean argument *

Supported API: true
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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

Parameters:
param_name -
Returns:
List

getChangedComboBox

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

Supported API: true

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

Returns:
Map

getChangedText

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

Supported API: true

Returns:
Map

getChangedTextArea

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

Supported API: true

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

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

Returns:
Map

getCompContext

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

Supported API: true

Returns:
String

getComponentMode

public com.ptc.core.ui.resources.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

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

getNewChecked

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


Supported API: true

Returns:
Map>
Throws:
WTException

getParameterMap

public HashMap<String,Object> getParameterMap()


Supported API: true

Returns:
HashMap

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

Returns:
Map

getRemovedItemsByName

public List getRemovedItemsByName(String param_name)


Supported API: true

Parameters:
param_name -
Returns:
List

getRequestDataParameterMap

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

Supported API: true

Returns:
Map

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

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

Returns:
Map

getTextParameter

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

Supported API: true

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

Parameters:
key -
Returns:
String[]

getUnChecked

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


Supported API: true

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