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 2014/11/28 16:01:25 UTC

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

Author: kwin
Date: Fri Nov 28 15:01:24 2014
New Revision: 1642308

URL: http://svn.apache.org/r1642308
Log:
SLING-4013 document optional properties/child resources for validation models

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=1642308&r1=1642307&r2=1642308&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Fri Nov 28 15:01:24 2014
@@ -35,12 +35,14 @@ The resources should have the following 
 `validatedResourceType` | Property | `String` | The resource type of the resource for which this validation model should be applied. | 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 not 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\<validatorName>` | Resource | - | The `<validatorName>` must be the OSGi component name of a validator. Each validators node might have arbitrarily many subnodes (one per validator).  | no | `false`  
 `properties\<propertyName>\validators\<validatorName>\validatorArguments` | Property | `String[]` | The parametrization for the validator with the name  `<validatorName>`. Each value must have the pattern `key=value`. The parametrization differs per validator.  | no | `regex=^[a-z]*$`  
 `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`
 `children\<resourceName>\properties` | Resource | - | The properties can be configured on the child level in the same way as on the root level. | no | -