You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:11:33 UTC

[sling-org-apache-sling-scripting-sightly-models-provider] annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0 created (now a420aa7)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git.


      at a420aa7  (tag)
 tagging 8fd434802540752dddce1b3cf37b64f002984d24 (commit)
      by Radu Cotescu
      on Thu Oct 8 11:05:30 2015 +0000

- Log -----------------------------------------------------------------
org.apache.sling.scripting.sightly.models.provider-1.0.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new ac1666c  SLING-4704 - Move the Sightly scripting engine artifacts from contrib to bundles
     new 05f5c10  svn:ignore
     new 6807384  Update to Sling Parent 23
     new 332659e  Remove superflous sling.java.version=6 as it's the default now
     new 0bbe25e  set parent version to 24 and add empty relativePath where missing
     new 9d020af  SLING-4734 first try to instantiate model with request then with resource
     new 212ee80  use released version of Models API
     new b05f95a  SLING-4734 skip provider as early as possible if the given class is no model
     new 61deecd  SLING-5036 - Optimise the ModelsFactoryUseProvider to fail as early as possible if it cannot provide an object
     new f03f3a8  SLING-5074 - Provide a way to configure the priority of the Sling Models Use Provider
     new 22c0fc0  Update the main reactor to parent 25
     new 3f0c850  trivial: corrected javadoc
     new ee3c667  trivial: corrected javadoc
     new 5acde02  [maven-release-plugin] prepare release org.apache.sling.scripting.sightly.models.provider-1.0.0
     new 8fd4348  [maven-release-plugin] copy for tag org.apache.sling.scripting.sightly.models.provider-1.0.0

The 15 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-scripting-sightly-models-provider] 08/15: SLING-4734 skip provider as early as possible if the given class is no model

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit b05f95abf7e82c442828459f6bf88ecf35c9471a
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Sep 17 06:58:24 2015 +0000

    SLING-4734 skip provider as early as possible if the given class is no model
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1703499 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                      |  2 +-
 .../sightly/models/impl/ModelFactoryUseProvider.java         | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pom.xml b/pom.xml
index 218f80c..04cddd5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,7 +92,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.models.api</artifactId>
-            <version>1.2.0</version>
+            <version>1.2.2</version>
             <scope>provided</scope>
         </dependency>
 
diff --git a/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java b/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
index 07c495b..6c81d92 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
@@ -80,6 +80,11 @@ public class ModelFactoryUseProvider implements UseProvider {
             // next use provider will be queried
             return ProviderOutcome.failure();
         }
+        if (!modelFactory.isModelClass(cls)) {
+            log.debug("{} is no Sling Model (because it lacks the according Model annotation or is not being picked up by the Bundle Listener)!");
+            // next use provider will be queried
+            return ProviderOutcome.failure();
+        }
         Bindings globalBindings = renderContext.getBindings();
         Bindings bindings = merge(globalBindings, arguments);
         Resource resource = (Resource) bindings.get(SlingBindings.RESOURCE);
