[ 
https://issues.apache.org/jira/browse/SLING-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13618695#comment-13618695
 ] 

Radu Cotescu commented on SLING-2803:
-------------------------------------

| Trying to do validation for the generic post servlet is a more challenging 
problem since I can imagine situations where a submitted value is valid for a 
node/resource type but not valid for a specific use case.

We can provide some special request parameters for these cases - 
:validationModel and :validationRule:

    1. <input type="hidden" name=":validationModel" value="foo/bar"/>
    2. <input type="hidden" name=":validationRule" 
value="field:@someValidatorRule"/>

The 1st parameter and its use are pretty obvious. For the 2nd one the 
ValidationModel would have to pass those validator rules to the required 
validators. This way we can also cover the cases you described without creating 
new resource types / validation models.

I'm also thinking to create the ValidationModels from the JCR content tree. 
However, now I'd like to just provide the validation framework and to integrate 
it into the main codebase without interfering too much with the existing code.

WDYT?
                
> Create a Validation module capable of validating POST requests or Resources
> ---------------------------------------------------------------------------
>
>                 Key: SLING-2803
>                 URL: https://issues.apache.org/jira/browse/SLING-2803
>             Project: Sling
>          Issue Type: New Feature
>            Reporter: Radu Cotescu
>
> Several Sling users have asked in the past [1] about a Validation mechanism 
> in Sling that's able to validate data coming from the user. However, such a 
> module is still missing.
> This issue is meant to track the work progress on such a module.
> Ideally the module should be able to validate both request parameters and 
> Resources, by obtaining their properties via a ValueMap and provide feedback 
> in case of a validation error.
> [1] - http://sling.markmail.org/search/?q=validation

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to