com.ptc.core.ui.validation
Class DefaultUIComponentValidator

java.lang.Object
  extended by com.ptc.core.ui.validation.DefaultValidationFilter
      extended by com.ptc.core.ui.validation.DefaultUIComponentValidator
All Implemented Interfaces:
UIComponentValidator, ValidationFilter
Direct Known Subclasses:
AttachmentsEditActionValidator, com.ptc.core.components.validators.DefaultCreateValidator, RelatedChangesValidator, RevisionLabelValidator, ShareStatusValidator

public class DefaultUIComponentValidator
extends DefaultValidationFilter
implements UIComponentValidator

This class serves as a default implementation of the UIComponentValidator Interface. Application developers should never need to modify the content of this class. Developers creating their own implementation of the UIComponentValidator Interface should extend this class, as opposed to implementing the Interface directly. This default implementation of a UIComponentValidator will always return results indicating that a given action/component is enabled/permitted/etc. It will never deny access/availability to an action/component. Developers who extend this class when creating their own implementation of a UIComponentValidator class only need to implement the APIs where they want non-defualt behavior. If a given API is not defined in the subclass, the default behavior defined in this class (always enabled/permitted/etc.) will be executed.

Supported API: true

Extendable: true


Method Summary
 UIComponentValidator getSubValidator(String componentId)
          Gets and returns an instance of a class that implements the UIComponentValidator interface, based on the componentId argument.
 UIComponentValidator getSubValidator(String componentId, Object requestor)
          Gets and returns an instance of a class that implements the UIComponentValidator interface, based on the componentId and requestor arguments.
 UIValidationResultSet performFullPreValidation(com.ptc.core.ui.validation.UIValidationKey validationKey, UIValidationCriteria validationCriteria, Locale locale)
          This implementation of performFullPreValdiation will return a UIValidationResultBean whose UIValidationResult objects all have an ENABLED status.
 UIValidationResultSet performLimitedPreValidation(com.ptc.core.ui.validation.UIValidationKey validationKey, UIValidationCriteria validationCriteria, Locale locale)
          This implementation of performLimitedPreValdiation will return a UIValidationResultBean whose UIValidationResult objects all have an ENABLED status.
 UIValidationStatus preValidateAction(com.ptc.core.ui.validation.UIValidationKey validationKey, UIValidationCriteria validationCriteria)
          

Supported API: true
 UIValidationStatus preValidateAttribute(com.ptc.core.ui.validation.UIValidationKey validationKey, UIValidationCriteria validationCriteria)
          

Supported API: true
 UIValidationResultSet preValidateMultiTargetAction(com.ptc.core.ui.validation.UIValidationKey validationKey, UIValidationCriteria validationCriteria)
          

Supported API: true
 UIValidationResult validateFormSubmission(com.ptc.core.ui.validation.UIValidationKey validationKey, UIValidationCriteria validationCriteria, Locale locale)
          This implementation of validateFormSubmission will return a UIValidationResult object with a PERMITTED status.
 UIValidationResult validateSelectedAction(com.ptc.core.ui.validation.UIValidationKey validationKey, UIValidationCriteria validationCriteria, Locale locale)
          This implementation of validateSelectedAction will return a UIValidationResult object with a PERMITTED status.
 UIValidationResultSet validateSelectedMultiSelectAction(com.ptc.core.ui.validation.UIValidationKey validationKey, UIValidationCriteria validationCriteria, Locale locale)
          This implementation of validateSelectedMultiSelectAction will return a UIValidationResultBean whose UIValidationResult objects all have a PERMITTED status.
 
Methods inherited from class com.ptc.core.ui.validation.DefaultValidationFilter
populateResultSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSubValidator

public UIComponentValidator getSubValidator(String componentId)
Gets and returns an instance of a class that implements the UIComponentValidator interface, based on the componentId argument. This method will return null if no validator is registered for the provided componentId.

The intent is that this method is called from Validators who need to delegate some validation logic to another validator. They can call this method to find the validator (and not worry about module dependencies), and then call whatever method they need to on that validator.

It will use entries like the one below to perform its lookup:

wt.services/svc/default/com.ptc.core.ui.validation.UIComponentValidator/componentId/null/0=(UIComponentValidator fully-qualified class name)

Supported API: true

Parameters:
componentId - - the selector used to register the desired validator in service.properties
Returns:
UIComponentValidator - will be null if no validator is registered for the given componentId

getSubValidator

public UIComponentValidator getSubValidator(String componentId,
                                            Object requestor)
Gets and returns an instance of a class that implements the UIComponentValidator interface, based on the componentId and requestor arguments. This method will return null if no validator is registered for the provided componentId and requestor combination.

The intent is that this method is called from Validators who need to delegate some validation logic to another validator. They can call this method to find the validator (and not worry about module dependencies), and then call whatever method they need to on that validator.

It will use entries like the one below to perform its lookup:

wt.services/svc/default/com.ptc.core.ui.validation.UIComponentValidator/componentId/requestor/0=(UIComponentValidator fully-qualified class name)

Supported API: true

Parameters:
componentId - - the selector used to register the desired validator in service.properties
requestor - - the requestor used to register the desired validator in service.properties
Returns:
UIComponentValidator - will be null if no validator is registered for the given componentId and requestor

performFullPreValidation

public UIValidationResultSet performFullPreValidation(com.ptc.core.ui.validation.UIValidationKey validationKey,
                                                      UIValidationCriteria validationCriteria,
                                                      Locale locale)
                                               throws WTException
This implementation of performFullPreValdiation will return a UIValidationResultBean whose UIValidationResult objects all have an ENABLED status.

