If I recall corectly, sometimes errors occur before the post processor gets a chance to run. Such as constraint violations on a node type. So I would think doing validation as a pre processor would catch a larger universe of errors. But, that could be complex to do right. On Mar 29, 2013 9:11 AM, "Radu Cotescu (JIRA)" <[email protected]> wrote:
> > [ > https://issues.apache.org/jira/browse/SLING-2803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13617467#comment-13617467] > > Radu Cotescu commented on SLING-2803: > ------------------------------------- > > I was also thinking to hook the Validation module using a > SlingPostProcessor implementation - it's probably the best place where we > can validate the data - but I wanted to wait for more seasoned Sling > developers' suggestions. > > Regarding the lack of a resource type: the post processor should be able > to identify the resource type before calling in the validation services. I > thought of these cases (for the sake of simplification of these examples > I've omitted to talk about the ":operation" parameter): > > 1. POST to a URL without any resource type parameter > - if the path exists, get the resource type from the repo (this POST > is essentially a modify operation) - a ValidationModel could be obtained > - if the path doesn't exist, we assume it's a create operation and the > resource type should be nt:unstructured - not sure what the Validation > module should do in this case > > 2. POST to a URL with a resource type parameter - again, we can obtain the > ValidationModel, if there is one > > What are the other cases when we can't identify the resource type? > > > 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 >
