You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2014/11/27 16:15:59 UTC
svn commit: r930779 - in /websites/staging/sling/trunk/content: ./
documentation/bundles/validation.html
Author: buildbot
Date: Thu Nov 27 15:15:58 2014
New Revision: 930779
Log:
Staging update by buildbot for sling
Modified:
websites/staging/sling/trunk/content/ (props changed)
websites/staging/sling/trunk/content/documentation/bundles/validation.html
Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Thu Nov 27 15:15:58 2014
@@ -1 +1 @@
-1642126
+1642173
Modified: websites/staging/sling/trunk/content/documentation/bundles/validation.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/validation.html (original)
+++ websites/staging/sling/trunk/content/documentation/bundles/validation.html Thu Nov 27 15:15:58 2014
@@ -152,21 +152,28 @@ This documentation is still work in prog
<td><code>applicablePaths</code></td>
<td>Property</td>
<td><code>String[]</code></td>
-<td>Path prefixes which restrict the validation model to resources which are below one of the given prefix. No wildcards are supported. If not given, there is not path restriction.</td>
+<td>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.</td>
<td>no</td>
</tr>
<tr>
<td><code>properties\<propertyName></code></td>
<td>Resource</td>
<td>-</td>
-<td>This resource ensures that the property with the name <code><propertyName></code> is there.</td>
+<td>This resource ensures that the property with the name <code><propertyName></code> is there. The resource name has no longer a meaning if the property <code>nameRegex</code> is set on this node.</td>
<td>no</td>
</tr>
<tr>
<td><code>properties\<propertyName>\propertyMultiple</code></td>
<td>Property</td>
<td><code>Boolean</code></td>
-<td>If <code>true</code> only multivalue properties are allowed with the name <code><propertyName></code>. If not set or <code>false</code>, multi- and single-value properties are accepted.</td>
+<td>If <code>true</code> only multivalue properties are allowed with the name <code><propertyName></code> or matching the <code>nameRegex</code>. If not set or <code>false</code>, multi- and single-value properties are accepted.</td>
+<td>no</td>
+</tr>
+<tr>
+<td><code>properties\<propertyName>\nameRegex</code></td>
+<td>Property</td>
+<td><code>String</code></td>
+<td>If set the <code><propertyName></code> 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.</td>
<td>no</td>
</tr>
<tr>
@@ -180,21 +187,28 @@ This documentation is still work in prog
<td><code>properties\<propertyName>\validators\<validatorName>\validatorArguments</code></td>
<td>Property</td>
<td><code>String[]</code></td>
-<td>The parametrization for the validator with the name <code><validatorName></code>. Each value must have the pattern <code>key=value</code>.</td>
+<td>The parametrization for the validator with the name <code><validatorName></code>. Each value must have the pattern <code>key=value</code>. The parametrization differs per validator.</td>
<td>no</td>
</tr>
<tr>
<td><code>children\<resourceName></code></td>
<td>Resource</td>
<td>-</td>
-<td>This resource ensures that the resource with the name <code><resourceName></code> is there.</td>
+<td>This resource ensures that the resource with the name <code><resourceName></code> is there. The resource name has no longer a meaning if the property <code>nameRegex</code> is set on this node.</td>
+<td>no</td>
+</tr>
+<tr>
+<td><code>children\<resourceName>\nameRegex</code></td>
+<td>Property</td>
+<td><code>String</code></td>
+<td>If set the <code><resourceName></code> 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.</td>
<td>no</td>
</tr>
<tr>
-<td><code>children\<resourceName>\properties\<propertyName></code></td>
+<td><code>children\<resourceName>\properties</code></td>
<td>Resource</td>
<td>-</td>
-<td>This resource ensures that the property with the name <code><propertyName></code> is there below the resource with the name <code><resourceName></code>. Below this node validators can be given like for properties on the root level.</td>
+<td>The properties can be configured on the child level in the same way as on the root level.</td>
<td>no</td>
</tr>
</tbody>
@@ -226,13 +240,13 @@ This documentation is still work in prog
<p>The Sling validation bundle currently comes only with one validator <code>RegexValidator</code> which checks that the property value matches a given pattern. That validator supports only one parameter which is called <code>regex</code>. The value specifies the pattern against which the resource value is matched.</p>
<p>To write a validator one needs to implement the <code>Validator</code> interface in an OSGi service.
That interface defines the method <code>validate</code>. That is called for each property which is bound to the validator through the Validation Resources.</p>
-<p>Each validator needs to specify one type parameter which defines upon which classes the validator can act (usually <code>String</code>). If a property value cannot be converted to the requested type from the validator (through <code>ValueMap.get(name, type)</code>), validation will fail.</p>
+<p>Each validator needs to specify one type parameter which defines upon which classes the validator can act (usually <code>String</code>). 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 <code>ValueMap.get(name, type)</code>), validation will fail.</p>
<h1 id="references">References</h1>
<ol>
<li><a href="http://www.slideshare.net/raducotescu/apache-sling-generic-validation-framework">Apache Sling Generic Validation Framework, adaptTo 2014</a></li>
</ol>
<div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
- Rev. 1641361 by kwin on Mon, 24 Nov 2014 11:12:04 +0000
+ Rev. 1642173 by kwin on Thu, 27 Nov 2014 15:15:47 +0000
</div>
<div class="trademarkFooter">
Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project