svn commit: r1638874 - in /sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl: Constants.java ValidationServiceImpl.java

2014-11-12 Thread kwin
Author: kwin
Date: Wed Nov 12 17:25:18 2014
New Revision: 1638874

URL: http://svn.apache.org/r1638874
Log:
SLING-4157, detect validation models in arbitrary locations

(only below the resource resolver search paths and below a node named 
validation)

Modified:

sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java

sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

Modified: 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java?rev=1638874r1=1638873r2=1638874view=diff
==
--- 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java
 (original)
+++ 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java
 Wed Nov 12 17:25:18 2014
@@ -25,7 +25,7 @@ public final class Constants {
 
 public static final String VALIDATED_RESOURCE_TYPE = 
validatedResourceType;
 public static final String APPLICABLE_PATHS = applicablePaths;
-public static final String MODELS_HOME = sling/validation/models/;
+public static final String MODELS_HOME = validation/;
 public static final String VALIDATION_MODEL_RESOURCE_TYPE = 
sling/validation/model;
 public static final String PROPERTIES = properties;
 public static final String PROPERTY_TYPE = propertyType;

Modified: 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1638874r1=1638873r2=1638874view=diff
==
--- 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Wed Nov 12 17:25:18 2014
@@ -64,7 +64,7 @@ public class ValidationServiceImpl imple
 
 private static final Logger LOG = 
LoggerFactory.getLogger(ValidationServiceImpl.class);
 
-static final String MODEL_XPATH_QUERY = /jcr:root/%s/ + 
Constants.MODELS_HOME + *[@sling:resourceType=\%s\ and @%s=\%s\];
+static final String MODEL_XPATH_QUERY = /jcr:root%s// + 
Constants.MODELS_HOME + /*[@sling:resourceType=\%s\ and @%s=\%s\];
 static final String[] TOPICS = {SlingConstants.TOPIC_RESOURCE_REMOVED, 
SlingConstants.TOPIC_RESOURCE_CHANGED,
 SlingConstants.TOPIC_RESOURCE_ADDED};
 
@@ -196,7 +196,7 @@ public class ValidationServiceImpl imple
 if (searchPath.endsWith(/)) {
 searchPath = searchPath.substring(0, searchPath.length() - 
1);
 }
-String path = searchPath + / + Constants.MODELS_HOME;
+String path = searchPath + /* + Constants.MODELS_HOME;
 sb.append((path=).append(path).append(*));
 }
 sb.append());




svn commit: r1639262 - /sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

2014-11-12 Thread kwin
Author: kwin
Date: Thu Nov 13 07:55:08 2014
New Revision: 1639262

URL: http://svn.apache.org/r1639262
Log:
SLING-4159, always close resource resolver (even in case of exceptions)

Modified:

sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

Modified: 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1639262r1=1639261r2=1639262view=diff
==
--- 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Thu Nov 13 07:55:08 2014
@@ -329,9 +329,10 @@ public class ValidationServiceImpl imple
 }
 } catch (LoginException e) {
 LOG.error(Unable to obtain a resource resolver., e);
-}
-if (rr != null) {
-rr.close();
+} finally {
+if (rr != null) {
+rr.close();
+}
 }
 return modelsForResourceType;
 }




svn commit: r1639292 - in /sling/trunk/contrib/validation: api/src/main/java/org/apache/sling/validation/api/ core/ core/src/main/java/org/apache/sling/validation/impl/ core/src/main/java/org/apache/s

2014-11-13 Thread kwin
Author: kwin
Date: Thu Nov 13 10:29:48 2014
New Revision: 1639292

URL: http://svn.apache.org/r1639292
Log:
SLING-4158, make applicablePaths optional
log in case invalid applicablePaths are provided from a model
refactoring of TrieTest

Modified:

sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidationModel.java
sling/trunk/contrib/validation/core/pom.xml

sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/JCRValidationModel.java

sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/util/Trie.java

sling/trunk/contrib/validation/core/src/test/java/org/apache/sling/validation/impl/util/TrieTest.java

Modified: 
sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidationModel.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidationModel.java?rev=1639292r1=1639291r2=1639292view=diff
==
--- 
sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidationModel.java
 (original)
+++ 
sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidationModel.java
 Thu Nov 13 10:29:48 2014
@@ -41,7 +41,9 @@ public interface ValidationModel {
 String getValidatedResourceType();
 
 /**
- * Returns the paths under which resources will be validated by this model.
+ * Returns the paths under which resources will be validated by this 
model. 
+ * Is never null nor an empty array. Might return a single element array 
containing only the empty string, 
+ * in which case the validation model has no path restriction.
  *
  * @return a path array
  */

Modified: sling/trunk/contrib/validation/core/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/validation/core/pom.xml?rev=1639292r1=1639291r2=1639292view=diff
==
--- sling/trunk/contrib/validation/core/pom.xml (original)
+++ sling/trunk/contrib/validation/core/pom.xml Thu Nov 13 10:29:48 2014
@@ -143,6 +143,12 @@
 scopeprovided/scope
 /dependency
 dependency
+groupIdcommons-lang/groupId
+artifactIdcommons-lang/artifactId
+version2.5/version
+scopeprovided/scope
+/dependency
+dependency
 groupIdjunit/groupId
 artifactIdjunit/artifactId
 scopetest/scope

Modified: 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/JCRValidationModel.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/JCRValidationModel.java?rev=1639292r1=1639291r2=1639292view=diff
==
--- 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/JCRValidationModel.java
 (original)
+++ 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/JCRValidationModel.java
 Thu Nov 13 10:29:48 2014
@@ -21,6 +21,7 @@ package org.apache.sling.validation.impl
 import java.util.List;
 import java.util.Set;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.sling.validation.api.ChildResource;
 import org.apache.sling.validation.api.ResourceProperty;
 import org.apache.sling.validation.api.ValidationModel;
@@ -38,7 +39,21 @@ public class JCRValidationModel implemen
 this.jcrPath = jcrPath;
 this.resourceProperties = resourceProperties;
 this.validatedResourceType = validatedResourceType;
-this.applicablePaths = applicablePaths;
+// if this property was not set
+if (applicablePaths == null) {
+// set this to the empty string (which matches all paths)
+this.applicablePaths = new String[] {};
+} else {
+if (applicablePaths.length == 0) {
+throw new IllegalArgumentException(applicablePaths cannot be 
an empty array!);
+}
+for (String applicablePath : applicablePaths) {
+if (StringUtils.isBlank(applicablePath)) {
+throw new IllegalArgumentException(applicablePaths may 
not contain empty values!);
+}
+}
+this.applicablePaths = applicablePaths;
+}
 this.children = children;
 }
 

Modified: 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1639292r1

svn commit: r1639315 - in /sling/trunk/contrib/validation: api/src/main/java/org/apache/sling/validation/api/ValidatorLookupService.java core/src/main/java/org/apache/sling/validation/impl/util/JCRBui

2014-11-13 Thread kwin
Author: kwin
Date: Thu Nov 13 11:57:06 2014
New Revision: 1639315

URL: http://svn.apache.org/r1639315
Log:
SLING-4160, log error in case invalid validator was specified in the model
improved javadoc for ValidatorLookupService

Modified:

sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidatorLookupService.java

sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java

Modified: 
sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidatorLookupService.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidatorLookupService.java?rev=1639315r1=1639314r2=1639315view=diff
==
--- 
sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidatorLookupService.java
 (original)
+++ 
sling/trunk/contrib/validation/api/src/main/java/org/apache/sling/validation/api/ValidatorLookupService.java
 Thu Nov 13 11:57:06 2014
@@ -23,5 +23,10 @@ package org.apache.sling.validation.api;
  */
 public interface ValidatorLookupService {
 
+/**
+ * Returns a {@link Validator} with the given class name.
+ * @param validatorType the class name of the requested validator
+ * @return a validator or {@code null} in case no validator could be found 
with the given name.
+ */
 Validator getValidator(String validatorType);
 }

Modified: 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java?rev=1639315r1=1639314r2=1639315view=diff
==
--- 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java
 (original)
+++ 
sling/trunk/contrib/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java
 Thu Nov 13 11:57:06 2014
