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

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

Thanks for the review, Bertrand!

I tried to bind a ValidationModel to a specific resource type because I expect 
that resources aren't that similar between each other if their types are 
different. However if you have a valid use case where you'd bind a 
ValidationModel to multiple resource types we could definitely change this.

In the default implementation I'm currently stopping the validation check as 
soon as I discover the first inconsistency; if we decide to perform the whole 
validation in one go, no matter what intermediary results we get, we could also 
change the use of the ValidationResult to return a list of failures.

For the Type object I preferred an enum due to its intrinsic advantages: 
singleton by default and thread safe (after I'll cleanup the SDF mess - I 
forgot that SDF is not thread-safe); also I can use the constants for the 
isValid check really easy.

The name of the parameter sent to ValidatorLookupService.getValidator is 
misleading now: I expect to have a validator name sent as parameter, not a 
type; also I expect the names to be unique. For the current implementation I'm 
using the class names.
                
> 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
>         Attachments: org.apache.sling.validation-2.zip, 
> org.apache.sling.validation.zip
>
>
> 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