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/06 10:21:05 UTC

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

Author: kwin
Date: Mon Mar  6 10:21:05 2017
New Revision: 1785620

URL: http://svn.apache.org/viewvc?rev=1785620&view=rev
Log:
Explain ValidationResult in detail and outline the severity handling being introduced with SLING-6610.

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=1785620&r1=1785619&r2=1785620&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Mon Mar  6 10:21:05 2017
@@ -50,7 +50,15 @@ Apart from that it is also possible to v
     }
     
 All methods to retrieve a validation model support a boolean parameter `considerResourceSuperTypeModels`. If this is set to true, the validation model is not only being looked up for exactly the given resource type but also for all its resource super types. The returned model is then a merged model of all found validation model along the resource type hierarchy.
-    
+
+## ValidationResult
+The `ValidationResult` indicates whether a given `Resource` or `ValueMap` is valid or invalid according to a given validation model. In the latter case it aggregates one or more `ValidationFailure`s. Each `ValidationFailure` is encapsulating an error message and a severity. The severity may be set on the following locations (where locations on top may overwrite severity from locations below):
+1. validation model (per use case of a `Validator`)
+1. severity defined on the `Validator`
+1. the default severity (may be set through the OSGi configuration for PID "org.apache.sling.validation.impl.ValidationServiceImpl", is 0 by default)
+
+You have to use a `ResourceBundle` ([Internationalization Support]({{ refs.internationalization-support-i18n.path }})) to resolve the message for a specific locale. By default Sling Validation comes only with English failure messages.
+
 # Validation Model Resources
 The `ValidationModel` is constructed from resources with the resourceType **sling/validation/model**. Those resources are considered validation model resources if they are located below the Sling ResourceResolver search paths (*/apps* and */libs*).
  
@@ -85,7 +93,7 @@ In case there are multiple validation mo
 See [Sling Models validation]({{ refs.models.path }}#validation)
 
 ## Before Sling Models 1.2.0
- one needs to call the validate method within the PostConstruct method of the according Sling Model
+One needs to call the validate method within the PostConstruct method of the according Sling Model
 
     ::java
     @SlingObject