@@ -68,6 +68,9 @@ public class JCRBuilder {
 ValueMap validatorProperties = 
validator.adaptTo(ValueMap.class);
 String validatorName = validator.getName();
 Validator v = vls.getValidator(validatorName);
+if (v == null) {
+throw new IllegalArgumentException(Could not find 
validator with name ' + validatorName + ');
+}
 String[] validatorArguments = 
validatorProperties.get(Constants.VALIDATOR_ARGUMENTS, String[].class);
 MapString, String validatorArgumentsMap = new 
HashMapString, String();
 if (validatorArguments != null) {




svn commit: r1639357 - /sling/site/trunk/content/documentation.mdtext

2014-11-13 Thread kwin
Author: kwin
Date: Thu Nov 13 15:09:19 2014
New Revision: 1639357

URL: http://svn.apache.org/r1639357
Log:
fix link to sling staging site

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

Modified: sling/site/trunk/content/documentation.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation.mdtext?rev=1639357r1=1639356r2=1639357view=diff
==
--- sling/site/trunk/content/documentation.mdtext (original)
+++ sling/site/trunk/content/documentation.mdtext Thu Nov 13 15:09:19 2014
@@ -159,7 +159,7 @@ lighted code with line numbers using the
 ### Manual Generation
 
 When commiting changes to pages into SVN the pages are automatically
-generated in [the staging site](http://felix.staging.apache.org).
+generated in [the staging site](http://sling.staging.apache.org).
 
 To manually generate the site or single pages the 
[site](http://svn.apache.org/repos/asf/felix/site)
 can be checked out from SVN. In addition Perl and Python must be installed




svn commit: r1639376 - /sling/site/trunk/content/documentation/bundles/models.mdtext

2014-11-13 Thread kwin
Author: kwin
Date: Thu Nov 13 16:06:53 2014
New Revision: 1639376

URL: http://svn.apache.org/r1639376
Log:
SLING-4156, extend documentation around default injection strategy
also document limitations for injector-specific annotations
add subsections for the Other Options section

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

Modified: sling/site/trunk/content/documentation/bundles/models.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/models.mdtext?rev=1639376r1=1639375r2=1639376view=diff
==
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Thu Nov 13 
16:06:53 2014
@@ -86,7 +86,7 @@ Or
 As with other AdapterFactories, if the adaptation can't be made for any 
reason, `adaptTo()` returns null.
 
 # Other Options
-
+## Names
 If the field or method name doesn't exactly match the property name, `@Named` 
can be used:
 
::java
@@ -97,7 +97,7 @@ If the field or method name doesn't exac
private String otherName;
} 
  
-
+## Optional and Required
 `@Inject`ed fields/methods are assumed to be required. To mark them as 
optional, use `@Optional`:
 
::java
@@ -119,7 +119,13 @@ strategy by using adding `defaultInjecti
private String otherName;
}
 
+To still mark some fields/methods as being mandatory while relying on 
`defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL` for all other 
fields, the annotation `@Required` can be used.
+
+`@Optional` annotations are only evaluated when using the 
`defaultInjectionStrategy = DefaultInjectionStrategy.REQUIRED` (which is the 
default), `@Required` annotations only if using `defaultInjectionStrategy = 
DefaultInjectionStrategy.OPTIONAL`.
+
+*The `defaultInjectionStrategy` is currently not considered for fields/methods 
annotated with Injector-specific annotations (see also 
[SLING-4155](https://issues.apache.org/jira/browse/SLING-4155))*
 
+## Defaults
 A default value can be provided (for Strings  primitives):
 
::java
@@ -154,6 +160,7 @@ OSGi services can be injected:
  
 In this case, the name is not used -- only the class name.
 
+## Collections
 Lists and arrays are supported:
 
::java
@@ -186,6 +193,7 @@ Is suitable for a resource structure suc
 
 In this case, the `addresses` `List` will contain `address1` and `address2`.
  
+## OSGi Service Filters
 OSGi injection can be filtered:
 
::java
@@ -204,7 +212,7 @@ OSGi injection can be filtered:
private ListServlet servlets;
}
 
- 
+## PostConstruct Methods 
 The `@PostConstruct` annotation can be used to add methods which are invoked 
upon completion of all injections:
 
::java
@@ -225,7 +233,8 @@ The `@PostConstruct` annotation can be u
}
 
 `@PostConstruct` methods in a super class will be invoked first.
- 
+
+## Via 
 If the injection should be based on a JavaBean property of the adaptable, you 
can indicate this using the `@Via` annotation:
 
::java
@@ -237,6 +246,7 @@ If the injection should be based on a Ja
String getPropertyName();
} 
 
+## Source
 If there is ambiguity where a given injection could be handled by more than 
one injector, the `@Source` annotation can be used to define which injector is 
responsible:
 
::java
@@ -248,6 +258,7 @@ If there is ambiguity where a given inje
Resource getResource();
} 
 
+## Adaptations
 If the injected object does not match the desired type and the object 
implements the `Adaptable` interface, Sling Models will try to adapt it. This 
provides the ability to create rich object graphs. For example:
 
::java
@@ -357,7 +368,7 @@ Annotation  | Supported Optional
 
 ## Hints
 
-Those annotations replace `@Via`, `@Filter`, `@Named`, `@Optional`, `@Source` 
and `@Inject`.
+Those annotations replace `@Via`, `@Filter`, `@Named`, `@Optional`, 
`@Required`, `@Source` and `@Inject`.
 `@Default` may still be used in addition to the injector-specific annotation 
to set default values. All elements given above are optional.
  
 ## Custom Annotations




svn commit: r929077 - /websites/production/sling/content/

2014-11-13 Thread kwin
Author: kwin
Date: Thu Nov 13 16:13:57 2014
New Revision: 929077

Log:
publish changes for Sling Models documentation

Added:
websites/production/sling/content/
  - copied from r929076, websites/staging/sling/trunk/content/



svn commit: r1640572 - in /sling/trunk/contrib/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ api/src/main/java/org/apache/sling/validation/api/exceptions/ core/ core/src/ma

2014-11-19 Thread kwin
Author: kwin
Date: Wed Nov 19 15:23:05 2014
New Revision: 1640572

URL: http://svn.apache.org/r1640572
Log:
SLING-4138, refactored Validator interface to support arbitrary types, arrays 
and cross-field validation

Added:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ParameterizedValidatorImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/ValidatorTypeUtil.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/ValidatorTypeUtilTest.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/AbstractValidatorWithAdditionalType.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/DateValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/DerivedStringValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/ExtendedStringValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/GenericTypeParameterBaseClass.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/IntegerValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringArrayValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringValidator.java
Removed:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Type.java

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/exceptions/NonExistingTypeException.java
Modified:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
sling/trunk/contrib/extensions/validation/core/pom.xml

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/JCRValidationModel.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ResourcePropertyImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Added: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java?rev=1640572view=auto
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java
 (added)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java
 Wed Nov 19 15:23:05 2014
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.validation.api;
+
+import java.util.Map;
+
+/**
+ * Defines a validator instance with information

svn commit: r1640589 - in /sling/trunk/contrib/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ core/src/main/java/org/apache/sling/validation/impl/ core/src/main/java/org/apa

2014-11-19 Thread kwin
Author: kwin
Date: Wed Nov 19 16:28:08 2014
New Revision: 1640589

URL: http://svn.apache.org/r1640589
Log:
SLILNG-4027 removal of ValidatorLookupService

Removed:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidatorLookupService.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidatorLookupServiceImpl.java
Modified:

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java?rev=1640589r1=1640588r2=1640589view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java
 Wed Nov 19 16:28:08 2014
@@ -1,11 +1,12 @@
 package org.apache.sling.validation.impl;
 
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.validation.api.ChildResource;
 import org.apache.sling.validation.api.ResourceProperty;
-import org.apache.sling.validation.api.ValidatorLookupService;
+import org.apache.sling.validation.api.Validator;
 import org.apache.sling.validation.impl.util.JCRBuilder;
 
 /**
@@ -16,13 +17,13 @@ public class ChildResourceImpl implement
 private String name;
 private SetResourceProperty properties;
 
-public ChildResourceImpl(Resource modelResource, Resource childResource, 
ValidatorLookupService validatorLookupService) {
+public ChildResourceImpl(Resource modelResource, Resource childResource, 
MapString, Validator? validatorsMap) {
 String root = modelResource.getPath();
 if (!childResource.getPath().startsWith(root)) {
 throw new IllegalArgumentException(Expected resource  + 
childResource.getPath() +  to be under root path  + root);
 }
 name = childResource.getPath().replaceFirst(root + /, 
).replaceAll(Constants.CHILDREN + /, );
-properties = JCRBuilder.buildProperties(validatorLookupService, 
childResource.getChild(Constants.PROPERTIES));
+properties = JCRBuilder.buildProperties(validatorsMap, 
childResource.getChild(Constants.PROPERTIES));
 }
 
 @Override

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1640589r1=1640588r2=1640589view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Wed Nov 19 16:28:08 2014
@@ -18,25 +18,21 @@
  */
 package org.apache.sling.validation.impl;
 
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
 import java.util.Dictionary;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
 import javax.jcr.query.Query;
 
 import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.reflect.TypeUtils;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.ReferencePolicy;
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.resource.LoginException;
@@ -54,7 +50,6 @@ import org.apache.sling.validation.api.V
 import org.apache.sling.validation.api.ValidationResult;
 import org.apache.sling.validation.api.ValidationService;
 import org.apache.sling.validation.api.Validator;
-import

svn commit: r1640710 [1/2] - in /sling/trunk/bundles/extensions/models: api/src/main/java/org/apache/sling/models/annotations/injectorspecific/ api/src/main/java/org/apache/sling/models/spi/injectorsp

2014-11-20 Thread kwin
Author: kwin
Date: Thu Nov 20 10:18:08 2014
New Revision: 1640710

URL: http://svn.apache.org/r1640710
Log:
SLING-4155, consider default injection strategy also for injector-specific 
annotations

by that deprecate isOptional on all injector-specific annotations and introduce 
the new injectionStrategy attribute as a replacement.

Added:

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/InjectionStrategy.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/AbstractInjectAnnotationProcessor2.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessor2.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory2.java
Modified:

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/ChildResource.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/OSGiService.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/RequestAttribute.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/ResourcePath.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/ScriptVariable.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/Self.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/SlingObject.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/ValueMapValue.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/injectorspecific/package-info.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/AbstractInjectAnnotationProcessor.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessor.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/StaticInjectAnnotationProcessorFactory.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/package-info.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/BindingsInjector.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ChildResourceInjector.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/OSGiServiceInjector.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/RequestAttributeInjector.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ResourcePathInjector.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/SelfInjector.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/SlingObjectInjector.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValueMapInjector.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/AbstractInjectableElement.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/ConstructorParameter.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/InjectableElement.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/InjectableField.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/InjectableMethod.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/ModelClass.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/ModelClassConstructor.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/InjectorSpecificAnnotationTest.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl

svn commit: r1640710 [2/2] - in /sling/trunk/bundles/extensions/models: api/src/main/java/org/apache/sling/models/annotations/injectorspecific/ api/src/main/java/org/apache/sling/models/spi/injectorsp

2014-11-20 Thread kwin
Modified: 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/ResourceModelClassesTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/ResourceModelClassesTest.java?rev=1640710r1=1640709r2=1640710view=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/ResourceModelClassesTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/ResourceModelClassesTest.java
 Thu Nov 20 10:18:08 2014
@@ -51,6 +51,7 @@ import org.mockito.invocation.Invocation
 import org.mockito.runners.MockitoJUnitRunner;
 import org.mockito.stubbing.Answer;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.osgi.service.component.ComponentContext;
 
 @RunWith(MockitoJUnitRunner.class)
@@ -71,8 +72,12 @@ public class ResourceModelClassesTest {
 
 factory = new ModelAdapterFactory();
 factory.activate(componentCtx);
-factory.bindInjector(new ValueMapInjector(), new 
ServicePropertiesMap(2, 2));
+ValueMapInjector valueMapInjector = new ValueMapInjector();
+factory.bindInjector(valueMapInjector, new ServicePropertiesMap(2, 2));
 factory.bindInjector(new ChildResourceInjector(), new 
ServicePropertiesMap(1, 1));
+
+factory.bindInjectAnnotationProcessorFactory(valueMapInjector,
+Collections.String, Object 
singletonMap(Constants.SERVICE_ID, 2L));
 }
 
 @Test
@@ -205,10 +210,9 @@ public class ResourceModelClassesTest {
 }
 
 @Test
-public void testRequiredPropertyModelOptionalStrategyAvailable() {
+public void testRequiredPropertyMissingModelOptionalStrategy() {
 MapString, Object map = new HashMapString, Object();
 map.put(first, first-value);
-map.put(third, third-value);
 ValueMap vm = spy(new ValueMapDecorator(map));
 
 Resource res = mock(Resource.class);
@@ -217,14 +221,16 @@ public class ResourceModelClassesTest {
 ResourceModelWithRequiredFieldOptionalStrategy model = 
factory.getAdapter(res, ResourceModelWithRequiredFieldOptionalStrategy.class);
 assertNull(model);
 
-verify(vm).get(optional, String.class);
-verify(vm).get(required, String.class);
+verify(vm).get(optional1, String.class);
+verify(vm).get(required1, String.class);
 }
 
 @Test
-public void testRequiredPropertyModelOptionalStrategyNotAvailable() {
+public void testRequiredPropertyModelOptionalStrategy() {
 MapString, Object map = new HashMapString, Object();
-map.put(required, first-value);
+map.put(required1, required value);
+map.put(required2, required value);
+map.put(required3, required value);
 ValueMap vm = spy(new ValueMapDecorator(map));
 
 Resource res = mock(Resource.class);
@@ -232,9 +238,11 @@ public class ResourceModelClassesTest {
 
 ResourceModelWithRequiredFieldOptionalStrategy model = 
factory.getAdapter(res, ResourceModelWithRequiredFieldOptionalStrategy.class);
 assertNotNull(model);
-
-verify(vm).get(optional, String.class);
-verify(vm).get(required, String.class);
+assertEquals(required value, model.getRequired1());
+assertEquals(required value, model.getRequired2());
+
+verify(vm).get(optional1, String.class);
+verify(vm).get(required1, String.class);
 }
 
 @Test

Modified: 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/injectors/SelfInjectorTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/injectors/SelfInjectorTest.java?rev=1640710r1=1640709r2=1640710view=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/injectors/SelfInjectorTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/injectors/SelfInjectorTest.java
 Thu Nov 20 10:18:08 2014
@@ -28,6 +28,8 @@ import javax.servlet.http.HttpServletReq
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.models.annotations.DefaultInjectionStrategy;
+import org.apache.sling.models.annotations.Model;
 import org.apache.sling.models.annotations.injectorspecific.Self;
 import org.apache.sling.models.impl.model.ConstructorParameter;
 import 
org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory;
@@ -48,15 +50,19 @@ public class SelfInjectorTest {
 @Mock
 private AnnotatedElement annotatedElement;
 
+@Mock
+private 

svn commit: r1640931 - in /sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific: InjectAnnotationProcessorFactory.java InjectAnnotationProcessorFactory2

2014-11-21 Thread kwin
Author: kwin
Date: Fri Nov 21 15:11:36 2014
New Revision: 1640931

URL: http://svn.apache.org/r1640931
Log:
SLING-4155 deprecate InjectAnnotationProcessorFactory as well

Modified:

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory2.java

Modified: 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory.java?rev=1640931r1=1640930r2=1640931view=diff
==
--- 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory.java
 Fri Nov 21 15:11:36 2014
@@ -21,8 +21,9 @@ import java.lang.reflect.AnnotatedElemen
 /**
  * Factory for {@link InjectAnnotationProcessor} that is evaluated at runtime 
for each
  * sling model adaption and may depend on the adaptable. 
- * Use {@link StaticInjectAnnotationProcessorFactory} preferably
+ * @deprecated Use {@link StaticInjectAnnotationProcessorFactory} preferably 
or in case of a dependency to the adaptable {@link 
InjectAnnotationProcessorFactory2}
  */
+@Deprecated
 public interface InjectAnnotationProcessorFactory {
 
 /**

Modified: 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory2.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory2.java?rev=1640931r1=1640930r2=1640931view=diff
==
--- 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory2.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/injectorspecific/InjectAnnotationProcessorFactory2.java
 Fri Nov 21 15:11:36 2014
@@ -21,8 +21,8 @@ import java.lang.reflect.AnnotatedElemen
 /**
  * Factory for {@link InjectAnnotationProcessor2} that is evaluated at runtime 
for each
  * sling model adaption and may depend on the adaptable. 
+ * Use {@link StaticInjectAnnotationProcessorFactory} preferably.
  */
-
 public interface InjectAnnotationProcessorFactory2 {
 /**
  * 




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

2014-11-24 Thread kwin
Author: kwin
Date: Mon Nov 24 10:39:29 2014
New Revision: 1641359

URL: http://svn.apache.org/r1641359
Log:
SLING-2803 initial documentation

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

Modified: sling/site/trunk/content/documentation/bundles.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles.mdtext?rev=1641359r1=1641358r2=1641359view=diff
==
--- sling/site/trunk/content/documentation/bundles.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles.mdtext Mon Nov 24 10:39:29 
2014
@@ -6,6 +6,7 @@ Title: Bundles
 * [Internationalization Support (i18n)]({{ 
refs.internationalization-support-i18n.path }})
 * [Manipulating Content - The SlingPostServlet (servlets.post)]({{ 
refs.manipulating-content-the-slingpostservlet-servlets-post.path }})
 * [Rendering Content - Default GET servlets (servlets.get)]({{ 
refs.rendering-content-default-get-servlets.path }})
+* [Validation]({{ refs.validation.path }})
 
 ## Resource Providers
 

Added: sling/site/trunk/content/documentation/bundles/validation.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/validation.mdtext?rev=1641359view=auto
==
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (added)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Mon Nov 24 
10:39:29 2014
@@ -0,0 +1,76 @@
+Title: Sling Validation
+
+[TOC]
+
+Many Sling projects want to be able to validate both Resources and request 
parameters. Through the Sling Validation Bundle this is possible with the help 
of validation model resources which define validation rules for a certain 
resourceType.
+
+# Basic Usage
+To validate a resource one first needs to get a `ValidationModel` and then 
validate the resource with that model. Both functionalities are provided by the 
`ValidationService` OSGi service:
+
+::java
+ValidationModel validationModel = 
validationService.getValidationModel(resource);
+if (validationModel != null) {
+  ValidationResult result = validationService.validate(resource, 
validationModel);
+  if (!result.isValid()) {
+// give out validation messages from result.get
+  }
+}
+
+
+# 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*) **and**
+*  below a node named **validation**.
+ 
+The resources should have the following format:
+
+  Property/Node 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`
+`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 prefix. 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. | no | `false`
+`properties\propertyName\propertyMultiple` | Property | `Boolean` | If 
`true` only multivalue properties are allowed with the name `propertyName`. 
If not set or `false`, multi- and single-value properties are accepted.  | no | 
`false`  
+`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`.  | no | 
`regex=^[a-z]*$`  
+`children\resourceName` | Resource | - | This resource ensures that the 
resource with the name `resourceName` is there.  | no | `child1`
+`children\resourceName\properties\propertyName` | Resource | - | This 
resource ensures that the property with the name `propertyName` is there 
below the resource with the name `resourceName`. Below this node validators 
can be given like for properties on the root level. | no | `property1`
+
+
+# Usage in Sling Models
+Until there is native support in Sling Models

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

2014-11-24 Thread kwin
Author: kwin
Date: Mon Nov 24 11:12:04 2014
New Revision: 1641361

URL: http://svn.apache.org/r1641361
Log:
SLING-2803 added work in progress note

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=1641361r1=1641360r2=1641361view=diff
==
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Mon Nov 24 
11:12:04 2014
@@ -1,5 +1,9 @@
 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 Bundle this is possible with the help 
of validation model resources which define validation rules for a certain 
resourceType.




svn commit: r930292 - /websites/production/sling/content/

2014-11-24 Thread kwin
Author: kwin
Date: Mon Nov 24 11:12:59 2014
New Revision: 930292

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r930291, websites/staging/sling/trunk/content/



svn commit: r1641391 - /sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

2014-11-24 Thread kwin
Author: kwin
Date: Mon Nov 24 13:18:11 2014
New Revision: 1641391

URL: http://svn.apache.org/r1641391
Log:
SLING-4192, fix typo in ModelAdapterFactory

This closes #47

Modified:

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java?rev=1641391r1=1641390r2=1641391view=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
 Mon Nov 24 13:18:11 2014
@@ -144,7 +144,7 @@ public class ModelAdapterFactory impleme
 
 private volatile InjectAnnotationProcessorFactory[] 
sortedInjectAnnotationProcessorFactories = new 
InjectAnnotationProcessorFactory[0];
 
-@Reference(name = injectAnnotationProcessorFactory2, referenceInterface 
= InjectAnnotationProcessorFactory.class,
+@Reference(name = injectAnnotationProcessorFactory2, referenceInterface 
= InjectAnnotationProcessorFactory2.class,
 cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = 
ReferencePolicy.DYNAMIC)
 private final MapObject, InjectAnnotationProcessorFactory2 
injectAnnotationProcessorFactories2 = new TreeMapObject, 
InjectAnnotationProcessorFactory2();
 




svn commit: r1641407 - in /sling/trunk/contrib/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ core/src/main/java/org/apache/sling/validation/impl/ core/src/main/java/org/apa

2014-11-24 Thread kwin
Author: kwin
Date: Mon Nov 24 15:13:44 2014
New Revision: 1641407

URL: http://svn.apache.org/r1641407
Log:
SLING-4194 use ValueMap for the validator arguments instead of a simple map

Modified:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ParameterizedValidatorImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/ValidatorTypeUtilTest.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/DateValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/ExtendedStringValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/IntegerValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringArrayValidator.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringValidator.java

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java?rev=1641407r1=1641406r2=1641407view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java
 Mon Nov 24 15:13:44 2014
@@ -18,7 +18,7 @@
  */
 package org.apache.sling.validation.api;
 
-import java.util.Map;
+import org.apache.sling.api.resource.ValueMap;
 
 /**
  * Defines a validator instance with information about the type and the 
parameterization of the validator.
@@ -28,7 +28,7 @@ public interface ParameterizedValidator 
 
 public abstract Validator? getValidator();
 
-public abstract MapString, String getParameters();
+public abstract ValueMap getParameters();
 
 public abstract Class? getType();
 

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java?rev=1641407r1=1641406r2=1641407view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
 Mon Nov 24 15:13:44 2014
@@ -68,5 +68,5 @@ public interface Validator T {
  * @return validation error message if validation was not successful, 
{@code null} otherwise. In case an empty string is returned a generic 
validation error message is used.
  * @throws 
org.apache.sling.validation.api.exceptions.SlingValidationException if some 
expected arguments are missing from the arguments map
  */
-String validate(T data, ValueMap valueMap, MapString, String arguments) 
throws SlingValidationException;
+String validate(T data, ValueMap valueMap, ValueMap arguments) throws 
SlingValidationException;
 }

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ParameterizedValidatorImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ParameterizedValidatorImpl.java?rev=1641407r1=1641406r2=1641407view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ParameterizedValidatorImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ParameterizedValidatorImpl.java
 Mon Nov 24 15:13:44 2014
@@ -1,17 +1,16 @@
 package org.apache.sling.validation.impl;
 
-import java.util.Map;
-
+import org.apache.sling.api.resource.ValueMap;
 import

svn commit: r1641433 - /sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

2014-11-24 Thread kwin
Author: kwin
Date: Mon Nov 24 18:01:50 2014
New Revision: 1641433

URL: http://svn.apache.org/r1641433
Log:
SLING-4195 array initialized to wrong size due to typo

Modified:

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java?rev=1641433r1=1641432r2=1641433view=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
 Mon Nov 24 18:01:50 2014
@@ -883,14 +883,14 @@ public class ModelAdapterFactory impleme
 protected void bindInjectAnnotationProcessorFactory2(final 
InjectAnnotationProcessorFactory2 factory, final MapString, Object props) {
 synchronized (injectAnnotationProcessorFactories2) {
 
injectAnnotationProcessorFactories2.put(ServiceUtil.getComparableForServiceRanking(props),
 factory);
-sortedInjectAnnotationProcessorFactories2 = 
injectAnnotationProcessorFactories2.values().toArray(new 
InjectAnnotationProcessorFactory2[injectAnnotationProcessorFactories.size()]);
+sortedInjectAnnotationProcessorFactories2 = 
injectAnnotationProcessorFactories2.values().toArray(new 
InjectAnnotationProcessorFactory2[injectAnnotationProcessorFactories2.size()]);
 }
 }
 
 protected void unbindInjectAnnotationProcessorFactory2(final 
InjectAnnotationProcessorFactory2 factory, final MapString, Object props) {
 synchronized (injectAnnotationProcessorFactories2) {
 
injectAnnotationProcessorFactories2.remove(ServiceUtil.getComparableForServiceRanking(props));
-sortedInjectAnnotationProcessorFactories2 = 
injectAnnotationProcessorFactories2.values().toArray(new 
InjectAnnotationProcessorFactory2[injectAnnotationProcessorFactories.size()]);
+sortedInjectAnnotationProcessorFactories2 = 
injectAnnotationProcessorFactories2.values().toArray(new 
InjectAnnotationProcessorFactory2[injectAnnotationProcessorFactories2.size()]);
 }
 }
 




svn commit: r1642166 - in /sling/trunk/contrib/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ core/src/main/java/org/apache/sling/validation/impl/ core/src/main/java/org/apa

2014-11-27 Thread kwin
Author: kwin
Date: Thu Nov 27 14:52:29 2014
New Revision: 1642166

URL: http://svn.apache.org/r1642166
Log:
SLING-4011, allow pattern matching on properties and child resources

also some refactoring of the ValidationServiceImplTest

Modified:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ResourcePropertyImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java?rev=1642166r1=1642165r2=1642166view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java
 Thu Nov 27 14:52:29 2014
@@ -18,7 +18,9 @@
  */
 package org.apache.sling.validation.api;
 
+import java.util.List;
 import java.util.Set;
+import java.util.regex.Pattern;
 
 /**
  * Defines the validation rules for a child resource, allowing {@link 
ValidationModel}s to be applied to {@link
@@ -27,11 +29,19 @@ import java.util.Set;
 public interface ChildResource {
 
 /**
- * Return this resource's name.
+ * Return this resource's name. This must match the name of the child 
resource which is validated through this section of the validation model.
+ * Either this method or {@link getNamePattern} must not return {@code 
null}
  *
- * @return the name
+ * @return the name (if one is set) or {@code null)
  */
 String getName();
+
+/**
+ * Returns this resource's name pattern. Either this method or {@link 
getName} must not return {@code null}
+ *
+ * @return the name pattern (if one is set) or {@code null)
+ */
+Pattern getNamePattern();
 
 /**
  * Returns the properties this child resource is expected to have.
@@ -39,4 +49,10 @@ public interface ChildResource {
  * @return the properties set
  */
 SetResourceProperty getProperties();
+
+/**
+ * Returns the child resources of this part of the Validation Model
+ * @return child resources. Never {@code null}.
+ */
+ListChildResource getChildren();
 }

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java?rev=1642166r1=1642165r2=1642166view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java
 Thu Nov 27 14:52:29 2014
@@ -19,6 +19,7 @@
 package org.apache.sling.validation.api;
 
 import java.util.List;
+import java.util.regex.Pattern;
 
 /**
  * Describes a {@link org.apache.sling.api.resource.Resource} property.
@@ -27,10 +28,18 @@ public interface ResourceProperty {
 
 /**
  * Returns the name of this property.
+ * Either this method or {@link getNamePattern} must not return {@code 
null}
  *
- * @return the name
+ * @return the name or {@code null}
  */
 String getName();
+
+/**
+ * Returns the name pattern for this property. Either this method or 
{@link getName} must not return {@code null}
+ *
+ * @return the name pattern (if one is set) or {@code null)
+ */
+Pattern getNamePattern();
 
 /**
  * Returns {@code true} if this property is expected to be a multiple 
property (e.g. array of values).

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib

svn commit: r1642169 - /sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java

2014-11-27 Thread kwin
Author: kwin
Date: Thu Nov 27 15:00:06 2014
New Revision: 1642169

URL: http://svn.apache.org/r1642169
Log:
SLING-4011, rename property name-regex to nameRegex to be more in line with 
other property names

Modified:

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java?rev=1642169r1=1642168r2=1642169view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java
 Thu Nov 27 15:00:06 2014
@@ -33,5 +33,5 @@ public final class Constants {
 public static final String VALIDATORS = validators;
 public static final String VALIDATOR_ARGUMENTS = validatorArguments;
 public static final String CHILDREN = children;
-public static final String NAME_REGEX = name-regex;
+public static final String NAME_REGEX = nameRegex;
 }




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

2014-11-27 Thread kwin
Author: kwin
Date: Thu Nov 27 15:15:47 2014
New Revision: 1642173

URL: http://svn.apache.org/r1642173
Log:
SLING-4011 document changes for pattern matching of properties and 
childresources

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=1642173r1=1642172r2=1642173view=diff
==
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Thu Nov 27 
15:15:47 2014
@@ -33,13 +33,15 @@ The resources should have the following 
  | --- | -- | -| -
 `sling:resourceType` | Property | `String` | Always `sling/validation/model`, 
otherwise node 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. | yes | 
`my/own/resourcetype` 
-`applicablePaths` | Property |  `String[]` | 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. | no | 
`/content/mysite`
-`properties\propertyName` | Resource | - | This resource ensures that the 
property with the name `propertyName` is there. | no | `false`
-`properties\propertyName\propertyMultiple` | Property | `Boolean` | If 
`true` only multivalue properties are allowed with the name `propertyName`. 
If not set or `false`, multi- and single-value properties are accepted.  | no | 
`false`  
+`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\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`.  | no | 
`regex=^[a-z]*$`  
-`children\resourceName` | Resource | - | This resource ensures that the 
resource with the name `resourceName` is there.  | no | `child1`
-`children\resourceName\properties\propertyName` | Resource | - | This 
resource ensures that the property with the name `propertyName` is there 
below the resource with the name `resourceName`. Below this node validators 
can be given like for properties on the root level. | no | `property1`
+`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\properties` | Resource | - | The properties can be 
configured on the child level in the same way as on the root level. | no | -
 
 
 # Usage in Sling Models
@@ -72,7 +74,7 @@ The Sling validation bundle currently co
 To write a validator one needs to implement the `Validator` interface in an 
OSGi service

svn commit: r930780 - /websites/production/sling/content/

2014-11-27 Thread kwin
Author: kwin
Date: Thu Nov 27 15:17:18 2014
New Revision: 930780

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r930779, websites/staging/sling/trunk/content/



svn commit: r1642306 - in /sling/trunk/contrib/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ core/src/main/java/org/apache/sling/validation/impl/ core/src/main/java/org/apa

2014-11-28 Thread kwin
Author: kwin
Date: Fri Nov 28 14:50:39 2014
New Revision: 1642306

URL: http://svn.apache.org/r1642306
Log:
SLING-4013 allow optional properties/child resources within validation model

Modified:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/Constants.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ResourcePropertyImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java?rev=1642306r1=1642305r2=1642306view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java
 Fri Nov 28 14:50:39 2014
@@ -44,6 +44,13 @@ public interface ChildResource {
 Pattern getNamePattern();
 
 /**
+ * Returns {@code true} if at least one resource matching the 
name/namePattern is required.
+ * 
+ * @return {@code true} if the resource is required, {@code false} 
otherwise
+ */
+boolean isRequired();
+
+/**
  * Returns the properties this child resource is expected to have.
  *
  * @return the properties set

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java?rev=1642306r1=1642305r2=1642306view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java
 Fri Nov 28 14:50:39 2014
@@ -49,6 +49,13 @@ public interface ResourceProperty {
 boolean isMultiple();
 
 /**
+ * Returns {@code true} if at least one property matching the 
name/namePattern is required.
+ * 
+ * @return {@code true} if the property is required, {@code false} 
otherwise
+ */
+boolean isRequired();
+
+/**
  * Returns a list of {@link ParameterizedValidator}s which should be 
applied on this property.
  *
  * @return the list of validators

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java?rev=1642306r1=1642305r2=1642306view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java
 Fri Nov 28 14:50:39 2014
@@ -8,6 +8,7 @@ import java.util.regex.PatternSyntaxExce
 
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.commons.osgi.PropertiesUtil;
 import org.apache.sling.validation.api.ChildResource;
 import org.apache.sling.validation.api.ResourceProperty;
 import org.apache.sling.validation.api.Validator;
@@ -22,6 +23,7 @@ public class ChildResourceImpl implement
 private final Pattern namePattern;
 private final SetResourceProperty properties;
 private final ListChildResource children;
+private final boolean isRequired;
 
 public ChildResourceImpl(Resource modelResource, Resource childResource, 
MapString, Validator? validatorsMap, ListChildResource children) {
 String root = modelResource.getPath();
@@ -46,7 +48,7 @@ public class ChildResourceImpl implement
 name

svn commit: r930881 - /websites/production/sling/content/

2014-11-28 Thread kwin
Author: kwin
Date: Fri Nov 28 15:01:56 2014
New Revision: 930881

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r930880, websites/staging/sling/trunk/content/



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

2014-11-28 Thread kwin
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=1642308r1=1642307r2=1642308view=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 | -
 
 




svn commit: r1643198 - in /sling/trunk/contrib/extensions/validation/core/src: main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java test/java/org/apache/sling/validation/impl/Validati

2014-12-05 Thread kwin
Author: kwin
Date: Fri Dec  5 08:51:57 2014
New Revision: 1643198

URL: http://svn.apache.org/viewvc?rev=1643198view=rev
Log:
SLING-4214, either children or properties must be set on each Validation model

Modified:

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1643198r1=1643197r2=1643198view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Fri Dec  5 08:51:57 2014
@@ -331,25 +331,25 @@ public class ValidationServiceImpl imple
 String[] applicablePaths = 
PropertiesUtil.toStringArray(validationModelProperties.get(Constants.APPLICABLE_PATHS,
 String[].class));
 Resource r = model.getChild(Constants.PROPERTIES);
-if (r != null) {
-SetResourceProperty resourceProperties = 
JCRBuilder.buildProperties(validators, r);
-if (!resourceProperties.isEmpty()) {
-ListChildResource children = 
JCRBuilder.buildChildren(model, model, validators);
-vm = new JCRValidationModel(jcrPath, 
resourceProperties, validatedResourceType, applicablePaths, children);
-modelsForResourceType = 
validationModelsCache.get(validatedResourceType);
-/**
- * if the modelsForResourceType is null the 
canAcceptModel will return true: performance optimisation so that
- * the Trie is created only if the model is 
accepted
- */
-
-if (canAcceptModel(vm, searchPath, 
searchPaths, modelsForResourceType)) {
-if (modelsForResourceType == null) {
-modelsForResourceType = new 
TrieJCRValidationModel();
-
validationModelsCache.put(validatedResourceType, modelsForResourceType);
-}
-for (String applicablePath : 
vm.getApplicablePaths()) {
-
modelsForResourceType.insert(applicablePath, vm);
-}
+SetResourceProperty resourceProperties = 
JCRBuilder.buildProperties(validators, r);
+ListChildResource children = 
JCRBuilder.buildChildren(model, model, validators);
+if (resourceProperties.isEmpty()  
children.isEmpty()) {
+LOG.warn(Incomplete validation model resource {}. 
Neither children nor properties set., model.getPath());
+} else {
+vm = new JCRValidationModel(jcrPath, 
resourceProperties, validatedResourceType, applicablePaths, children);
+modelsForResourceType = 
validationModelsCache.get(validatedResourceType);
+/**
+ * if the modelsForResourceType is null the 
canAcceptModel will return true: performance
+ * optimisation so that the Trie is created only 
if the model is accepted
+ */
+
+if (canAcceptModel(vm, searchPath, searchPaths, 
modelsForResourceType)) {
+if (modelsForResourceType == null) {
+modelsForResourceType = new 
TrieJCRValidationModel();
+
validationModelsCache.put(validatedResourceType, modelsForResourceType);
+}
+for (String applicablePath : 
vm.getApplicablePaths()) {
+
modelsForResourceType.insert(applicablePath, vm);
 }
 }
 }

Modified: 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling

svn commit: r1643291 - in /sling/trunk/contrib/extensions/validation/core/src: main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java test/java/org/apache/sling/validation/impl/Validati

2014-12-05 Thread kwin
Author: kwin
Date: Fri Dec  5 14:12:28 2014
New Revision: 1643291

URL: http://svn.apache.org/r1643291
Log:
SLING-4221 fix for AIOOBE in case of empty multivalue properties

Modified:

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1643291r1=1643290r2=1643291view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Fri Dec  5 14:12:28 2014
@@ -417,7 +417,7 @@ public class ValidationServiceImpl imple
 
 Object[] typedValue = (Object[])valueMap.get(property, type);
 // see https://issues.apache.org/jira/browse/SLING-4178 for why 
the second check is necessary
-if (typedValue == null || typedValue[0] == null) {
+if (typedValue == null || (typedValue.length  0  typedValue[0] 
== null)) {
 // here the missing required property case was already treated 
in validateValueMap
 result.addFailureMessage(property, Property was expected to 
be of type ' + validator.getType() + ' but cannot be converted to that type. 
);
 return;

Modified: 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java?rev=1643291r1=1643290r2=1643291view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 Fri Dec  5 14:12:28 2014
@@ -278,6 +278,48 @@ public class ValidationServiceImplTest {
 }
 
 @Test()
+public void testValueMapWithMissingField() throws Exception {
+
validationService.validators.put(org.apache.sling.validation.impl.validators.RegexValidator,
 new RegexValidator());
+
+TestProperty property = new TestProperty(field1);
+
property.addValidator(org.apache.sling.validation.impl.validators.RegexValidator,
 regex=.*);
+TestProperty property2 = new TestProperty(field2);
+
property2.addValidator(org.apache.sling.validation.impl.validators.RegexValidator,
 regex=.*);
+TestProperty property3 = new TestProperty(field3);
+
property3.addValidator(org.apache.sling.validation.impl.validators.RegexValidator,
 regex=.*);
+TestProperty property4 = new TestProperty(field4);
+
property3.addValidator(org.apache.sling.validation.impl.validators.RegexValidator,
 regex=.*);
+ResourceResolver rr = rrf.getAdministrativeResourceResolver(null);
+Resource model1 = null;
+try {
+if (rr != null) {
+model1 = createValidationModelResource(rr, 
libsValidatorsRoot.getPath(), testValidationModel1, sling/validation/test,
+new String[]{/apps/validation}, property, property2, 
property3, property4);
+}
+ValidationModel vm = 
validationService.getValidationModel(sling/validation/test, 
/apps/validation/1/resource);
+// this should not be detected as missing property
+HashMapString, Object hashMap = new HashMapString, Object() {{
+put(field1, new String[]{});
+put(field2, new String[]{null});
+put(field3, );
+}};
+ValueMap map = new ValueMapDecorator(hashMap);
+ValidationResult vr = validationService.validate(map, vm);
+MapString, ListString expectedFailureMessages = new 
HashMapString, ListString();
+expectedFailureMessages.put(field4, Arrays.asList(Missing 
required property.));
+Assert.assertThat(vr.getFailureMessages().entrySet(), 
Matchers.equalTo(expectedFailureMessages.entrySet()));
+} finally {
+if (model1 != null) {
+rr.delete(model1);
+}
+if (rr != null) {
+rr.commit();
+rr.close

svn commit: r1644056 - /sling/trunk/bundles/extensions/models/integration-tests/pom.xml

2014-12-09 Thread kwin
Author: kwin
Date: Tue Dec  9 14:21:14 2014
New Revision: 1644056

URL: http://svn.apache.org/r1644056
Log:
SLING-4226 - use latest release of the launchpad (which does not include Sling 
Models itself) and use latest testing tools (to prevent IMSE in case of 
keepJarRunning)

Modified:
sling/trunk/bundles/extensions/models/integration-tests/pom.xml

Modified: sling/trunk/bundles/extensions/models/integration-tests/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/pom.xml?rev=1644056r1=1644055r2=1644056view=diff
==
--- sling/trunk/bundles/extensions/models/integration-tests/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/integration-tests/pom.xml Tue Dec  9 
14:21:14 2014
@@ -249,10 +249,11 @@
 version1.0.8/version
 scopeprovided/scope
 /dependency
+!-- use 1.0.9-SNAPSHOT due to 
https://issues.apache.org/jira/browse/SLING-3819 --
 dependency
 groupIdorg.apache.sling/groupId
 artifactIdorg.apache.sling.testing.tools/artifactId
-version1.0.8/version
+version1.0.9-SNAPSHOT/version
 scopeprovided/scope
 /dependency
 dependency
@@ -315,11 +316,12 @@
 artifactIdorg.apache.sling.commons.json/artifactId
 version2.0.6/version
 /dependency
+!-- use latest release version which does no itself include Sling 
Model due to issues with redeployment (see 
https://issues.apache.org/jira/browse/SLING-4226) --
 dependency
 groupIdorg.apache.sling/groupId
 artifactIdorg.apache.sling.launchpad/artifactId
 classifierstandalone/classifier
-version8-SNAPSHOT/version
+version7/version
 /dependency
 dependency
 groupIdorg.slf4j/groupId




svn commit: r1644069 - in /sling/trunk/bundles/extensions/models: api/ api/src/main/java/org/apache/sling/models/annotations/ api/src/main/java/org/apache/sling/models/factory/ impl/ impl/src/main/jav

2014-12-09 Thread kwin
Author: kwin
Date: Tue Dec  9 14:46:28 2014
New Revision: 1644069

URL: http://svn.apache.org/r1644069
Log:
SLING-4161 support Sling Validation by a new field on the Model annotation

The dependency to Sling Validation is optional (i.e. Sling Models still work 
even if  Sling Validation is not deployed)

Added:

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/ValidationStrategy.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/InvalidResourceException.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/InvalidValidationModelException.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelClassException.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/validation/

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/validation/ModelValidation.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/validation/ModelValidationImpl.java
Removed:

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/InvalidModelException.java
Modified:
sling/trunk/bundles/extensions/models/api/pom.xml

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/Model.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/package-info.java

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java
sling/trunk/bundles/extensions/models/impl/pom.xml

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/Result.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/ConstructorTest.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/InvalidAdaptationsTest.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/PostConstructTest.java

Modified: sling/trunk/bundles/extensions/models/api/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/pom.xml?rev=1644069r1=1644068r2=1644069view=diff
==
--- sling/trunk/bundles/extensions/models/api/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/api/pom.xml Tue Dec  9 14:46:28 2014
@@ -49,6 +49,7 @@
 configuration
instructions
 
Export-Packageorg.apache.sling.models.*,javax.inject;version=0/Export-Package
+
DynamicImport-Packageorg.apache.sling.validation.api.*/DynamicImport-Package
/instructions
 /configuration
 /plugin
@@ -61,5 +62,18 @@
 version1/version
 scopeprovided/scope
 /dependency
+dependency
+groupIdorg.apache.sling/groupId
+artifactIdorg.apache.sling.validation.api/artifactId
+version1.0.0-SNAPSHOT/version
+scopeprovided/scope
+optionaltrue/optional
+/dependency
+dependency
+groupIdcommons-lang/groupId
+artifactIdcommons-lang/artifactId
+version2.5/version
+scopeprovided/scope
+/dependency
 /dependencies
 /project

Modified: 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/Model.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/Model.java?rev=1644069r1=1644068r2=1644069view=diff
==
--- 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/Model.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/Model.java
 Tue Dec  9 14:46:28 2014
@@ -50,5 +50,14 @@ public @interface Model {
  * @return Condition that is displayed in the felix console adapter plugin
  */
 public String condition() default ;
+
+/**
+ * 
+ * @return {@link ValidationStrategy.DISABLED} in case the model should 
not be validated through Sling Validation (default),
+ *  {@link ValidationStrategy.REQUIRED} in case the model should be 
validated and if no appropriate Sling Validation Model exists it is considered 
invalid or
+ *  {@link ValidationStrategy.OPTIONAL} in case the model should

svn commit: r1644385 - in /sling/site/trunk/content/documentation/bundles: models.mdtext validation.mdtext

2014-12-10 Thread kwin
Author: kwin
Date: Wed Dec 10 12:42:57 2014
New Revision: 1644385

URL: http://svn.apache.org/r1644385
Log:
SLING-3709 - document ModelFactory
SLING-4161 - extend documentation around validation

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

Modified: sling/site/trunk/content/documentation/bundles/models.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/models.mdtext?rev=1644385r1=1644384r2=1644385view=diff
==
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Wed Dec 10 
12:42:57 2014
@@ -67,6 +67,7 @@ can be listed in a comma-separated list
 /Sling-Model-Packages
 
 # Client Code
+## adaptTo()
 
 Client code doesn't need to be aware that Sling Models is being used. It just 
uses the Sling Adapter framework:
 
@@ -84,6 +85,20 @@ Or
${sling:adaptTo(resource, 'org.apache.sling.models.it.models.MyModel')}
 
 As with other AdapterFactories, if the adaptation can't be made for any 
reason, `adaptTo()` returns null.
+## ModelFactory (since 1.2.0)
+
+Since Sling Models 1.2.0 
([SLING-3709](https://issues.apache.org/jira/browse/SLING-3709)) there is 
another way of instanciating models. The OSGi service `ModelFactory` provides a 
method for instanciating a model that throws exceptions in case the model 
cannot be instanciated. That way `null` checks are not necessary.
+
+::java
+   try {
+MyModel model = modelFactory.createModel(resource, MyModel.class);
+} catch (Exception e) {
+// give out error message that the model could not be instanciated. 
+// The exception contains further information. 
+// See the javadoc of the ModelFactory for which Exception can be 
expected here
+}
+
+In addition `ModelFactory` provides methods for checking whether a given class 
is a model at all (having the model annotation) or whether a class can be 
adapted from a given adaptable.
 
 # Other Options
 ## Names
@@ -294,6 +309,20 @@ Constructor injection is supported for t
 private String propertyName;
 }
 
+## a name=validation/aSling Validation (since 1.2.0)
+*See also [SLING-4161](https://issues.apache.org/jira/browse/SLING-4161)*
+
+You can use the attribute `validation` on the Model annotation to enable 
validation of the resource being used by the Sling model through [Sling 
Validation]({{ refs.validation.path }}). That field supports three different 
values:
+
+  Value |  Description |  Invalid validation model |  No validation model 
found |  Resource invalid according to model
+  - | --- | - | -| -
+ `DISABLED` (default) | don't validate the resource bound to the Model | Model 
instanciated | Model instanciated  | Model instanciated  
+ `REQUIRED` | enforce validation of the resource bound to the Model | Model 
not instanciated | Model not instanciated | Model not instanciated
+ `OPTIONAL` | validate the resource bound to the Model (if a validation model 
is found) | Model not instanciated | Model instanciated | Model not instanciated
+
+In case the model is not instanciated an appropriate error message is logged 
(if the model is instanciated through the `adaptTo()` method or an appropriate 
exception is thrown if the model is instanciated through 
`ModelFactory.createModel()`).
+Validation is only supported on models which are adapted from a `Resource` and 
if the Sling Validation Bundle is deployed.
+
 # Custom Injectors
 
 To create a custom injector, simply implement the 
`org.apache.sling.models.spi.Injector` interface and register your 
implementation with the OSGi service registry. Please refer to the standard 
injectors in 
[Subversion](http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/)
 for examples.
@@ -344,7 +373,7 @@ Sling Object   | `sling-object`
 
 # Injector-specific Annotations (Since Sling Models Impl 1.0.6)
 
-See also  [SLING-3499](https://issues.apache.org/jira/browse/SLING-3499)
+*See also  [SLING-3499](https://issues.apache.org/jira/browse/SLING-3499)*
 
 Sometimes it is desirable to use customized annotations which aggregate the 
standard annotations described above. This will generally have
 the following advantages over using the standard annotations:

Modified: sling/site/trunk/content/documentation/bundles/validation.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/validation.mdtext?rev=1644385r1=1644384r2=1644385view=diff
==
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Wed Dec 10 
12:42

svn commit: r1644388 - /sling/site/trunk/content/documentation/bundles/models.mdtext

2014-12-10 Thread kwin
Author: kwin
Date: Wed Dec 10 13:02:24 2014
New Revision: 1644388

URL: http://svn.apache.org/r1644388
Log:
fix anchor

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

Modified: sling/site/trunk/content/documentation/bundles/models.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/models.mdtext?rev=1644388r1=1644387r2=1644388view=diff
==
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Wed Dec 10 
13:02:24 2014
@@ -309,8 +309,8 @@ Constructor injection is supported for t
 private String propertyName;
 }
 
-## a name=validation/aSling Validation (since 1.2.0)
-*See also [SLING-4161](https://issues.apache.org/jira/browse/SLING-4161)*
+## Sling Validation (since 1.2.0)
+a name=validation*See also 
[SLING-4161](https://issues.apache.org/jira/browse/SLING-4161)*/a
 
 You can use the attribute `validation` on the Model annotation to enable 
validation of the resource being used by the Sling model through [Sling 
Validation]({{ refs.validation.path }}). That field supports three different 
values:
 




svn commit: r932176 - /websites/production/sling/content/

2014-12-10 Thread kwin
Author: kwin
Date: Wed Dec 10 13:20:56 2014
New Revision: 932176

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r932175, websites/staging/sling/trunk/content/



svn commit: r1644472 - /sling/site/trunk/content/documentation/bundles/models.mdtext

2014-12-10 Thread kwin
Author: kwin
Date: Wed Dec 10 16:44:21 2014
New Revision: 1644472

URL: http://svn.apache.org/r1644472
Log:
fix typos

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

Modified: sling/site/trunk/content/documentation/bundles/models.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/models.mdtext?rev=1644472r1=1644471r2=1644472view=diff
==
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Wed Dec 10 
16:44:21 2014
@@ -87,13 +87,13 @@ Or
 As with other AdapterFactories, if the adaptation can't be made for any 
reason, `adaptTo()` returns null.
 ## ModelFactory (since 1.2.0)
 
-Since Sling Models 1.2.0 
([SLING-3709](https://issues.apache.org/jira/browse/SLING-3709)) there is 
another way of instanciating models. The OSGi service `ModelFactory` provides a 
method for instanciating a model that throws exceptions in case the model 
cannot be instanciated. That way `null` checks are not necessary.
+Since Sling Models 1.2.0 
([SLING-3709](https://issues.apache.org/jira/browse/SLING-3709)) there is 
another way of instantiating models. The OSGi service `ModelFactory` provides a 
method for instantiating a model that throws exceptions this is not possible. 
That way `null` checks are not necessary.
 
 ::java
try {
 MyModel model = modelFactory.createModel(resource, MyModel.class);
 } catch (Exception e) {
-// give out error message that the model could not be instanciated. 
+// give out error message that the model could not be instantiated. 
 // The exception contains further information. 
 // See the javadoc of the ModelFactory for which Exception can be 
expected here
 }
@@ -316,11 +316,11 @@ You can use the attribute `validation` o
 
   Value |  Description |  Invalid validation model |  No validation model 
found |  Resource invalid according to model
   - | --- | - | -| -
- `DISABLED` (default) | don't validate the resource bound to the Model | Model 
instanciated | Model instanciated  | Model instanciated  
- `REQUIRED` | enforce validation of the resource bound to the Model | Model 
not instanciated | Model not instanciated | Model not instanciated
- `OPTIONAL` | validate the resource bound to the Model (if a validation model 
is found) | Model not instanciated | Model instanciated | Model not instanciated
+ `DISABLED` (default) | don't validate the resource bound to the Model | Model 
instantiated | Model instantiated  | Model instantiated  
+ `REQUIRED` | enforce validation of the resource bound to the Model | Model 
not instantiated | Model not instantiated | Model not instantiated
+ `OPTIONAL` | validate the resource bound to the Model (if a validation model 
is found) | Model not instantiated | Model instantiated | Model not instantiated
 
-In case the model is not instanciated an appropriate error message is logged 
(if the model is instanciated through the `adaptTo()` method or an appropriate 
exception is thrown if the model is instanciated through 
`ModelFactory.createModel()`).
+In case the model is not instantiated an appropriate error message is logged 
(if `adaptTo()` is used) or an appropriate exception is thrown (if 
`ModelFactory.createModel()` is used).
 Validation is only supported on models which are adapted from a `Resource` and 
if the Sling Validation Bundle is deployed.
 
 # Custom Injectors




svn commit: r932210 - /websites/production/sling/content/

2014-12-10 Thread kwin
Author: kwin
Date: Wed Dec 10 16:44:56 2014
New Revision: 932210

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r932209, websites/staging/sling/trunk/content/



svn commit: r1645995 - /sling/trunk/bundles/extensions/models/integration-tests/pom.xml

2014-12-16 Thread kwin
Author: kwin
Date: Tue Dec 16 16:14:10 2014
New Revision: 1645995

URL: http://svn.apache.org/r1645995
Log:
SLING-4226 depend on the release version of the launchpad (to speed things up)

Modified:
sling/trunk/bundles/extensions/models/integration-tests/pom.xml

Modified: sling/trunk/bundles/extensions/models/integration-tests/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/pom.xml?rev=1645995r1=1645994r2=1645995view=diff
==
--- sling/trunk/bundles/extensions/models/integration-tests/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/integration-tests/pom.xml Tue Dec 16 
16:14:10 2014
@@ -320,7 +320,7 @@
 groupIdorg.apache.sling/groupId
 artifactIdorg.apache.sling.launchpad/artifactId
 classifierstandalone/classifier
-version8-SNAPSHOT/version
+version7/version
 /dependency
 dependency
 groupIdorg.slf4j/groupId




svn commit: r1657348 - /sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java

2015-02-04 Thread kwin
Author: kwin
Date: Wed Feb  4 17:56:48 2015
New Revision: 1657348

URL: http://svn.apache.org/r1657348
Log:
SLING-4387 clarify javadoc

Modified:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java?rev=1657348r1=1657347r2=1657348view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
 Wed Feb  4 17:56:48 2015
@@ -81,7 +81,8 @@ public interface ValidationService {
  * @param resource the root resource which is validated (including all its 
children resources having a valid resource type)
  * @param enforceValidation if {@code true} will throw an 
IllegalArgumentException in case a validation model could not be found for a 
(not-ignored) resource type
  * set on one of the resource's children. 
- * @param ignoredResourceTypes a set of resource types which should not be 
validated (e.g. nt:unstructured, the default primary node type in case of 
underlying an JCR for nodes not having a sling:resourceType property being set)
+ * @param ignoredResourceTypes a set of resource types which should not be 
validated (e.g. nt:unstructured, the default primary node type in case of 
underlying an JCR for nodes not having a sling:resourceType property being set).
+ * May be {@code null} to not ignore any resource types.
  * @return the aggregated {@link ValidationResult} over all child resource 
validations
  * @throws IllegalStateException in case an invalid validation model was 
found
  * @throws IllegalArgumentException in case resourceType is absolute but 
outside of the search paths or if no validation model could be found (and 
enforceValidation is {@code true}).




svn commit: r1657326 - /sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java

2015-02-04 Thread kwin
Author: kwin
Date: Wed Feb  4 17:10:05 2015
New Revision: 1657326

URL: http://svn.apache.org/r1657326
Log:
SLING-4387 now really skip nodes from validation if they don't have a connected 
model

Modified:

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java?rev=1657326r1=1657325r2=1657326view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
 Wed Feb  4 17:10:05 2015
@@ -53,6 +53,7 @@ public class ValidationResourceVisitor e
 if (enforceValidation) {
 throw new IllegalArgumentException(No model for resource 
type  + resource.getResourceType() +  found.);
 }
+return;
 }
 // the relative path must end with a slash and not start with a 
slash
 final String relativePath;




svn commit: r1657324 - in /sling/trunk/contrib/extensions/validation/core/src: main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java test/java/org/apache/sling/validation/impl/Validati

2015-02-04 Thread kwin
Author: kwin
Date: Wed Feb  4 17:07:28 2015
New Revision: 1657324

URL: http://svn.apache.org/r1657324
Log:
SLING-4387 fix handling of enforceValidation and test case for that

Modified:

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1657324r1=1657323r2=1657324view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Wed Feb  4 17:07:28 2015
@@ -228,7 +228,7 @@ public class ValidationServiceImpl imple
 if (ignoredResourceTypes == null) {
 ignoredResourceTypes = Collections.emptySet();
 }
-ValidationResourceVisitor visitor = new 
ValidationResourceVisitor(this, resource.getPath(), true, ignoredResourceTypes);
+ValidationResourceVisitor visitor = new 
ValidationResourceVisitor(this, resource.getPath(), enforceValidation, 
ignoredResourceTypes);
 visitor.accept(resource);
 return visitor.getResult();
 }

Modified: 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java?rev=1657324r1=1657323r2=1657324view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 Wed Feb  4 17:07:28 2015
@@ -793,6 +793,42 @@ public class ValidationServiceImplTest {
 }
 }
 
+@Test()
+public void 
testValidateAllResourceTypesInResourceWithMissingValidatorAndNoEnforcement() 
throws Exception {
+
validationService.validators.put(org.apache.sling.validation.impl.validators.RegexValidator,
+new RegexValidator());
+
+TestProperty property = new TestProperty(field1);
+
property.addValidator(org.apache.sling.validation.impl.validators.RegexValidator);
+Resource model1 = null;
+Resource resource = null;
+try {
+model1 = createValidationModelResource(rr, 
libsValidatorsRoot.getPath(), testValidationModel1,
+sling/validation/test, new String[] { /content }, 
property);
+resource = ResourceUtil.getOrCreateResource(rr, 
/content/testpage, sling/validation/test,
+JcrConstants.NT_UNSTRUCTURED, true);
+ModifiableValueMap values = 
resource.adaptTo(ModifiableValueMap.class);
+values.put(field2, somvalue);
+Resource grandChildResource = ResourceUtil.getOrCreateResource(rr, 
/content/testpage/par/testpar,
+sling/validation/test2, JcrConstants.NT_UNSTRUCTURED, 
true);
+values = grandChildResource.adaptTo(ModifiableValueMap.class);
+values.put(field2, somvalue);
+ValidationResult vr = 
validationService.validateAllResourceTypesInResource(resource, false,
+Collections.singleton(JcrConstants.NT_UNSTRUCTURED));
+// should not fail 
+MapString, ListString expectedFailureMessages = new 
HashMapString, ListString();
+expectedFailureMessages.put(field1, Arrays.asList(Missing 
required property.));
+Assert.assertThat(vr.getFailureMessages().entrySet(), 
Matchers.equalTo(expectedFailureMessages.entrySet()));
+} finally {
+if (resource != null) {
+rr.delete(resource);
+}
+if (model1 != null) {
+rr.delete(model1);
+}
+}
+}
+
 @Test
 public void testGetRelativeResourcePath() {
 // return relative paths unmodified




svn commit: r1656755 - in /sling/trunk/contrib/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ core/src/main/java/org/apache/sling/validation/impl/ core/src/test/java/org/apa

2015-02-03 Thread kwin
Author: kwin
Date: Tue Feb  3 15:13:12 2015
New Revision: 1656755

URL: http://svn.apache.org/r1656755
Log:
SLING-4387 support recursive validation of resources

cleanup of tests and mocked resource

Added:

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
Modified:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/setup/MockedResource.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/setup/MockedResourceResolver.java

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java?rev=1656755r1=1656754r2=1656755view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
 Tue Feb  3 15:13:12 2015
@@ -18,6 +18,8 @@
  */
 package org.apache.sling.validation.api;
 
+import java.util.Set;
+
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ValueMap;
@@ -46,8 +48,9 @@ public interface ValidationService {
  * @param resource the resource for which to obtain a validation model
  * @return a {@code ValidationModel} if one is found, {@code null} 
otherwise
  * @throws IllegalStateException in case an invalid validation model was 
found
+ * @throws IllegalArgumentException in case resourceType being set on the 
given resource is blank, not set or absolute but outside of the search paths.
  */
-ValidationModel getValidationModel(Resource resource) throws 
IllegalStateException;
+ValidationModel getValidationModel(Resource resource) throws 
IllegalStateException, IllegalArgumentException;
 
 /**
  * Validates a {@link Resource} using a specific {@link ValidationModel}. 
If the {@code model} describes a resource tree,
@@ -71,4 +74,19 @@ public interface ValidationService {
  * @throws 
org.apache.sling.validation.api.exceptions.SlingValidationException if one 
validator was called with invalid arguments
  */
 ValidationResult validate(ValueMap valueMap, ValidationModel model) throws 
SlingValidationException;
+
+/**
+ * Validates a {@link Resource} and all child resources recursively by 
traversing starting from the given resource.
+ * For all resources having a resourceType which is not contained in one 
of {@code ignoredResourceTypes} the according {@link ValidationModel} is 
retrieved and validation called on those.
+ * @param resource the root resource which is validated (including all its 
children resources having a valid resource type)
+ * @param enforceValidation if {@code true} will throw an 
IllegalArgumentException in case a validation model could not be found for a 
(not-ignored) resource type
+ * set on one of the resource's children. 
+ * @param ignoredResourceTypes a set of resource types which should not be 
validated (e.g. nt:unstructured, the default primary node type in case of 
underlying an JCR for nodes not having a sling:resourceType property being set)
+ * @return the aggregated {@link ValidationResult} over all child resource 
validations
+ * @throws IllegalStateException in case an invalid validation model was 
found
+ * @throws IllegalArgumentException in case resourceType is absolute but 
outside of the search paths or if no validation model could be found (and 
enforceValidation is {@code true}).
+ * @throws 
org.apache.sling.validation.api.exceptions.SlingValidationException if one 
validator was called with invalid arguments
+ */
+ValidationResult validateAllResourceTypesInResource(Resource resource, 
boolean enforceValidation, SetString ignoredResourceTypes) throws 
IllegalStateException, IllegalArgumentException, SlingValidationException;
+
 }

Added: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java?rev=1656755view=auto

svn commit: r1652378 - /sling/trunk/testing/junit/core/pom.xml

2015-01-16 Thread kwin
Author: kwin
Date: Fri Jan 16 10:35:50 2015
New Revision: 1652378

URL: http://svn.apache.org/r1652378
Log:
SLING-4320 make JUnit and Hamcrest available as transitive dependencies

Modified:
sling/trunk/testing/junit/core/pom.xml

Modified: sling/trunk/testing/junit/core/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/testing/junit/core/pom.xml?rev=1652378r1=1652377r2=1652378view=diff
==
--- sling/trunk/testing/junit/core/pom.xml (original)
+++ sling/trunk/testing/junit/core/pom.xml Fri Jan 16 10:35:50 2015
@@ -148,24 +148,12 @@
 scopeprovided/scope
 /dependency
 dependency
-groupIdjunit/groupId
-artifactIdjunit/artifactId
-version${junit.version}/version
-scopeprovided/scope
-/dependency
-dependency
 groupIdorg.jacoco/groupId
 artifactIdorg.jacoco.agent/artifactId
 classifierruntime/classifier
 version${jacoco.version}/version
 scopeprovided/scope
 /dependency
-   dependency
-groupIdorg.hamcrest/groupId
-artifactIdhamcrest-core/artifactId
-version${hamcrest.version}/version
-scopeprovided/scope
-/dependency
 dependency
 groupIdch.qos.logback/groupId
 artifactIdlogback-classic/artifactId
@@ -178,5 +166,20 @@
 artifactIdorg.apache.sling.commons.osgi/artifactId
 version2.2.2/version
 /dependency
+!-- This bundle exposes the following dependencies at runtime, 
therefore make those dependencies available in a transitive fashion (i.e. with 
compile scope). 
+ All bundles providing remote unit tests, should rely on the same 
version of JUnit and Hamcrest.
+--
+dependency
+groupIdjunit/groupId
+artifactIdjunit/artifactId
+version${junit.version}/version
+scopecompile/scope
+/dependency
+dependency
+groupIdorg.hamcrest/groupId
+artifactIdhamcrest-core/artifactId
+version${hamcrest.version}/version
+scopecompile/scope
+/dependency
 /dependencies
 /project




svn commit: r1652381 - /sling/trunk/testing/junit/remote/pom.xml

2015-01-16 Thread kwin
Author: kwin
Date: Fri Jan 16 10:48:47 2015
New Revision: 1652381

URL: http://svn.apache.org/r1652381
Log:
SLING-4321 make SLF4J API available at compile and testing time (even for 
dependent modules)

Modified:
sling/trunk/testing/junit/remote/pom.xml

Modified: sling/trunk/testing/junit/remote/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/testing/junit/remote/pom.xml?rev=1652381r1=1652380r2=1652381view=diff
==
--- sling/trunk/testing/junit/remote/pom.xml (original)
+++ sling/trunk/testing/junit/remote/pom.xml Fri Jan 16 10:48:47 2015
@@ -87,10 +87,13 @@
 version4.8.2/version
 scopecompile/scope
 /dependency
+!-- SLF4J is needed at runtime (whenever SlingRemoteTestRunner is 
executed) --
 dependency
 groupIdorg.slf4j/groupId
 artifactIdslf4j-api/artifactId
 version1.5.11/version
+!-- scope must be given explicitly because it has provided scope 
in the depMgmt --
+scopecompile/scope
 /dependency
 dependency
 groupIdorg.slf4j/groupId




svn commit: r1652433 - /sling/trunk/testing/junit/core/pom.xml

2015-01-16 Thread kwin
Author: kwin
Date: Fri Jan 16 15:20:25 2015
New Revision: 1652433

URL: http://svn.apache.org/r1652433
Log:
SLING-4319 embed hamcrest-library as well

Modified:
sling/trunk/testing/junit/core/pom.xml

Modified: sling/trunk/testing/junit/core/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/testing/junit/core/pom.xml?rev=1652433r1=1652432r2=1652433view=diff
==
--- sling/trunk/testing/junit/core/pom.xml (original)
+++ sling/trunk/testing/junit/core/pom.xml Fri Jan 16 15:20:25 2015
@@ -71,14 +71,15 @@
 org.junit.rules.*;version=${junit.version},
 org.junit.runner.*;version=${junit.version},
 org.junit.runners.*;version=${junit.version},
-org.hamcrest.*;version=${hamcrest.version},
-org.hamcrest.core.*;version=${hamcrest.version}
+org.hamcrest;version=${hamcrest.version},
+org.hamcrest.*;version=${hamcrest.version}
 /_exportcontents
 
Private-Packageorg.apache.sling.junit.impl.*/Private-Package
 Embed-Dependency
 
org.jacoco.agent;classifier=runtime;inline=org/jacoco/agent/rt/IAgent.class,
 *;artifactId=junit,
-*;artifactId=hamcrest-core
+*;artifactId=hamcrest-core,
+*;artifactId=hamcrest-library
 /Embed-Dependency
 /instructions
 /configuration
@@ -181,5 +182,11 @@
 version${hamcrest.version}/version
 scopecompile/scope
 /dependency
+dependency
+groupIdorg.hamcrest/groupId
+artifactIdhamcrest-library/artifactId
+version${hamcrest.version}/version
+scopecompile/scope
+/dependency
 /dependencies
 /project




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

2015-01-14 Thread kwin
Author: kwin
Date: Wed Jan 14 17:49:41 2015
New Revision: 1651749

URL: http://svn.apache.org/r1651749
Log:
fix typo in description for applicablePaths

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=1651749r1=1651748r2=1651749view=diff
==
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Wed Jan 14 
17:49:41 2015
@@ -37,7 +37,7 @@ The resources should have the following
  | --- | -- | -| -
 `sling:resourceType` | Property | `String` | Always `sling/validation/model`, 
otherwise node 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 not path restriction. | no | 
`/content/mysite`
+`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`




svn commit: r936195 - /websites/production/sling/content/

2015-01-14 Thread kwin
Author: kwin
Date: Wed Jan 14 17:50:23 2015
New Revision: 936195

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r936194, websites/staging/sling/trunk/content/



svn commit: r1651756 - /sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

2015-01-14 Thread kwin
Author: kwin
Date: Wed Jan 14 18:05:39 2015
New Revision: 1651756

URL: http://svn.apache.org/r1651756
Log:
SLING-4310 also get rid of all validator references in the cache if one is 
unbound

Modified:

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1651756r1=1651755r2=1651756view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Wed Jan 14 18:05:39 2015
@@ -503,6 +503,8 @@ public class ValidationServiceImpl imple
 }
 
 protected void unbindValidator(Validator? validator, Map?, ? 
properties) {
+// also remove references to all validators in the cache
+validationModelsCache.clear();
 validators.remove(validator.getClass().getName());
 }
 }




svn commit: r1651744 - in /sling/trunk/contrib/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ core/src/main/java/org/apache/sling/validation/impl/ core/src/test/java/org/apa

2015-01-14 Thread kwin
Author: kwin
Date: Wed Jan 14 17:42:50 2015
New Revision: 1651744

URL: http://svn.apache.org/r1651744
Log:
SLING-4262 always convert resource types to relative ones
fix bug in overlay handling when search paths where ending with a slash

Modified:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/setup/MockedResourceResolver.java

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java?rev=1651744r1=1651743r2=1651744view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
 Wed Jan 14 17:42:50 2015
@@ -31,11 +31,12 @@ public interface ValidationService {
 /**
  * Tries to obtain a {@link ValidationModel} that is able to validate a 
{@code Resource} of type {@code validatedResourceType}.
  *
- * @param validatedResourceType the type of {@code Resources} the model 
validates
+ * @param validatedResourceType the type of {@code Resources} the model 
validates, should be either relative 
+ *  (i.e. not start with a /) or starting 
with one of the resource resolver's search paths
  * @param applicablePaththe model's applicable path (the path of 
the validated resource)
  * @return a {@code ValidationModel} if one is found, {@code null} 
otherwise
  * @throws IllegalStateException in case an invalid validation model was 
found
- * @throws IllegalArgumentException in case validatedResourceType was 
blank or {@code null}
+ * @throws IllegalArgumentException in case validatedResourceType was 
blank, {@code null} or absolute but outside of the search paths.
  */
 ValidationModel getValidationModel(String validatedResourceType, String 
applicablePath) throws IllegalStateException, IllegalArgumentException;
 

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1651744r1=1651743r2=1651744view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Wed Jan 14 17:42:50 2015
@@ -68,7 +68,7 @@ public class ValidationServiceImpl imple
 
 private static final Logger LOG = 
LoggerFactory.getLogger(ValidationServiceImpl.class);
 
-static final String MODEL_XPATH_QUERY = /jcr:root%s// + 
Constants.MODELS_HOME + /*[@sling:resourceType=\%s\ and @%s=\%s\];
+static final String MODEL_XPATH_QUERY = /jcr:root%s/ + 
Constants.MODELS_HOME + /*[@sling:resourceType=\%s\ and @%s=\%s\];
 static final String[] TOPICS = {SlingConstants.TOPIC_RESOURCE_REMOVED, 
SlingConstants.TOPIC_RESOURCE_CHANGED,
 SlingConstants.TOPIC_RESOURCE_ADDED};
 
@@ -93,6 +93,10 @@ public class ValidationServiceImpl imple
 // ValidationService 
###
 @Override
 public ValidationModel getValidationModel(String validatedResourceType, 
String resourcePath) {
+if (validatedResourceType == null || resourcePath == null) {
+throw new 
IllegalArgumentException(ValidationService.getValidationModel - cannot accept 
null parameters);
+}
+validatedResourceType = getRelativeResourceType(validatedResourceType);
 ValidationModel model = null;
 TrieJCRValidationModel modelsForResourceType = 
validationModelsCache.get(validatedResourceType);
 if (modelsForResourceType != null) {
@@ -115,7 +119,7 @@ public class ValidationServiceImpl imple
 @Override
 public ValidationResult validate(Resource resource, ValidationModel model) 
{
 if (resource == null || model == null) {
-throw new IllegalArgumentException

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

2015-01-14 Thread kwin
Author: kwin
Date: Wed Jan 14 17:47:33 2015
New Revision: 1651747

URL: http://svn.apache.org/r1651747
Log:
SLING-4262 document that the validatedResourceType must be relative

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=1651747r1=1651746r2=1651747view=diff
==
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Wed Jan 14 
17:47:33 2015
@@ -36,7 +36,7 @@ The resources should have the following
   Property/Node 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`
-`validatedResourceType` | Property | `String` | The resource type of the 
resource for which this validation model should be applied. | yes | 
`my/own/resourcetype` 
+`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 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`




svn commit: r1660344 [1/2] - in /sling/trunk/bundles/api: ./ src/main/java/org/apache/sling/api/ src/main/java/org/apache/sling/api/adapter/ src/main/java/org/apache/sling/api/auth/ src/main/java/org/

2015-02-17 Thread kwin
Author: kwin
Date: Tue Feb 17 10:32:22 2015
New Revision: 1660344

URL: http://svn.apache.org/r1660344
Log:
SLING-4377 add null check annotations (JSR 305)

Increasing Java dependency to 1.6 (because of imports to javax.annotation)
This closes #64

Modified:
sling/trunk/bundles/api/pom.xml

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/adapter/Adaptable.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/adapter/AdapterFactory.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/adapter/AdapterManager.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/adapter/package-info.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/auth/Authenticator.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/auth/package-info.java
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/package-info.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/RequestParameter.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/RequestParameterMap.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/RequestPathInfo.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/RequestProgressTracker.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/RequestUtil.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/ResponseUtil.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/package-info.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/Resource.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceProvider.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceProviderFactory.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolverFactory.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceUtil.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ValueMap.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/scripting/SlingBindings.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/scripting/SlingScript.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/scripting/SlingScriptHelper.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/scripting/SlingScriptResolver.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/scripting/package-info.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/security/ResourceAccessSecurity.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/security/package-info.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/OptingServlet.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingSafeMethodsServlet.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/package-info.java

Modified: sling/trunk/bundles/api/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/pom.xml?rev=1660344r1=1660343r2=1660344view=diff
==
--- sling/trunk/bundles/api/pom.xml (original)
+++ sling/trunk/bundles/api/pom.xml Tue Feb 17 10:32:22 2015
@@ -51,6 +51,7 @@
 
 properties
 site.jira.version.id12314252/site.jira.version.id
+sling.java.version6/sling.java.version
 /properties
 
 dependencies
@@ -71,6 +72,12 @@
 scopeprovided/scope
 /dependency
 
+dependency
+groupIdcom.google.code.findbugs/groupId
+artifactIdjsr305/artifactId
+version3.0.0/version
+scopeprovided/scope
+/dependency
 !-- Testing --
 dependency
 groupIdjunit/groupId
@@ -90,6 +97,13 @@
 
 build
 plugins
+plugin
+artifactIdmaven-compiler-plugin/artifactId
+configuration
+source1.6/source
+target1.6/target
+/configuration
+/plugin
 !-- Create the bundle of the Sling API --
 plugin

svn commit: r1660344 [2/2] - in /sling/trunk/bundles/api: ./ src/main/java/org/apache/sling/api/ src/main/java/org/apache/sling/api/adapter/ src/main/java/org/apache/sling/api/auth/ src/main/java/org/

2015-02-17 Thread kwin
Modified: 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java?rev=1660344r1=1660343r2=1660344view=diff
==
--- 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java
 (original)
+++ 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java
 Tue Feb 17 10:32:22 2015
@@ -18,6 +18,7 @@
  */
 package org.apache.sling.api.servlets;
 
+import javax.annotation.Nonnull;
 import javax.servlet.Servlet;
 
 import org.apache.sling.api.SlingHttpServletRequest;
@@ -62,7 +63,7 @@ public interface ServletResolver {
  * request or if no servlet could be resolved to handle the
  * request.
  */
-Servlet resolveServlet(SlingHttpServletRequest request);
+@Nonnull Servlet resolveServlet(@Nonnull SlingHttpServletRequest request);
 
 /**
  * Resolves a codejavax.servlet.Servlet/code whose
@@ -90,7 +91,7 @@ public interface ServletResolver {
  * request.
  * @since 2.1 (Sling API Bundle 2.1.0)
  */
-Servlet resolveServlet(Resource resource, String scriptName);
+@Nonnull Servlet resolveServlet(@Nonnull Resource resource, @Nonnull 
String scriptName);
 
 /**
  * Resolves a codejavax.servlet.Servlet/code whose
@@ -117,6 +118,6 @@ public interface ServletResolver {
  * request.
  * @since 2.1 (Sling API Bundle 2.1.0)
  */
-Servlet resolveServlet(ResourceResolver resolver, String scriptName);
+@Nonnull Servlet resolveServlet(@Nonnull ResourceResolver resolver, 
@Nonnull String scriptName);
 
 }

Modified: 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java?rev=1660344r1=1660343r2=1660344view=diff
==
--- 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
 (original)
+++ 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/SlingAllMethodsServlet.java
 Tue Feb 17 10:32:22 2015
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.lang.reflect.Method;
 import java.util.Map;
 
+import javax.annotation.Nonnull;
 import javax.servlet.ServletException;
 
 import org.apache.sling.api.SlingHttpServletRequest;
@@ -60,8 +61,8 @@ public class SlingAllMethodsServlet exte
  * client.
  */
 @SuppressWarnings(unused)
-protected void doPost(SlingHttpServletRequest request,
-SlingHttpServletResponse response) throws ServletException,
+protected void doPost(@Nonnull SlingHttpServletRequest request,
+@Nonnull SlingHttpServletResponse response) throws 
ServletException,
 IOException {
 handleMethodNotImplemented(request, response);
 }
@@ -84,8 +85,8 @@ public class SlingAllMethodsServlet exte
  * client.
  */
 @SuppressWarnings(unused)
-protected void doPut(SlingHttpServletRequest request,
-SlingHttpServletResponse response) throws ServletException,
+protected void doPut(@Nonnull SlingHttpServletRequest request,
+@Nonnull SlingHttpServletResponse response) throws 
ServletException,
 IOException {
 handleMethodNotImplemented(request, response);
 }
@@ -108,8 +109,8 @@ public class SlingAllMethodsServlet exte
  * client.
  */
 @SuppressWarnings(unused)
-protected void doDelete(SlingHttpServletRequest request,
-SlingHttpServletResponse response) throws ServletException,
+protected void doDelete(@Nonnull SlingHttpServletRequest request,
+@Nonnull SlingHttpServletResponse response) throws 
ServletException,
 IOException {
 handleMethodNotImplemented(request, response);
 }
@@ -131,8 +132,8 @@ public class SlingAllMethodsServlet exte
  * @throws ServletException Forwarded from any of the dispatched methods
  * @throws IOException Forwarded from any of the dispatched methods
  */
-protected boolean mayService(SlingHttpServletRequest request,
-SlingHttpServletResponse response) throws ServletException,
+protected boolean mayService(@Nonnull SlingHttpServletRequest request,
+@Nonnull SlingHttpServletResponse response) throws 
ServletException,
 IOException {
 
 // assume the method is known for now
@@ -175,8 +176,8 @@ public class SlingAllMethodsServlet exte
  * @return A codeStringBuffer/code containing the list of HTTP methods
  * supported.
  */
-protected StringBuffer getAllowedRequestMethods(
-

svn commit: r940844 - /websites/production/sling/content/

2015-02-20 Thread kwin
Author: kwin
Date: Fri Feb 20 10:37:21 2015
New Revision: 940844

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r940843, websites/staging/sling/trunk/content/



svn commit: r1661083 - in /sling/site/trunk/content/documentation: development.mdtext development/eclipse-settings-null-analysis.png development/jsr-305.mdtext

2015-02-20 Thread kwin
Author: kwin
Date: Fri Feb 20 10:34:30 2015
New Revision: 1661083

URL: http://svn.apache.org/r1661083
Log:
SLING-4377 add documentation on how to leverage the JSR-305 annotations

Added:

sling/site/trunk/content/documentation/development/eclipse-settings-null-analysis.png
   (with props)
sling/site/trunk/content/documentation/development/jsr-305.mdtext
Modified:
sling/site/trunk/content/documentation/development.mdtext

Modified: sling/site/trunk/content/documentation/development.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development.mdtext?rev=1661083r1=1661082r2=1661083view=diff
==
--- sling/site/trunk/content/documentation/development.mdtext (original)
+++ sling/site/trunk/content/documentation/development.mdtext Fri Feb 20 
10:34:30 2015
@@ -14,6 +14,7 @@ Look here for more information on develo
 * [Monitoring Requests]({{ refs.monitoring-requests.path }})
 * [Repository Based Development]({{ refs.repository-based-development.path }})
 * [Sling IDE Tooling]({{ refs.ide-tooling.path }})
+* [Leveraging JSR-305 null annotations]({{refs.jsr-305.path}})
 
 
 ## Testing Sling-based Applications

Added: 
sling/site/trunk/content/documentation/development/eclipse-settings-null-analysis.png
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/eclipse-settings-null-analysis.png?rev=1661083view=auto
==
Binary file - no diff available.

Propchange: 
sling/site/trunk/content/documentation/development/eclipse-settings-null-analysis.png
--
svn:mime-type = application/octet-stream

Added: sling/site/trunk/content/documentation/development/jsr-305.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/jsr-305.mdtext?rev=1661083view=auto
==
--- sling/site/trunk/content/documentation/development/jsr-305.mdtext (added)
+++ sling/site/trunk/content/documentation/development/jsr-305.mdtext Fri Feb 
20 10:34:30 2015
@@ -0,0 +1,55 @@
+Title: Leveraging JSR-305 null annotations to prevent NullPointerExceptions
+
+The Sling API forces developers to sometimes check for `null` return values. 
Most prominently this is the case for 
[`Adaptable.adaptTo`](https://sling.apache.org/apidocs/sling7/org/apache/sling/api/adapter/Adaptable.html#adaptTo-java.lang.Class-)
 and 
[`ResourceResolver.getResource`](https://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/ResourceResolver.html#getResource-java.lang.String-).
 This is often forgotten, which may lead to `NullPointerException`s. Sling API 
2.9.0 introduced the JSR-305 annotations 
([SLING-4377](https://issues.apache.org/jira/browse/SLING-4377)) which allow 
tools to check automatically for missing null checks in the code.
+
+
+## Annotations
+The annotations used within Sling are based on the 
[JSR-305](https://jcp.org/en/jsr/detail?id=305) which is dormant since 2012. 
Nevertheless those annotations are understood by most of the tools and used by 
other Apache Projects like Apache Oak 
[OAK-37](https://issues.apache.org/jira/browse/OAK-37).
+
+Due to the fact that Eclipse and FindBugs are interpreting annotations 
differently ([Findbugs-1355](https://sourceforge.net/p/findbugs/bugs/1355/)). 
Sling only uses the following two different annotations which are supported by 
both tools:
+
+1. `javax.annotation.CheckForNull`
+1. `javax.annotation.Nonnull`
+
+Annotations which support setting the default null semantics of return values 
and or parameters on a package level cannot be leveraged for that reason.
+
+## Use With Eclipse
+Eclipse since Juno supports [null analysis based on any 
annotations](http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Freference%2Fpreferences%2Fjava%2Fcompiler%2Fref-preferences-errors-warnings.htmanchor=null_analysis).
 Those need to be enabled in 
+*Preferences-Java-Compiler-Errors/Warnings* via **Enable annoation-based 
null analysis**.
+Also the annotations need to be configured. For Sling those are
+
+* `javax.annotation.CheckForNull` as **'Nullable' annotation**
+* `javax.annotation.Nonnull` as ** **'NonNull' annotation**
+  
+![Eclipse Settings for Null analysis](eclipse-settings-null-analysis.png)
+
+## Use With Findbugs
+Findbugs evaluates the used annotations by default. You can restrict the rules 
to only the ones which check for those annotations, which are
+
+* InconsistentAnnotations
+* NoteUnconditionalParamDerefs
+* FindNullDeref
+* FindNullDerefsInvolvingNonShortCircuitEvaluation
+
+Findbugs is also integrated in 
[Sonarqube](http://docs.sonarqube.org/display/SONAR/Findbugs+Plugin).
+
+## Use With Maven
+You can also let Maven automatically run Findbugs to execute those checks via

svn commit: r1661084 - /sling/site/trunk/content/documentation/development.mdtext

2015-02-20 Thread kwin
Author: kwin
Date: Fri Feb 20 10:35:51 2015
New Revision: 1661084

URL: http://svn.apache.org/r1661084
Log:
fix reference

Modified:
sling/site/trunk/content/documentation/development.mdtext

Modified: sling/site/trunk/content/documentation/development.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development.mdtext?rev=1661084r1=1661083r2=1661084view=diff
==
--- sling/site/trunk/content/documentation/development.mdtext (original)
+++ sling/site/trunk/content/documentation/development.mdtext Fri Feb 20 
10:35:51 2015
@@ -14,7 +14,7 @@ Look here for more information on develo
 * [Monitoring Requests]({{ refs.monitoring-requests.path }})
 * [Repository Based Development]({{ refs.repository-based-development.path }})
 * [Sling IDE Tooling]({{ refs.ide-tooling.path }})
-* [Leveraging JSR-305 null annotations]({{refs.jsr-305.path}})
+* [Leveraging JSR-305 null annotations]({{ refs.jsr-305.path }})
 
 
 ## Testing Sling-based Applications




svn commit: r1661085 - /sling/site/trunk/content/documentation/development/jsr-305.mdtext

2015-02-20 Thread kwin
Author: kwin
Date: Fri Feb 20 10:46:50 2015
New Revision: 1661085

URL: http://svn.apache.org/r1661085
Log:
fix small typo

Modified:
sling/site/trunk/content/documentation/development/jsr-305.mdtext

Modified: sling/site/trunk/content/documentation/development/jsr-305.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/jsr-305.mdtext?rev=1661085r1=1661084r2=1661085view=diff
==
--- sling/site/trunk/content/documentation/development/jsr-305.mdtext (original)
+++ sling/site/trunk/content/documentation/development/jsr-305.mdtext Fri Feb 
20 10:46:50 2015
@@ -19,7 +19,7 @@ Eclipse since Juno supports [null analys
 Also the annotations need to be configured. For Sling those are
 
 * `javax.annotation.CheckForNull` as **'Nullable' annotation**
-* `javax.annotation.Nonnull` as ** **'NonNull' annotation**
+* `javax.annotation.Nonnull` as **'NonNull' annotation**
   
 ![Eclipse Settings for Null analysis](eclipse-settings-null-analysis.png)
 




svn commit: r1661073 - in /sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension: IncludeRuntimeExtension.java ResourceRuntimeExtension.ja

2015-02-20 Thread kwin
Author: kwin
Date: Fri Feb 20 08:28:30 2015
New Revision: 1661073

URL: http://svn.apache.org/r1661073
Log:
SLING-4175 do not catch exceptions when including scripts/resources within 
Sightly

Modified:

sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/IncludeRuntimeExtension.java

sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java

Modified: 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/IncludeRuntimeExtension.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/IncludeRuntimeExtension.java?rev=1661073r1=1661072r2=1661073view=diff
==
--- 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/IncludeRuntimeExtension.java
 (original)
+++ 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/IncludeRuntimeExtension.java
 Fri Feb 20 08:28:30 2015
@@ -18,12 +18,14 @@
  
**/
 package org.apache.sling.scripting.sightly.impl.engine.extension;
 
+import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.Map;
 
 import javax.script.Bindings;
 import javax.servlet.Servlet;
+import javax.servlet.ServletException;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.felix.scr.annotations.Component;
@@ -109,8 +111,10 @@ public class IncludeRuntimeExtension imp
 SlingHttpServletResponse response = 
(SlingHttpServletResponse) bindings.get(SlingBindings.RESPONSE);
 PrintWriterResponseWrapper resWrapper = new 
PrintWriterResponseWrapper(out, response);
 servlet.service(request, resWrapper);
-} catch (Exception e) {
-LOG.error(Failed to include script {}, script, e);
+} catch (ServletException e) {
+throw new SightlyException(Failed to include script  
+ script, e);
+} catch (IOException e) {
+throw new SightlyException(Failed to include script  
+ script, e);
 }
 } else {
 LOG.error(Failed to locate script {}, script);

Modified: 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java?rev=1661073r1=1661072r2=1661073view=diff
==
--- 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java
 (original)
+++ 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/ResourceRuntimeExtension.java
 Fri Feb 20 08:28:30 2015
@@ -18,6 +18,7 @@
  
**/
 package org.apache.sling.scripting.sightly.impl.engine.extension;
 
+import java.io.IOException;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.util.Arrays;
@@ -28,6 +29,7 @@ import java.util.Set;
 
 import javax.script.Bindings;
 import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.felix.scr.annotations.Component;
@@ -42,6 +44,7 @@ import org.apache.sling.api.resource.Res
 import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.api.resource.SyntheticResource;
 import org.apache.sling.api.scripting.SlingBindings;
+import org.apache.sling.scripting.sightly.SightlyException;
 import org.apache.sling.scripting.sightly.extension.RuntimeExtension;
 import org.apache.sling.scripting.sightly.impl.plugin.ResourcePlugin;
 import org.apache.sling.scripting.sightly.render.RenderContext;
@@ -248,15 +251,17 @@ public class ResourceRuntimeExtension im
 if (includeRes instanceof NonExistingResource || 
includeRes.isResourceType(Resource.RESOURCE_TYPE_NON_EXISTING)) {
 includeRes = new 
SyntheticResource(request.getResourceResolver(), script, resourceType);
 }
+RequestDispatcherOptions opts = new 
RequestDispatcherOptions(dispatcherOptions);
+if (StringUtils.isNotEmpty(resourceType

svn commit: r1659574 - in /sling/trunk/bundles/api/src/main/java/org/apache/sling/api: ./ adapter/ request/ resource/ scripting/ servlets/ wrappers/

2015-02-13 Thread kwin
Author: kwin
Date: Fri Feb 13 14:35:04 2015
New Revision: 1659574

URL: http://svn.apache.org/r1659574
Log:
SLING-4383 extend @since in Javadoc to always mention the bundle version in 
addition to the package version

Modified:

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/SlingConstants.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/SlingHttpServletRequest.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/adapter/SlingAdaptable.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/RequestParameter.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/RequestPathInfo.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/RequestUtil.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/ResponseUtil.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/request/SlingRequestEvent.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/AbstractResource.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/AttributableResourceProvider.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/DynamicResourceProvider.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/LoginException.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifiableValueMap.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ModifyingResourceProvider.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/PersistenceException.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/QueriableResourceProvider.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/RefreshableResourceProvider.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/Resource.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceDecorator.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceProvider.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceProviderFactory.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolverFactory.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceUtil.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceWrapper.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/scripting/SlingScriptConstants.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/servlets/ServletResolver.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/wrappers/CompositeValueMap.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/wrappers/DeepReadModifiableValueMapDecorator.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/wrappers/DeepReadValueMapDecorator.java

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/wrappers/ModifiableValueMapDecorator.java

Modified: 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/SlingConstants.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/SlingConstants.java?rev=1659574r1=1659573r2=1659574view=diff
==
--- 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/SlingConstants.java 
(original)
+++ 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/SlingConstants.java 
Fri Feb 13 14:35:04 2015
@@ -265,7 +265,7 @@ public class SlingConstants {
  * to the resource tree.
  * The event contains at least the {@link #PROPERTY_PATH}, {@link 
#PROPERTY_RESOURCE_SUPER_TYPE}
  * and {@link #PROPERTY_RESOURCE_TYPE} properties.
- * @since 2.0.6
+ * @since 2.0.6 (Sling API Bundle 2.0.6)
  */
 public static final String TOPIC_RESOURCE_ADDED = 
org/apache/sling/api/resource/Resource/ADDED;
 
@@ -274,7 +274,7 @@ public class SlingConstants {
  * from the resource tree.
  * The event contains at least the {@link #PROPERTY_PATH}. As the resource 
has already been removed
  * no further information like resource type etc. might be available.
- * @since 2.0.6
+ * @since 2.0.6 (Sling API Bundle 2.0.6)
  */
 public static final String TOPIC_RESOURCE_REMOVED = 
org/apache/sling/api/resource/Resource/REMOVED;
 
@@ -286,7 +286,7 @@ public class SlingConstants {
  * Since 2.2.0 the event might contain these properties {@link 
#PROPERTY_ADDED_ATTRIBUTES},
  * {@link

svn commit: r1660065 - /sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

2015-02-16 Thread kwin
Author: kwin
Date: Mon Feb 16 10:49:41 2015
New Revision: 1660065

URL: http://svn.apache.org/r1660065
Log:
improve exception message in case of null arguments

Modified:

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1660065r1=1660064r2=1660065view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Mon Feb 16 10:49:41 2015
@@ -94,8 +94,11 @@ public class ValidationServiceImpl imple
 // ValidationService 
###
 @Override
 public ValidationModel getValidationModel(String validatedResourceType, 
String resourcePath) {
-if (validatedResourceType == null || resourcePath == null) {
-throw new 
IllegalArgumentException(ValidationService.getValidationModel - cannot accept 
null parameters);
+if (resourcePath == null) {
+throw new 
IllegalArgumentException(ValidationService.getValidationModel - cannot accept 
null as resource path);
+}
+if (validatedResourceType == null) {
+throw new 
IllegalArgumentException(ValidationService.getValidationModel - cannot accept 
null as resource type. Resource path was:  + resourcePath);
 }
 validatedResourceType = getRelativeResourceType(validatedResourceType);
 ValidationModel model = null;




svn commit: r943129 - /websites/production/sling/content/

2015-03-10 Thread kwin
Author: kwin
Date: Tue Mar 10 11:02:22 2015
New Revision: 943129

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r943128, websites/staging/sling/trunk/content/



svn commit: r942582 - /websites/production/sling/content/

2015-03-06 Thread kwin
Author: kwin
Date: Fri Mar  6 12:42:16 2015
New Revision: 942582

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r942581, websites/staging/sling/trunk/content/



svn commit: r1664614 - /sling/site/trunk/templates/downloads.html

2015-03-06 Thread kwin
Author: kwin
Date: Fri Mar  6 13:25:55 2015
New Revision: 1664614

URL: http://svn.apache.org/r1664614
Log:
also strip out superfluous slash from the link title

Modified:
sling/site/trunk/templates/downloads.html

Modified: sling/site/trunk/templates/downloads.html
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/templates/downloads.html?rev=1664614r1=1664613r2=1664614view=diff
==
--- sling/site/trunk/templates/downloads.html (original)
+++ sling/site/trunk/templates/downloads.html Fri Mar  6 13:25:55 2015
@@ -78,7 +78,7 @@ incubator releases of Apache Sling, have
 
 h2 id=ide-toolingSling IDE Tooling/h2
 
-pIf you want to install the convenience binaries for the IDE tooling, it's 
recommended that you add a 
href=[preferred]sling/eclipse[preferred]/sling/eclipse/a as an update site 
URL. This way you will receive updates every time a new version is released. 
For specific versions and zipped update site download, see the table below./p
+pIf you want to install the convenience binaries for the IDE tooling, it's 
recommended that you add a 
href=[preferred]sling/eclipse[preferred]sling/eclipse/a as an update site 
URL. This way you will receive updates every time a new version is released. 
For specific versions and zipped update site download, see the table below./p
 
 {{ ide|markdown }}
 




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

2015-03-06 Thread kwin
Author: kwin
Date: Fri Mar  6 12:41:15 2015
New Revision: 1664603

URL: http://svn.apache.org/r1664603
Log:
SLING-4387 document validation of sub resources

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=1664603r1=1664602r2=1664603view=diff
==
--- sling/site/trunk/content/documentation/bundles/validation.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/validation.mdtext Fri Mar  6 
12:41:15 2015
@@ -24,6 +24,20 @@ To validate a resource one first needs t
 // give out error message that the validation model is invalid!
 }
 
+Apart from that it is also possible to validate resources including all child 
resources having their own validation model (i.e. a merged view of the 
validation models is applied). The appropriate validation model is being looked 
up by getting the resource type for each node. Since by default the JCR will 
return the primary type in case there is no `sling:resourceType` property found 
on the node, either the 2nd parameter `enforceValidation` should be set to 
`false` or some resource types must be explicitly ignored to also properly 
support validation models which have children on its own.
+
+::java
+try {
+   ValidationResult result = 
validationService.validateAllResourceTypesInResource(resource, false, null);
+   if (!result.isValid()) {
+   // give out validation messages from result.get
+   }
+
+} catch (IllegalStateException e) {
+// give out error message that an invalid validation model for at 
least one sub resource was found
+} catch (IllegalArgumentException e) {
+// one of the resource types is absolute or there was no validation 
model found for at least one sub resource
+}
 
 # 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




svn commit: r942590 - /websites/production/sling/content/

2015-03-06 Thread kwin
Author: kwin
Date: Fri Mar  6 13:28:10 2015
New Revision: 942590

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r942589, websites/staging/sling/trunk/content/



svn commit: r1666261 - /sling/site/trunk/content/documentation/development/jsr-305.mdtext

2015-03-12 Thread kwin
Author: kwin
Date: Thu Mar 12 17:17:05 2015
New Revision: 1666261

URL: http://svn.apache.org/r1666261
Log:
add more informations about field analysis in Eclipse

Modified:
sling/site/trunk/content/documentation/development/jsr-305.mdtext

Modified: sling/site/trunk/content/documentation/development/jsr-305.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/jsr-305.mdtext?rev=1666261r1=1666260r2=1666261view=diff
==
--- sling/site/trunk/content/documentation/development/jsr-305.mdtext (original)
+++ sling/site/trunk/content/documentation/development/jsr-305.mdtext Thu Mar 
12 17:17:05 2015
@@ -23,6 +23,8 @@ Also the annotations need to be configur
   
 ![Eclipse Settings for Null analysis](eclipse-settings-null-analysis.png)
 
+Unfortunately Eclipse cannot infer information about fields which are for sure 
either null or not null ([Eclipse Bug 
247564](https://bugs.eclipse.org/bugs/show_bug.cgi?id=247564)). This also 
affecs constants (static final fields) or enums which are known to be non null, 
but still Eclipse will emit a warning like *The expression of type 'String' 
needs unchecked conversion to conform to '@Nonnull String'*. The only known 
workaround is to disable the **Unchecked conversion from non-annotated type to 
@NonNull type** or use the fixes proposed in 
[https://wiki.eclipse.org/JDT_Core/Null_Analysis](https://wiki.eclipse.org/JDT_Core/Null_Analysis).
+
 ## Use With Findbugs
 Findbugs evaluates the used annotations by default. You can restrict the rules 
to only the ones which check for those annotations, which are
 




svn commit: r1663283 - /sling/site/trunk/templates/downloads.html

2015-03-02 Thread kwin
Author: kwin
Date: Mon Mar  2 12:30:31 2015
New Revision: 1663283

URL: http://svn.apache.org/r1663283
Log:
fix link to Sling IDE tooling, the variable [preferred] always ends with a slash

Modified:
sling/site/trunk/templates/downloads.html

Modified: sling/site/trunk/templates/downloads.html
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/templates/downloads.html?rev=1663283r1=1663282r2=1663283view=diff
==
--- sling/site/trunk/templates/downloads.html (original)
+++ sling/site/trunk/templates/downloads.html Mon Mar  2 12:30:31 2015
@@ -78,7 +78,7 @@ incubator releases of Apache Sling, have
 
 h2 id=ide-toolingSling IDE Tooling/h2
 
-pIf you want to install the convenience binaries for the IDE tooling, it's 
recommended that you add a 
href=[preferred]/sling/eclipse[preferred]/sling/eclipse/a as an update 
site URL. This way you will receive updates every time a new version is 
released. For specific versions and zipped update site download, see the table 
below./p
+pIf you want to install the convenience binaries for the IDE tooling, it's 
recommended that you add a 
href=[preferred]sling/eclipse[preferred]/sling/eclipse/a as an update site 
URL. This way you will receive updates every time a new version is released. 
For specific versions and zipped update site download, see the table below./p
 
 {{ ide|markdown }}
 




svn commit: r1662217 - /sling/site/trunk/content/documentation/development/jsr-305.mdtext

2015-02-25 Thread kwin
Author: kwin
Date: Wed Feb 25 14:10:02 2015
New Revision: 1662217

URL: http://svn.apache.org/r1662217
Log:
reorder paragraph around findbugs visitors

Modified:
sling/site/trunk/content/documentation/development/jsr-305.mdtext

Modified: sling/site/trunk/content/documentation/development/jsr-305.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/jsr-305.mdtext?rev=1662217r1=1662216r2=1662217view=diff
==
--- sling/site/trunk/content/documentation/development/jsr-305.mdtext (original)
+++ sling/site/trunk/content/documentation/development/jsr-305.mdtext Wed Feb 
25 14:10:02 2015
@@ -31,6 +31,8 @@ Findbugs evaluates the used annotations
 * FindNullDeref
 * FindNullDerefsInvolvingNonShortCircuitEvaluation
 
+A complete list of visitors class names in Findbugs can be found in the 
[sourcecode](https://code.google.com/p/findbugs/source/browse/#git%2Ffindbugs%2Fsrc%2Fjava%2Fedu%2Fumd%2Fcs%2Ffindbugs%2Fdetect%253Fstate%253Dclosed).
 The according [bug 
patterns](http://findbugs.sourceforge.net/bugDescriptions.html) have an 
identifier (in parenthesis) for which you can search in the according Java 
classes, in case you want to extend the checks.
+
 Findbugs is also integrated in 
[Sonarqube](http://docs.sonarqube.org/display/SONAR/Findbugs+Plugin).
 
 ## Use With Maven
@@ -54,6 +56,6 @@ You can also let Maven automatically run
   /executions
 /plugin
 
-This example only runs those checks which are related to null checks. A 
complete list of visitors class names in Findbugs can be found in the 
[sourcecode](https://code.google.com/p/findbugs/source/browse/#git%2Ffindbugs%2Fsrc%2Fjava%2Fedu%2Fumd%2Fcs%2Ffindbugs%2Fdetect%253Fstate%253Dclosed).
 The according [bug 
patterns](http://findbugs.sourceforge.net/bugDescriptions.html) have an 
identifier (in parenthesis) for which you can search in the according Java 
classes, in case you want to extend the checks.
+
 
 The results are often very imprecise 
([MFINDBUGS-208](http://jira.codehaus.org/browse/MFINDBUGS-208)), especially 
when it comes to line numbers, therefore it is best to start the Findbugs GUI 
in case of errors found by this plugin via `mvn findbugs:gui`.
\ No newline at end of file




svn commit: r1662216 - /sling/site/trunk/content/documentation/development/jsr-305.mdtext

2015-02-25 Thread kwin
Author: kwin
Date: Wed Feb 25 14:08:15 2015
New Revision: 1662216

URL: http://svn.apache.org/r1662216
Log:
extends JSR 305 documentation (with maven-findbugs-plugin limitations)

Modified:
sling/site/trunk/content/documentation/development/jsr-305.mdtext

Modified: sling/site/trunk/content/documentation/development/jsr-305.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/development/jsr-305.mdtext?rev=1662216r1=1662215r2=1662216view=diff
==
--- sling/site/trunk/content/documentation/development/jsr-305.mdtext (original)
+++ sling/site/trunk/content/documentation/development/jsr-305.mdtext Wed Feb 
25 14:08:15 2015
@@ -52,4 +52,8 @@ You can also let Maven automatically run
   /goals
 /execution
   /executions
-/plugin
\ No newline at end of file
+/plugin
+
+This example only runs those checks which are related to null checks. A 
complete list of visitors class names in Findbugs can be found in the 
[sourcecode](https://code.google.com/p/findbugs/source/browse/#git%2Ffindbugs%2Fsrc%2Fjava%2Fedu%2Fumd%2Fcs%2Ffindbugs%2Fdetect%253Fstate%253Dclosed).
 The according [bug 
patterns](http://findbugs.sourceforge.net/bugDescriptions.html) have an 
identifier (in parenthesis) for which you can search in the according Java 
classes, in case you want to extend the checks.
+
+The results are often very imprecise 
([MFINDBUGS-208](http://jira.codehaus.org/browse/MFINDBUGS-208)), especially 
when it comes to line numbers, therefore it is best to start the Findbugs GUI 
in case of errors found by this plugin via `mvn findbugs:gui`.
\ No newline at end of file




svn commit: r1662230 - in /sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly: impl/engine/extension/use/ use/

2015-02-25 Thread kwin
Author: kwin
Date: Wed Feb 25 14:43:46 2015
New Revision: 1662230

URL: http://svn.apache.org/r1662230
Log:
SLING-4454 fix description and javadoc around service rankings of Use Providers

Modified:

sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/JavaUseProvider.java

sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java

sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/ScriptUseProvider.java

sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/use/UseProvider.java

Modified: 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/JavaUseProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/JavaUseProvider.java?rev=1662230r1=1662229r2=1662230view=diff
==
--- 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/JavaUseProvider.java
 (original)
+++ 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/JavaUseProvider.java
 Wed Feb 25 14:43:46 2015
@@ -57,7 +57,7 @@ import org.slf4j.LoggerFactory;
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
with which this Use Provider is queried to return an  +
-Use-object. A higher value represents a higher 
priority.,
+Use-object. The lower the value, the earlier the Use 
Provider is asked.,
 intValue = 90,
 propertyPrivate = false
 )

Modified: 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java?rev=1662230r1=1662229r2=1662230view=diff
==
--- 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java
 (original)
+++ 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/RenderUnitProvider.java
 Wed Feb 25 14:43:46 2015
@@ -55,7 +55,7 @@ import org.osgi.framework.Constants;
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
with which this Use Provider is queried to return an  +
-Use-object. A higher value represents a higher 
priority.,
+Use-object. The lower the value, the earlier the Use 
Provider is asked.,
 intValue = 100,
 propertyPrivate = false
 )

Modified: 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/ScriptUseProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/ScriptUseProvider.java?rev=1662230r1=1662229r2=1662230view=diff
==
--- 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/ScriptUseProvider.java
 (original)
+++ 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/ScriptUseProvider.java
 Wed Feb 25 14:43:46 2015
@@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory;
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
with which this Use Provider is queried to return an  +
-Use-object. A higher value represents a higher 
priority.,
+Use-object. The lower the value, the earlier the Use 
Provider is asked.,
 intValue = 0,
 propertyPrivate = false
 )

Modified: 
sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/use/UseProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling

svn commit: r941461 - /websites/production/sling/content/

2015-02-25 Thread kwin
Author: kwin
Date: Wed Feb 25 16:01:44 2015
New Revision: 941461

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r941460, websites/staging/sling/trunk/content/



svn commit: r1661947 - in /sling/trunk/contrib/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ core/src/main/java/org/apache/sling/validation/impl/validators/

2015-02-24 Thread kwin
Author: kwin
Date: Tue Feb 24 13:42:39 2015
New Revision: 1661947

URL: http://svn.apache.org/r1661947
Log:
clarified that the valuemap given to a validate method is never null

Modified:

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java

sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java

sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java?rev=1661947r1=1661946r2=1661947view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java
 Tue Feb 24 13:42:39 2015
@@ -26,10 +26,22 @@ import org.apache.sling.api.resource.Val
  */
 public interface ParameterizedValidator {
 
+/**
+ * 
+ * @return the validator
+ */
 public abstract Validator? getValidator();
 
+/**
+ * 
+ * @return the parameterization of the validator (never {@code null}, but 
might be empty map)
+ */
 public abstract ValueMap getParameters();
 
+/**
+ * 
+ * @return the type of the validator (i.e. the type of the data it can 
handle)
+ */
 public abstract Class? getType();
 
 }
\ No newline at end of file

Modified: 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java?rev=1661947r1=1661946r2=1661947view=diff
==
--- 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
 Tue Feb 24 13:42:39 2015
@@ -62,7 +62,7 @@ public interface Validator T {
  *
  * @param data the data to validate (primary property), never {@code null}.
  * @param valueMap all properties (only used for validations considering 
multiple properties), never {@code null}.
- * @param arguments the parameterization of the validator. Might be {@code 
null} in case no arguments were given.
+ * @param arguments the parameterization of the validator. Never {@code 
null} but might be the empty map.
  * @return validation error message if validation was not successful, 
{@code null} otherwise. In case an empty string is returned a generic 
validation error message is used.
  * @throws 
org.apache.sling.validation.api.exceptions.SlingValidationException if some 
expected arguments are missing from the arguments map
  */

Modified: 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java?rev=1661947r1=1661946r2=1661947view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java
 Tue Feb 24 13:42:39 2015
@@ -40,9 +40,6 @@ public class RegexValidator implements V
 @Override
 public String validate(String data, ValueMap valueMap, ValueMap arguments)
 throws SlingValidationException {
-if (arguments == null) {
-throw new SlingValidationException(Cannot perform data validation 
with null parameters);
-}
 String regex = arguments.get(REGEX_PARAM, );
 if (StringUtils.isEmpty(regex)) {
 throw new SlingValidationException(Mandatory  + REGEX_PARAM +  
is missing from the arguments map.);




svn commit: r1661954 - /sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

2015-02-24 Thread kwin
Author: kwin
Date: Tue Feb 24 13:58:14 2015
New Revision: 1661954

URL: http://svn.apache.org/r1661954
Log:
add test for arguments parameter of the validate to never be null

Modified:

sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Modified: 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java?rev=1661954r1=1661953r2=1661954view=diff
==
--- 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 (original)
+++ 
sling/trunk/contrib/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 Tue Feb 24 13:58:14 2015
@@ -44,6 +44,7 @@ import org.apache.sling.jcr.resource.Jcr
 import org.apache.sling.validation.api.ValidationModel;
 import org.apache.sling.validation.api.ValidationResult;
 import org.apache.sling.validation.api.Validator;
+import org.apache.sling.validation.api.exceptions.SlingValidationException;
 import org.apache.sling.validation.impl.setup.MockedResourceResolver;
 import org.apache.sling.validation.impl.util.examplevalidators.DateValidator;
 import org.apache.sling.validation.impl.validators.RegexValidator;
@@ -54,6 +55,7 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
+import org.mockito.Mockito;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 import org.powermock.reflect.Whitebox;
@@ -258,6 +260,46 @@ public class ValidationServiceImplTest {
 } finally {
 if (model1 != null) {
 rr.delete(model1);
+}
+}
+}
+
+@Test
+public void testValidateNeverCalledWithNullValues() throws Exception {
+
+ValidatorString myValidator = new ValidatorString() {
+@Override
+public String validate(String data, ValueMap valueMap, ValueMap 
arguments)
+throws SlingValidationException {
+Assert.assertNotNull(ValueMap parameter for validate should 
never be null, valueMap);
+Assert.assertNotNull(arguments parameter for validate should 
never be null, arguments);
+return null;
+}
+
+};
+
+validationService.validators.put(testvalidator,
+myValidator);
+
+TestProperty property = new TestProperty(field1);
+property.addValidator(testvalidator);
+Resource model1 = null;
+try {
+model1 = createValidationModelResource(rr, 
libsValidatorsRoot.getPath(), testValidationModel1,
+sling/validation/test, new String[] { /apps/validation 
}, property);
+
+ValidationModel vm = 
validationService.getValidationModel(sling/validation/test,
+/apps/validation/1/resource);
+HashMapString, Object hashMap = new HashMapString, Object() {
+{
+put(field1, 1);
+}
+};
+ValueMap map = new ValueMapDecorator(hashMap);
+validationService.validate(map, vm);
+} finally {
+if (model1 != null) {
+rr.delete(model1);
 }
 }
 }




svn commit: r1662434 - in /sling/trunk/bundles/extensions/models/impl: pom.xml src/main/java/org/apache/sling/models/impl/sightly/ src/main/java/org/apache/sling/models/impl/sightly/ModelFactoryUsePro

2015-02-26 Thread kwin
Author: kwin
Date: Thu Feb 26 12:27:25 2015
New Revision: 1662434

URL: http://svn.apache.org/r1662434
Log:
SLING-4447 provide a SlingModels Sightly UseProvider which throws exceptions in 
case a Sling Model cannot be instantiated instead of falling back to the simple 
Pojo instantiation.

Added:

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/sightly/

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/sightly/ModelFactoryUseProvider.java
Modified:
sling/trunk/bundles/extensions/models/impl/pom.xml

Modified: sling/trunk/bundles/extensions/models/impl/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/pom.xml?rev=1662434r1=1662433r2=1662434view=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Thu Feb 26 12:27:25 2015
@@ -146,5 +146,19 @@
 scopeprovided/scope
 optionaltrue/optional
 /dependency
+dependency
+groupIdorg.apache.sling/groupId
+artifactIdorg.apache.sling.scripting.sightly/artifactId
+version1.0.0-SNAPSHOT/version
+scopeprovided/scope
+optionaltrue/optional
+/dependency
+dependency
+groupIdorg.apache.sling/groupId
+artifactIdorg.apache.sling.commons.classloader/artifactId
+version1.3.0/version
+scopeprovided/scope
+optionaltrue/optional
+/dependency
 /dependencies
 /project

Added: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/sightly/ModelFactoryUseProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/sightly/ModelFactoryUseProvider.java?rev=1662434view=auto
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/sightly/ModelFactoryUseProvider.java
 (added)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/sightly/ModelFactoryUseProvider.java
 Thu Feb 26 12:27:25 2015
@@ -0,0 +1,146 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the License); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.models.impl.sightly;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.script.Bindings;
+import javax.servlet.ServletRequest;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.scripting.SlingBindings;
+import org.apache.sling.commons.classloader.DynamicClassLoaderManager;
+import org.apache.sling.models.factory.ModelFactory;
+import 
org.apache.sling.scripting.sightly.impl.engine.extension.use.UseProviderUtils;
+import org.apache.sling.scripting.sightly.render.RenderContext;
+import org.apache.sling.scripting.sightly.use.ProviderOutcome;
+import org.apache.sling.scripting.sightly.use.UseProvider;
+import org.osgi.framework.Constants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Sightly {@code UseProvider} which will instantiate a referenced Sling Model.
+ * It will always fail with an exception (i.e. no other {@code UseProvider} is 
asked afterwards and the exception is being rethrown)
+ * in case the following two preconditions are fulfilled:
+ * 1. the given identifier specifies a class which can be loaded by the 
DynamicClassLoader
+ * 2. the loaded class has a Model annotation
+ * In case any of those preconditions are not fulfilled, the other registered 
UseProviders are used!
+ */
+@Component
+@Service
+/*
+ * must have a higher priority than 
org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider 
but lower than 
+ * 
org.apache.sling.scripting.sightly.impl.engine.extension.use.RenderUnitProvider 
to kick

svn commit: r937442 - /websites/production/sling/content/

2015-01-23 Thread kwin
Author: kwin
Date: Fri Jan 23 16:13:07 2015
New Revision: 937442

Log:
Publishing svnmucc operation to sling site by kwin

Added:
websites/production/sling/content/
  - copied from r937441, websites/staging/sling/trunk/content/



svn commit: r1654253 - /sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext

2015-01-23 Thread kwin
Author: kwin
Date: Fri Jan 23 16:07:43 2015
New Revision: 1654253

URL: http://svn.apache.org/r1654253
Log:
SLING-3440 explain multiple selector handling, node type resource types and add 
examples which won't match

Modified:

sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext

Modified: 
sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext?rev=1654253r1=1654252r2=1654253view=diff
==
--- 
sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext
 (original)
+++ 
sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext
 Fri Jan 23 16:07:43 2015
@@ -15,7 +15,7 @@ Scripts and servlets are itself resource
 JCR repository, the resource type in a servlet component configuration or the 
virtual bundle resource path 
 (if a script is provided inside a bundle without being installed into the JCR 
repository). 
 
-For the Whole Truth about script resolution, see the [ScriptSelectionTest][1] 
class. If you see interesting cases that are not
+For the Whole Truth about script resolution, see the 
[ScriptSelectionTest](http://svn.apache.org/repos/asf/sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ScriptSelectionTest.java)
 class. If you see interesting cases that are not
 covered there, please let us know via the Sling users mailing list.
 
 TODO: explain super types, servlet path mappings, node type resource types 
(`my:type - my/type`) 
@@ -76,10 +76,10 @@ Depending on whether request selectors a
 
 The constituents of these script names are as follows: 
 
-* `{resourceTypeLabel}` - The last path segment of the path created from the 
resource type. This part is optional if the `{requestExtension}` is used in the 
script name. 
+* `{resourceTypeLabel}` - The last path segment of the path created from the 
resource type. This part is optional if the `{requestExtension}` is used in the 
script name. The resource type might either be set via the `sling:resourceType` 
property on the accessed node or if that property is not there its primary node 
type (property `jcr:primaryType`) is taken as fallback.
 * `{requestExtension}` - The request extension. This part may be ommitted if 
the request extension is html, otherwise this part is required. If this part 
is ommitted, the `{resourceTypeLabel}` is required in the case of ignoring the 
selectors. 
 * `{scriptExtension}` - The extension, e.g. esp or jsp, identifying the 
scripting langauage used. 
-* `{selectorStringPath}` - The selector string converted to a path, along the 
lines of `selectorString.replace('.', '/')`. 
+* `{selectorStringPath}` - The selector string converted to a path, along the 
lines of `selectorString.replace('.', '/')`. If less selectors are specified in 
the script name than given in the request, the script will only be taken into 
consideration if the given selectors are the **first** selectors in the 
request. This means *sel1/sel2.html.jsp* will be a candidate for the request 
url */content/test.sel1.sel2.sel3.html* but not for 
*/content/test.sel3.sel1.sel2.html*. So the order of selectors is relevant!
 
 ## Priority 
 
@@ -91,7 +91,7 @@ The rules for script path priorization i
 
 ## Examples 
 
-Taking up again the list of potential script paths for a request of a resource 
whose resource type is sling:sample and the request selectors are print.a4 
and the request extension is html could be: 
+Taking up again the list of potential script paths for a request of a resource 
whose resource type is `sling\sample` and the request selectors are *print.a4* 
and the request extension is *html* could be: 
 
 * (0) GET.esp 
 * (1) sample.esp 
@@ -99,10 +99,8 @@ Taking up again the list of potential sc
 * (3) print.esp 
 * (4) print/a4.esp 
 * (5) print.html.esp 
-* (6) print/a4.html.esp 
+* (6) print/a4.html.esp
+* (7) a4.html.esp
+* (8) a4/print.html.esp 
 
-The priority of script selection would (6) - (4) - (5) - (3) - (2) - (1) - 
(0). Note that (4) is a better match than (5) because it matches more selectors 
even though (5) has an extension match where (4) does not.
-
-
-
-  [1]: 
http://svn.apache.org/repos/asf/sling/trunk/bundles/servlets/resolver/src/test/java/org/apache/sling/servlets/resolver/internal/helper/ScriptSelectionTest.java
\ No newline at end of file
+The priority of script selection would be (starting with the best one): (6) - 
(4) - (5) - (3) - (2) - (1) - (0). Note that (4) is a better match than (5) 
because it matches more selectors even though (5) has an extension match where 
(4) does not. (7) is not a candidate because it does not include the first 
selector (print) and (8) is not a candidate because

svn commit: r1654255 - /sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext

2015-01-23 Thread kwin
Author: kwin
Date: Fri Jan 23 16:12:01 2015
New Revision: 1654255

URL: http://svn.apache.org/r1654255
Log:
SLING-3440 clarify example

Modified:

sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext

Modified: 
sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext?rev=1654255r1=1654254r2=1654255view=diff
==
--- 
sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext
 (original)
+++ 
sling/site/trunk/content/documentation/the-sling-engine/url-to-script-resolution.mdtext
 Fri Jan 23 16:12:01 2015
@@ -91,7 +91,7 @@ The rules for script path priorization i
 
 ## Examples 
 
-Taking up again the list of potential script paths for a request of a resource 
whose resource type is `sling\sample` and the request selectors are *print.a4* 
and the request extension is *html* could be: 
+Let's consider the following script paths for a request of a resource whose 
resource type is `sling\sample` and the request selectors are *print.a4* and 
the request extension is *html*: 
 
 * (0) GET.esp 
 * (1) sample.esp 




svn commit: r1655986 - /sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

2015-01-30 Thread kwin
Author: kwin
Date: Fri Jan 30 11:01:53 2015
New Revision: 1655986

URL: http://svn.apache.org/r1655986
Log:
SLING-4373 throw IAE in case null is given as parameter to createModel

Modified:

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java?rev=1655986r1=1655985r2=1655986view=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelAdapterFactory.java
 Fri Jan 30 11:01:53 2015
@@ -189,6 +189,12 @@ public class ModelAdapterFactory impleme
 @Override
 public ModelType ModelType createModel(Object adaptable, 
ClassModelType type) throws MissingElementsException,
 InvalidAdaptableException, InvalidValidationModelException, 
InvalidResourceException {
+if (adaptable == null) {
+throw new IllegalArgumentException(Given adaptable is null!);
+}
+if (type == null) {
+throw new IllegalArgumentException(Given type is null);
+}
 ResultModelType result = internalCreateModel(adaptable, type);
 result.throwException(log);
 return result.getModel();




svn commit: r1675834 - /sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java

2015-04-24 Thread kwin
Author: kwin
Date: Fri Apr 24 13:19:25 2015
New Revision: 1675834

URL: http://svn.apache.org/r1675834
Log:
SLING-4658 add (ignored test case) for extraction from single elements from an 
underlying array

Modified:

sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java

Modified: 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java?rev=1675834r1=1675833r2=1675834view=diff
==
--- 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java
 (original)
+++ 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java
 Fri Apr 24 13:19:25 2015
@@ -24,6 +24,7 @@ import java.util.Map;
 import org.apache.sling.api.resource.ValueMap;
 import org.junit.Assert;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 
 public class ValueMapDecoratorTest {
@@ -64,8 +65,26 @@ public class ValueMapDecoratorTest {
}

@Test
+   @Ignore(SLING-4658)
+   public void testGettingSingleValuesFromMultiValueEntries() {
+   map.put(prop1, new String[] {test, test2});
+   map.put(prop2, new String[] {1, 2});
+   Assert.assertEquals(First element from underlying array should 
be returned, test, valueMap.get(prop1, String.class));
+   Assert.assertEquals(First element from underlying array should 
be returned, Integer.valueOf(1), valueMap.get(prop1, Integer.class));
+   }
+   
+   @Test
public void testGettingInvalidEntryWithDefaultValue() {
Assert.assertEquals(Integer.valueOf(1), valueMap.get(prop1, 
1));
Assert.assertEquals(test, valueMap.get(prop1, test));
}
+   
+   @Test
+   public void testPrimitiveTypes() {
+   map.put(prop1, new String[] {1, 2});
+   Assert.assertNull(ValueMap should not support conversion to 
primitive type, valueMap.get(prop1, int.class));
+   Assert.assertNull(ValueMap should not support conversion to 
array of primitive type, valueMap.get(prop1, int[].class));
+   }
+   
+   
 }




svn commit: r1676917 - in /sling/trunk/launchpad: integration-tests/README.txt testing/README.txt testing/pom.xml

2015-04-30 Thread kwin
Author: kwin
Date: Thu Apr 30 07:56:38 2015
New Revision: 1676917

URL: http://svn.apache.org/r1676917
Log:
SLING-4674: clarify how the integration tests can be debugged (server- and 
client-side)

Modified:
sling/trunk/launchpad/integration-tests/README.txt
sling/trunk/launchpad/testing/README.txt
sling/trunk/launchpad/testing/pom.xml

Modified: sling/trunk/launchpad/integration-tests/README.txt
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/README.txt?rev=1676917r1=1676916r2=1676917view=diff
==
--- sling/trunk/launchpad/integration-tests/README.txt (original)
+++ sling/trunk/launchpad/integration-tests/README.txt Thu Apr 30 07:56:38 2015
@@ -6,7 +6,7 @@ separated in their own jar to be reusabl
 To run a single test or a specific set of tests against a running Sling
 instance, use for example:
 
-mvn test -Dtest=UploadFileTest
+mvn test -Dtest=UploadFileTest -Dhttp.port=1234
 
 Where UploadFileTest is the test to run. Wildcards are allowed, and test
 classes are found in the src/main folder (not a typo - that's not src/test
@@ -32,14 +32,15 @@ are excluded, to switch to them use -Dsl
 To run the tests against the same instance that is used in the full build,
 start an instance by running
 
-  mvn launchpad:run
+   mvn slingstart:start -Dlaunchpad.keep.running=true
 
 in the launchpad/testing folder, optionally using -Dsling.run.modes=oak to
-use Oak instead of Jackrabbit.
+use Oak instead of Jackrabbit. Since that instance is using an arbitrary
+http port you have to give exactly that port as parameter if you execute the 
test.
 
 The standard -Dmaven.surefire.debug option can be used to debug the tests
-themselves. To debug the server-side Sling code, set the appropriate JVM
-options on the VM that runs it.
+themselves. Have a look at the README.txt in the launchpad.testing module on 
how
+to debug the server-side Sling code.
 
 Note that, for all tests to pass, the Sling instance under test needs the 
 org.apache.sling.launchpad.test-services bundle, and the war file of the

Modified: sling/trunk/launchpad/testing/README.txt
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/README.txt?rev=1676917r1=1676916r2=1676917view=diff
==
--- sling/trunk/launchpad/testing/README.txt (original)
+++ sling/trunk/launchpad/testing/README.txt Thu Apr 30 07:56:38 2015
@@ -29,12 +29,14 @@ See the Subversion documentation for oth
 Integration tests
 -
 This module runs number of integration tests provided by the sibling 
-integration-tests module.
+integration-tests module. By default the instance is started, then the 
+integration-tests are executed and the instance is being shutdown again.
 
-To run individual tests, see the README.txt in that module.
+To run individual tests, see the README.txt in the integration-tests module.
 
 Use mvn slingstart:start -Dlaunchpad.keep.running=true to start this test 
instance.
-It allows you to run and debug individual tests against it. The standard 
MAVEN_OPTS 
-environment variable can be used to activate debugging of the Sling instance 
that's 
-being tested.
+It allows you to run and debug individual tests against it (on client-side). 
+To debug this instance on server-side start with mvn slingstart:run 
-Dlaunchpad.keep.running=true -Ddebug.
+That allows to connect to it via Java Remote Debugging on port 8000.
+You can stop the instance via Ctrl+C.
 

Modified: sling/trunk/launchpad/testing/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/testing/pom.xml?rev=1676917r1=1676916r2=1676917view=diff
==
--- sling/trunk/launchpad/testing/pom.xml (original)
+++ sling/trunk/launchpad/testing/pom.xml Thu Apr 30 07:56:38 2015
@@ -46,8 +46,7 @@
 properties
 sling.java.version7/sling.java.version
 
-!-- HTTP port to use when running mvn launchpad:run --
-run.http.port/run.http.port
+sling.default.vm.options-Xmx1024m -XX:MaxPermSize=256m 
-Djava.awt.headless=true/sling.default.vm.options
 
 !-- path suffix for HTTP access to Sling --
 http.base.path /
@@ -112,6 +111,7 @@
 controlPort${sling.control.port}/controlPort
 runmode${sling.run.modes}/runmode
 contextPath${http.base.path}/contextPath
+vmOpts${sling.vm.options}/vmOpts
 /server
 /servers
 /configuration
@@ -207,6 +207,28 @@
 max.port41799/max.port
 /properties
 /profile
+profile
+ iddebug/id
+ activation
+property
+namedebug/name
+/property

svn commit: r1676805 - in /sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run: LauncherCallable.java ServerConfiguration.java

2015-04-29 Thread kwin
Author: kwin
Date: Wed Apr 29 17:55:45 2015
New Revision: 1676805

URL: http://svn.apache.org/r1676805
Log:
SLING-4677 allow to start Sling in debug mode with a simple mojo parameter

Modified:

sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java

sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java

Modified: 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java?rev=1676805r1=1676804r2=1676805view=diff
==
--- 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java
 (original)
+++ 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java
 Wed Apr 29 17:55:45 2015
@@ -141,6 +141,7 @@ public class LauncherCallable implements
 
 args.add(java);
 add(args, this.configuration.getVmOpts());
+add(args, this.configuration.getVmDebugOpts());
 
 args.add(-cp);
 args.add(bin);

Modified: 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java?rev=1676805r1=1676804r2=1676805view=diff
==
--- 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java
 (original)
+++ 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java
 Wed Apr 29 17:55:45 2015
@@ -28,6 +28,9 @@ public class ServerConfiguration impleme
 
 private static final String DEFAULT_VM_OPTS = -Xmx1024m 
-XX:MaxPermSize=256m -Djava.awt.headless=true;
 
+// 
http://docs.oracle.com/javase/7/docs/technotes/guides/jpda/conninv.html#Invocation
+private static final String DEFAULT_VM_DEBUG_OPTS = 
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000;
+
 /** The unique id. */
 private String id;
 
@@ -46,6 +49,9 @@ public class ServerConfiguration impleme
 /** The vm options. */
 private String vmOpts = DEFAULT_VM_OPTS;
 
+/** Attach a debugger to the forked JVM. If set to true, the process 
will allow a debugger to attach on port 8000. If set to some other string, that 
string will be appended to the vmOpts, allowing you to configure arbitrary 
debuggability options (without overwriting the other options specified through 
the vmOpts parameter).*/
+private String debug;
+
 /** Additional application options. */
 private String opts;
 
@@ -103,6 +109,21 @@ public class ServerConfiguration impleme
 this.vmOpts = vmOpts;
 }
 
+/**
+ * @return the debugging options to use or {@code null}. Should be 
appended to the ones being returned by {@link #getVmOpts()}.
+ * @see a 
href=http://docs.oracle.com/javase/7/docs/technotes/guides/jpda/conninv.html#Invocation;JPDA
 Sun VM Invocation Options/a
+ */
+public String getVmDebugOpts() {
+if (Boolean.valueOf(debug).equals(Boolean.TRUE)) {
+return DEFAULT_VM_DEBUG_OPTS;
+}
+return debug;
+}
+
+public void setDebug(final String debug) {
+this.debug = debug;
+}
+
 public String getOpts() {
 return opts;
 }
@@ -151,6 +172,7 @@ public class ServerConfiguration impleme
 copy.setPort(this.getPort());
 copy.setContextPath(this.getContextPath());
 copy.setVmOpts(this.getVmOpts());
+copy.setDebug(this.debug);
 copy.setOpts(this.getOpts());
 copy.setInstances(1);
 copy.setFolder(this.getFolder());
@@ -164,7 +186,7 @@ public class ServerConfiguration impleme
 return LaunchpadConfiguration [id= + id + , runmode= + runmode
 + , port= + port + , controlPort= + controlPort
 + , contextPath= + contextPath
-+ , vmOpts= + vmOpts + , opts= + opts + , instances=
++ , vmOpts= + vmOpts + , vmDebugOpts= + getVmDebugOpts() + 
, opts= + opts + , instances=
 + instances + , folder= + folder + ];
 }
 }




svn commit: r1677000 - in /sling/trunk: bundles/extensions/models/impl/ bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/sightly/ contrib/scripting/sightly/ contrib/scripting/

2015-04-30 Thread kwin
Author: kwin
Date: Thu Apr 30 14:16:36 2015
New Revision: 1677000

URL: http://svn.apache.org/r1677000
Log:
SLING-4447 move Sightly Use Provider for Models into dedicated bundle

Added:
sling/trunk/contrib/scripting/sightly/models-use-provider/   (with props)
sling/trunk/contrib/scripting/sightly/models-use-provider/pom.xml
sling/trunk/contrib/scripting/sightly/models-use-provider/src/
sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/
sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/
sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/

sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/

sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/

sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/

sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/

sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/

sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/impl/

sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
Removed:

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/sightly/
Modified:
sling/trunk/bundles/extensions/models/impl/pom.xml
sling/trunk/contrib/scripting/sightly/pom.xml

Modified: sling/trunk/bundles/extensions/models/impl/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/pom.xml?rev=1677000r1=1676999r2=1677000view=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Thu Apr 30 14:16:36 2015
@@ -146,19 +146,5 @@
 scopeprovided/scope
 optionaltrue/optional
 /dependency
-dependency
-groupIdorg.apache.sling/groupId
-artifactIdorg.apache.sling.scripting.sightly/artifactId
-version1.0.0/version
-scopeprovided/scope
-optionaltrue/optional
-/dependency
-dependency
-groupIdorg.apache.sling/groupId
-artifactIdorg.apache.sling.commons.classloader/artifactId
-version1.3.0/version
-scopeprovided/scope
-optionaltrue/optional
-/dependency
 /dependencies
 /project

Propchange: sling/trunk/contrib/scripting/sightly/models-use-provider/
--
--- svn:ignore (added)
+++ svn:ignore Thu Apr 30 14:16:36 2015
@@ -0,0 +1 @@
+target

Added: sling/trunk/contrib/scripting/sightly/models-use-provider/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/models-use-provider/pom.xml?rev=1677000view=auto
==
--- sling/trunk/contrib/scripting/sightly/models-use-provider/pom.xml (added)
+++ sling/trunk/contrib/scripting/sightly/models-use-provider/pom.xml Thu Apr 
30 14:16:36 2015
@@ -0,0 +1,132 @@
+?xml version=1.0?
+!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ License); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  
~~~--
+project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd;
+modelVersion4.0.0/modelVersion
+!-- 
=== --
+!-- P A R E N T   P R O J E C T   
  --
+!-- 
=== --
+parent
+groupIdorg.apache.sling/groupId

svn commit: r1677002 - /sling/trunk/contrib/scripting/sightly/models-use-provider/

2015-04-30 Thread kwin
Author: kwin
Date: Thu Apr 30 14:22:16 2015
New Revision: 1677002

URL: http://svn.apache.org/r1677002
Log:
SLING-4447 add svn:ignore for Eclipse files

Modified:
sling/trunk/contrib/scripting/sightly/models-use-provider/   (props changed)

Propchange: sling/trunk/contrib/scripting/sightly/models-use-provider/
--
--- svn:ignore (original)
+++ svn:ignore Thu Apr 30 14:22:16 2015
@@ -1 +1,2 @@
 target
+.*




svn commit: r1677578 - /sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java

2015-05-04 Thread kwin
Author: kwin
Date: Mon May  4 10:42:55 2015
New Revision: 1677578

URL: http://svn.apache.org/r1677578
Log:
fix javadoc

Modified:

sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java

Modified: 
sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java?rev=1677578r1=1677577r2=1677578view=diff
==
--- 
sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
 (original)
+++ 
sling/trunk/contrib/scripting/sightly/models-use-provider/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
 Mon May  4 10:42:55 2015
@@ -41,19 +41,23 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Sightly {@code UseProvider} which will instantiate a referenced Sling Model.
+ * Sightly {@link UseProvider} which will instantiate a referenced Sling Model.
+ * For that it tries to use the {@link ModelFactory#createModel(Object, 
Class)} first with the adaptable {@link Resource} 
+ * then with the adaptable {@link SlingHttpServletRequest}.
  * It will always fail with an exception (i.e. no other {@code UseProvider} is 
asked afterwards and the exception is being rethrown)
  * in case the following two preconditions are fulfilled:
- * 1. the given identifier specifies a class which can be loaded by the 
DynamicClassLoader
- * 2. the loaded class has a Model annotation
- * In case any of those preconditions are not fulfilled, the other registered 
UseProviders are used!
+ * ol
+ * lithe given identifier specifies a class which can be loaded by the 
DynamicClassLoader/li
+ * lithe loaded class has a Model annotation/li
+ * /ol
+ * In case any of those preconditions are not fulfilled the other registered 
UseProviders are used!
  */
 @Component
 @Service
 /*
  * must have a higher priority than 
org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider 
but lower than 
  * 
org.apache.sling.scripting.sightly.impl.engine.extension.use.RenderUnitProvider 
to kick in 
- * before the JavaUserProvider but after the RenderUnitProvider
+ * before the JavaUseProvider but after the RenderUnitProvider
  */
 @Property(name = Constants.SERVICE_RANKING, intValue = { 95 }) 
 public class ModelFactoryUseProvider implements UseProvider {




svn commit: r1676456 - in /sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest: PostRedirectTest.java servlets/post/PostServletImportTest.java

2015-04-28 Thread kwin
Author: kwin
Date: Tue Apr 28 09:35:12 2015
New Revision: 1676456

URL: http://svn.apache.org/r1676456
Log:
SLING-4666 fix ITs of SlingPostServlet which does no longer allow redirects 
with host information

Modified:

sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PostRedirectTest.java

sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletImportTest.java

Modified: 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PostRedirectTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PostRedirectTest.java?rev=1676456r1=1676455r2=1676456view=diff
==
--- 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PostRedirectTest.java
 (original)
+++ 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/PostRedirectTest.java
 Tue Apr 28 09:35:12 2015
@@ -46,15 +46,16 @@ public class PostRedirectTest extends Ht
 
 public void testForcedRedirect() throws IOException {
 final MapString, String params = new HashMapString, String();
-params.put(:redirect, http://forced;);
+params.put(:redirect, /forced);
 final MapString, String headers = new HashMapString, String();
 headers.put(Referer, http://referer/;);
 
 final String location = testClient.createNode(postUrl, params, headers,
 false);
+// the servlet container prepends the host information to the redirect 
location
 assertEquals(
 With forced redirect and Referer, redirect must be forced,
-http://forced;, location);
+HTTP_BASE_URL + /forced, location);
 }
 
 public void testDefaultRedirect() throws IOException {

Modified: 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletImportTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletImportTest.java?rev=1676456r1=1676455r2=1676456view=diff
==
--- 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletImportTest.java
 (original)
+++ 
sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/servlets/post/PostServletImportTest.java
 Tue Apr 28 09:35:12 2015
@@ -208,14 +208,12 @@ public class PostServletImportTest exten
 
 props.put(SlingPostConstants.RP_CONTENT, jsonContent2);
 props.put(SlingPostConstants.RP_CONTENT_TYPE, json);
-props.put(SlingPostConstants.RP_REDIRECT_TO, importedNodeUrl);
 props.put(SlingPostConstants.RP_REPLACE, false);
 props.put(SlingPostConstants.RP_REPLACE_PROPERTIES, true);
-String importedNodeUrl2 = testClient.createNode(importedNodeUrl, 
props);
-assertEquals(importedNodeUrl, importedNodeUrl2);
+testClient.createNode(importedNodeUrl, props);
 
 // assert content at new location
-String content2 = getContent(importedNodeUrl2 + .3.json, 
CONTENT_TYPE_JSON);
+String content2 = getContent(importedNodeUrl + .3.json, 
CONTENT_TYPE_JSON);
 
JSONObject jsonObj2 = new JSONObject(content2);
assertNotNull(jsonObj2);




svn commit: r1677798 - in /sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run: LauncherCallable.java LaunchpadEnvironment.java ServerConfiguration.ja

2015-05-05 Thread kwin
Author: kwin
Date: Tue May  5 12:24:46 2015
New Revision: 1677798

URL: http://svn.apache.org/r1677798
Log:
SLING-4677 allow to override debug settings of all controlled Sling servers 
through Mojo parameter

Modified:

sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java

sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LaunchpadEnvironment.java

sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java

sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/StartMojo.java

Modified: 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java?rev=1677798r1=1677797r2=1677798view=diff
==
--- 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java
 (original)
+++ 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LauncherCallable.java
 Tue May  5 12:24:46 2015
@@ -141,7 +141,7 @@ public class LauncherCallable implements
 
 args.add(java);
 add(args, this.configuration.getVmOpts());
-add(args, this.configuration.getVmDebugOpts());
+add(args, 
this.configuration.getVmDebugOpts(this.environment.getDebug()));
 
 args.add(-cp);
 args.add(bin);

Modified: 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LaunchpadEnvironment.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LaunchpadEnvironment.java?rev=1677798r1=1677797r2=1677798view=diff
==
--- 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LaunchpadEnvironment.java
 (original)
+++ 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/LaunchpadEnvironment.java
 Tue May  5 12:24:46 2015
@@ -35,15 +35,18 @@ public class LaunchpadEnvironment {
 private final boolean cleanWorkingDirectory;
 private final boolean shutdownOnExit;
 private final int readyTimeOutSec;
+private final String debug;
 
 public LaunchpadEnvironment(final File launchpadJar,
 final boolean cleanWorkingDirectory,
 final boolean shutdownOnExit,
-final int readyTimeOutSec) {
+final int readyTimeOutSec,
+final String debug) {
 this.launchpadJar = launchpadJar;
 this.cleanWorkingDirectory = cleanWorkingDirectory;
 this.shutdownOnExit = shutdownOnExit;
 this.readyTimeOutSec = readyTimeOutSec;
+this.debug = debug;
 }
 
 public boolean isShutdownOnExit() {
@@ -137,4 +140,13 @@ public class LaunchpadEnvironment {
 }
 }
 }
+
+/**
+ * 
+ * @return the global debug parameter for all Sling instances. Set through 
{@link StartMojo#debug}.
+ */
+public String getDebug() {
+return debug;
+}
+
 }

Modified: 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java?rev=1677798r1=1677797r2=1677798view=diff
==
--- 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java
 (original)
+++ 
sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/java/org/apache/sling/maven/slingstart/run/ServerConfiguration.java
 Tue May  5 12:24:46 2015
@@ -110,10 +110,18 @@ public class ServerConfiguration impleme
 }
 
 /**
+ * Returns the debugging options derived from the passed globalDebug 
parameter and the debug field (where the globalDebug parameter has precedence 
over the local field)
+ * @param globalDebug the global debug options (may be {@code null}).
  * @return the debugging options to use or {@code null}. Should be 
appended to the ones being returned by {@link #getVmOpts()}.
  * @see a 
href=http://docs.oracle.com/javase/7/docs/technotes/guides/jpda/conninv.html#Invocation;JPDA
 Sun VM Invocation Options

svn commit: r1673463 - in /sling/trunk/bundles/extensions/validation/core/src: main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java test/java/org/apache/sling/validation/impl/Validati

2015-04-14 Thread kwin
Author: kwin
Date: Tue Apr 14 16:31:34 2015
New Revision: 1673463

URL: http://svn.apache.org/r1673463
Log:
SLING-4609 fix faulty commit

Modified:

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Modified: 
sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java?rev=1673463r1=1673462r2=1673463view=diff
==
--- 
sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 (original)
+++ 
sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
 Tue Apr 14 16:31:34 2015
@@ -132,7 +132,7 @@ public class ValidationServiceImpl imple
 
 @Override
 public @Nonnull ValidationResult validate(@Nonnull Resource resource, 
@Nonnull ValidationModel model) {
-return new ValidationResultImpl(); //validate(resource, model, );
+return validate(resource, model, );
 }
 
 protected @Nonnull ValidationResult validate(@Nonnull Resource resource, 
@Nonnull ValidationModel model, @Nonnull String relativePath) {

Modified: 
sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java?rev=1673463r1=1673462r2=1673463view=diff
==
--- 
sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 Tue Apr 14 16:31:34 2015
@@ -491,7 +491,7 @@ public class ValidationServiceImplTest {
 Assert.assertNotNull(Could not find validation model for 
'sling/validation/test', vm);
 
 ValidationResult vr = validationService.validate(testResource, 
vm);
-assertFalse(vr.isValid());
+assertFalse(resource should have been considered invalid, 
vr.isValid());
 assertThat(vr.getFailureMessages(), 
Matchers.hasKey(child1/grandChild1/hello));
 assertThat(vr.getFailureMessages().keySet(), 
Matchers.hasSize(1));
 }




svn commit: r1673430 - in /sling/trunk/bundles/extensions/validation: api/src/main/java/org/apache/sling/validation/api/ core/ core/src/main/java/org/apache/sling/validation/impl/ core/src/main/java/o

2015-04-14 Thread kwin
Author: kwin
Date: Tue Apr 14 14:19:49 2015
New Revision: 1673430

URL: http://svn.apache.org/r1673430
Log:
SLING-4609 more null annotations

Modified:

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
sling/trunk/bundles/extensions/validation/core/pom.xml

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ChildResourceImpl.java

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/JCRValidationModel.java

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ParameterizedValidatorImpl.java

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ResourcePropertyImpl.java

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResultImpl.java

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/JCRBuilder.java

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/ValidatorTypeUtil.java

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/validators/RegexValidator.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/ValidatorTypeUtilTest.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/DateValidator.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/ExtendedStringValidator.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/IntegerValidator.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringArrayValidator.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/util/examplevalidators/StringValidator.java
sling/trunk/bundles/extensions/validation/examples/pom.xml

sling/trunk/bundles/extensions/validation/examples/src/main/resources/SLING-INF/apps/validationdemo/components/user/user.jsp

Modified: 
sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java?rev=1673430r1=1673429r2=1673430view=diff
==
--- 
sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
 (original)
+++ 
sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java
 Tue Apr 14 14:19:49 2015
@@ -38,12 +38,12 @@ public interface ValidationService {
  *
  * @param validatedResourceType the type of {@code Resources} the model 
validates, should be either relative 
  *  (i.e. not start with a /) or starting 
with one of the resource resolver's search paths
- * @param applicablePaththe model's applicable path (the path of 
the validated resource)
+ * @param resourcePaththe path of the validated resource, may be 
{@code null} or empty. Must match the applicablePath property of the model
  * @return a {@code ValidationModel} if one is found, {@code null} 
otherwise
  * @throws IllegalStateException in case an invalid validation model was 
found
- * @throws IllegalArgumentException in case validatedResourceType was 
blank, {@code null} or absolute but outside of the search paths.
+ * @throws IllegalArgumentException in case validatedResourceType was 
blank, {@code null} or absolute but outside of the search paths
  */
-@CheckForNull ValidationModel getValidationModel(String 
validatedResourceType, String applicablePath) throws IllegalStateException, 
IllegalArgumentException;
+@CheckForNull ValidationModel getValidationModel(@Nonnull String 
validatedResourceType, String resourcePath) throws IllegalStateException, 
IllegalArgumentException;
 
 /**
  * Tries to obtain a {@link ValidationModel} that is able to validate the 
given {@code resource}.

Modified: sling/trunk/bundles/extensions/validation/core/pom.xml
URL: 
http

svn commit: r1672855 - /sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/ValidatorTypeUtil.java

2015-04-11 Thread kwin
Author: kwin
Date: Sat Apr 11 10:15:36 2015
New Revision: 1672855

URL: http://svn.apache.org/r1672855
Log:
SLING-4608 workaround for bug with type extraction on array types in Java  7

Modified:

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/ValidatorTypeUtil.java

Modified: 
sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/ValidatorTypeUtil.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/ValidatorTypeUtil.java?rev=1672855r1=1672854r2=1672855view=diff
==
--- 
sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/ValidatorTypeUtil.java
 (original)
+++ 
sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/util/ValidatorTypeUtil.java
 Sat Apr 11 10:15:36 2015
@@ -18,6 +18,8 @@
  */
 package org.apache.sling.validation.impl.util;
 
+import java.lang.reflect.Array;
+import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.TypeVariable;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -42,10 +44,15 @@ public class ValidatorTypeUtil {
 if (entry.getKey().getGenericDeclaration() instanceof Class?) {
 Class clazz = (Class)entry.getKey().getGenericDeclaration();
 if (clazz.equals(Validator.class)) {
+   // Java6 doesn't return the class for array types due 
to this bug: http://bugs.java.com/view_bug.do?bug_id=5041784
+   if (type instanceof GenericArrayType) {
+   // as a workaround make a new array class out 
of the generic component type encapsulated in the generic array type
+   type = Array.newInstance((Class?) 
((GenericArrayType)type).getGenericComponentType(), 0).getClass();
+}
 if (type instanceof Class?) {
 return (Class)type;
 }
-// type may also be a parmeterized type (e.g. for 
CollectionString), this is not allowed!
+// type may also be a parameterized type (e.g. for 
CollectionString), this is not allowed!
 else {
 throw new IllegalArgumentException(Validators may not 
use parameterized types as type parameter. Only simple class types and arrays 
of class types are allowed.);
 }




svn commit: r1672913 - /sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java

2015-04-11 Thread kwin
Author: kwin
Date: Sat Apr 11 18:04:00 2015
New Revision: 1672913

URL: http://svn.apache.org/r1672913
Log:
SLING-4609 add some more JSR 305 annotations

Modified:

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java

Modified: 
sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java?rev=1672913r1=1672912r2=1672913view=diff
==
--- 
sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
 (original)
+++ 
sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java
 Sat Apr 11 18:04:00 2015
@@ -18,6 +18,9 @@
  */
 package org.apache.sling.validation.api;
 
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.validation.api.exceptions.SlingValidationException;
 
@@ -69,5 +72,5 @@ public interface Validator T {
  * @return validation error message if validation was not successful, 
{@code null} otherwise. In case an empty string is returned a generic 
validation error message is used.
  * @throws 
org.apache.sling.validation.api.exceptions.SlingValidationException if some 
expected arguments are missing from the arguments map
  */
-String validate(T data, ValueMap valueMap, ValueMap arguments) throws 
SlingValidationException;
+@CheckForNull String validate(@Nonnull T data, @Nonnull ValueMap valueMap, 
@Nonnull ValueMap arguments) throws SlingValidationException;
 }




svn commit: r1672910 - in /sling/trunk/bundles/extensions/validation/api: ./ src/main/java/org/apache/sling/validation/api/ src/main/java/org/apache/sling/validation/api/exceptions/

2015-04-11 Thread kwin
Author: kwin
Date: Sat Apr 11 17:53:10 2015
New Revision: 1672910

URL: http://svn.apache.org/r1672910
Log:
SLING-4609 add JSR 305 null annotations

Added:

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/exceptions/package-info.java

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/package-info.java
Modified:
sling/trunk/bundles/extensions/validation/api/pom.xml

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ParameterizedValidator.java

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ResourceProperty.java

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationModel.java

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationResult.java

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ValidationService.java

sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/Validator.java

Modified: sling/trunk/bundles/extensions/validation/api/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/api/pom.xml?rev=1672910r1=1672909r2=1672910view=diff
==
--- sling/trunk/bundles/extensions/validation/api/pom.xml (original)
+++ sling/trunk/bundles/extensions/validation/api/pom.xml Sat Apr 11 17:53:10 
2015
@@ -20,13 +20,12 @@
 project xmlns=http://maven.apache.org/POM/4.0.0;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;
+modelVersion4.0.0/modelVersion
 parent
 groupIdorg.apache.sling/groupId
 artifactIdsling/artifactId
-version15/version
-relativePath /
+version22/version
 /parent
-modelVersion4.0.0/modelVersion
 
 artifactIdorg.apache.sling.validation.api/artifactId
 version1.0.0-SNAPSHOT/version
@@ -35,36 +34,26 @@
 nameApache Sling Validation Framework API/name
 descriptionThe Apache Sling Validation Framework API/description
 
+   properties
+sling.java.version6/sling.java.version
+/properties
+
+scm
+
connectionscm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/validation/api/connection
+developerConnection 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/validation/api/developerConnection
+
urlhttp://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/api/url
+/scm
+
 build
-plugins
-!--plugin--
-!--groupIdorg.apache.felix/groupId--
-!--artifactIdmaven-scr-plugin/artifactId--
-!--version1.11.0/version--
-!--executions--
-!--execution--
-!--idgenerate-scr-descriptor/id--
-!--goals--
-!--goalscr/goal--
-!--/goals--
-!--/execution--
-!--/executions--
-!--/plugin--
-plugin
-groupIdorg.apache.felix/groupId
-artifactIdmaven-bundle-plugin/artifactId
-extensionstrue/extensions
-configuration
-instructions
-Export-Package
-org.apache.sling.validation.api;version=1.0.0,
-
org.apache.sling.validation.api.exceptions;version=1.0.0
-/Export-Package
-/instructions
-/configuration
-/plugin
-/plugins
+   plugins
+   plugin
+   groupIdorg.apache.felix/groupId
+   artifactIdmaven-bundle-plugin/artifactId
+   extensionstrue/extensions
+/plugin
+   /plugins
 /build
+
 dependencies
 dependency
 groupIdorg.apache.sling/groupId
@@ -72,5 +61,12 @@
 version2.4.2/version
 scopeprovided/scope
 /dependency
+
+dependency
+groupIdcom.google.code.findbugs/groupId
+artifactIdjsr305/artifactId
+version3.0.0/version
+scopeprovided/scope
+/dependency
 /dependencies
 /project

Modified: 
sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling/validation/api/ChildResource.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/api/src/main/java/org/apache/sling

svn commit: r1672911 - in /sling/trunk/bundles/extensions/validation: ./ core/ core/src/main/java/org/apache/sling/validation/impl/ examples/ it-http/ test-services/ test-services/src/main/java/org/ap

2015-04-11 Thread kwin
Author: kwin
Date: Sat Apr 11 17:54:36 2015
New Revision: 1672911

URL: http://svn.apache.org/r1672911
Log:
use newest parent, get rid of JCR dependency, clean up POMs

Modified:
sling/trunk/bundles/extensions/validation/core/pom.xml

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationServiceImpl.java
sling/trunk/bundles/extensions/validation/examples/pom.xml
sling/trunk/bundles/extensions/validation/it-http/pom.xml
sling/trunk/bundles/extensions/validation/pom.xml
sling/trunk/bundles/extensions/validation/test-services/pom.xml

sling/trunk/bundles/extensions/validation/test-services/src/main/java/org/apache/sling/validation/testservices/ValidationPostOperation.java

Modified: sling/trunk/bundles/extensions/validation/core/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/pom.xml?rev=1672911r1=1672910r2=1672911view=diff
==
--- sling/trunk/bundles/extensions/validation/core/pom.xml (original)
+++ sling/trunk/bundles/extensions/validation/core/pom.xml Sat Apr 11 17:54:36 
2015
@@ -22,7 +22,7 @@
 parent
 groupIdorg.apache.sling/groupId
 artifactIdsling/artifactId
-version15/version
+version22/version
 relativePath /
 /parent
 
@@ -31,10 +31,9 @@
 version1.0.0-SNAPSHOT/version
 
 scm
-
connectionscm:git:https://github.com/raducotescu/org.apache.sling.validation.git/connection
-
developerConnectionscm:git:g...@github.com:raducotescu/org.apache.sling.validation.git/developerConnection
-tagHEAD/tag
-urlhttps://github.com/raducotescu/org.apache.sling.validation/url
+
connectionscm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/validation/core/connection
+developerConnection 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/validation/core/developerConnection
+
urlhttp://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/url
 /scm
 
 nameApache Sling Validation Framework Core Implementation/name
@@ -49,15 +48,6 @@
 plugin
 groupIdorg.apache.felix/groupId
 artifactIdmaven-scr-plugin/artifactId
-version1.11.0/version
-executions
-execution
-idgenerate-scr-descriptor/id
-goals
-goalscr/goal
-/goals
-/execution
-/executions
 /plugin
 plugin
 groupIdorg.apache.felix/groupId
@@ -65,9 +55,6 @@
 extensionstrue/extensions
 configuration
 instructions
-Private-Package
-org.apache.sling.validation.impl*
-/Private-Package
 Embed-Dependencycommons-lang3/Embed-Dependency
 /instructions
 /configuration
@@ -96,12 +83,7 @@
 artifactIdorg.osgi.core/artifactId
 scopeprovided/scope
 /dependency
-dependency
-groupIdjavax.jcr/groupId
-artifactIdjcr/artifactId
-version2.0/version
-scopeprovided/scope
-/dependency
+   
 dependency
 groupIdorg.apache.sling/groupId
 artifactIdorg.apache.sling.api/artifactId
@@ -116,7 +98,6 @@
 dependency
 groupIdorg.apache.felix/groupId
 artifactIdorg.apache.felix.scr.annotations/artifactId
-version1.9.0/version
 scopeprovided/scope
 /dependency
 dependency
@@ -185,32 +166,11 @@
 version1.3/version
 scopetest/scope
 /dependency
+dependency
+groupIdjavax.jcr/groupId
+artifactIdjcr/artifactId
+version2.0/version
+scopetest/scope
+/dependency
 /dependencies
-profiles
-profile
-idautoInstallBundle/id
-build
-plugins
-plugin
-groupIdorg.apache.sling/groupId
-artifactIdmaven-sling-plugin/artifactId
-version2.0.4-incubator/version
-executions
-execution
-idinstall-bundle/id
-goals
-goalinstall/goal
-/goals
-configuration
-
slingUrlhttp://localhost:/system/console/slingUrl
-useradmin/user
-passwordadmin/password

svn commit: r1672986 - /sling/trunk/parent/pom.xml

2015-04-12 Thread kwin
Author: kwin
Date: Sun Apr 12 07:08:36 2015
New Revision: 1672986

URL: http://svn.apache.org/r1672986
Log:
SLING-4610 ignore maven-enforcer-plugin and maven-remote-resources-plugin for 
m2e 

Modified:
sling/trunk/parent/pom.xml

Modified: sling/trunk/parent/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/parent/pom.xml?rev=1672986r1=1672985r2=1672986view=diff
==
--- sling/trunk/parent/pom.xml (original)
+++ sling/trunk/parent/pom.xml Sun Apr 12 07:08:36 2015
@@ -868,6 +868,48 @@ on 64bit platforms: MAVEN_OPTS=-Xmx512M
 ignore /
 /action
 /pluginExecution
+pluginExecution
+pluginExecutionFilter
+groupId
+org.apache.maven.plugins
+/groupId
+artifactId
+maven-enforcer-plugin
+/artifactId
+versionRange
+[1.3.1,)
+/versionRange
+goals
+goal
+enforce
+/goal
+/goals
+/pluginExecutionFilter
+action
+ignore /
+/action
+/pluginExecution
+pluginExecution
+pluginExecutionFilter
+groupId
+org.apache.maven.plugins
+/groupId
+artifactId
+
maven-remote-resources-plugin
+/artifactId
+versionRange
+[1.5,)
+/versionRange
+goals
+goal
+process
+/goal
+/goals
+/pluginExecutionFilter
+action
+ignore /
+/action
+/pluginExecution
 /pluginExecutions
 /lifecycleMappingMetadata
 /configuration




svn commit: r1671761 - /sling/trunk/bundles/extensions/models/impl/pom.xml

2015-04-07 Thread kwin
Author: kwin
Date: Tue Apr  7 08:32:49 2015
New Revision: 1671761

URL: http://svn.apache.org/r1671761
Log:
SLING-4447, rely on released version of Sightly to fix build errors related to 
SNAPSHOT not being available

Modified:
sling/trunk/bundles/extensions/models/impl/pom.xml

Modified: sling/trunk/bundles/extensions/models/impl/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/pom.xml?rev=1671761r1=1671760r2=1671761view=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Tue Apr  7 08:32:49 2015
@@ -149,7 +149,7 @@
 dependency
 groupIdorg.apache.sling/groupId
 artifactIdorg.apache.sling.scripting.sightly/artifactId
-version1.0.0-SNAPSHOT/version
+version1.0.0/version
 scopeprovided/scope
 optionaltrue/optional
 /dependency




svn commit: r1672038 - /sling/trunk/contrib/extensions/validation/org.apache.sling.validation/

2015-04-08 Thread kwin
Author: kwin
Date: Wed Apr  8 09:05:13 2015
New Revision: 1672038

URL: http://svn.apache.org/r1672038
Log:
remove empty folder

Removed:
sling/trunk/contrib/extensions/validation/org.apache.sling.validation/



svn commit: r1680762 - /sling/site/trunk/content/documentation/bundles/models.mdtext

2015-05-21 Thread kwin
Author: kwin
Date: Thu May 21 08:25:05 2015
New Revision: 1680762

URL: http://svn.apache.org/r1680762
Log:
clarify how injector sling-object works

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

Modified: sling/site/trunk/content/documentation/bundles/models.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/models.mdtext?rev=1680762r1=1680761r2=1680762view=diff
==
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Thu May 21 
08:25:05 2015
@@ -86,8 +86,9 @@ Or
 
 As with other AdapterFactories, if the adaptation can't be made for any 
reason, `adaptTo()` returns null.
 ## ModelFactory (since 1.2.0)
+*See also  [SLING-3709](https://issues.apache.org/jira/browse/SLING-3709)*
 
-Since Sling Models 1.2.0 
([SLING-3709](https://issues.apache.org/jira/browse/SLING-3709)) there is 
another way of instantiating models. The OSGi service `ModelFactory` provides a 
method for instantiating a model that throws exceptions this is not possible. 
That way `null` checks are not necessary.
+Since Sling Models 1.2.0 there is another way of instantiating models. The 
OSGi service `ModelFactory` provides a method for instantiating a model that 
throws exceptions. This is not allowed by the Javadoc contract of the adaptTo 
method. That way `null` checks are not necessary and it is easier to see why 
instantiation of the model failed.
 
 ::java
try {
@@ -366,9 +367,9 @@ Value Map  | `valuemap`
 Child Resources| `child-resources`   | 3000| 1.0.0 
   | Gets a child resource by name | `Resource` 
objects | no | none | if a parameterized type is passed, a `ListResource` is 
returned (the contents of which may be adapted to the target type).
 Request Attributes | `request-attributes`| 4000| 1.0.0 
   | Get a request attribute   | 
`ServletRequest` objects | no | no conversion is done | If a parameterized type 
is passed, the request attribute must be of a compatible type of the 
parameterized type.
 OSGi Services  | `osgi-services` | 5000| 1.0.0 
   | Lookup services based on class name | Any 
object | yes | yes | Parameterized `List` and `Collection` injection points are 
injected by getting an array of the services and creating an unmodifiable 
`List` from the array.
-Resource Path  | `resource-path` | 2500| 1.1.0 
   | Injects a resource by its path. | `Resource` 
or `SlingHttpRequest` objects | yes | none | none
+Resource Path  | `resource-path` | 2500| 1.1.0 
   | Injects a resource by its path. | `Resource` 
or `SlingHttpServletRequest` objects | yes | none | none
 Self   | `self`  | `Integer.MAX_VALUE` | 1.1.0 
   | Injects the adaptable object itself (if the 
class of the field matches or is a supertype). If the @Self annotation is 
present it is tried to adapt the adaptable to the field type.  | Any object | 
yes | none | none
-Sling Object   | `sling-object`  | `Integer.MAX_VALUE` | 1.1.0 
   | Injects commonly used sling objects if the 
field matches with the class: request, response, resource resolver, current 
resource, SlingScriptHelper | `Resource`, `ResourceResolver` or 
`SlingHttpRequest` objects | yes | none | none
+Sling Object   | `sling-object`  | `Integer.MAX_VALUE` | 1.1.0 
   | Injects commonly used sling objects if the 
field matches with the class: request, response, resource resolver, current 
resource, SlingScriptHelper. This works only if the adaptable can get the 
according information, i.e. all objects are available via 
`SlingHttpServletRequest` while `ResourceResolver` can only resolve the 
`ResourceResolver` object and nothing else | `Resource`, `ResourceResolver` or 
`SlingHttpServletRequest` objects | yes | none | none
 
 # Injector-specific Annotations (Since Sling Models Impl 1.0.6)
 




svn commit: r1680764 - /sling/site/trunk/content/documentation/bundles/models.mdtext

2015-05-21 Thread kwin
Author: kwin
Date: Thu May 21 08:48:44 2015
New Revision: 1680764

URL: http://svn.apache.org/r1680764
Log:
more information about sling-objects injector limitations (resource injection 
only works with injector-specific annotation)

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

Modified: sling/site/trunk/content/documentation/bundles/models.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/models.mdtext?rev=1680764r1=1680763r2=1680764view=diff
==
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Thu May 21 
08:48:44 2015
@@ -369,7 +369,7 @@ Request Attributes | `request-attributes
 OSGi Services  | `osgi-services` | 5000| 1.0.0 
   | Lookup services based on class name | Any 
object | yes | yes | Parameterized `List` and `Collection` injection points are 
injected by getting an array of the services and creating an unmodifiable 
`List` from the array.
 Resource Path  | `resource-path` | 2500| 1.1.0 
   | Injects a resource by its path. | `Resource` 
or `SlingHttpServletRequest` objects | yes | none | none
 Self   | `self`  | `Integer.MAX_VALUE` | 1.1.0 
   | Injects the adaptable object itself (if the 
class of the field matches or is a supertype). If the @Self annotation is 
present it is tried to adapt the adaptable to the field type.  | Any object | 
yes | none | none
-Sling Object   | `sling-object`  | `Integer.MAX_VALUE` | 1.1.0 
   | Injects commonly used sling objects if the 
field matches with the class: request, response, resource resolver, current 
resource, SlingScriptHelper. This works only if the adaptable can get the 
according information, i.e. all objects are available via 
`SlingHttpServletRequest` while `ResourceResolver` can only resolve the 
`ResourceResolver` object and nothing else. A discussion around this limitation 
and a potential solution can be found at the [sling-dev mailing 
list](http://apache-sling.73963.n3.nabble.com/RTC-ThreadLocal-for-getting-current-request-in-sling-td4042387.html).
 | `Resource`, `ResourceResolver` or `SlingHttpServletRequest` objects (not all 
objects can be resolved by all adaptables) | yes | none | none
+Sling Object   | `sling-object`  | `Integer.MAX_VALUE` | 1.1.0 
   | Injects commonly used sling objects if the 
field matches with the class: request, response, resource resolver, current 
resource, SlingScriptHelper. This works only if the adaptable can get the 
according information, i.e. all objects are available via 
`SlingHttpServletRequest` while `ResourceResolver` can only resolve the 
`ResourceResolver` object and nothing else. A discussion around this limitation 
can be found at [SLING-4083](https://issues.apache.org/jira/browse/SLING-4083). 
Also `Resource`s can only be injected if the according injector-specific 
annotation is used (`@SlingObject`). | `Resource`, `ResourceResolver` or 
`SlingHttpServletRequest` objects (not all objects can be resolved by all 
adaptables).  | yes | none | none
 
 # Injector-specific Annotations (Since Sling Models Impl 1.0.6)
 




svn commit: r1683690 - in /sling/trunk/bundles/extensions/validation/core: ./ src/main/java/org/apache/sling/validation/impl/ src/test/java/org/apache/sling/validation/impl/ src/test/java/org/apache/s

2015-06-05 Thread kwin
Author: kwin
Date: Fri Jun  5 09:44:30 2015
New Revision: 1683690

URL: http://svn.apache.org/r1683690
Log:
SLING-4388 use Sling Mocks for testing

This closes #93

Removed:

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/setup/MockedResource.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/setup/MockedResourceResolver.java
Modified:
sling/trunk/bundles/extensions/validation/core/pom.xml

sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java

sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java

Modified: sling/trunk/bundles/extensions/validation/core/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/pom.xml?rev=1683690r1=1683689r2=1683690view=diff
==
--- sling/trunk/bundles/extensions/validation/core/pom.xml (original)
+++ sling/trunk/bundles/extensions/validation/core/pom.xml Fri Jun  5 09:44:30 
2015
@@ -137,9 +137,15 @@
 scopetest/scope
 /dependency
 dependency
-groupIdorg.apache.sling/groupId
-artifactIdorg.apache.sling.commons.testing/artifactId
-version2.0.14/version
+groupIdorg.hamcrest/groupId
+artifactIdhamcrest-library/artifactId
+version1.3/version
+scopetest/scope
+/dependency
+ dependency
+groupIdorg.hamcrest/groupId
+artifactIdhamcrest-core/artifactId
+version1.3/version
 scopetest/scope
 /dependency
 dependency
@@ -155,22 +161,20 @@
 scopetest/scope
 /dependency
 dependency
-groupIdorg.hamcrest/groupId
-artifactIdhamcrest-library/artifactId
-version1.3/version
-scopetest/scope
-/dependency
- dependency
-groupIdorg.hamcrest/groupId
-artifactIdhamcrest-core/artifactId
-version1.3/version
-scopetest/scope
-/dependency
-dependency
 groupIdjavax.jcr/groupId
 artifactIdjcr/artifactId
 version2.0/version
 scopetest/scope
 /dependency
+dependency
+groupIdorg.apache.sling/groupId
+artifactIdorg.apache.sling.testing.sling-mock/artifactId
+version1.3.0/version
+/dependency
+dependency
+groupIdorg.slf4j/groupId
+artifactIdslf4j-simple/artifactId
+ scopetest/scope
+ /dependency
 /dependencies
 /project

Modified: 
sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java?rev=1683690r1=1683689r2=1683690view=diff
==
--- 
sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
 (original)
+++ 
sling/trunk/bundles/extensions/validation/core/src/main/java/org/apache/sling/validation/impl/ValidationResourceVisitor.java
 Fri Jun  5 09:44:30 2015
@@ -51,7 +51,7 @@ public class ValidationResourceVisitor e
 if (isValidSubResource(resource)) {
 // JCR will return then primary type instead!!
 @SuppressWarnings(null)
-   ValidationModel model = 
validationService.getValidationModel(resource);
+ValidationModel model = 
validationService.getValidationModel(resource);
 if (model == null) {
 if (enforceValidation) {
 throw new IllegalArgumentException(No model for resource 
type  + resource.getResourceType() +  found.);

Modified: 
sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java?rev=1683690r1=1683689r2=1683690view=diff
==
--- 
sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/validation/core/src/test/java/org/apache/sling/validation/impl/ValidationServiceImplTest.java
 Fri Jun  5 09:44:30 2015
@@ -22,18 +22,24 @@ import static org.junit.Assert.assertFal
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertThat

svn commit: r1683791 - in /sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi: PropertiesUtil.java ServiceUtil.java

2015-06-05 Thread kwin
Author: kwin
Date: Fri Jun  5 16:08:42 2015
New Revision: 1683791

URL: http://svn.apache.org/r1683791
Log:
fix typos

Modified:

sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java

sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java

Modified: 
sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java?rev=1683791r1=1683790r2=1683791view=diff
==
--- 
sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java
 (original)
+++ 
sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/PropertiesUtil.java
 Fri Jun  5 16:08:42 2015
@@ -26,7 +26,7 @@ import java.util.Map;
 
 /**
  * The codePropertiesUtil/code is a utility class providing some
- * usefull utility methods for converting property types.
+ * useful utility methods for converting property types.
  *
  * @since 2.1
  */

Modified: 
sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java?rev=1683791r1=1683790r2=1683791view=diff
==
--- 
sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java
 (original)
+++ 
sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java
 Fri Jun  5 16:08:42 2015
@@ -25,7 +25,7 @@ import org.osgi.framework.ServiceReferen
 
 /**
  * The codeServiceUtil/code is a utility class providing some
- * usefull utility methods for service handling.
+ * useful utility methods for service handling.
  * @since 2.1
  */
 public class ServiceUtil {




svn commit: r1684152 - /sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java

2015-06-08 Thread kwin
Author: kwin
Date: Mon Jun  8 11:25:38 2015
New Revision: 1684152

URL: http://svn.apache.org/r1684152
Log:
fix formatting

Modified:

sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java

Modified: 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java?rev=1684152r1=1684151r2=1684152view=diff
==
--- 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java
 (original)
+++ 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java
 Mon Jun  8 11:25:38 2015
@@ -28,113 +28,123 @@ import org.junit.Ignore;
 import org.junit.Test;
 
 public class ValueMapDecoratorTest {
-   
-   private MapString, Object map;
-   private ValueMap valueMap;
-   
-   @Before
-   public void setUp() {
-   map = new HashMapString,Object();
-   valueMap = new ValueMapDecorator(map);
-   }
-
-   // SLING-4178
-   @Test
-   public void testIncompatibleTypeInArray() {
-   map.put(prop1, new String[] {test, test2});
-   map.put(prop2, test);
-   Assert.assertNull(Not convertible type should return null, 
valueMap.get(prop1, Integer[].class));
-   Assert.assertNull(Not convertible type should return null, 
valueMap.get(prop2, Integer[].class));
-   }
-   
-   // SLING-662
-   @Test
-   public void testGettingArraysFromSingleValueEntries() {
-   map.put(prop1, test);
-   map.put(prop2, 1);
-   Assert.assertArrayEquals(Even though the underlying entry is 
single-value if should be enclosed in a single element array, new String[] 
{test}, valueMap.get(prop1, String[].class));
-   Assert.assertArrayEquals(Even though the underlying entry is 
single-value if should be enclosed in a single element array, new Integer[] 
{1}, valueMap.get(prop2, Integer[].class));
-   }
-   
-   @Test
-   public void testGettingArraysFromMultiValueEntries() {
-   map.put(prop1, new String[] {test, test2});
-   map.put(prop2, new String[] {1, 2});
-   Assert.assertArrayEquals(Could not get values from underlying 
array, new String[] {test, test2}, valueMap.get(prop1, String[].class));
-   Assert.assertArrayEquals(Conversion to Integer was not 
possible, new Integer[] {1, 2}, valueMap.get(prop2, Integer[].class));
-   }
-   
-   @Test
-   @Ignore(SLING-4658)
-   public void testGettingSingleValuesFromMultiValueEntries() {
-   map.put(prop1, new String[] {test, test2});
-   map.put(prop2, new String[] {1, 2});
-   Assert.assertEquals(First element from underlying array should 
be returned, test, valueMap.get(prop1, String.class));
-   Assert.assertEquals(First element from underlying array should 
be returned, Integer.valueOf(1), valueMap.get(prop1, Integer.class));
-   }
-   
-   @Test
-   public void testGettingInvalidEntryWithDefaultValue() {
-   Assert.assertEquals(Integer.valueOf(1), valueMap.get(prop1, 
1));
-   Assert.assertEquals(test, valueMap.get(prop1, test));
-   }
-   
-   @Test
-   public void testPrimitiveTypes() {
-   map.put(prop1, new String[] {1, 2});
-   Assert.assertNull(ValueMap should not support conversion to 
primitive type, valueMap.get(prop1, int.class));
-   Assert.assertNull(ValueMap should not support conversion to 
array of primitive type, valueMap.get(prop1, int[].class));
-   }
-   
-   @Test 
-   public void testEqualsAndHashCodeOfEqualValueMapsWithNonArrayTypes() {
-   map.put(prop1, some string);
-ValueMapDecorator valueMap2 = new ValueMapDecorator(map);
-Assert.assertTrue(Two ValueMapDecorators based on the same 
map should be equal, valueMap.equals(valueMap2));
-Assert.assertEquals(Two equal ValueMapDecorators should have 
the same hash code, valueMap.hashCode(), valueMap2.hashCode());
-
-ValueMapDecorator valueMap3 = new ValueMapDecorator(new 
HashMapString, Object());
-valueMap3.put(prop1, some string);
-Assert.assertEquals(valueMap, valueMap3);
-Assert.assertEquals(Two equal ValueMapDecorators should have 
the same hash code, valueMap.hashCode(), valueMap3.hashCode());
-
-Assert.assertEquals(map, valueMap);
-Assert.assertEquals(valueMap, map);
-   }
-   
-   @Ignore(SLING-4784)
-   @Test
-public void

svn commit: r1684151 - in /sling/trunk/bundles/api/src: main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java

2015-06-08 Thread kwin
Author: kwin
Date: Mon Jun  8 11:24:47 2015
New Revision: 1684151

URL: http://svn.apache.org/r1684151
Log:
SLING-4784 implement equals and hashCode for ValueMapDecorator

Modified:

sling/trunk/bundles/api/src/main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java

sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java

Modified: 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java?rev=1684151r1=1684150r2=1684151view=diff
==
--- 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java
 (original)
+++ 
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/wrappers/ValueMapDecorator.java
 Mon Jun  8 11:24:47 2015
@@ -221,4 +221,22 @@ public class ValueMapDecorator implement
 public String toString() {
 return super.toString() +  :  + this.base.toString();
 }
+
+@Override
+/**
+ * {@inheritDoc}
+ */
+public int hashCode() {
+return base.hashCode();
+}
+
+@Override
+/**
+ * {@inheritDoc}
+ */
+public boolean equals(Object obj) {
+return base.equals(obj);
+}
+
+
 }
\ No newline at end of file

Modified: 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java?rev=1684151r1=1684150r2=1684151view=diff
==
--- 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java
 (original)
+++ 
sling/trunk/bundles/api/src/test/java/org/apache/sling/api/wrappers/ValueMapDecoratorTest.java
 Mon Jun  8 11:24:47 2015
@@ -86,5 +86,55 @@ public class ValueMapDecoratorTest {
Assert.assertNull(ValueMap should not support conversion to 
array of primitive type, valueMap.get(prop1, int[].class));
}

+   @Test 
+   public void testEqualsAndHashCodeOfEqualValueMapsWithNonArrayTypes() {
+   map.put(prop1, some string);
+ValueMapDecorator valueMap2 = new ValueMapDecorator(map);
+Assert.assertTrue(Two ValueMapDecorators based on the same 
map should be equal, valueMap.equals(valueMap2));
+Assert.assertEquals(Two equal ValueMapDecorators should have 
the same hash code, valueMap.hashCode(), valueMap2.hashCode());
+
+ValueMapDecorator valueMap3 = new ValueMapDecorator(new 
HashMapString, Object());
+valueMap3.put(prop1, some string);
+Assert.assertEquals(valueMap, valueMap3);
+Assert.assertEquals(Two equal ValueMapDecorators should have 
the same hash code, valueMap.hashCode(), valueMap3.hashCode());
+
+Assert.assertEquals(map, valueMap);
+Assert.assertEquals(valueMap, map);
+   }
+   
+   @Ignore(SLING-4784)
+   @Test
+public void testEqualsAndHashCodeOfEqualValueMapsWithArrayTypes() {
+map.put(prop1, new String[] {1, 2});
+ValueMapDecorator valueMap2 = new ValueMapDecorator(map);
+Assert.assertTrue(Two ValueMapDecorators based on the same 
map should be equal, valueMap.equals(valueMap2));
+Assert.assertEquals(Two equal ValueMapDecorators should have 
the same hash code, valueMap.hashCode(), valueMap2.hashCode());
+
+ValueMapDecorator valueMap3 = new ValueMapDecorator(new 
HashMapString, Object());
+valueMap3.put(prop1, new String[] {1, 2});
+Assert.assertEquals(valueMap, valueMap3);
+Assert.assertEquals(Two equal ValueMapDecorators should have 
the same hash code, valueMap.hashCode(), valueMap3.hashCode());
+}
+   
+   @Test 
+public void testEqualsOfInequalValueMapsWithNonArrayTypes() {
+valueMap.put(prop, value);
+ValueMapDecorator valueMap2 = new ValueMapDecorator(new 
HashMapString, Object());
+valueMap2.put(prop, value2);
+Assert.assertFalse(Two ValueMapDecorators based on maps with 
different entries should not be equal, valueMap.equals(valueMap2));
+
+}
+   
+   @Test 
+public void testEqualsOfInequalValueMapsWithArrayTypes() {
+valueMap.put(prop, new String[] {1, 2});
+ValueMapDecorator valueMap2 = new ValueMapDecorator(new 
HashMapString, Object());
+valueMap2.put(prop, new String[] {3, 4});
+Assert.assertFalse(Two ValueMapDecorators based on maps

svn commit: r1683242 - /sling/trunk/bundles/extensions/models/validation-impl/src/main/java/org/apache/sling/models/validation/impl/ModelValidationImpl.java

2015-06-03 Thread kwin
Author: kwin
Date: Wed Jun  3 07:02:09 2015
New Revision: 1683242

URL: http://svn.apache.org/r1683242
Log:
SLING-4161 log missing validation models only with debug level (in case it is 
not required)

Modified:

sling/trunk/bundles/extensions/models/validation-impl/src/main/java/org/apache/sling/models/validation/impl/ModelValidationImpl.java

Modified: 
sling/trunk/bundles/extensions/models/validation-impl/src/main/java/org/apache/sling/models/validation/impl/ModelValidationImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/validation-impl/src/main/java/org/apache/sling/models/validation/impl/ModelValidationImpl.java?rev=1683242r1=1683241r2=1683242view=diff
==
--- 
sling/trunk/bundles/extensions/models/validation-impl/src/main/java/org/apache/sling/models/validation/impl/ModelValidationImpl.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/validation-impl/src/main/java/org/apache/sling/models/validation/impl/ModelValidationImpl.java
 Wed Jun  3 07:02:09 2015
@@ -77,7 +77,7 @@ public class ModelValidationImpl impleme
 if (required) {
 return new ValidationException(error);
 } else {
-log.warn(error);
+log.debug(error);
 }
 } else {
 try {
@@ -92,8 +92,6 @@ public class ModelValidationImpl impleme
 } catch (IllegalStateException e) {
 return new ValidationException(e);
 }
-
 return null;
 }
-
 }




svn commit: r1683166 - /sling/trunk/bundles/extensions/models/validation-impl/

2015-06-02 Thread kwin
Author: kwin
Date: Tue Jun  2 19:25:02 2015
New Revision: 1683166

URL: http://svn.apache.org/r1683166
Log:
SLING-4161 add svn:ignore for Eclipse files

Modified:
sling/trunk/bundles/extensions/models/validation-impl/   (props changed)

Propchange: sling/trunk/bundles/extensions/models/validation-impl/
--
--- svn:ignore (original)
+++ svn:ignore Tue Jun  2 19:25:02 2015
@@ -1 +1,2 @@
 target
+.*




svn commit: r1686215 - in /sling/trunk/bundles/extensions/i18n: ./ src/main/java/org/apache/sling/i18n/impl/ src/test/java/org/apache/sling/i18n/impl/

2015-06-18 Thread kwin
Author: kwin
Date: Thu Jun 18 13:50:56 2015
New Revision: 1686215

URL: http://svn.apache.org/r1686215
Log:
SLING-4811, SLING-4818 handle events asynchronously and also correctly detect 
newly added dictionaries

Modified:
sling/trunk/bundles/extensions/i18n/pom.xml

sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java

sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java

sling/trunk/bundles/extensions/i18n/src/test/java/org/apache/sling/i18n/impl/ConcurrentJcrResourceBundleLoadingTest.java

Modified: sling/trunk/bundles/extensions/i18n/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/i18n/pom.xml?rev=1686215r1=1686214r2=1686215view=diff
==
--- sling/trunk/bundles/extensions/i18n/pom.xml (original)
+++ sling/trunk/bundles/extensions/i18n/pom.xml Thu Jun 18 13:50:56 2015
@@ -163,6 +163,12 @@
 groupIdjavax.servlet/groupId
 artifactIdservlet-api/artifactId
 /dependency
+dependency
+groupIdorg.apache.sling/groupId
+artifactIdorg.apache.sling.commons.scheduler/artifactId
+version2.4.0/version
+scopeprovided/scope
+/dependency
 
 !-- Version needs to be overwritten for SLING-3954
  Can be removed once we update to a new parent pom (22) --

Modified: 
sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java?rev=1686215r1=1686214r2=1686215view=diff
==
--- 
sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
 (original)
+++ 
sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundle.java
 Thu Jun 18 13:50:56 2015
@@ -46,8 +46,13 @@ public class JcrResourceBundle extends R
 
 private static final Logger log = 
LoggerFactory.getLogger(JcrResourceBundle.class);
 
+/** default primary type (=resource type) for message entry dictionaries */
+static final String RT_MESSAGE_ENTRY = sling:MessageEntry;
+
 static final String MIXIN_MESSAGE = sling:Message;
 
+static final String MIXIN_LANGUAGE = mix:language;
+
 static final String PROP_KEY = sling:key;
 
 static final String PROP_VALUE = sling:message;

Modified: 
sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java?rev=1686215r1=1686214r2=1686215view=diff
==
--- 
sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java
 (original)
+++ 
sling/trunk/bundles/extensions/i18n/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java
 Thu Jun 18 13:50:56 2015
@@ -24,12 +24,12 @@ import static org.apache.sling.i18n.impl
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Date;
 import java.util.Dictionary;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.Iterator;
-import java.util.List;
 import java.util.Locale;
 import java.util.Map;
 import java.util.MissingResourceException;
@@ -46,9 +46,13 @@ import org.apache.felix.scr.annotations.
 import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.resource.LoginException;
+import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
+import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.commons.osgi.PropertiesUtil;
+import org.apache.sling.commons.scheduler.ScheduleOptions;
+import org.apache.sling.commons.scheduler.Scheduler;
 import org.apache.sling.i18n.ResourceBundleProvider;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
@@ -83,6 +87,11 @@ public class JcrResourceBundleProvider i
 @Property(boolValue = DEFAULT_PRELOAD_BUNDLES)
 private static final String PROP_PRELOAD_BUNDLES = preload.bundles;
 
+@Reference
+private Scheduler scheduler;
+
+/** job names of scheduled jobs for reloading individual bundles */
+private final CollectionString scheduledJobNames = 
Collections.synchronizedList(new ArrayListString()) ;
 
 /** default log */
 private final Logger log = LoggerFactory.getLogger(getClass());
@@ -182,7 +191,7 @@ public class

  1   2   3   4   5   6   7   8   >