Supported API: true

Specified by:
performFullPreValidation in interface UIComponentValidator
Parameters:
validationKey - A UIValidationKey object representing the action or UI component to be validated.
validationCriteria - Object holding information required to perform validation tasks.
locale - The user's Locale. If a null value is passed in, the session locale will be used.
Returns:
UIValidationResultSet
Throws:
WTException
See Also:
UIComponentValidator.performFullPreValidation(com.ptc.core.ui.validation.UIValidationKey, com.ptc.core.ui.validation.UIValidationCriteria, java.util.Locale)

performLimitedPreValidation

public UIValidationResultSet performLimitedPreValidation(com.ptc.core.ui.validation.UIValidationKey validationKey,
                                                         UIValidationCriteria validationCriteria,
                                                         Locale locale)
                                                  throws WTException
This implementation of performLimitedPreValdiation will return a UIValidationResultBean whose UIValidationResult objects all have an ENABLED status.

Supported API: true

Specified by:
performLimitedPreValidation in interface UIComponentValidator
Parameters:
validationKey - A UIValidationKey object representing the action or UI component to be validated.
validationCriteria - Object holding information required to perform validation tasks.
locale - The user's Locale. If a null value is passed in, the session locale will be used.
Returns:
UIValidationResultSet
Throws:
WTException

preValidateAction

public UIValidationStatus preValidateAction(com.ptc.core.ui.validation.UIValidationKey validationKey,
                                            UIValidationCriteria validationCriteria)


Supported API: true

Specified by:
preValidateAction in interface ValidationFilter
Overrides:
preValidateAction in class DefaultValidationFilter
Parameters:
validationKey - A UIValidationKey object representing the action or UI component to be validated.
validationCriteria - Object holding information required to perform validation tasks.
Returns:
UIValidationStatus
See Also:
DefaultValidationFilter.preValidateAction(com.ptc.core.ui.validation.UIValidationKey, com.ptc.core.ui.validation.UIValidationCriteria)

preValidateAttribute

public UIValidationStatus preValidateAttribute(com.ptc.core.ui.validation.UIValidationKey validationKey,
                                               UIValidationCriteria validationCriteria)


Supported API: true

Specified by:
preValidateAttribute in interface ValidationFilter
Overrides:
preValidateAttribute in class DefaultValidationFilter
Parameters:
validationKey - A UIValidationKey object representing the action or UI component to be validated.
validationCriteria - Object holding information required to perform validation tasks.
Returns:
UIValidationStatus
See Also:
DefaultValidationFilter.preValidateAttribute(com.ptc.core.ui.validation.UIValidationKey, com.ptc.core.ui.validation.UIValidationCriteria)

preValidateMultiTargetAction

public UIValidationResultSet preValidateMultiTargetAction(com.ptc.core.ui.validation.UIValidationKey validationKey,
                                                          UIValidationCriteria validationCriteria)


Supported API: true

Specified by:
preValidateMultiTargetAction in interface ValidationFilter
Overrides:
preValidateMultiTargetAction in class DefaultValidationFilter
Parameters:
validationKey - A UIValidationKey object representing the action or UI component to be validated.
validationCriteria - Object holding information required to perform validation tasks.
Returns:
UIValidationResultSet
See Also:
DefaultValidationFilter.preValidateMultiTargetAction(com.ptc.core.ui.validation.UIValidationKey, com.ptc.core.ui.validation.UIValidationCriteria)

validateFormSubmission

public UIValidationResult validateFormSubmission(com.ptc.core.ui.validation.UIValidationKey validationKey,
                                                 UIValidationCriteria validationCriteria,
                                                 Locale locale)
                                          throws WTException
This implementation of validateFormSubmission will return a UIValidationResult object with a PERMITTED status.

Supported API: true

Specified by:
validateFormSubmission in interface UIComponentValidator
Parameters:
validationKey - A UIValidationKey object representing the action or UI component to be validated.
validationCriteria - Object holding information required to perform validation tasks.
locale - The user's Locale. If a null value is passed in, the session locale will be used.
Returns:
UIValidationResult
Throws:
WTException

validateSelectedAction

public UIValidationResult validateSelectedAction(com.ptc.core.ui.validation.UIValidationKey validationKey,
                                                 UIValidationCriteria validationCriteria,
                                                 Locale locale)
                                          throws WTException
This implementation of validateSelectedAction will return a UIValidationResult object with a PERMITTED status.

Supported API: true

Specified by:
validateSelectedAction in interface UIComponentValidator
Parameters:
validationKey - A UIValidationKey object representing the action or UI component to be validated.
validationCriteria - Object holding information required to perform validation tasks.
locale - The user's Locale. If a null value is passed in, the session locale will be used.
Returns:
UIValidationResult
Throws:
WTException

validateSelectedMultiSelectAction

public UIValidationResultSet validateSelectedMultiSelectAction(com.ptc.core.ui.validation.UIValidationKey validationKey,
                                                               UIValidationCriteria validationCriteria,
                                                               Locale locale)
                                                        throws WTException
This implementation of validateSelectedMultiSelectAction will return a UIValidationResultBean whose UIValidationResult objects all have a PERMITTED status.

Supported API: true

Specified by:
validateSelectedMultiSelectAction in interface UIComponentValidator
Parameters:
validationKey - A UIValidationKey object representing the action or UI component to be validated.
validationCriteria - Object holding information required to perform validation tasks.
locale - The user's Locale. If a null value is passed in, the session locale will be used.
Returns:
UIValidationResultSet
Throws:
WTException