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 07:35:45 UTC

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

Author: kwin
Date: Thu Mar  2 07:35:44 2017
New Revision: 1785079

URL: http://svn.apache.org/viewvc?rev=1785079&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=1785079&r1=1785078&r2=1785079&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Thu Mar  2 07:35:44 2017
@@ -62,14 +62,14 @@ The resources should have the following
 
   Property/Resource Name      | Property or Resource |  Type   |  Description   |  Mandatory   |  Example 
 -------------------- | ------- | -------------- | -------------| ---------
-`sling:resourceType` | Property | `String` | Always `sling/validation/model`, otherwise node will never be picked up by Sling Validation. | yes | `sling/validation/model`
+`sling:resourceType` | Property | `String` | Always `sling/validation/model`, otherwise model will never be picked up by Sling Validation. | yes | `sling/validation/model`
 `validatedResourceType` | Property | `String` | The resource type of the resource for which this validation model should be applied. Must always be relative (i.e. not start with a "/"). | yes | `my/own/resourcetype` 
 `applicablePaths` | Property |  `String[]` | Path prefixes which restrict the validation model to resources which are below one of the given prefixes. No wildcards are supported. If not given, there is no path restriction. | no | `/content/mysite`
 `properties\<propertyName>` | Resource | - | This resource ensures that the property with the name `<propertyName>` is there. The resource name has no longer a meaning if the property `nameRegex` is set on this node. | no | `false`
 `properties\<propertyName>\optional` | Property | `Boolean` | If `true` it is not an error if there is no property with the given `<propertyName>` or none matching the  `nameRegex`. If not set or `false` the property must be there.  | no | `false`
 `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 `validation.id` set in the validator. Each validators node might have arbitrarily many child resources (one per validator).  | no | `false`  
+`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` 
 `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`
@@ -120,7 +120,7 @@ Validator ID | Description | Parameters
 [`org.apache.sling.validation.core.RegexValidator`](https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java) | Validates that a property value matches a given regular expression | `regex`, mandatory parameter giving a regular expression according to the pattern described in [java.util.regex.Pattern](http://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html). Only if the property value matches this expression it is considered valid. | 1.0.0
 
 # Writing Validators
-To write a validator one needs to implement the [`org.apache.sling.validation.spi.Validator`](hhttps://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/spi/Validator.java) interface in an OSGi service (look at [`org.apache.sling.validation.core.RegexValidator`](https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java) for an example).
+To write a validator one needs to implement the [`org.apache.sling.validation.spi.Validator`](https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/spi/Validator.java) interface in an OSGi service (look at [`org.apache.sling.validation.core.RegexValidator`](https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java) for an example).
 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.