You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2017/03/02 13:35:06 UTC

svn commit: r1785133 - /sling/site/trunk/content/documentation/bundles/validation.mdtext

Author: kwin
Date: Thu Mar  2 13:35:06 2017
New Revision: 1785133

URL: http://svn.apache.org/viewvc?rev=1785133&view=rev
Log:
fix some typos

Modified:
    sling/site/trunk/content/documentation/bundles/validation.mdtext

Modified: sling/site/trunk/content/documentation/bundles/validation.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/validation.mdtext?rev=1785133&r1=1785132&r2=1785133&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Thu Mar  2 13:35:06 2017
@@ -1,9 +1,5 @@
 Title: Sling Validation
 
-<div class="note">
-This documentation is still work in progress!
-</div>
-
 [TOC]
 
 Many Sling projects want to be able to validate both Resources and request parameters. Through the Sling Validation framework this is possible with the help of validation model resources which define validation rules for a certain resourceType.
@@ -70,8 +66,8 @@ The resources should have the following
 `properties\<propertyName>\propertyMultiple` | Property | `Boolean` | If `true` only multivalue properties are allowed with the name `<propertyName>` or matching the `nameRegex`. If not set or `false`, multi- and single-value properties are accepted.  | no | `false`
 `properties\<propertyName>\nameRegex` | Property | `String` | If set the `<propertyName>` has no longer a meaning. Rather all properties which match the given regular expression are considered. At least one match is required, otherwise the validated resource/valuemap is considered invalid. | no | `property[0-8]`  
 `properties\<propertyName>\validators\<validatorId>` | Resource | - | The `<validatorId>` must be the id of a validator. The id is given by the OSGi service property `validator.id` set in the validator. Each validators node might have arbitrarily many child resources (one per validator).  | no | `false`  
-`properties\<propertyName>\validators\<validatorName>\validatorArguments` | Property | `String[]` | The parametrization for the validator with the id  `<validatorId>`. Each value must have the pattern `key=value`. The parametrization differs per validator. | no | `regex=^[a-z]*$`
-`properties\<propertyName>\validators\<validatorName>\severity` | Property | `Integer` | The severity which should be set on all emitted validation failures by this validator. | no | `0` 
+`properties\<propertyName>\validators\<validatorId>\validatorArguments` | Property | `String[]` | The parametrization for the validator with the id  `<validatorId>`. Each value must have the pattern `key=value`. The parametrization differs per validator. | no | `regex=^[a-z]*$`
+`properties\<propertyName>\validators\<validatorId>\severity` | Property | `Integer` | The severity which should be set on all emitted validation failures by this validator. | no | `0` 
 `children\<resourceName>` | Resource | - | This resource ensures that the resource with the name `<resourceName>` is there. The resource name has no longer a meaning if the property `nameRegex` is set on this node. | no | `child1`
 `children\<resourceName>\nameRegex` | Property | `String` | If set the `<resourceName>` has no longer a meaning. Rather all resources whose name match the given regular expression are considered. At least one match is required, otherwise the validated resource/valuemap is considered invalid. | no | `child[1-9]`
 `children\<resourceName>\optional` | Property | `Boolean` | If `true` it is not an error if there is no resource with the given `<resourceName>` or none matching the  `nameRegex`. If not set or `false` the resource must be there. | no | `false`
@@ -124,7 +120,7 @@ To write a validator one needs to implem
 That interface defines the method `validate`. That is called for each property which is bound to the validator through the validation model.
 Each validator needs to specify one type parameter which defines upon which classes the validator can act (usually `String`). Array types are also supported here. Collection types are not supported. If a property value cannot be converted to the requested type from the validator (through `ValueMap.get(name, type)`), validation will fail.
 
-In addition that OSGi service needs to expose a property called `validation.id`. The value of this property should start with the providing bundle symbolic name. Only through this value the validator can be referenced from validation models. If multiple validators have the same `validation.id` value the one with the highest service ranking gets chosen.
+In addition that OSGi service needs to expose a property called `validation.id`. The value of this property should always start with the providing bundle's symbolic name. Only through this value the validator can be referenced from validation models. If multiple validators have the same `validation.id` value the one with the highest service ranking gets chosen.
 
 # References
 1. [Apache Sling Generic Validation Framework, adaptTo 2014](http://www.slideshare.net/raducotescu/apache-sling-generic-validation-framework)