@@ -90,16 +95,11 @@ public class ModelFactoryUseProvider implements UseProvider {
         if (request == null) {
             return ProviderOutcome.failure(new IllegalStateException("Could not get request from bindings"));
         }
-
+        
         // pass parameters as request attributes
         Map<String, Object> overrides = setRequestAttributes(request, arguments);
         Object obj = null;
         try {
-            if (!modelFactory.isModelClass(resource, cls)) {
-                log.debug("{} is no Sling Model (because it lacks the according Model annotation)!");
-                // next use provider will be queried
-                return ProviderOutcome.failure();
-            }
             // try to instantiate class via Sling Models (first via request, then via resource)
             if (modelFactory.canCreateFromAdaptable(request, cls)) {
                 obj = modelFactory.createModel(request, cls);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 11/15: Update the main reactor to parent 25

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 22c0fc03c397f63e062dc66ce87cc7fa565b8a8c
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Oct 5 10:03:45 2015 +0000

    Update the main reactor to parent 25
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1706780 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 04cddd5..7a8ab91 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>24</version>
+        <version>25</version>
         <relativePath/>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 02/15: svn:ignore

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 05f5c10c66b8095c68500f04501f4e77a56b707d
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Jun 4 14:07:57 2015 +0000

    svn:ignore
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1683552 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 06/15: SLING-4734 first try to instantiate model with request then with resource

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 9d020af7a52130302ec887abe121fdc71b27f291
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Tue Sep 1 13:54:19 2015 +0000

    SLING-4734 first try to instantiate model with request then with resource
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1700549 13f79535-47bb-0310-9956-ffa450edef68
---
 .../scripting/sightly/models/impl/ModelFactoryUseProvider.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java b/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
index 538aca4..07c495b 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
@@ -100,11 +100,11 @@ public class ModelFactoryUseProvider implements UseProvider {
                 // next use provider will be queried
                 return ProviderOutcome.failure();
             }
-            // try to instantiate class via Sling Models (first via resource, then via request)
-            if (modelFactory.canCreateFromAdaptable(resource, cls)) {
-                obj = modelFactory.createModel(resource, cls);
-            } else if (modelFactory.canCreateFromAdaptable(request, cls)) {
+            // try to instantiate class via Sling Models (first via request, then via resource)
+            if (modelFactory.canCreateFromAdaptable(request, cls)) {
                 obj = modelFactory.createModel(request, cls);
+            } else if (modelFactory.canCreateFromAdaptable(resource, cls)) {
+                obj = modelFactory.createModel(resource, cls);
             } else {
                 return ProviderOutcome.failure(new IllegalStateException("Could not adapt the given Sling Model from neither resource nor request: " + cls));
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 05/15: set parent version to 24 and add empty relativePath where missing

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 0bbe25e624af2fc4fc4a4c0aeb0e9a438a8d196d
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jul 7 08:09:17 2015 +0000

    set parent version to 24 and add empty relativePath where missing
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1689593 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 9541f16..53fbae3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,8 +25,8 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>23</version>
-        <relativePath />
+        <version>24</version>
+        <relativePath/>
     </parent>
 
     <!-- ======================================================================= -->

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 15/15: [maven-release-plugin] copy for tag org.apache.sling.scripting.sightly.models.provider-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 8fd434802540752dddce1b3cf37b64f002984d24
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Thu Oct 8 11:05:30 2015 +0000

    [maven-release-plugin] copy for tag org.apache.sling.scripting.sightly.models.provider-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.sightly.models.provider-1.0.0@1707483 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 09/15: SLING-5036 - Optimise the ModelsFactoryUseProvider to fail as early as possible if it cannot provide an object

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 61deecdf19370b31bfafd2c0d2f8b793c72fc1e6
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Thu Sep 17 14:07:19 2015 +0000

    SLING-5036 - Optimise the ModelsFactoryUseProvider to fail as early as possible if it cannot provide an object
    
    * renamed ModelsFactoryUseProvider to SlingModelsUseProvider
    * delayed all bindings retrievals until they're absolutely necessary
    * removed bindings merging - models can get their arguments through request attributes if they're adaptable from SlingHttpServletRequest
    * updated the test setup to take into account the SlingModelsUseProvider (both IT and performance)
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1703629 13f79535-47bb-0310-9956-ffa450edef68
---
 ...seProvider.java => SlingModelsUseProvider.java} | 124 +++++++++++----------
 1 file changed, 67 insertions(+), 57 deletions(-)

diff --git a/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
similarity index 61%
rename from src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
rename to src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
index 6c81d92..cf8fa3d 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
@@ -1,30 +1,29 @@
-/*
+/*******************************************************************************
  * 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
- *
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
  * 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.scripting.sightly.models.impl;
 
-
 import java.util.HashMap;
 import java.util.Map;
-
+import java.util.regex.Pattern;
 import javax.script.Bindings;
-import javax.script.SimpleBindings;
 import javax.servlet.ServletRequest;
 
 import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.Service;
@@ -41,83 +40,104 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
+ * <p>
  * 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} 
+ * </p>
+ * <p>
+ * 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:
  * <ol>
- * <li>the given identifier specifies a class which can be loaded by the DynamicClassLoader</li>
- * <li>the loaded class has a Model annotation</li>
+ * <li>the given identifier specifies a class which can be loaded by a {@link org.apache.sling.commons.classloader.DynamicClassLoader}</li>
+ * <li>the loaded class has a {@link org.apache.sling.models.annotations.Model} annotation</li>
  * </ol>
- * In case any of those preconditions are not fulfilled the other registered UseProviders are used!
+ * </p>
+ * <p>
+ * <p>
+ * In case any of those preconditions are not fulfilled the other registered {@link UseProvider}s will be queried.
+ * </p>
  */
 @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 JavaUseProvider but after the RenderUnitProvider
- */
-@Property(name = Constants.SERVICE_RANKING, intValue = { 95 }) 
-public class ModelFactoryUseProvider implements UseProvider {
+@Properties({
+    @Property(
+        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.",
+        /**
+         * Must have a higher priority than {@link org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider} but lower
+         * than {@link org.apache.sling.scripting.sightly.impl.engine.extension.use.RenderUnitProvider} to kick in before the
+         * JavaUseProvider but after the RenderUnitProvider.
+         */
+        intValue = 95
+    )
+})
+public class SlingModelsUseProvider implements UseProvider {
+
+    private static final Logger LOGGER = LoggerFactory.getLogger(SlingModelsUseProvider.class);
+    private static final Pattern JAVA_PATTERN = Pattern.compile(
+        "([[\\p{L}&&[^\\p{Lu}]]_$][\\p{L}\\p{N}_$]*\\.)*[\\p{Lu}_$][\\p{L}\\p{N}_$]*");
+
 
-    private static final Logger log = LoggerFactory.getLogger(ModelFactoryUseProvider.class);
-    
     @Reference
-    ModelFactory modelFactory;
-    
+    private ModelFactory modelFactory = null;
+
     @Reference
     private DynamicClassLoaderManager dynamicClassLoaderManager = null;
-    
+
     @Override
     public ProviderOutcome provide(final String identifier, final RenderContext renderContext, final Bindings arguments) {
+        if (!JAVA_PATTERN.matcher(identifier).matches()) {
+            LOGGER.debug("Identifier {} does not match a Java class name pattern.", identifier);
+            return ProviderOutcome.failure();
+        }
         final Class<?> cls;
         try {
             cls = dynamicClassLoaderManager.getDynamicClassLoader().loadClass(identifier);
-        } catch(ClassNotFoundException e) {
-            log.debug("Could not find class with the given name {}: {}", identifier, e.getMessage());
+        } catch (ClassNotFoundException e) {
+            LOGGER.debug("Could not find class with the given name {}: {}", identifier, e.getMessage());
             // next use provider will be queried
             return ProviderOutcome.failure();
         }
         if (!modelFactory.isModelClass(cls)) {
-            log.debug("{} is no Sling Model (because it lacks the according Model annotation or is not being picked up by the Bundle Listener)!");
+            LOGGER.debug("{} is not a Sling Model.");
             // next use provider will be queried
             return ProviderOutcome.failure();
         }
         Bindings globalBindings = renderContext.getBindings();
-        Bindings bindings = merge(globalBindings, arguments);
-        Resource resource = (Resource) bindings.get(SlingBindings.RESOURCE);
-        if (resource == null) {
-            return ProviderOutcome.failure(new IllegalStateException("Could not get resource from bindings"));
-        }
-        SlingHttpServletRequest request = (SlingHttpServletRequest) bindings.get(SlingBindings.REQUEST);
+        SlingHttpServletRequest request = (SlingHttpServletRequest) globalBindings.get(SlingBindings.REQUEST);
         if (request == null) {
-            return ProviderOutcome.failure(new IllegalStateException("Could not get request from bindings"));
+            return ProviderOutcome.failure(new IllegalStateException("Could not get request from bindings."));
         }
-        
         // pass parameters as request attributes
         Map<String, Object> overrides = setRequestAttributes(request, arguments);
-        Object obj = null;
+
         try {
             // try to instantiate class via Sling Models (first via request, then via resource)
             if (modelFactory.canCreateFromAdaptable(request, cls)) {
-                obj = modelFactory.createModel(request, cls);
-            } else if (modelFactory.canCreateFromAdaptable(resource, cls)) {
-                obj = modelFactory.createModel(resource, cls);
-            } else {
-                return ProviderOutcome.failure(new IllegalStateException("Could not adapt the given Sling Model from neither resource nor request: " + cls));
+                return ProviderOutcome.notNullOrFailure(modelFactory.createModel(request, cls));
+            }
+            Resource resource = (Resource) globalBindings.get(SlingBindings.RESOURCE);
+            if (resource == null) {
+                return ProviderOutcome.failure(new IllegalStateException("Could not get resource from bindings."));
             }
+            if (modelFactory.canCreateFromAdaptable(resource, cls)) {
+                return ProviderOutcome.notNullOrFailure(modelFactory.createModel(resource, cls));
+            }
+            return ProviderOutcome.failure(
+                new IllegalStateException("Could not adapt the given Sling Model from neither request nor resource: " + cls));
         } catch (Throwable e) {
             return ProviderOutcome.failure(e);
         } finally {
             resetRequestAttribute(request, overrides);
+
         }
-        return ProviderOutcome.notNullOrFailure(obj);
     }
 
-    private Map<String, Object> setRequestAttributes(final ServletRequest request,
-            final Bindings arguments) {
+    private Map<String, Object> setRequestAttributes(final ServletRequest request, final Bindings arguments) {
         Map<String, Object> overrides = new HashMap<String, Object>();
         for (Map.Entry<String, Object> entry : arguments.entrySet()) {
             String key = entry.getKey();
@@ -125,8 +145,7 @@ public class ModelFactoryUseProvider implements UseProvider {
             Object oldValue = request.getAttribute(key);
             if (oldValue != null) {
                 overrides.put(key, oldValue);
-            }
-            else {
+            } else {
                 overrides.put(key, null);
             }
             request.setAttribute(key, value);
@@ -134,24 +153,15 @@ public class ModelFactoryUseProvider implements UseProvider {
         return overrides;
     }
 
-    private void resetRequestAttribute(final ServletRequest request,
-            final Map<String, Object> overrides) {
+    private void resetRequestAttribute(final ServletRequest request, final Map<String, Object> overrides) {
         for (Map.Entry<String, Object> entry : overrides.entrySet()) {
             String key = entry.getKey();
             Object value = entry.getValue();
             if (value == null) {
                 request.removeAttribute(key);
-            }
-            else {
+            } else {
                 request.setAttribute(key, value);
             }
         }
     }
-
-    private SimpleBindings merge(Bindings former, Bindings latter) {
-        SimpleBindings bindings = new SimpleBindings();
-        bindings.putAll(former);
-        bindings.putAll(latter);
-        return bindings;
-    }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 03/15: Update to Sling Parent 23

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 68073842e62058ea1481573d7e263dea7dbfef1b
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:08:16 2015 +0000

    Update to Sling Parent 23
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1687500 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 9b84786..0f6c875 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>22</version>
+        <version>23</version>
         <relativePath />
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 07/15: use released version of Models API

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 212ee8054bb31c680a7ea516f924f403e9775133
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Tue Sep 1 14:00:56 2015 +0000

    use released version of Models API
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1700552 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 53fbae3..218f80c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -92,7 +92,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.models.api</artifactId>
-            <version>1.1.1-SNAPSHOT</version>
+            <version>1.2.0</version>
             <scope>provided</scope>
         </dependency>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 10/15: SLING-5074 - Provide a way to configure the priority of the Sling Models Use Provider

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit f03f3a893486b73887012660c08d8d7e33e982ed
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Tue Sep 29 10:02:00 2015 +0000

    SLING-5074 - Provide a way to configure the priority of the Sling Models Use Provider
    
    * exposed the service.ranking property through the component's metatype description
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1705827 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sightly/models/impl/SlingModelsUseProvider.java         | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
index cf8fa3d..fea828f 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
@@ -58,21 +58,26 @@ import org.slf4j.LoggerFactory;
  * In case any of those preconditions are not fulfilled the other registered {@link UseProvider}s will be queried.
  * </p>
  */
-@Component
+@Component(
+    metatype = true,
+    label = "Apache Sling Scripting Sightly Sling Models Use Provider",
+    description = "The Sling Models Use Provider is responsible for instantiating Sling Models to be used with Sightly's Use-API."
+)
 @Service
 @Properties({
     @Property(
         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.",
+            "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.",
         /**
          * Must have a higher priority than {@link org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider} but lower
          * than {@link org.apache.sling.scripting.sightly.impl.engine.extension.use.RenderUnitProvider} to kick in before the
          * JavaUseProvider but after the RenderUnitProvider.
          */
-        intValue = 95
+        intValue = 95,
+        propertyPrivate = false
     )
 })
 public class SlingModelsUseProvider implements UseProvider {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 14/15: [maven-release-plugin] prepare release org.apache.sling.scripting.sightly.models.provider-1.0.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 5acde0292764103f2444af7f9c0ca10424314b64
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Thu Oct 8 11:05:16 2015 +0000

    [maven-release-plugin] prepare release org.apache.sling.scripting.sightly.models.provider-1.0.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1707482 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7a8ab91..599c223 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,14 +26,14 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>25</version>
-        <relativePath/>
+        <relativePath />
     </parent>
 
     <!-- ======================================================================= -->
     <!-- P R O J E C T                                                           -->
     <!-- ======================================================================= -->
     <artifactId>org.apache.sling.scripting.sightly.models.provider</artifactId>
-    <version>1.0.0-SNAPSHOT</version>
+    <version>1.0.0</version>
     <packaging>bundle</packaging>
 
     <name>Apache Sling Scripting Sightly Models Use Provider</name>
@@ -43,9 +43,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider</developerConnection>
-        <url>http://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.sightly.models.provider-1.0.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.sightly.models.provider-1.0.0</developerConnection>
+        <url>http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.scripting.sightly.models.provider-1.0.0</url>
     </scm>
 
     <!-- ======================================================================= -->

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 01/15: SLING-4704 - Move the Sightly scripting engine artifacts from contrib to bundles

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit ac1666cda70977dd455d4f82a4bb5f76a2efa180
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Tue May 12 15:39:47 2015 +0000

    SLING-4704 - Move the Sightly scripting engine artifacts from contrib to bundles
    
    * moved Sightly artifacts from contrib to bundles
    * updated SCM info
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1678979 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 132 +++++++++++++++++
 .../models/impl/ModelFactoryUseProvider.java       | 157 +++++++++++++++++++++
 2 files changed, 289 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..9b84786
--- /dev/null
+++ b/pom.xml
@@ -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">
+    <modelVersion>4.0.0</modelVersion>
+    <!-- ======================================================================= -->
+    <!-- P A R E N T   P R O J E C T                                             -->
+    <!-- ======================================================================= -->
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>22</version>
+        <relativePath />
+    </parent>
+
+    <!-- ======================================================================= -->
+    <!-- P R O J E C T                                                           -->
+    <!-- ======================================================================= -->
+    <artifactId>org.apache.sling.scripting.sightly.models.provider</artifactId>
+    <version>1.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>Apache Sling Scripting Sightly Models Use Provider</name>
+
+    <description>
+        Apache Sling Scripting Sightly Models Use Provider adds support for accessing Sling Models from Sightly's Use-API leveraging the ModelFactory.
+    </description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider</developerConnection>
+        <url>http://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider</url>
+    </scm>
+
+    <properties>
+        <sling.java.version>6</sling.java.version>
+    </properties>
+
+    <!-- ======================================================================= -->
+    <!-- B U I L D                                                               -->
+    <!-- ======================================================================= -->
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <!-- ======================================================================= -->
+    <!-- D E P E N D E N C I E S                                                 -->
+    <!-- ======================================================================= -->
+    <dependencies>
+        <!-- OSGI -->
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <!-- Sling -->
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.api</artifactId>
+            <version>2.4.0</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.models.api</artifactId>
+            <version>1.1.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <!-- Sightly -->
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.scripting.sightly</artifactId>
+            <version>1.0.0</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.classloader</artifactId>
+            <version>1.3.0</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>servlet-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+
+    </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java b/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
new file mode 100644
index 0000000..538aca4
--- /dev/null
+++ b/src/main/java/org/apache/sling/scripting/sightly/models/impl/ModelFactoryUseProvider.java
@@ -0,0 +1,157 @@
+/*
+ * 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.scripting.sightly.models.impl;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
+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.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 {@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:
+ * <ol>
+ * <li>the given identifier specifies a class which can be loaded by the DynamicClassLoader</li>
+ * <li>the 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 JavaUseProvider but after the RenderUnitProvider
+ */
+@Property(name = Constants.SERVICE_RANKING, intValue = { 95 }) 
+public class ModelFactoryUseProvider implements UseProvider {
+
+    private static final Logger log = LoggerFactory.getLogger(ModelFactoryUseProvider.class);
+    
+    @Reference
+    ModelFactory modelFactory;
+    
+    @Reference
+    private DynamicClassLoaderManager dynamicClassLoaderManager = null;
+    
+    @Override
+    public ProviderOutcome provide(final String identifier, final RenderContext renderContext, final Bindings arguments) {
+        final Class<?> cls;
+        try {
+            cls = dynamicClassLoaderManager.getDynamicClassLoader().loadClass(identifier);
+        } catch(ClassNotFoundException e) {
+            log.debug("Could not find class with the given name {}: {}", identifier, e.getMessage());
+            // next use provider will be queried
+            return ProviderOutcome.failure();
+        }
+        Bindings globalBindings = renderContext.getBindings();
+        Bindings bindings = merge(globalBindings, arguments);
+        Resource resource = (Resource) bindings.get(SlingBindings.RESOURCE);
+        if (resource == null) {
+            return ProviderOutcome.failure(new IllegalStateException("Could not get resource from bindings"));
+        }
+        SlingHttpServletRequest request = (SlingHttpServletRequest) bindings.get(SlingBindings.REQUEST);
+        if (request == null) {
+            return ProviderOutcome.failure(new IllegalStateException("Could not get request from bindings"));
+        }
+
+        // pass parameters as request attributes
+        Map<String, Object> overrides = setRequestAttributes(request, arguments);
+        Object obj = null;
+        try {
+            if (!modelFactory.isModelClass(resource, cls)) {
+                log.debug("{} is no Sling Model (because it lacks the according Model annotation)!");
+                // next use provider will be queried
+                return ProviderOutcome.failure();
+            }
+            // try to instantiate class via Sling Models (first via resource, then via request)
+            if (modelFactory.canCreateFromAdaptable(resource, cls)) {
+                obj = modelFactory.createModel(resource, cls);
+            } else if (modelFactory.canCreateFromAdaptable(request, cls)) {
+                obj = modelFactory.createModel(request, cls);
+            } else {
+                return ProviderOutcome.failure(new IllegalStateException("Could not adapt the given Sling Model from neither resource nor request: " + cls));
+            }
+        } catch (Throwable e) {
+            return ProviderOutcome.failure(e);
+        } finally {
+            resetRequestAttribute(request, overrides);
+        }
+        return ProviderOutcome.notNullOrFailure(obj);
+    }
+
+    private Map<String, Object> setRequestAttributes(final ServletRequest request,
+            final Bindings arguments) {
+        Map<String, Object> overrides = new HashMap<String, Object>();
+        for (Map.Entry<String, Object> entry : arguments.entrySet()) {
+            String key = entry.getKey();
+            Object value = entry.getValue();
+            Object oldValue = request.getAttribute(key);
+            if (oldValue != null) {
+                overrides.put(key, oldValue);
+            }
+            else {
+                overrides.put(key, null);
+            }
+            request.setAttribute(key, value);
+        }
+        return overrides;
+    }
+
+    private void resetRequestAttribute(final ServletRequest request,
+            final Map<String, Object> overrides) {
+        for (Map.Entry<String, Object> entry : overrides.entrySet()) {
+            String key = entry.getKey();
+            Object value = entry.getValue();
+            if (value == null) {
+                request.removeAttribute(key);
+            }
+            else {
+                request.setAttribute(key, value);
+            }
+        }
+    }
+
+    private SimpleBindings merge(Bindings former, Bindings latter) {
+        SimpleBindings bindings = new SimpleBindings();
+        bindings.putAll(former);
+        bindings.putAll(latter);
+        return bindings;
+    }
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 13/15: trivial: corrected javadoc

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit ee3c66708b548f4589807376d9bb052cf93856f2
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Thu Oct 8 11:04:47 2015 +0000

    trivial: corrected javadoc
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1707481 13f79535-47bb-0310-9956-ffa450edef68
---
 .../scripting/sightly/models/impl/SlingModelsUseProvider.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
index 2643254..01a387d 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
@@ -45,14 +45,14 @@ import org.slf4j.LoggerFactory;
  * </p>
  * <p>
  * 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:
+ * 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:
+ * </p>
  * <ol>
  * <li>the given identifier specifies a class which can be loaded by a {@link org.apache.sling.commons.classloader.DynamicClassLoader}</li>
  * <li>the loaded class has a {@link org.apache.sling.models.annotations.Model} annotation</li>
  * </ol>
- * </p>
+ *
  * <p>
  * In case any of those preconditions are not fulfilled the other registered {@link UseProvider}s will be queried.
  * </p>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 04/15: Remove superflous sling.java.version=6 as it's the default now

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 332659e1abb73fc8d9c5b9129e0477fb941c9e4e
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:14:53 2015 +0000

    Remove superflous sling.java.version=6 as it's the default now
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1687505 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 0f6c875..9541f16 100644
--- a/pom.xml
+++ b/pom.xml
@@ -48,10 +48,6 @@
         <url>http://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider</url>
     </scm>
 
-    <properties>
-        <sling.java.version>6</sling.java.version>
-    </properties>
-
     <!-- ======================================================================= -->
     <!-- B U I L D                                                               -->
     <!-- ======================================================================= -->

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-scripting-sightly-models-provider] 12/15: trivial: corrected javadoc

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.scripting.sightly.models.provider-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-scripting-sightly-models-provider.git

commit 3f0c850602a9278245b00a22d6418fdc45faf211
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Thu Oct 8 11:02:35 2015 +0000

    trivial: corrected javadoc
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/sightly/models-use-provider@1707480 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/scripting/sightly/models/impl/SlingModelsUseProvider.java      | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
index fea828f..2643254 100644
--- a/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
+++ b/src/main/java/org/apache/sling/scripting/sightly/models/impl/SlingModelsUseProvider.java
@@ -54,7 +54,6 @@ import org.slf4j.LoggerFactory;
  * </ol>
  * </p>
  * <p>
- * <p>
  * In case any of those preconditions are not fulfilled the other registered {@link UseProvider}s will be queried.
  * </p>
  */

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.