svn commit: r1811741 - in /sling/trunk/bundles/extensions/models/impl/src: main/java/org/apache/sling/models/impl/model/AbstractInjectableElement.java test/java/org/apache/sling/models/impl/Annotation

2017-10-10 Thread justin
Author: justin
Date: Tue Oct 10 17:16:15 2017
New Revision: 1811741

URL: http://svn.apache.org/viewvc?rev=1811741=rev
Log:
SLING-7187 - handle conflicts between annotations

Added:

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
Modified:

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

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/AbstractInjectableElement.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/AbstractInjectableElement.java?rev=1811741=1811740=1811741=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/AbstractInjectableElement.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/AbstractInjectableElement.java
 Tue Oct 10 17:16:15 2017
@@ -204,13 +204,16 @@ abstract class AbstractInjectableElement
 }
 
 private static boolean getOptional(AnnotatedElement element, 
InjectAnnotationProcessor annotationProcessor) {
+if (element.isAnnotationPresent(Optional.class)) {
+return true;
+}
 if (annotationProcessor != null) {
 Boolean optional = annotationProcessor.isOptional();
 if (optional != null) {
 return optional.booleanValue();
 }
 }
-return element.isAnnotationPresent(Optional.class);
+return false;
 }
 
 private static boolean getRequired(AnnotatedElement element, 
InjectAnnotationProcessor annotationProcessor) {

Added: 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java?rev=1811741=auto
==
--- 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
 (added)
+++ 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AnnotationConflictsTest.java
 Tue Oct 10 17:16:15 2017
@@ -0,0 +1,280 @@
+/*
+ * 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;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.api.wrappers.ValueMapDecorator;
+import org.apache.sling.models.annotations.DefaultInjectionStrategy;
+import org.apache.sling.models.annotations.Model;
+import org.apache.sling.models.annotations.Optional;
+import org.apache.sling.models.annotations.Required;
+import org.apache.sling.models.annotations.injectorspecific.InjectionStrategy;
+import org.apache.sling.models.annotations.injectorspecific.ValueMapValue;
+import org.apache.sling.models.factory.MissingElementException;
+import org.apache.sling.models.factory.MissingElementsException;
+import org.apache.sling.models.impl.injectors.ValueMapInjector;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.ComponentContext;
+
+import java.util.Collections;
+import java.util.Hashtable;
+
+import static org.mockito.Mockito.when;
+import static org.junit.Assert.*;
+
+@RunWith(MockitoJUnitRunner.class)
+public class AnnotationConflictsTest {
+
+@Mock
+private ComponentContext componentCtx;
+
+@Mock
+private BundleContext bundleContext;
+
+private ModelAdapterFactory factory;
+
+@Mock
+private Resource resource;
+
+@Before
+public void setup() {
+when(componentCtx.getBundleContext()).thenReturn(bundleContext);
+when(componentCtx.getProperties()).thenReturn(new Hasht

svn commit: r1810581 - /sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java

2017-10-02 Thread justin
Author: justin
Date: Mon Oct  2 19:32:27 2017
New Revision: 1810581

URL: http://svn.apache.org/viewvc?rev=1810581=rev
Log:
SLING-7174 - should be IllegalStateException, not IllegalArgumentException

Modified:

sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java

Modified: 
sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java?rev=1810581=1810580=1810581=diff
==
--- 
sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java
 Mon Oct  2 19:32:27 2017
@@ -354,7 +354,7 @@ public class MockSlingHttpServletRequest
 request.getInputStream();
 try {
 request.getReader();
-} catch (IllegalArgumentException e) {
+} catch (IllegalStateException e) {
 thrown = true;
 }
 assertTrue(thrown);
@@ -366,7 +366,7 @@ public class MockSlingHttpServletRequest
 request.getReader();
 try {
 request.getInputStream();
-} catch (IllegalArgumentException e) {
+} catch (IllegalStateException e) {
 thrown = true;
 }
 assertTrue(thrown);




svn commit: r1810564 - /sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java

2017-10-02 Thread justin
Author: justin
Date: Mon Oct  2 17:39:30 2017
New Revision: 1810564

URL: http://svn.apache.org/viewvc?rev=1810564=rev
Log:
SLING-7174 - should be IllegalStateException, not IllegalArgumentException

Modified:

sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java

Modified: 
sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java?rev=1810564=1810563=1810564=diff
==
--- 
sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
 (original)
+++ 
sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
 Mon Oct  2 17:39:30 2017
@@ -545,7 +545,7 @@ public class MockSlingHttpServletRequest
 @Override
 public ServletInputStream getInputStream() {
 if (getReaderCalled) {
-throw new IllegalArgumentException();
+throw new IllegalStateException();
 }
 getInputStreamCalled = true;
 return new ServletInputStream() {
@@ -829,7 +829,7 @@ public class MockSlingHttpServletRequest
 @Override
 public BufferedReader getReader() {
 if (getInputStreamCalled) {
-throw new IllegalArgumentException();
+throw new IllegalStateException();
 }
 getReaderCalled = true;
 if (this.content == null) {




svn commit: r1810562 - in /sling/trunk/bundles/extensions/servlet-helpers/src: main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java test/java/org/apache/sling/servlethelpers/Mock

2017-10-02 Thread justin
Author: justin
Date: Mon Oct  2 17:33:10 2017
New Revision: 1810562

URL: http://svn.apache.org/viewvc?rev=1810562=rev
Log:
SLING-7174 - implement getReader in MockRequest

Modified:

sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java

sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java

Modified: 
sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java?rev=1810562=1810561=1810562=diff
==
--- 
sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
 (original)
+++ 
sling/trunk/bundles/extensions/servlet-helpers/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
 Mon Oct  2 17:33:10 2017
@@ -24,9 +24,11 @@ import java.io.BufferedReader;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
+import java.nio.charset.Charset;
 import java.security.Principal;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -101,6 +103,8 @@ public class MockSlingHttpServletRequest
 private String remoteHost;
 private int remotePort;
 private Locale locale = Locale.US;
+private boolean getInputStreamCalled;
+private boolean getReaderCalled;
 
 private MockRequestDispatcherFactory requestDispatcherFactory;
 
@@ -540,11 +544,12 @@ public class MockSlingHttpServletRequest
 
 @Override
 public ServletInputStream getInputStream() {
-if (content == null) {
-return null;
+if (getReaderCalled) {
+throw new IllegalArgumentException();
 }
+getInputStreamCalled = true;
 return new ServletInputStream() {
-private final InputStream is = new ByteArrayInputStream(content);
+private final InputStream is = content == null ? new 
ByteArrayInputStream(new byte[0]) : new ByteArrayInputStream(content);
 @Override
 public int read() throws IOException {
 return is.read();
@@ -823,7 +828,26 @@ public class MockSlingHttpServletRequest
 
 @Override
 public BufferedReader getReader() {
-throw new UnsupportedOperationException();
+if (getInputStreamCalled) {
+throw new IllegalArgumentException();
+}
+getReaderCalled = true;
+if (this.content == null) {
+return new BufferedReader(new StringReader(""));
+} else {
+String content;
+try {
+if (characterEncoding == null) {
+content = new String(this.content, 
Charset.defaultCharset());
+} else {
+content = new String(this.content, characterEncoding);
+}
+} catch (UnsupportedEncodingException e) {
+content = new String(this.content, Charset.defaultCharset());
+}
+return new BufferedReader(new StringReader(content));
+}
+
 }
 
 @Override

Modified: 
sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java?rev=1810562=1810561=1810562=diff
==
--- 
sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/servlet-helpers/src/test/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequestTest.java
 Mon Oct  2 17:33:10 2017
@@ -29,8 +29,10 @@ import static org.mockito.Matchers.any;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import java.io.BufferedReader;
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
+import java.nio.charset.Charset;
 import java.util.Calendar;
 import java.util.Enumeration;
 import java.util.LinkedHashMap;
@@ -326,7 +328,8 @@ public class MockSlingHttpServletRequest
 @Test
 public void testContent() throws Exception {
 assertEquals(0, request.getContentLength());
-assertNull(request.getInputStream());
+assertNotNull(request.getInputStream());
+assertArrayEquals(new byte[0], 
IOUtils.t

[2/2] sling-site git commit: use timezone in feed updated date

2017-10-02 Thread justin
use timezone in feed updated date


Project: http://git-wip-us.apache.org/repos/asf/sling-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/sling-site/commit/078f462c
Tree: http://git-wip-us.apache.org/repos/asf/sling-site/tree/078f462c
Diff: http://git-wip-us.apache.org/repos/asf/sling-site/diff/078f462c

Branch: refs/heads/asf-site
Commit: 078f462ce0abc5e3b66be5c850bbebee2902bad5
Parents: 47a72f1
Author: Justin Edelson <jus...@apache.org>
Authored: Mon Oct 2 08:26:42 2017 -0400
Committer: Justin Edelson <jus...@apache.org>
Committed: Mon Oct 2 08:26:42 2017 -0400

--
 feed.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/sling-site/blob/078f462c/feed.xml
--
diff --git a/feed.xml b/feed.xml
index 1624b74..ce67d93 100644
--- a/feed.xml
+++ b/feed.xml
@@ -4,7 +4,7 @@
 http://sling.apache.org/"/>
 http://sling.apache.org/feed.xml"/>
 Work in progress...
-2017-10-02T12:05:27Z
+2017-10-02T08:25:03Z-0400
 tag:localhost,2017:10
 
 
\ No newline at end of file



[1/2] sling-site git commit: use timezone in feed updated date

2017-10-02 Thread justin
Repository: sling-site
Updated Branches:
  refs/heads/asf-site 47a72f1d1 -> 078f462ce
  refs/heads/master bf0b58e35 -> dfb1cbc16


use timezone in feed updated date


Project: http://git-wip-us.apache.org/repos/asf/sling-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/sling-site/commit/dfb1cbc1
Tree: http://git-wip-us.apache.org/repos/asf/sling-site/tree/dfb1cbc1
Diff: http://git-wip-us.apache.org/repos/asf/sling-site/diff/dfb1cbc1

Branch: refs/heads/master
Commit: dfb1cbc16aeca5dba59e293feef7cfe2af05ed17
Parents: bf0b58e
Author: Justin Edelson <jus...@apache.org>
Authored: Mon Oct 2 08:25:51 2017 -0400
Committer: Justin Edelson <jus...@apache.org>
Committed: Mon Oct 2 08:25:51 2017 -0400

--
 src/main/jbake/templates/feed.tpl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/sling-site/blob/dfb1cbc1/src/main/jbake/templates/feed.tpl
--
diff --git a/src/main/jbake/templates/feed.tpl 
b/src/main/jbake/templates/feed.tpl
index 866cc73..ff0a4d3 100644
--- a/src/main/jbake/templates/feed.tpl
+++ b/src/main/jbake/templates/feed.tpl
@@ -9,7 +9,7 @@ feed(xmlns:"http://www.w3.org/2005/Atom;){
 newLine()
 subtitle("${config.blog_subtitle}")
 newLine()
-updated("${published_date.format('-MM-dd\'T\'HH:mm:ss\'Z\'')}")
+updated("${published_date.format('-MM-dd\'T\'HH:mm:ss\'Z\'Z')}")
 newLine()
 id("tag:${config.feed_id},${published_date.format(':MM')}")
 newLine()
@@ -23,7 +23,7 @@ feed(xmlns:"http://www.w3.org/2005/Atom;){
   newLine()
   link(href:"${config.site_host}${config.site_contextPath}${post.uri}")
   newLine()
-  updated("${post.date.format('-MM-dd\'T\'HH:mm:ss\'Z\'')}")
+  updated("${post.date.format('-MM-dd\'T\'HH:mm:ss\'Z\'Z')}")
   newLine()
   id("${config.site_host}${config.site_contextPath}${post.uri}")
   newLine()



sling-site git commit: SLING-7095 - restore missing sling models cache documentation

2017-10-01 Thread justin
Repository: sling-site
Updated Branches:
  refs/heads/asf-site 0998f5f80 -> aa4955c75


SLING-7095 - restore missing sling models cache documentation


Project: http://git-wip-us.apache.org/repos/asf/sling-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/sling-site/commit/aa4955c7
Tree: http://git-wip-us.apache.org/repos/asf/sling-site/tree/aa4955c7
Diff: http://git-wip-us.apache.org/repos/asf/sling-site/diff/aa4955c7

Branch: refs/heads/asf-site
Commit: aa4955c75415ae56472704d7e475779d3e807735
Parents: 0998f5f
Author: Justin Edelson <jus...@apache.org>
Authored: Sun Oct 1 08:36:49 2017 -0400
Committer: Justin Edelson <jus...@apache.org>
Committed: Sun Oct 1 08:36:49 2017 -0400

--
 documentation/bundles/models.html | 35 ++
 1 file changed, 35 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/sling-site/blob/aa4955c7/documentation/bundles/models.html
--
diff --git a/documentation/bundles/models.html 
b/documentation/bundles/models.html
index b823bbc..bd16738 100644
--- a/documentation/bundles/models.html
+++ b/documentation/bundles/models.html
@@ -626,6 +626,41 @@ public class MyModel implements MyService {
 /instructions
 /configuration
 
+Caching
+By default, Sling Models do not do any caching of the adaptation result and 
every request for a model class will result in a new instance of the model 
class. However, there are two notable cases when the adaptation result can be 
cached. The first case is when the adaptable extends the 
SlingAdaptable base class. Most significantly, this is the case 
for many Resource adaptables as AbstractResource 
extends SlingAdaptable. SlingAdaptable implements a 
caching mechanism such that multiple invocations of adaptTo() will 
return the same object. For example:
+// assume that 
resource is an instance of some subclass of AbstractResource
+ModelClass object1 = resource.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = resource.adaptTo(ModelClass.class); // SlingAdaptable 
returns the cached instance
+assert object1 == object2;
+
+While this is true for AbstractResource subclasses, it is 
notably not the case for SlingHttpServletRequest 
as this class does not extend SlingAdaptable. So:
+// assume that request 
is some SlingHttpServletRequest object
+ModelClass object1 = request.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = request.adaptTo(ModelClass.class); // creates another new 
instance of ModelClass
+assert object1 != object2;
+
+Since API version 1.3.4, Sling Models can cache an adaptation 
result, regardless of the adaptable by specifying cache = true on 
the @Model annotation.
+@Model(adaptable = 
SlingHttpServletRequest.class, cache = true)
+public class ModelClass {}
+
+...
+
+// assume that request is some SlingHttpServletRequest object
+ModelClass object1 = request.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = request.adaptTo(ModelClass.class); // Sling Models 
returns the cached instance
+assert object1 == object2;
+
+When cache = true is specified, the adaptation result is 
cached regardless of how the adaptation is done:
+@Model(adaptable = 
SlingHttpServletRequest.class, cache = true)
+public class ModelClass {}
+
+...
+
+// assume that request is some SlingHttpServletRequest object
+ModelClass object1 = request.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = modelFactory.createModel(request, ModelClass.class); // 
Sling Models returns the cached instance
+assert object1 == object2;
+
 Via Types (Since API 
1.3.4/Implementation 1.4.0)
 As discussed in the Via section above, it is possible to 
select a different adaptable than the original value using the 
@Via annotation. The following standard types are provided (all 
types are in the package 
org.apache.sling.models.annotations.via)
 



sling-site git commit: SLING-7095 - restore lost cache documenation

2017-10-01 Thread justin
Repository: sling-site
Updated Branches:
  refs/heads/master b636fda1e -> fd837603e


SLING-7095 - restore lost cache documenation


Project: http://git-wip-us.apache.org/repos/asf/sling-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/sling-site/commit/fd837603
Tree: http://git-wip-us.apache.org/repos/asf/sling-site/tree/fd837603
Diff: http://git-wip-us.apache.org/repos/asf/sling-site/diff/fd837603

Branch: refs/heads/master
Commit: fd837603ef94ba4d4fc2689049f0516d054b37c6
Parents: b636fda
Author: Justin Edelson <jus...@apache.org>
Authored: Sun Oct 1 08:33:05 2017 -0400
Committer: Justin Edelson <jus...@apache.org>
Committed: Sun Oct 1 08:33:05 2017 -0400

--
 .../content/documentation/bundles/models.md | 46 
 1 file changed, 46 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/sling-site/blob/fd837603/src/main/jbake/content/documentation/bundles/models.md
--
diff --git a/src/main/jbake/content/documentation/bundles/models.md 
b/src/main/jbake/content/documentation/bundles/models.md
index efd6efa..35dace2 100644
--- a/src/main/jbake/content/documentation/bundles/models.md
+++ b/src/main/jbake/content/documentation/bundles/models.md
@@ -543,6 +543,52 @@ If you want to generate a bundle header compliant with 
Sling Models < 1.3.4 (i.e
 
 
 
+# Caching
+
+By default, Sling Models do not do any caching of the adaptation result and 
every request for a model class will
+result in a new instance of the model class. However, there are two notable 
cases when the adaptation result can be cached. The first case is when the 
adaptable extends the `SlingAdaptable` base class. Most significantly, this is 
the case for many `Resource` adaptables as `AbstractResource` extends 
`SlingAdaptable`.  `SlingAdaptable` implements a caching mechanism such that 
multiple invocations of `adaptTo()` will return the same object. For example:
+
+::java
+// assume that resource is an instance of some subclass of AbstractResource
+ModelClass object1 = resource.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = resource.adaptTo(ModelClass.class); // SlingAdaptable 
returns the cached instance
+assert object1 == object2;
+
+While this is true for `AbstractResource` subclasses, it is notably **not** 
the case for `SlingHttpServletRequest` as this class does not extend 
`SlingAdaptable`. So:
+
+::java
+// assume that request is some SlingHttpServletRequest object
+ModelClass object1 = request.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = request.adaptTo(ModelClass.class); // creates another 
new instance of ModelClass
+assert object1 != object2;
+
+Since API version 1.3.4, Sling Models *can* cache an adaptation result, 
regardless of the adaptable by specifying `cache = true` on the `@Model` 
annotation.
+
+
+::java
+@Model(adaptable = SlingHttpServletRequest.class, cache = true)
+public class ModelClass {}
+
+...
+
+// assume that request is some SlingHttpServletRequest object
+ModelClass object1 = request.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = request.adaptTo(ModelClass.class); // Sling Models 
returns the cached instance
+assert object1 == object2;
+
+When `cache = true` is specified, the adaptation result is cached regardless 
of how the adaptation is done:
+
+::java
+@Model(adaptable = SlingHttpServletRequest.class, cache = true)
+public class ModelClass {}
+
+...
+
+// assume that request is some SlingHttpServletRequest object
+ModelClass object1 = request.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = modelFactory.createModel(request, ModelClass.class); 
// Sling Models returns the cached instance
+assert object1 == object2;
+
 # Via Types (Since API 1.3.4/Implementation 1.4.0)
  
 As discussed in the [Via](#via) section above, it is possible to select a 
different adaptable than the original value using the `@Via` annotation. The 
following standard types are provided (all types are in the package 
`org.apache.sling.models.annotations.via`)



sling-site git commit: fixing whitespace which is preventing GitHub from displaying README properly

2017-09-27 Thread justin
Repository: sling-site
Updated Branches:
  refs/heads/master 19b0d30d4 -> 148eadb81


fixing whitespace which is preventing GitHub from displaying README properly


Project: http://git-wip-us.apache.org/repos/asf/sling-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/sling-site/commit/148eadb8
Tree: http://git-wip-us.apache.org/repos/asf/sling-site/tree/148eadb8
Diff: http://git-wip-us.apache.org/repos/asf/sling-site/diff/148eadb8

Branch: refs/heads/master
Commit: 148eadb816f0a0519aab851a723c1b9577157fb9
Parents: 19b0d30
Author: Justin Edelson <jus...@apache.org>
Authored: Wed Sep 27 14:02:30 2017 +0200
Committer: Justin Edelson <jus...@apache.org>
Committed: Wed Sep 27 14:02:30 2017 +0200

--
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/sling-site/blob/148eadb8/README.md
--
diff --git a/README.md b/README.md
index 1175a30..4f1bd00 100644
--- a/README.md
+++ b/README.md
@@ -8,7 +8,7 @@ Clone this repository, run the below Maven command, 
http://localhost:8820/ and e
 
 mvn clean package jbake:inline -Djbake.port=8820 
-Djbake.listenAddress=0.0.0.0
 
-## How to publish the website
+## How to publish the website
 Build the site using `mvn clean package` after changing the JBake settings 
using this patch:
 
 (TODO: automate this using Maven resource rewriting or something similar.)



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

2017-09-26 Thread justin
Author: justin
Date: Tue Sep 26 12:22:41 2017
New Revision: 1018731

Log:
Publishing svnmucc operation to sling site by justin

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



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

2017-09-26 Thread justin
Author: justin
Date: Tue Sep 26 12:20:35 2017
New Revision: 1809734

URL: http://svn.apache.org/viewvc?rev=1809734=rev
Log:
SLING-7095 - Document Sling Models cache feature

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=1809734=1809733=1809734=diff
==
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Tue Sep 26 
12:20:35 2017
@@ -537,6 +537,52 @@ If you want to generate a bundle header
 
 
 
+# Caching
+
+By default, Sling Models do not do any caching of the adaptation result and 
every request for a model class will
+result in a new instance of the model class. However, there are two notable 
cases when the adaptation result can be cached. The first case is when the 
adaptable extends the `SlingAdaptable` base class. Most significantly, this is 
the case for many `Resource` adaptables as `AbstractResource` extends 
`SlingAdaptable`.  `SlingAdaptable` implements a caching mechanism such that 
multiple invocations of `adaptTo()` will return the same object. For example:
+
+::java
+// assume that resource is an instance of some subclass of AbstractResource
+ModelClass object1 = resource.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = resource.adaptTo(ModelClass.class); // SlingAdaptable 
returns the cached instance
+assert object1 == object2;
+
+While this is true for `AbstractResource` subclasses, it is notably **not** 
the case for `SlingHttpServletRequest` as this class does not extend 
`SlingAdaptable`. So:
+
+::java
+// assume that request is some SlingHttpServletRequest object
+ModelClass object1 = request.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = request.adaptTo(ModelClass.class); // creates another 
new instance of ModelClass
+assert object1 != object2;
+
+Since API version 1.3.4, Sling Models *can* cache an adaptation result, 
regardless of the adaptable by specifying `cache = true` on the `@Model` 
annotation.
+
+
+::java
+@Model(adaptable = SlingHttpServletRequest.class, cache = true)
+public class ModelClass {}
+
+...
+
+// assume that request is some SlingHttpServletRequest object
+ModelClass object1 = request.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = request.adaptTo(ModelClass.class); // Sling Models 
returns the cached instance
+assert object1 == object2;
+
+When `cache = true` is specified, the adaptation result is cached regardless 
of how the adaptation is done:
+
+::java
+@Model(adaptable = SlingHttpServletRequest.class, cache = true)
+public class ModelClass {}
+
+...
+
+// assume that request is some SlingHttpServletRequest object
+ModelClass object1 = request.adaptTo(ModelClass.class); // creates new 
instance of ModelClass
+ModelClass object2 = modelFactory.createModel(request, ModelClass.class); 
// Sling Models returns the cached instance
+assert object1 == object2;
+
 # Via Types (Since API 1.3.4/Implementation 1.4.0)
 
 As discussed in the [Via](#via) section above, it is possible to select a 
different adaptable than the original value using the `@Via` annotation. The 
following standard types are provided (all types are in the package 
`org.apache.sling.models.annotations.via`)




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

2017-09-18 Thread justin
Author: justin
Date: Mon Sep 18 14:18:34 2017
New Revision: 1018325

Log:
Publishing svnmucc operation to sling site by justin

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



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

2017-09-18 Thread justin
Author: justin
Date: Mon Sep 18 14:15:11 2017
New Revision: 1018324

Log:
Publishing svnmucc operation to sling site by justin

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



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

2017-09-18 Thread justin
Author: justin
Date: Mon Sep 18 14:15:00 2017
New Revision: 1808721

URL: http://svn.apache.org/viewvc?rev=1808721=rev
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=1808721=1808720=1808721=diff
==
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Mon Sep 18 
14:15:00 2017
@@ -281,7 +281,7 @@ A different strategy can be used to defi
 
 }
 
-See the [Via Types](#via-types) section below for details on the included 
types for `@Via`.
+See the [Via Types](#via-types-since-api-134implementation-140) section below 
for details on the included types for `@Via`.
 
 ## 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:
@@ -552,7 +552,7 @@ As discussed in the [Via](#via) section
 
 Defining your own type for the `@Via` annotation is a two step process. The 
first step is to create a marker class implementing the `@ViaProviderType` 
annotation. This class can be entirely empty, e.g.
 
-:java
+::java
 public class MyCustomProviderType implements ViaProviderType {}
 
 The second step is to create an OSGi service implementing the `ViaProvider` 
interface. This interface defines two methods:




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

2017-09-18 Thread justin
Author: justin
Date: Mon Sep 18 14:13:34 2017
New Revision: 1018322

Log:
Publishing svnmucc operation to sling site by justin

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



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

2017-09-18 Thread justin
Author: justin
Date: Mon Sep 18 14:08:16 2017
New Revision: 1808719

URL: http://svn.apache.org/viewvc?rev=1808719=rev
Log:
update Sling Models documentation for new features

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=1808719=1808718=1808719=diff
==
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Mon Sep 18 
14:08:16 2017
@@ -252,18 +252,37 @@ The `@PostConstruct` annotation can be u
 
 `@PostConstruct` methods in a super class will be invoked first.
 
+Since Sling Models Implementation 1.4.6, `@PostConstruct` methods may return a 
`false` boolean value in which case the model creation will fail without 
logging any exception
+(a message will be logged at the `DEBUG` level).
+
 ## Via 
-If the injection should be based on a JavaBean property of the adaptable, you 
can indicate this using the `@Via` annotation:
+In some cases, a different object should be used as the adaptable instead of 
the original adaptable. This can be done
+using the `@Via` annotation. By default, this can be done using a JavaBean 
property of the adaptable:
 
::java
@Model(adaptables=SlingHttpServletRequest.class)
public interface MyModel {
 
-   // will return 
request.getResource().adaptTo(ValueMap.class).get("propertyName", String.class)
+   // will return 
request.getResource().getValueMap().get("propertyName", String.class)
@Inject @Via("resource")
String getPropertyName();
} 
 
+
+A different strategy can be used to define the adaptable by specifying a 
`type` attribute:
+
+::java
+@Model(adaptables=Resource.class)
+public interface MyModel {
+
+   // will return 
resource.getChild("jcr:content").getValueMap().get("propertyName", String.class)
+@Inject @Via(value = "jcr:content", type = ChildResource.class)
+String getPropertyName();
+
+}
+
+See the [Via Types](#via-types) section below for details on the included 
types for `@Via`.
+
 ## 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:
 
@@ -356,7 +375,7 @@ Injectors are invoked in order of their
 :   methods to call upon model option creation (only for model classes)
 
 `@Via`
-:   use a JavaBean property of the adaptable as the source of the injection
+:   change the adaptable as the source of the injection
 
 `@Default`
 :   set default values for a field or method
@@ -516,4 +535,27 @@ If you want to generate a bundle header
 
 
<_plugin>org.apache.sling.bnd.models.ModelsScannerPlugin;generatePackagesHeader=true
 
-
\ No newline at end of file
+
+
+# Via Types (Since API 1.3.4/Implementation 1.4.0)
+
+As discussed in the [Via](#via) section above, it is possible to select a 
different adaptable than the original value using the `@Via` annotation. The 
following standard types are provided (all types are in the package 
`org.apache.sling.models.annotations.via`)
+
+`@Via` type value | Description
+- | -- 
+`BeanProperty`  (default) | Uses a JavaBean property from the adaptable.
+`ChildResource`   | Uses a child resource from the adaptable, 
assuming the adaptable is a `Resource`.
+`ForcedResourceType`  | Creates a wrapped resource with the provided 
resource type. If the adaptable is a `SlingHttpServletRequest`, a wrapped 
request is created as well to contain the wrapped resource.
+`ResourceSuperType`   | Creates a wrapped resource with the resource 
type set to the adaptable's resource super type. If the adaptable is a 
`SlingHttpServletRequest`, a wrapped request is created as well to contain the 
wrapped resource.
+
+## Custom Via Type
+
+Defining your own type for the `@Via` annotation is a two step process. The 
first step is to create a marker class implementing the `@ViaProviderType` 
annotation. This class can be entirely empty, e.g.
+
+:java
+public class MyCustomProviderType implements ViaProviderType {}
+
+The second step is to create an OSGi service implementing the `ViaProvider` 
interface. This interface defines two methods:
+
+* `getType()` should return the marker class. 
+* `getAdaptable()` should return the new adaptable or `ViaProvider.ORIGINAL` 
to indicate that the original adaptable should be used.
\ No newline at end of file




svn commit: r1808699 - in /sling/trunk/bundles/extensions/models/impl/src: main/java/org/apache/sling/models/impl/ test/java/org/apache/sling/models/impl/ test/java/org/apache/sling/models/testmodels/

2017-09-18 Thread justin
Author: justin
Date: Mon Sep 18 13:18:04 2017
New Revision: 1808699

URL: http://svn.apache.org/viewvc?rev=1808699=rev
Log:
SLING-7124 - allow PostConstruct method to return a boolean to indicate a 
failure

Added:

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/testmodels/classes/FalsePostConstuctModel.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/testmodels/classes/TruePostConstuctModel.java
Modified:

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/PostConstructTest.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=1808699=1808698=1808699=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 Sep 18 13:18:04 2017
@@ -610,7 +610,7 @@ public class ModelAdapterFactory impleme
 
 final Map<ValuePreparer, Object> preparedValues = new 
HashMap<>(VALUE_PREPARERS_COUNT);
 
-final ModelType object;
+ModelType object;
 if (constructorToUse.getConstructor().getParameterTypes().length == 0) 
{
 // no parameters for constructor injection? instantiate it right 
away
 object = constructorToUse.getConstructor().newInstance();
@@ -656,7 +656,7 @@ public class ModelAdapterFactory impleme
 return new Result<>(missingElements);
 }
 try {
-invokePostConstruct(object);
+object = invokePostConstruct(object);
 } catch (InvocationTargetException e) {
 return new Result<>(new PostConstructException("Post-construct 
method has thrown an exception for model " + modelClass.getType(), 
e.getCause()));
 } catch (IllegalAccessException e) {
@@ -830,7 +830,7 @@ public class ModelAdapterFactory impleme
 return true;
 }
 
-private void invokePostConstruct(Object object) throws 
InvocationTargetException, IllegalAccessException {
+private  ModelType invokePostConstruct(ModelType object) throws 
InvocationTargetException, IllegalAccessException {
 Class clazz = object.getClass();
 List postConstructMethods = new ArrayList<>();
 while (clazz != null) {
@@ -849,13 +849,18 @@ public class ModelAdapterFactory impleme
 if (!accessible) {
 method.setAccessible(true);
 }
-method.invoke(object);
+Object result = method.invoke(object);
+if (result instanceof Boolean && !((Boolean) 
result).booleanValue()) {
+log.debug("PostConstruct method {}.{} returned false. 
Returning null model.", method.getDeclaringClass().getName(), method.getName());
+return null;
+}
 } finally {
 if (!accessible) {
 method.setAccessible(false);
 }
 }
 }
+return object;
 }
 
 private RuntimeException setField(InjectableField injectableField, Object 
createdObject, Object value) {

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/Result.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/Result.java?rev=1808699=1808698=1808699=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/Result.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/Result.java
 Mon Sep 18 13:18:04 2017
@@ -19,7 +19,6 @@
 package org.apache.sling.models.impl;
 
 import javax.annotation.Nonnull;
-
 /**
  * This class encapsulates a value of a generic class in case of success or the
  * {@link RuntimeException}s in case of an error. It is used because the
@@ -59,7 +58,7 @@ public class Result {
  */
 public @Nonnull RuntimeException getThrowable() {
 if (t == null) {
-throw new IllegalStateException("No throwable available");
+return new IllegalStateException("No throwable available");
 }
 return t;

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

2017-09-11 Thread justin
Author: justin
Date: Mon Sep 11 14:19:17 2017
New Revision: 1808029

URL: http://svn.apache.org/viewvc?rev=1808029=rev
Log:
update Sling Model ITs to latest versions

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=1808029=1808028=1808029=diff
==
--- sling/trunk/bundles/extensions/models/integration-tests/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/integration-tests/pom.xml Mon Sep 11 
14:19:17 2017
@@ -267,6 +267,7 @@
 -->
 
org.apache.sling.junit.core
 
org.apache.sling.commons.johnzon
+
commons-lang3
 
org.apache.sling.models.api
 
org.apache.sling.models.impl
 
org.apache.sling.models.jacksonexporter
@@ -326,19 +327,19 @@
 
 org.apache.sling
 org.apache.sling.models.api
-1.3.7-SNAPSHOT
+1.3.6
 provided
 
 
 org.apache.sling
 org.apache.sling.models.impl
-1.4.5-SNAPSHOT
+1.4.4
 provided
 
 
 org.apache.sling
 org.apache.sling.models.jacksonexporter
-1.0.9-SNAPSHOT
+1.0.8
 provided
 
 




svn commit: r21325 - /release/sling/

2017-08-28 Thread justin
Author: justin
Date: Mon Aug 28 13:04:09 2017
New Revision: 21325

Log:
Apache Sling Models API 1.3.6, Implementation 1.4.4 and Jackson Exporter 1.0.8 
release

Added:
release/sling/org.apache.sling.models.api-1.3.6-javadoc.jar   (with props)
release/sling/org.apache.sling.models.api-1.3.6-javadoc.jar.asc
release/sling/org.apache.sling.models.api-1.3.6-javadoc.jar.md5
release/sling/org.apache.sling.models.api-1.3.6-javadoc.jar.sha1
release/sling/org.apache.sling.models.api-1.3.6-source-release.zip   (with 
props)
release/sling/org.apache.sling.models.api-1.3.6-source-release.zip.asc
release/sling/org.apache.sling.models.api-1.3.6-source-release.zip.md5
release/sling/org.apache.sling.models.api-1.3.6-source-release.zip.sha1
release/sling/org.apache.sling.models.api-1.3.6-sources.jar   (with props)
release/sling/org.apache.sling.models.api-1.3.6-sources.jar.asc
release/sling/org.apache.sling.models.api-1.3.6-sources.jar.md5
release/sling/org.apache.sling.models.api-1.3.6-sources.jar.sha1
release/sling/org.apache.sling.models.api-1.3.6.jar   (with props)
release/sling/org.apache.sling.models.api-1.3.6.jar.asc
release/sling/org.apache.sling.models.api-1.3.6.jar.md5
release/sling/org.apache.sling.models.api-1.3.6.jar.sha1
release/sling/org.apache.sling.models.api-1.3.6.pom
release/sling/org.apache.sling.models.api-1.3.6.pom.asc
release/sling/org.apache.sling.models.api-1.3.6.pom.md5
release/sling/org.apache.sling.models.api-1.3.6.pom.sha1
release/sling/org.apache.sling.models.impl-1.4.4-javadoc.jar   (with props)
release/sling/org.apache.sling.models.impl-1.4.4-javadoc.jar.asc
release/sling/org.apache.sling.models.impl-1.4.4-javadoc.jar.md5
release/sling/org.apache.sling.models.impl-1.4.4-javadoc.jar.sha1
release/sling/org.apache.sling.models.impl-1.4.4-source-release.zip   (with 
props)
release/sling/org.apache.sling.models.impl-1.4.4-source-release.zip.asc
release/sling/org.apache.sling.models.impl-1.4.4-source-release.zip.md5
release/sling/org.apache.sling.models.impl-1.4.4-source-release.zip.sha1
release/sling/org.apache.sling.models.impl-1.4.4-sources.jar   (with props)
release/sling/org.apache.sling.models.impl-1.4.4-sources.jar.asc
release/sling/org.apache.sling.models.impl-1.4.4-sources.jar.md5
release/sling/org.apache.sling.models.impl-1.4.4-sources.jar.sha1
release/sling/org.apache.sling.models.impl-1.4.4.jar   (with props)
release/sling/org.apache.sling.models.impl-1.4.4.jar.asc
release/sling/org.apache.sling.models.impl-1.4.4.jar.md5
release/sling/org.apache.sling.models.impl-1.4.4.jar.sha1
release/sling/org.apache.sling.models.impl-1.4.4.pom
release/sling/org.apache.sling.models.impl-1.4.4.pom.asc
release/sling/org.apache.sling.models.impl-1.4.4.pom.md5
release/sling/org.apache.sling.models.impl-1.4.4.pom.sha1
release/sling/org.apache.sling.models.jacksonexporter-1.0.8-javadoc.jar   
(with props)
release/sling/org.apache.sling.models.jacksonexporter-1.0.8-javadoc.jar.asc
release/sling/org.apache.sling.models.jacksonexporter-1.0.8-javadoc.jar.md5
release/sling/org.apache.sling.models.jacksonexporter-1.0.8-javadoc.jar.sha1

release/sling/org.apache.sling.models.jacksonexporter-1.0.8-source-release.zip  
 (with props)

release/sling/org.apache.sling.models.jacksonexporter-1.0.8-source-release.zip.asc

release/sling/org.apache.sling.models.jacksonexporter-1.0.8-source-release.zip.md5

release/sling/org.apache.sling.models.jacksonexporter-1.0.8-source-release.zip.sha1
release/sling/org.apache.sling.models.jacksonexporter-1.0.8-sources.jar   
(with props)
release/sling/org.apache.sling.models.jacksonexporter-1.0.8-sources.jar.asc
release/sling/org.apache.sling.models.jacksonexporter-1.0.8-sources.jar.md5
release/sling/org.apache.sling.models.jacksonexporter-1.0.8-sources.jar.sha1
release/sling/org.apache.sling.models.jacksonexporter-1.0.8.jar   (with 
props)
release/sling/org.apache.sling.models.jacksonexporter-1.0.8.jar.asc
release/sling/org.apache.sling.models.jacksonexporter-1.0.8.jar.md5
release/sling/org.apache.sling.models.jacksonexporter-1.0.8.jar.sha1
release/sling/org.apache.sling.models.jacksonexporter-1.0.8.pom
release/sling/org.apache.sling.models.jacksonexporter-1.0.8.pom.asc
release/sling/org.apache.sling.models.jacksonexporter-1.0.8.pom.md5
release/sling/org.apache.sling.models.jacksonexporter-1.0.8.pom.sha1
Removed:
release/sling/org.apache.sling.models.api-1.3.4-javadoc.jar
release/sling/org.apache.sling.models.api-1.3.4-javadoc.jar.asc
release/sling/org.apache.sling.models.api-1.3.4-javadoc.jar.md5
release/sling/org.apache.sling.models.api-1.3.4-javadoc.jar.sha1
release/sling/org.apache.sling.models.api-1.3.4-source-release.zip
release/sling/org.apache.sling.models.api-1.3.4-source-release.zip.asc
release/sling

svn commit: r1805911 - /sling/tags/org.apache.sling.models.jacksonexporter-1.0.8/

2017-08-23 Thread justin
Author: justin
Date: Wed Aug 23 15:06:47 2017
New Revision: 1805911

URL: http://svn.apache.org/viewvc?rev=1805911=rev
Log:
[maven-release-plugin] copy for tag 
org.apache.sling.models.jacksonexporter-1.0.8

Added:
sling/tags/org.apache.sling.models.jacksonexporter-1.0.8/   (props changed)
  - copied from r1805910, 
sling/trunk/bundles/extensions/models/jackson-exporter/

Propchange: sling/tags/org.apache.sling.models.jacksonexporter-1.0.8/
--
--- svn:ignore (added)
+++ svn:ignore Wed Aug 23 15:06:47 2017
@@ -0,0 +1,4 @@
+.project
+.settings
+.classpath
+target

Propchange: sling/tags/org.apache.sling.models.jacksonexporter-1.0.8/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Aug 23 15:06:47 2017
@@ -0,0 +1 @@
+/sling/whiteboard/sseifert/SLING-4112_models_tuning/jackson-exporter:1635259-1639316




svn commit: r1805912 - /sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml

2017-08-23 Thread justin
Author: justin
Date: Wed Aug 23 15:06:49 2017
New Revision: 1805912

URL: http://svn.apache.org/viewvc?rev=1805912=rev
Log:
[maven-release-plugin] prepare for next development iteration

Modified:
sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml

Modified: sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml?rev=1805912=1805911=1805912=diff
==
--- sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml Wed Aug 23 
15:06:49 2017
@@ -19,15 +19,15 @@
 
 
 org.apache.sling.models.jacksonexporter
-1.0.8
+1.0.9-SNAPSHOT
 bundle
 Apache Sling Models Model Exporter - Jackson
 Apache Sling Models Client Model Exporter - 
Jackson
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.jacksonexporter-1.0.8
- 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.jacksonexporter-1.0.8
-
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.jacksonexporter-1.0.8
+
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/jackson-exporter
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/jackson-exporter
+
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter
 
 
 




svn commit: r1805910 - /sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml

2017-08-23 Thread justin
Author: justin
Date: Wed Aug 23 15:06:35 2017
New Revision: 1805910

URL: http://svn.apache.org/viewvc?rev=1805910=rev
Log:
[maven-release-plugin] prepare release 
org.apache.sling.models.jacksonexporter-1.0.8

Modified:
sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml

Modified: sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml?rev=1805910=1805909=1805910=diff
==
--- sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml Wed Aug 23 
15:06:35 2017
@@ -19,15 +19,15 @@
 
 
 org.apache.sling.models.jacksonexporter
-1.0.7-SNAPSHOT
+1.0.8
 bundle
 Apache Sling Models Model Exporter - Jackson
 Apache Sling Models Client Model Exporter - 
Jackson
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/jackson-exporter
- 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/jackson-exporter
-
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter
+
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.jacksonexporter-1.0.8
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.jacksonexporter-1.0.8
+
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.jacksonexporter-1.0.8
 
 
 




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

2017-08-23 Thread justin
Author: justin
Date: Wed Aug 23 15:04:05 2017
New Revision: 1805909

URL: http://svn.apache.org/viewvc?rev=1805909=rev
Log:
[maven-release-plugin] prepare for next development iteration

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=1805909=1805908=1805909=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Wed Aug 23 15:04:05 2017
@@ -27,14 +27,14 @@
 
 org.apache.sling.models.impl
 bundle
-1.4.4
+1.4.5-SNAPSHOT
 Apache Sling Models Implementation
 Apache Sling Models Implementation
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.impl-1.4.4
- 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.impl-1.4.4
-
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.impl-1.4.4
+
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
+
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl
 
 
 7




svn commit: r1805908 - /sling/tags/org.apache.sling.models.impl-1.4.4/

2017-08-23 Thread justin
Author: justin
Date: Wed Aug 23 15:04:03 2017
New Revision: 1805908

URL: http://svn.apache.org/viewvc?rev=1805908=rev
Log:
[maven-release-plugin] copy for tag org.apache.sling.models.impl-1.4.4

Added:
sling/tags/org.apache.sling.models.impl-1.4.4/   (props changed)
  - copied from r1805907, sling/trunk/bundles/extensions/models/impl/

Propchange: sling/tags/org.apache.sling.models.impl-1.4.4/
--
--- svn:ignore (added)
+++ svn:ignore Wed Aug 23 15:04:03 2017
@@ -0,0 +1,11 @@
+*.iml
+*.ipr
+*.iws
+.classpath
+.externalToolBuilders
+.project
+.settings
+bin
+dependency-reduced-pom.xml
+maven-eclipse.xml
+target

Propchange: sling/tags/org.apache.sling.models.impl-1.4.4/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Aug 23 15:04:03 2017
@@ -0,0 +1 @@
+/sling/whiteboard/sseifert/SLING-4112_models_tuning/impl:1635259-1639316




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

2017-08-23 Thread justin
Author: justin
Date: Wed Aug 23 15:03:51 2017
New Revision: 1805907

URL: http://svn.apache.org/viewvc?rev=1805907=rev
Log:
[maven-release-plugin] prepare release org.apache.sling.models.impl-1.4.4

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=1805907=1805906=1805907=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Wed Aug 23 15:03:51 2017
@@ -1,245 +1,245 @@
-
-
-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;>
-4.0.0
-
-org.apache.sling
-sling
-26
-
-
-org.apache.sling.models.impl
-bundle
-1.4.3-SNAPSHOT
-Apache Sling Models Implementation
-Apache Sling Models Implementation
-
-
-
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
- 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
-
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl
-
-
-7
-
-
-
-
-org.apache.felix
-maven-scr-plugin
-
-
-org.apache.felix
-maven-bundle-plugin
-true
-
-  
-
-  *;artifactId=commons-beanutils;groupId=commons-beanutils
-
-
-
-  !org.apache.sling.commons.osgi,
-  !org.apache.sling.scripting.core.impl.helper,
-  *
-
-  
-
-
-
-org.apache.maven.plugins
-maven-shade-plugin
-2.4.3
-
-
-package
-
-shade
-
-
-true
-true
-
-
-
org.apache.sling:org.apache.sling.commons.osgi
-
org.apache.sling:org.apache.sling.scripting.core
-
-
-
-
-
org.apache.sling.commons.osgi
-
slingmodelsimpl.org.apache.sling.commons.osgi
-
-
-
org.apache.sling.scripting.core.impl.helper
-
slingmodelsimpl.org.apache.sling.scripting.core.impl.helper
-
-
-
-
-
org.apache.sling:org.apache.sling.commons.osgi
-
-
org/apache/sling/commons/osgi/**
-
-
-
-
org.apache.sling:org.apache.sling.scripting.core
-
-
org/apache/sling/scripting/core/impl/helper/ProtectedBindings*
-
-
-
-
-
-
-
-
-org.apache.rat
-apache-rat-plugin
-
-
-dependency-reduced-pom.xml
-
-
-
-
-org.apache.maven.plugins
-maven-source-plugin
-
-false
-
-
-
-
-
-
-org.apache.sling
-org.apache.sling.models.api
-1.3.6
-provided
-
-
-javax.servlet
-servlet-api
-provided
-
-
-org.osgi
-org.osgi.compendium
-4.2.0
-provided
-
-
-org.apache.commons
-commons-lang3
-3.4
-provided
-
-
-org.osgi
-

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

2017-08-23 Thread justin
Author: justin
Date: Wed Aug 23 15:03:27 2017
New Revision: 1805906

URL: http://svn.apache.org/viewvc?rev=1805906=rev
Log:
use released version

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=1805906=1805905=1805906=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Wed Aug 23 15:03:27 2017
@@ -132,7 +132,7 @@
 
 org.apache.sling
 org.apache.sling.models.api
-1.3.5-SNAPSHOT
+1.3.6
 provided
 
 




svn commit: r1805905 - /sling/trunk/bundles/extensions/models/api/pom.xml

2017-08-23 Thread justin
Author: justin
Date: Wed Aug 23 15:00:34 2017
New Revision: 1805905

URL: http://svn.apache.org/viewvc?rev=1805905=rev
Log:
[maven-release-plugin] prepare for next development iteration

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

Modified: sling/trunk/bundles/extensions/models/api/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/pom.xml?rev=1805905=1805904=1805905=diff
==
--- sling/trunk/bundles/extensions/models/api/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/api/pom.xml Wed Aug 23 15:00:34 2017
@@ -28,13 +28,13 @@
 
 org.apache.sling.models.api
 bundle
-1.3.6
+1.3.7-SNAPSHOT
 Apache Sling Models API
 Apache Sling Models API
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.6
- 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.6
-
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.api-1.3.6
+
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api
+
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api
 
 
 




svn commit: r1805904 - /sling/tags/org.apache.sling.models.api-1.3.6/

2017-08-23 Thread justin
Author: justin
Date: Wed Aug 23 15:00:32 2017
New Revision: 1805904

URL: http://svn.apache.org/viewvc?rev=1805904=rev
Log:
[maven-release-plugin] copy for tag org.apache.sling.models.api-1.3.6

Added:
sling/tags/org.apache.sling.models.api-1.3.6/   (props changed)
  - copied from r1805903, sling/trunk/bundles/extensions/models/api/

Propchange: sling/tags/org.apache.sling.models.api-1.3.6/
--
--- svn:ignore (added)
+++ svn:ignore Wed Aug 23 15:00:32 2017
@@ -0,0 +1,13 @@
+target
+bin
+*.iml
+*.ipr
+*.iws
+.settings
+.project
+.classpath
+.externalToolBuilders
+maven-eclipse.xml
+
+
+

Propchange: sling/tags/org.apache.sling.models.api-1.3.6/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Wed Aug 23 15:00:32 2017
@@ -0,0 +1 @@
+/sling/whiteboard/sseifert/SLING-4112_models_tuning/api:1635259-1639316




svn commit: r1805829 - /sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java

2017-08-22 Thread justin
Author: justin
Date: Tue Aug 22 20:48:42 2017
New Revision: 1805829

URL: http://svn.apache.org/viewvc?rev=1805829=rev
Log:
remove unused import

Modified:

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java

Modified: 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java?rev=1805829=1805828=1805829=diff
==
--- 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java
 Tue Aug 22 20:48:42 2017
@@ -25,7 +25,6 @@ import com.fasterxml.jackson.databind.se
 import org.apache.commons.collections.iterators.EnumerationIterator;
 
 import java.io.IOException;
-import java.util.Calendar;
 import java.util.Enumeration;
 import java.util.Iterator;
 




svn commit: r1805830 - in /sling/trunk/bundles/extensions/healthcheck/core/src: main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java test/java/org/apache/sling/hc/core/impl/CompositeHealt

2017-08-22 Thread justin
Author: justin
Date: Tue Aug 22 20:48:47 2017
New Revision: 1805830

URL: http://svn.apache.org/viewvc?rev=1805830=rev
Log:
SLING-7069 - provide option to combine tags with or

Modified:

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/CompositeHealthCheckTest.java

Modified: 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java?rev=1805830=1805829=1805830=diff
==
--- 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java
 (original)
+++ 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java
 Tue Aug 22 20:48:47 2017
@@ -18,6 +18,7 @@
 package org.apache.sling.hc.core.impl;
 
 import java.util.Arrays;
+import java.util.Dictionary;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -35,6 +36,7 @@ import org.apache.sling.commons.osgi.Pro
 import org.apache.sling.hc.api.HealthCheck;
 import org.apache.sling.hc.api.Result;
 import org.apache.sling.hc.api.Result.Status;
+import org.apache.sling.hc.api.execution.HealthCheckExecutionOptions;
 import org.apache.sling.hc.api.execution.HealthCheckExecutionResult;
 import org.apache.sling.hc.api.execution.HealthCheckExecutor;
 import org.apache.sling.hc.api.execution.HealthCheckSelector;
@@ -76,12 +78,20 @@ public class CompositeHealthCheck implem
 
 private final Logger log = LoggerFactory.getLogger(getClass());
 
+private static final boolean DEFAULT_COMBINE_TAGS_WITH_OR = false;
+
 @Property(unbounded=PropertyUnbounded.ARRAY,
   label="Filter Tags",
   description="Tags used to select which health checks the 
composite health check executes.")
 static final String PROP_FILTER_TAGS = "filter.tags";
 private String [] filterTags;
 
+@Property(boolValue = DEFAULT_COMBINE_TAGS_WITH_OR,
+label="Combine Tags With Or",
+description="Tags used to select which health checks the composite 
health check executes.")
+static final String PROP_COMBINE_TAGS_WITH_OR = "filter.combineTagsWithOr";
+private boolean combineTagsWithOr;
+
 
 @Reference
 private HealthCheckExecutor healthCheckExecutor;
@@ -97,8 +107,10 @@ public class CompositeHealthCheck implem
 componentContext = ctx;
 healthCheckFilter = new HealthCheckFilter(bundleContext);
 
-filterTags = 
PropertiesUtil.toStringArray(ctx.getProperties().get(PROP_FILTER_TAGS), new 
String[] {});
-log.debug("Activated, will select HealthCheck having tags {}", 
Arrays.asList(filterTags));
+final Dictionary properties = ctx.getProperties();
+filterTags = 
PropertiesUtil.toStringArray(properties.get(PROP_FILTER_TAGS), new String[] {});
+combineTagsWithOr = 
PropertiesUtil.toBoolean(properties.get(PROP_COMBINE_TAGS_WITH_OR), 
DEFAULT_COMBINE_TAGS_WITH_OR);
+log.debug("Activated, will select HealthCheck having tags {} {}", 
Arrays.asList(filterTags), combineTagsWithOr ? "using OR" : "using AND");
 }
 
 @Deactivate
@@ -119,7 +131,9 @@ public class CompositeHealthCheck implem
 }
 
 FormattingResultLog resultLog = new FormattingResultLog();
-List executionResults = 
healthCheckExecutor.execute(HealthCheckSelector.tags(filterTags));
+HealthCheckExecutionOptions options = new 
HealthCheckExecutionOptions();
+options.setCombineTagsWithOr(combineTagsWithOr);
+List executionResults = 
healthCheckExecutor.execute(HealthCheckSelector.tags(filterTags), options);
 resultLog.debug("Executing {} HealthChecks selected by tags {}", 
executionResults.size(), Arrays.asList(filterTags));
 result = new CompositeResult(resultLog, executionResults);
 
@@ -156,7 +170,7 @@ public class CompositeHealthCheck implem
 }
 
 // check each sub composite check
-ServiceReference[] hcRefsOfCompositeCheck = 
healthCheckFilter.getHealthCheckServiceReferences(HealthCheckSelector.tags(tagsForIncludedChecksArr));
+ServiceReference[] hcRefsOfCompositeCheck = 
healthCheckFilter.getHealthCheckServiceReferences(HealthCheckSelector.tags(tagsForIncludedChecksArr),
 combineTagsWithOr);
 for (ServiceReference hcRefOfCompositeCheck : hcRefsOfCompositeCheck) {
 if 
(CompositeHealthCheck.class.getName().equals(hcRefOfCompositeCheck.getProperty(ComponentConstants.COMPONENT_NAME)))
 {
   

svn commit: r1805037 - in /sling/trunk/bundles/extensions/models/impl/src: main/java/org/apache/sling/models/impl/ModelAdapterFactory.java test/java/org/apache/sling/models/impl/AdapterFactoryTest.jav

2017-08-14 Thread justin
Author: justin
Date: Mon Aug 14 21:04:43 2017
New Revision: 1805037

URL: http://svn.apache.org/viewvc?rev=1805037=rev
Log:
SLING-7049 - MissingExporterException thrown when the desired ModelExporter is 
not the first in the list

Modified:

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

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.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=1805037=1805036=1805037=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 Aug 14 21:04:43 2017
@@ -1210,8 +1210,6 @@ public class ModelAdapterFactory impleme
 if (exporter.getName().equals(name) && 
exporter.isSupported(targetClass)) {
 T resultObject = exporter.export(model, targetClass, options);
 return resultObject;
-} else {
-throw new MissingExporterException(name, targetClass);
 }
 }
 throw new MissingExporterException(name, targetClass);
@@ -1239,17 +1237,9 @@ public class ModelAdapterFactory impleme
 return handleAndExportResult(result, name, targetClass, options);
 }
 
-private  T handleAndExportResult(Result result, String name, 
Class targetClass, Map<String, String> options) throws ExportException, 
MissingExporterException {
+protected  T handleAndExportResult(Result result, String name, 
Class targetClass, Map<String, String> options) throws ExportException, 
MissingExporterException {
 if (result.wasSuccessful()) {
-for (ModelExporter exporter : modelExporters) {
-if (exporter.getName().equals(name) && 
exporter.isSupported(targetClass)) {
-T resultObject = exporter.export(result.getValue(), 
targetClass, options);
-return resultObject;
-} else {
-throw new MissingExporterException(name, targetClass);
-}
-}
-throw new MissingExporterException(name, targetClass);
+return exportModel(result.getValue(), name, targetClass, options);
 } else {
 throw result.getThrowable();
 }

Modified: 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java?rev=1805037=1805036=1805037=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AdapterFactoryTest.java
 Mon Aug 14 21:04:43 2017
@@ -16,8 +16,10 @@
  */
 package org.apache.sling.models.impl;
 
+import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Map;
@@ -28,8 +30,11 @@ import org.apache.sling.api.resource.Val
 import org.apache.sling.api.wrappers.ValueMapDecorator;
 import org.apache.sling.models.annotations.Model;
 import org.apache.sling.models.annotations.injectorspecific.Self;
+import org.apache.sling.models.export.spi.ModelExporter;
+import org.apache.sling.models.factory.ExportException;
 import org.apache.sling.models.factory.InvalidAdaptableException;
 import org.apache.sling.models.factory.MissingElementsException;
+import org.apache.sling.models.factory.MissingExporterException;
 import org.apache.sling.models.factory.ModelClassException;
 import org.apache.sling.models.impl.injectors.SelfInjector;
 import org.apache.sling.models.impl.injectors.ValueMapInjector;
@@ -46,6 +51,9 @@ import org.mockito.runners.MockitoJUnitR
 import org.osgi.framework.BundleContext;
 import org.osgi.service.component.ComponentContext;
 
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+
 @RunWith(MockitoJUnitRunner.class)
 public class AdapterFactoryTest {
 @Mock
@@ -71,6 +79,9 @@ public class AdapterFactoryTest {
 factory.activate(componentCtx);
 factory.bindInjector(new ValueMapInjector(), new 
ServicePropertiesMap(0, 0));
 factory.bindInjector(new SelfInjector(), ne

svn commit: r1804333 - /sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/MetricWebConsolePlugin.java

2017-08-07 Thread justin
Author: justin
Date: Mon Aug  7 13:30:02 2017
New Revision: 1804333

URL: http://svn.apache.org/viewvc?rev=1804333=rev
Log:
SLING-7028 - remove assumption that histograms are durations

Modified:

sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/MetricWebConsolePlugin.java

Modified: 
sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/MetricWebConsolePlugin.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/MetricWebConsolePlugin.java?rev=1804333=1804332=1804333=diff
==
--- 
sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/MetricWebConsolePlugin.java
 (original)
+++ 
sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/MetricWebConsolePlugin.java
 Mon Aug  7 13:30:02 2017
@@ -314,7 +314,6 @@ public class MetricWebConsolePlugin exte
 pw.println("98%");
 pw.println("99%");
 pw.println("999%");
-pw.println("Duration Unit");
 pw.println("");
 pw.println("");
 pw.println("");
@@ -325,25 +324,22 @@ public class MetricWebConsolePlugin exte
 Snapshot s = h.getSnapshot();
 String name = e.getKey();
 
-double durationFactor = 1.0 / 
timeUnit.durationFor(name).toNanos(1);
-String durationUnit = 
timeUnit.durationFor(name).toString().toLowerCase(Locale.US);
 pw.printf("%n", rowClass);
 
 pw.printf("%s", name);
 pw.printf("%d", h.getCount());
-pw.printf("%f", s.getMedian() * durationFactor);
-pw.printf("%f", s.getMin() * durationFactor);
-pw.printf("%f", s.getMax() * durationFactor);
-pw.printf("%f", s.getMean() * durationFactor);
-pw.printf("%f", s.getStdDev() * durationFactor);
-
-pw.printf("%f", s.get75thPercentile() * durationFactor);
-pw.printf("%f", s.get95thPercentile() * durationFactor);
-pw.printf("%f", s.get98thPercentile() * durationFactor);
-pw.printf("%f", s.get99thPercentile() * durationFactor);
-pw.printf("%f", s.get999thPercentile() * durationFactor);
+pw.printf("%f", s.getMedian());
+pw.printf("%d", s.getMin());
+pw.printf("%d", s.getMax());
+pw.printf("%f", s.getMean());
+pw.printf("%f", s.getStdDev());
+
+pw.printf("%f", s.get75thPercentile());
+pw.printf("%f", s.get95thPercentile());
+pw.printf("%f", s.get98thPercentile());
+pw.printf("%f", s.get99thPercentile());
+pw.printf("%f", s.get999thPercentile());
 
-pw.printf("%s", durationUnit);
 
 pw.println("");
 rowClass = "odd".equals(rowClass) ? "even" : "odd";




svn commit: r1804334 - in /sling/trunk/bundles/commons/metrics: pom.xml src/main/java/org/apache/sling/commons/metrics/internal/LogReporter.java src/test/java/org/apache/sling/commons/metrics/internal

2017-08-07 Thread justin
Author: justin
Date: Mon Aug  7 13:30:08 2017
New Revision: 1804334

URL: http://svn.apache.org/viewvc?rev=1804334=rev
Log:
SLING-7031 - configurable component to write subset of metrics to log file on a 
recurring basis.

Added:

sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/LogReporter.java

sling/trunk/bundles/commons/metrics/src/test/java/org/apache/sling/commons/metrics/internal/LogReporterTest.java
Modified:
sling/trunk/bundles/commons/metrics/pom.xml

Modified: sling/trunk/bundles/commons/metrics/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/metrics/pom.xml?rev=1804334=1804333=1804334=diff
==
--- sling/trunk/bundles/commons/metrics/pom.xml (original)
+++ sling/trunk/bundles/commons/metrics/pom.xml Mon Aug  7 13:30:08 2017
@@ -238,6 +238,12 @@
 test
  
 
+junit-addons
+junit-addons
+1.4
+test
+
+
 org.apache.sling
 org.apache.sling.testing.paxexam
 0.0.4

Added: 
sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/LogReporter.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/LogReporter.java?rev=1804334=auto
==
--- 
sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/LogReporter.java
 (added)
+++ 
sling/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/internal/LogReporter.java
 Mon Aug  7 13:30:08 2017
@@ -0,0 +1,150 @@
+/*
+ * 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.commons.metrics.internal;
+
+import com.codahale.metrics.Metric;
+import com.codahale.metrics.MetricFilter;
+import com.codahale.metrics.MetricRegistry;
+import com.codahale.metrics.Slf4jReporter;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.Designate;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
+import org.osgi.util.tracker.ServiceTracker;
+import org.osgi.util.tracker.ServiceTrackerCustomizer;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.TimeUnit;
+import java.util.regex.Pattern;
+
+@Component(service = {}, configurationPolicy = ConfigurationPolicy.REQUIRE)
+@Designate(ocd = LogReporter.Config.class, factory = true)
+public class LogReporter implements ServiceTrackerCustomizer<MetricRegistry, 
Slf4jReporter> {
+
+private BundleContext context;
+private ServiceTracker<MetricRegistry, Slf4jReporter> tracker;
+private Config config;
+
+@Activate
+protected void activate(Config config, BundleContext context) {
+this.config = config;
+this.context = context;
+tracker = new ServiceTracker<>(context, MetricRegistry.class, this);
+tracker.open();
+}
+
+@Deactivate
+protected void deactivate(BundleContext context) {
+tracker.close();
+}
+
+//~-< ServiceTracker >
+
+@Override
+public Slf4jReporter addingService(ServiceReference 
serviceReference) {
+MetricRegistry registry = context.getService(serviceReference);
+String metricRegistryName = (String) 
serviceReference.getProperty(MetricWebConsolePlugin.METRIC_REGISTRY_NAME);
+
+if (config.registryName() == null || config.registryName().length() == 0
+|| config.registryName().equals(metricRegistryName)) {
+Slf4jReporter.Builder builder = 
Slf4jReporter.forRegistry(registry).
+output

svn propchange: r1802505 - svn:log

2017-07-20 Thread justin
Author: justin
Revision: 1802505
Modified property: svn:log

Modified: svn:log at Thu Jul 20 15:19:32 2017
--
--- svn:log (original)
+++ svn:log Thu Jul 20 15:19:32 2017
@@ -1 +1 @@
-Merge branch 'SLING-7015'
+SLING-7015 - add utility method for adapting a request forcing a specific 
resource



svn commit: r1802505 - in /sling/trunk/bundles/extensions/models: api/src/main/java/org/apache/sling/models/factory/ impl/ impl/src/main/java/org/apache/sling/models/impl/ impl/src/test/java/org/apach

2017-07-20 Thread justin
Author: justin
Date: Thu Jul 20 15:14:15 2017
New Revision: 1802505

URL: http://svn.apache.org/viewvc?rev=1802505=rev
Log:
Merge branch 'SLING-7015'

Added:

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

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

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/RequestWrapperTest.java
Removed:

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExporterScriptEngineFactory.java
Modified:

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

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

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.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/ModelPackageBundleListener.java

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

Modified: 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java?rev=1802505=1802504=1802505=diff
==
--- 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/ModelFactory.java
 Thu Jul 20 15:14:15 2017
@@ -186,4 +186,16 @@ public interface ModelFactory {
 InvalidAdaptableException, ModelClassException, 
PostConstructException, ValidationException, InvalidModelException,
 ExportException, MissingExporterException;
 
+
+/**
+ * Create a wrapped request object with the specified resource and (try 
to) adapt the request object into the specified class. The wrapped request
+ * object will have a fresh set of script bindings so that any injected 
bindings references have the correct context.
+ *
+ * @param request the current request
+ * @param resource the resource to set as the wrapped request's resource
+ * @param targetClass the target adapter class
+ * @param  the target adapter class
+ * @return an instance of the target class or null if the adaptation could 
not be done
+ */
+public  T getModelFromWrappedRequest(@Nonnull SlingHttpServletRequest 
request, @Nonnull Resource resource, @Nonnull Class targetClass);
 }

Modified: 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/package-info.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/package-info.java?rev=1802505=1802504=1802505=diff
==
--- 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/package-info.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/factory/package-info.java
 Thu Jul 20 15:14:15 2017
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-@Version("1.3.1")
+@Version("1.4.0")
 package org.apache.sling.models.factory;
 
 import aQute.bnd.annotation.Version;
\ No newline at end of file

Modified: sling/trunk/bundles/extensions/models/impl/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/pom.xml?rev=1802505=1802504=1802505=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Thu Jul 20 15:14:15 2017
@@ -132,7 +132,7 @@
 
 org.apache.sling
 org.apache.sling.models.api
-1.3.4
+1.3.5-SNAPSHOT
 provided
 
 

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java?rev=1802505=1802504=1802505=diff
==
--- 
sling/trunk/bundles/extensions/models/im

svn commit: r1801663 - in /sling/trunk/bundles/servlets/post/src: main/java/org/apache/sling/servlets/post/ test/java/org/apache/sling/servlets/post/

2017-07-11 Thread justin
Author: justin
Date: Tue Jul 11 23:23:18 2017
New Revision: 1801663

URL: http://svn.apache.org/viewvc?rev=1801663=rev
Log:
SLING-7006 - omit change log from post response on error

Added:

sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/HtmlResponseTest.java
Modified:

sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/HtmlResponse.java

sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/JSONResponse.java

sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/JsonResponseTest.java

Modified: 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/HtmlResponse.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/HtmlResponse.java?rev=1801663=1801662=1801663=diff
==
--- 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/HtmlResponse.java
 (original)
+++ 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/HtmlResponse.java
 Tue Jul 11 23:23:18 2017
@@ -113,7 +113,11 @@ public class HtmlResponse extends Abstra
 // get changelog
 changes.insert(0, "");
 changes.append("");
-setProperty(PN_CHANGE_LOG, changes.toString());
+if (getError() == null) {
+setProperty(PN_CHANGE_LOG, changes.toString());
+} else {
+setProperty(PN_CHANGE_LOG, "");
+}
 
 Writer out = response.getWriter();
 

Modified: 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/JSONResponse.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/JSONResponse.java?rev=1801663=1801662=1801663=diff
==
--- 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/JSONResponse.java
 (original)
+++ 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/JSONResponse.java
 Tue Jul 11 23:23:18 2017
@@ -116,28 +116,28 @@ public class JSONResponse extends Abstra
 .add("message", error.getMessage()));
 }
 JsonArrayBuilder changesBuilder = Json.createArrayBuilder();
-for (Map<String, Object> entry : changes) {
-JsonObjectBuilder entryBuilder = Json.createObjectBuilder();
-entryBuilder.add(PROP_TYPE, (String) entry.get(PROP_TYPE));
-
-Object arguments = entry.get(PROP_ARGUMENT);
-
-if (arguments != null) {
-if (arguments instanceof List) {
-JsonArrayBuilder argumentsBuilder = 
Json.createArrayBuilder();
-
-for (String argument : ((List) arguments))
-{
-argumentsBuilder.add(argument);
+if (this.error == null) {
+for (Map<String, Object> entry : changes) {
+JsonObjectBuilder entryBuilder = Json.createObjectBuilder();
+entryBuilder.add(PROP_TYPE, (String) entry.get(PROP_TYPE));
+
+Object arguments = entry.get(PROP_ARGUMENT);
+
+if (arguments != null) {
+if (arguments instanceof List) {
+JsonArrayBuilder argumentsBuilder = 
Json.createArrayBuilder();
+
+for (String argument : ((List) arguments)) {
+argumentsBuilder.add(argument);
+}
+
+entryBuilder.add(PROP_ARGUMENT, argumentsBuilder);
+} else {
+entryBuilder.add(PROP_ARGUMENT, (String) arguments);
 }
-
-entryBuilder.add(PROP_ARGUMENT, argumentsBuilder);
-}
-else {
-entryBuilder.add(PROP_ARGUMENT, (String) arguments);
 }
+changesBuilder.add(entryBuilder);
 }
-changesBuilder.add(entryBuilder);
 }
 jsonBuilder.add(PROP_CHANGES, changesBuilder);
 return jsonBuilder.build();

Added: 
sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/HtmlResponseTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/HtmlResponseTest.java?rev=1801663=auto
==
--- 
sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/HtmlResponseTest.java
 (added)
+++ 
sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/HtmlRespo

svn commit: r1801649 - in /sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/exporter: FakeRequest.java FakeResponse.java

2017-07-11 Thread justin
Author: justin
Date: Tue Jul 11 19:24:14 2017
New Revision: 1801649

URL: http://svn.apache.org/viewvc?rev=1801649=rev
Log:
switch Sling Models ITs to use TeleporterRule (missing files)

Added:

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/exporter/FakeRequest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/exporter/FakeResponse.java

Added: 
sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/exporter/FakeRequest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/exporter/FakeRequest.java?rev=1801649=auto
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/exporter/FakeRequest.java
 (added)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/exporter/FakeRequest.java
 Tue Jul 11 19:24:14 2017
@@ -0,0 +1,316 @@
+/*
+ * 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.testing.exporter;
+
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.security.Principal;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+class FakeRequest implements HttpServletRequest {
+
+private final String path;
+
+private final StringBuffer requestUrl;
+
+private final Map<String, Object> attributes = new HashMap<String, 
Object>();
+
+FakeRequest(String path) {
+this.path = path;
+this.requestUrl = new StringBuffer("http://notarealhost;).append(path);
+}
+
+@Override
+public String getAuthType() {
+return null;
+}
+
+@Override
+public Cookie[] getCookies() {
+return new Cookie[0];
+}
+
+@Override
+public long getDateHeader(String name) {
+return 0;
+}
+
+@Override
+public String getHeader(String name) {
+return null;
+}
+
+@Override
+public Enumeration getHeaders(String name) {
+return null;
+}
+
+@Override
+public Enumeration getHeaderNames() {
+return null;
+}
+
+@Override
+public int getIntHeader(String name) {
+return 0;
+}
+
+@Override
+public String getMethod() {
+return "GET";
+}
+
+@Override
+public String getPathInfo() {
+return path;
+}
+
+@Override
+public String getPathTranslated() {
+return null;
+}
+
+@Override
+public String getContextPath() {
+return null;
+}
+
+@Override
+public String getQueryString() {
+return null;
+}
+
+@Override
+public String getRemoteUser() {
+return null;
+}
+
+@Override
+public boolean isUserInRole(String role) {
+return false;
+}
+
+@Override
+public Principal getUserPrincipal() {
+return null;
+}
+
+@Override
+public String getRequestedSessionId() {
+return null;
+}
+
+@Override
+public String getRequestURI() {
+return null;
+}
+
+@Override
+public StringBuffer getRequestURL() {
+return requestUrl;
+}
+
+@Override
+public String getServletPath() {
+return "";
+}
+
+@Override
+public HttpSession getSession(boolean create) {
+return null;
+}
+
+@Override
+public HttpSession getSession() {
+return null;
+}
+
+@Override
+public boolean isRequestedSessionIdValid() {
+return false;
+}
+
+@Override
+public boolean isRequestedSessionIdFromCookie() {
+

svn commit: r1801648 - in /sling/trunk/bundles/extensions/models/integration-tests: ./ src/main/java/org/apache/sling/models/it/ src/main/java/org/apache/sling/models/it/delegate/ src/main/java/org/ap

2017-07-11 Thread justin
Author: justin
Date: Tue Jul 11 19:23:26 2017
New Revision: 1801648

URL: http://svn.apache.org/viewvc?rev=1801648=rev
Log:
switch Sling Models ITs to use TeleporterRule

Added:

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/junit/

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/junit/teleporter/

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/junit/teleporter/customizers/

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/junit/teleporter/customizers/SM_TeleporterCustomizer.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/DecoratedIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/ImplementsExtendsIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ImplementsExtendsTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/InjectorSpecificAnnotationIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ViaTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/ModelFactorySimpleIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ModelFactorySimpleTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/ServiceInjectionWithDifferentRankingIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ServiceInjectionWithDifferentRankingTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/SimpleIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/SimpleTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/ViaIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ViaTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/delegate/

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/delegate/DelegateRequestIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/DelegateRequestTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/delegate/DelegateResourceIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/DelegateResourceTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/exporter/

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/exporter/ExporterIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/rtbound/

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/rtbound/FakeRequest.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/rtbound/FakeRequest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/rtbound/ResourceTypeBindingIT.java
  - copied, changed from r1801589, 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/rtbound/ResourceTypeBindingTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/rtboundpicker/

sling/trunk/bundles/extensions/models/integration-tests/src/test/java/org/apache/sling/models/testing/rtboundpicker/ResourceTypePickerIT.java
  - copied, changed from r1801589

svn commit: r1801499 - /sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/FakeRequest.java

2017-07-10 Thread justin
Author: justin
Date: Mon Jul 10 17:03:43 2017
New Revision: 1801499

URL: http://svn.apache.org/viewvc?rev=1801499=rev
Log:
fix testing errors when running Sling Models ITs with I18n bundle installed

Modified:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/FakeRequest.java

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/FakeRequest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/FakeRequest.java?rev=1801499=1801498=1801499=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/FakeRequest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/FakeRequest.java
 Mon Jul 10 17:03:43 2017
@@ -35,10 +35,13 @@ class FakeRequest implements HttpServlet
 
 private final String path;
 
+private final StringBuffer requestUrl;
+
 private final Map<String, Object> attributes = new HashMap<String, 
Object>();
 
 FakeRequest(String path) {
 this.path = path;
+this.requestUrl = new StringBuffer("http://notarealhost;).append(path);
 }
 
 @Override
@@ -128,7 +131,7 @@ class FakeRequest implements HttpServlet
 
 @Override
 public StringBuffer getRequestURL() {
-return null;
+return requestUrl;
 }
 
 @Override
@@ -273,7 +276,7 @@ class FakeRequest implements HttpServlet
 
 @Override
 public Enumeration getLocales() {
-return null;
+return Collections.emptyEnumeration();
 }
 
 @Override




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

2017-07-10 Thread justin
Author: justin
Date: Mon Jul 10 17:03:38 2017
New Revision: 1801498

URL: http://svn.apache.org/viewvc?rev=1801498=rev
Log:
use release version of testing libraries

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=1801498=1801497=1801498=diff
==
--- sling/trunk/bundles/extensions/models/integration-tests/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/integration-tests/pom.xml Mon Jul 10 
17:03:38 2017
@@ -292,7 +292,7 @@
 
 org.apache.sling
 org.apache.sling.junit.remote
-1.0.11-SNAPSHOT
+1.0.12
 provided
 
 
@@ -304,7 +304,7 @@
 
 org.apache.sling
 org.apache.sling.testing.tools
-1.0.17-SNAPSHOT
+1.0.16
 provided
 
 




svn commit: r1799221 - in /sling/trunk/bundles/extensions/models/jackson-exporter/src: main/java/org/apache/sling/models/jacksonexporter/impl/ test/ test/java/ test/java/org/ test/java/org/apache/ tes

2017-06-19 Thread justin
Author: justin
Date: Mon Jun 19 15:28:23 2017
New Revision: 1799221

URL: http://svn.apache.org/viewvc?rev=1799221=rev
Log:
SLING-6966 - don't use ResourceSerializer for Model annotated classes

Added:

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ModelSkippingSerializers.java
sling/trunk/bundles/extensions/models/jackson-exporter/src/test/
sling/trunk/bundles/extensions/models/jackson-exporter/src/test/java/
sling/trunk/bundles/extensions/models/jackson-exporter/src/test/java/org/

sling/trunk/bundles/extensions/models/jackson-exporter/src/test/java/org/apache/

sling/trunk/bundles/extensions/models/jackson-exporter/src/test/java/org/apache/sling/

sling/trunk/bundles/extensions/models/jackson-exporter/src/test/java/org/apache/sling/models/

sling/trunk/bundles/extensions/models/jackson-exporter/src/test/java/org/apache/sling/models/jacksonexporter/

sling/trunk/bundles/extensions/models/jackson-exporter/src/test/java/org/apache/sling/models/jacksonexporter/impl/

sling/trunk/bundles/extensions/models/jackson-exporter/src/test/java/org/apache/sling/models/jacksonexporter/impl/ModelSkippingSerializersTest.java
Modified:

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java

Added: 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ModelSkippingSerializers.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ModelSkippingSerializers.java?rev=1799221=auto
==
--- 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ModelSkippingSerializers.java
 (added)
+++ 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ModelSkippingSerializers.java
 Mon Jun 19 15:28:23 2017
@@ -0,0 +1,37 @@
+/*
+ * 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.jacksonexporter.impl;
+
+import com.fasterxml.jackson.databind.BeanDescription;
+import com.fasterxml.jackson.databind.JavaType;
+import com.fasterxml.jackson.databind.JsonSerializer;
+import com.fasterxml.jackson.databind.SerializationConfig;
+import com.fasterxml.jackson.databind.module.SimpleSerializers;
+import org.apache.sling.models.annotations.Model;
+
+public class ModelSkippingSerializers extends SimpleSerializers {
+
+@Override
+public JsonSerializer findSerializer(SerializationConfig config, 
JavaType type, BeanDescription beanDesc) {
+Class clazz = type.getRawClass();
+if (clazz.getAnnotation(Model.class) != null) {
+return null;
+}
+
+return super.findSerializer(config, type, beanDesc);
+}
+}

Modified: 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java?rev=1799221=1799220=1799221=diff
==
--- 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java
 Mon Jun 19 15:28:23 2017
@@ -49,7 +49,7 @@ public class ResourceModuleProvider impl
 private void activate(Map<String, Object> props) {
 final int maxRecursionLevels = 
PropertiesUtil.toInteger(props.get(PROP_MAX_RECURSION_LEVELS), 
DEFAULT_MAX_RECURSION_LEVELS);
 this.moduleInstance = new SimpleModule();
-SimpleSerializers serializers = new SimpleSerializers();
+ModelSkippingSer

svn commit: r1799218 - in /sling/trunk/bundles/extensions/models: integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java jackson-exporter/src/main/java/org/apache/sling/

2017-06-19 Thread justin
Author: justin
Date: Mon Jun 19 14:45:05 2017
New Revision: 1799218

URL: http://svn.apache.org/viewvc?rev=1799218=rev
Log:
SLING-6965 - remove duplicate object start in ResourceSeriailzer

Modified:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceSerializer.java

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java?rev=1799218=1799217=1799218=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
 Mon Jun 19 14:45:05 2017
@@ -91,6 +91,8 @@ public class ExporterTest {
 "sling/exp/base");
 ResourceUtil.getOrCreateResource(adminResolver, baseComponentPath, 
properties, null, false);
 
+ResourceUtil.getOrCreateResource(adminResolver, baseComponentPath 
+ "/child", Collections.<String, Object>emptyMap(), null, false);
+
 properties.put(SlingConstants.NAMESPACE_PREFIX + ":" + 
SlingConstants.PROPERTY_RESOURCE_TYPE,
 "sling/exp-request/base");
 ResourceUtil.getOrCreateResource(adminResolver, 
baseRequestComponentPath, properties, null, false);

Modified: 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceSerializer.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceSerializer.java?rev=1799218=1799217=1799218=diff
==
--- 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceSerializer.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceSerializer.java
 Mon Jun 19 14:45:05 2017
@@ -96,7 +96,7 @@ public class ResourceSerializer extends
 // the child nodes
 if (recursionLevelActive(currentRecursionLevel)) {
 for (final Resource n : resource.getChildren()) {
-jgen.writeObjectFieldStart(n.getName());
+jgen.writeFieldName(n.getName());
 create(n, jgen, currentRecursionLevel + 1, provider);
 }
 }




svn commit: r1798518 - in /sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it: DecoratedTest.java services/TestResourceDecorator.java

2017-06-12 Thread justin
Author: justin
Date: Mon Jun 12 19:53:18 2017
New Revision: 1798518

URL: http://svn.apache.org/viewvc?rev=1798518=rev
Log:
update decorator test to include custom adaptTo method which gets adaptTo to 
work as expected

Modified:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/TestResourceDecorator.java

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java?rev=1798518=1798517=1798518=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java
 Mon Jun 12 19:53:18 2017
@@ -43,41 +43,50 @@ public class DecoratedTest {
 
 @TestReference
 private ModelFactory modelFactory;
-
-private String value;
+
 private ResourceResolver resolver;
-private Resource resource;
-private Node createdNode;
+private Resource resourceWithDefaultWrapperBehavior;
+private Resource resourceWithCustomAdaptToWrapper;
 
 @Before
 public void setUp() throws Exception {
-value = RandomStringUtils.randomAlphanumeric(10);
 
 resolver = rrFactory.getAdministrativeResourceResolver(null);
 Session session = resolver.adaptTo(Session.class);
 Node rootNode = session.getRootNode();
-createdNode = rootNode.addNode("test_" + 
RandomStringUtils.randomAlphanumeric(10));
-createdNode.setProperty("testProperty", value);
+Node createdNode = rootNode.addNode("test_" + 
RandomStringUtils.randomAlphanumeric(10));
 createdNode.setProperty("decorate", true);
 session.save();
 
-resource = resolver.getResource(createdNode.getPath());
+resourceWithDefaultWrapperBehavior = 
resolver.getResource(createdNode.getPath());
+
+createdNode = rootNode.addNode("test_" + 
RandomStringUtils.randomAlphanumeric(10));
+createdNode.setProperty("decorate", "customAdaptTo");
+session.save();
+
+resourceWithCustomAdaptToWrapper = 
resolver.getResource(createdNode.getPath());
 }
 
 @After
 public void tearDown() throws Exception {
-if (createdNode != null) {
-createdNode.remove();
-}
-if (resolver != null) {
-resolver.close();
-}
+resolver.delete(resourceWithDefaultWrapperBehavior);
+resolver.delete(resourceWithCustomAdaptToWrapper);
+resolver.close();
+}
+
+@Test
+public void testInjectDecoratedResourceUsingCreateModel() {
+assertTrue("Resource is not wrapped", 
resourceWithDefaultWrapperBehavior instanceof ResourceWrapper);
+SelfModel model = 
modelFactory.createModel(resourceWithDefaultWrapperBehavior, SelfModel.class);
+
+assertNotNull("Model is null", model);
+assertTrue("Model is not wrapped", model.getResource() instanceof 
ResourceWrapper);
 }
 
 @Test
-public void testInjectDecoratedResource() {
-SelfModel model = modelFactory.createModel(resource, SelfModel.class);
-assertTrue("Resource is not wrapped", resource instanceof 
ResourceWrapper);
+public void testInjectDecoratedResourceUsingAdaptTo() {
+assertTrue("Resource is not wrapped", resourceWithCustomAdaptToWrapper 
instanceof ResourceWrapper);
+SelfModel model = 
resourceWithCustomAdaptToWrapper.adaptTo(SelfModel.class);
 
 assertNotNull("Model is null", model);
 assertTrue("Model is not wrapped", model.getResource() instanceof 
ResourceWrapper);

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/TestResourceDecorator.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/TestResourceDecorator.java?rev=1798518=1798517=1798518=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/TestResourceDecorator.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/TestResourceDecorator.java
 Mon Jun 12 19:53:18 2017
@@ -17,7 +17,9 @@
 package org.apache

svn commit: r1798515 - /sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java

2017-06-12 Thread justin
Author: justin
Date: Mon Jun 12 19:32:10 2017
New Revision: 1798515

URL: http://svn.apache.org/viewvc?rev=1798515=rev
Log:
fix inverted test message

Modified:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java?rev=1798515=1798514=1798515=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java
 Mon Jun 12 19:32:10 2017
@@ -76,8 +76,8 @@ public class DecoratedTest {
 
 @Test
 public void testInjectDecoratedResource() {
-assertTrue("Resource is wrapped", resource instanceof ResourceWrapper);
 SelfModel model = modelFactory.createModel(resource, SelfModel.class);
+assertTrue("Resource is not wrapped", resource instanceof 
ResourceWrapper);
 
 assertNotNull("Model is null", model);
 assertTrue("Model is not wrapped", model.getResource() instanceof 
ResourceWrapper);




svn commit: r1798489 - in /sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it: DecoratedTest.java models/SelfModel.java services/TestResourceDecorator.jav

2017-06-12 Thread justin
Author: justin
Date: Mon Jun 12 16:51:15 2017
New Revision: 1798489

URL: http://svn.apache.org/viewvc?rev=1798489=rev
Log:
integration test of Sling Models and ResourceWrapper

Added:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/SelfModel.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/TestResourceDecorator.java

Added: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java?rev=1798489=auto
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java
 (added)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/DecoratedTest.java
 Mon Jun 12 16:51:15 2017
@@ -0,0 +1,86 @@
+/*
+ * 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.it;
+
+import org.apache.commons.lang.RandomStringUtils;
+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.ResourceWrapper;
+import org.apache.sling.junit.annotations.SlingAnnotationsTestRunner;
+import org.apache.sling.junit.annotations.TestReference;
+import org.apache.sling.models.factory.ModelFactory;
+import org.apache.sling.models.it.models.SelfModel;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.jcr.Node;
+import javax.jcr.Session;
+
+import static org.junit.Assert.*;
+
+@RunWith(SlingAnnotationsTestRunner.class)
+public class DecoratedTest {
+
+@TestReference
+private ResourceResolverFactory rrFactory;
+
+@TestReference
+private ModelFactory modelFactory;
+
+private String value;
+private ResourceResolver resolver;
+private Resource resource;
+private Node createdNode;
+
+@Before
+public void setUp() throws Exception {
+value = RandomStringUtils.randomAlphanumeric(10);
+
+resolver = rrFactory.getAdministrativeResourceResolver(null);
+Session session = resolver.adaptTo(Session.class);
+Node rootNode = session.getRootNode();
+createdNode = rootNode.addNode("test_" + 
RandomStringUtils.randomAlphanumeric(10));
+createdNode.setProperty("testProperty", value);
+createdNode.setProperty("decorate", true);
+session.save();
+
+resource = resolver.getResource(createdNode.getPath());
+}
+
+@After
+public void tearDown() throws Exception {
+if (createdNode != null) {
+createdNode.remove();
+}
+if (resolver != null) {
+resolver.close();
+}
+}
+
+@Test
+public void testInjectDecoratedResource() {
+assertTrue("Resource is wrapped", resource instanceof ResourceWrapper);
+SelfModel model = modelFactory.createModel(resource, SelfModel.class);
+
+assertNotNull("Model is null", model);
+assertTrue("Model is not wrapped", model.getResource() instanceof 
ResourceWrapper);
+}
+
+}

Added: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/SelfModel.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/SelfModel.java?rev=1798489=auto
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/SelfModel.java
 (added)
+++ 
sling/trunk/bundles/extensions/models/integ

svn commit: r1794887 - in /sling/trunk/bundles/extensions/healthcheck: api/src/main/java/org/apache/sling/hc/api/execution/ api/src/main/java/org/apache/sling/hc/util/ api/src/test/java/org/apache/sli

2017-05-11 Thread justin
Author: justin
Date: Thu May 11 20:05:21 2017
New Revision: 1794887

URL: http://svn.apache.org/viewvc?rev=1794887=rev
Log:
SLING-6804 - allow selecting health checks by name

Added:

sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/api/execution/HealthCheckSelector.java

sling/trunk/bundles/extensions/healthcheck/api/src/test/java/org/apache/sling/hc/util/HealthCheckFilterTest.java
Modified:

sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutor.java

sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/api/execution/package-info.java

sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/util/FormattingResultLog.java

sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/util/HealthCheckFilter.java

sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/util/HealthCheckMetadata.java

sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/util/package-info.java

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/CompositeHealthCheck.java

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/AsyncHealthCheckExecutor.java

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/executor/HealthCheckExecutorImpl.java

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/CompositeHealthCheckTest.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServletTest.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/AsyncHealthCheckIT.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/ExtendedHealthCheckExecutorIT.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/HealthCheckFilterIT.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/JmxAdjustableStatusForTestingIT.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/U.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/jmx/impl/HealthCheckMBeanTest.java

sling/trunk/bundles/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/SampleHealthChecksTest.java

sling/trunk/bundles/extensions/healthcheck/it/src/test/java/org/apache/sling/hc/it/core/U.java

Modified: 
sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutor.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutor.java?rev=1794887=1794886=1794887=diff
==
--- 
sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutor.java
 (original)
+++ 
sling/trunk/bundles/extensions/healthcheck/api/src/main/java/org/apache/sling/hc/api/execution/HealthCheckExecutor.java
 Thu May 11 20:05:21 2017
@@ -32,11 +32,33 @@ import org.osgi.annotation.versioning.Pr
 public interface HealthCheckExecutor {
 
 /**
+ * Executes all health checks matching the supplied filter options.
+ * If no options are supplied, all health checks are executed.
+ *
+ * @param selector filter selector
+ * @return List of results. The list might be empty.
+ */
+List execute(HealthCheckSelector selector);
+
+/**
+ * Executes all health checks with the supplied filter options.
+ * If no options are supplied, all health checks are executed.
+ *
+ * @param selector filter selector
+ * @param options options for controlling execution behavior
+ *
+ * @return List of results. The list might be empty.
+ */
+List execute(HealthCheckSelector selector, 
HealthCheckExecutionOptions options);
+
+/**
  * Executes all health checks with the supplied list of tags.
  * If no tags are supplied, all health checks are executed.
  *
  * @return List of results. The list might be empty.
+ * @deprecated use execute(HealthCheckFilter.Options)
  */
+@Deprecated
 List execute(String... tags);
 
 /**
@@ -47,7 +69,9 @@ public interface HealthCheckExecutor {
  * @param tags tags to be executed
  *
  * @return List of results. The list might be empty.
+ * @deprecated use execute(HealthCheckFilter.Options, 
HealthCheckExecutionOptions

svn commit: r1793654 - /sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java

2017-05-03 Thread justin
Author: justin
Date: Wed May  3 14:30:28 2017
New Revision: 1793654

URL: http://svn.apache.org/viewvc?rev=1793654=rev
Log:
SLING-6806 - move tags in HTML output to part of the first column

Modified:

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java

Modified: 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java?rev=1793654=1793653=1793654=diff
==
--- 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
 (original)
+++ 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
 Wed May  3 14:30:28 2017
@@ -81,14 +81,22 @@ public class ResultHtmlSerializer {
 final DateFormat dfLong = new SimpleDateFormat("-MM-dd HH:mm");
 
 writer.println("");
-writer.println("Health 
CheckTagsStatusLogFinished 
AtExecution Time");
+writer.println("Health 
CheckStatusLogFinished AtExecution 
Time");
 for (HealthCheckExecutionResult executionResult : executionResults) {
 Result result = executionResult.getHealthCheckResult();
-writer.println("");
-writer.println(""
-+ 
StringEscapeUtils.escapeHtml(executionResult.getHealthCheckMetadata().getTitle())
 + "");
-writer.println("" + 
StringEscapeUtils.escapeHtml(StringUtils.join(executionResult.getHealthCheckMetadata().getTags(),
 ", ")) + "");
+List tags = 
executionResult.getHealthCheckMetadata().getTags();
+boolean hasTags = tags != null && tags.size() > 0 && 
StringUtils.isNotBlank(tags.get(0));
+writer.print("");
+writer.print(""
++ 
StringEscapeUtils.escapeHtml(executionResult.getHealthCheckMetadata().getTitle())
 + "");
+if (hasTags) {
+writer.println("Tags: " + 
StringEscapeUtils.escapeHtml(StringUtils.join(tags, ", ")) + "");
+}
+writer.println("");
 writer.println("" + 
StringEscapeUtils.escapeHtml(result.getStatus().toString()) + "");
 writer.println("");
 boolean isFirst = true;




svn commit: r1793561 - in /sling/trunk/bundles/extensions/healthcheck/core/src: main/java/org/apache/sling/hc/core/impl/servlet/ test/java/org/apache/sling/hc/core/it/

2017-05-02 Thread justin
Author: justin
Date: Tue May  2 17:01:12 2017
New Revision: 1793561

URL: http://svn.apache.org/viewvc?rev=1793561=rev
Log:
SLING-6803 - ensure that Health Check servlet responds on root path. fix IT

Modified:

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/HealthCheckServletIT.java

sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/MockHttpService.java

Modified: 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java?rev=1793561=1793560=1793561=diff
==
--- 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
 (original)
+++ 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
 Tue May  2 17:01:12 2017
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.PrintWriter;
 import java.util.Dictionary;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -153,7 +154,7 @@ public class HealthCheckExecutorServlet
 this.servletPath = 
PropertiesUtil.toString(properties.get(PROPERTY_SERVLET_PATH), 
SERVLET_PATH_DEFAULT);
 this.disabled = 
PropertiesUtil.toBoolean(properties.get(PROPERTY_DISABLED), false);
 
-Map<String, HttpServlet> servletsToRegister = new HashMap<String, 
HttpServlet>();
+Map<String, HttpServlet> servletsToRegister = new 
LinkedHashMap<String, HttpServlet>();
 servletsToRegister.put(this.servletPath, this);
 servletsToRegister.put(this.servletPath + "." + FORMAT_HTML, new 
ProxyServlet(FORMAT_HTML));
 servletsToRegister.put(this.servletPath + "." + FORMAT_JSON, new 
ProxyServlet(FORMAT_JSON));

Modified: 
sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/HealthCheckServletIT.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/HealthCheckServletIT.java?rev=1793561=1793560=1793561=diff
==
--- 
sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/HealthCheckServletIT.java
 (original)
+++ 
sling/trunk/bundles/extensions/healthcheck/core/src/test/java/org/apache/sling/hc/core/it/HealthCheckServletIT.java
 Tue May  2 17:01:12 2017
@@ -62,15 +62,11 @@ public class HealthCheckServletIT {
 }
 
 private int countServletServices(String packageNamePrefix) throws 
InvalidSyntaxException {
-final ServiceReference [] refs = 
bundleContext.getServiceReferences("javax.servlet.Servlet", null);
+final List classNames = httpService.getServletClassNames();
 int count = 0;
-if(refs != null) {
-for(ServiceReference ref : refs) {
-final Object o = bundleContext.getService(ref);
-if(o.getClass().getName().startsWith(packageNamePrefix)) {
-count++;
-}
-bundleContext.ungetService(ref);
+for(final String className : classNames) {
+if(className.startsWith(packageNamePrefix)) {
+count++;
 }
 }
 return count;
@@ -113,9 +109,11 @@ public class HealthCheckServletIT {
 Thread.sleep(50L);
 }
 
-assertEquals("After adding configuration, expecting one servlet from " 
+  packagePrefix, 1, countServletServices(packagePrefix));
+assertEquals("After adding configuration, expecting five servlets from 
" +  packagePrefix, 5, countServletServices(packagePrefix));
 final List paths = httpService.getPaths();
-assertEquals("Expecting one new servlet registration", pathsBefore + 
1, paths.size());
-assertEquals("Expecting the HC servlet to be registered at " + path, 
path, paths.get(paths.size() - 1));
+assertEquals("Expecting five new servlet registration", pathsBefore + 
5, paths.size());
+assertEquals("Expecting the HC servlet to be registered at " + path, 
path, paths.get(paths.size() - 5));
+assertEquals("Expecting the HTML HC servlet to be registered at " + 
path + ".html", path + ".html", paths.get(paths.size() - 4));
+assertEquals("Expecting

svn commit: r1793562 - in /sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet: ResultHtmlSerializer.java ResultJsonSerializer.java

2017-05-02 Thread justin
Author: justin
Date: Tue May  2 17:01:16 2017
New Revision: 1793562

URL: http://svn.apache.org/viewvc?rev=1793562=rev
Log:
SLING-6806 - add tags to HTML/JSON Health Check output

Modified:

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultJsonSerializer.java

Modified: 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java?rev=1793562=1793561=1793562=diff
==
--- 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
 (original)
+++ 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
 Tue May  2 17:01:16 2017
@@ -81,13 +81,14 @@ public class ResultHtmlSerializer {
 final DateFormat dfLong = new SimpleDateFormat("-MM-dd HH:mm");
 
 writer.println("");
-writer.println("Health 
CheckStatusLogFinished AtExecution 
Time");
+writer.println("Health 
CheckTagsStatusLogFinished 
AtExecution Time");
 for (HealthCheckExecutionResult executionResult : executionResults) {
 Result result = executionResult.getHealthCheckResult();
 writer.println("");
 writer.println(""
 + 
StringEscapeUtils.escapeHtml(executionResult.getHealthCheckMetadata().getTitle())
 + "");
+writer.println("" + 
StringEscapeUtils.escapeHtml(StringUtils.join(executionResult.getHealthCheckMetadata().getTags(),
 ", ")) + "");
 writer.println("" + 
StringEscapeUtils.escapeHtml(result.getStatus().toString()) + "");
 writer.println("");
 boolean isFirst = true;

Modified: 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultJsonSerializer.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultJsonSerializer.java?rev=1793562=1793561=1793562=diff
==
--- 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultJsonSerializer.java
 (original)
+++ 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultJsonSerializer.java
 Tue May  2 17:01:16 2017
@@ -86,6 +86,11 @@ public class ResultJsonSerializer {
 result.add("status", 
healthCheckResult.getHealthCheckResult().getStatus().toString());
 result.add("timeInMs", healthCheckResult.getElapsedTimeInMs());
 result.add("finishedAt", healthCheckResult.getFinishedAt().toString());
+JsonArrayBuilder tagsArray = Json.createArrayBuilder();
+for (final String tag : 
healthCheckResult.getHealthCheckMetadata().getTags()) {
+tagsArray.add(tag);
+}
+result.add("tags", tagsArray);
 
 JsonArrayBuilder messagesArr = Json.createArrayBuilder();
 




svn commit: r1793559 - /sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java

2017-05-02 Thread justin
Author: justin
Date: Tue May  2 16:14:26 2017
New Revision: 1793559

URL: http://svn.apache.org/viewvc?rev=1793559=rev
Log:
SLING-6803 - ensure that Health Check servlet responds on root path

Modified:

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java

Modified: 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java?rev=1793559=1793558=1793559=diff
==
--- 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
 (original)
+++ 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/HealthCheckExecutorServlet.java
 Tue May  2 16:14:26 2017
@@ -66,10 +66,9 @@ import org.slf4j.LoggerFactory;
  * Useful in combination with load balancers.
  * 
  * NOTE: This servlet registers directly (low-level) at the HttpService and is 
not processed by sling (better performance, fewer dependencies, no 
authentication required, 503 can be sent without the progress tracker 
information). */
-@Service
 @Component(label = "Apache Sling Health Check Executor Servlet",
 description = "Serializes health check results into html or json 
format",
-policy = ConfigurationPolicy.REQUIRE, metatype = true, immediate = 
true)
+policy = ConfigurationPolicy.REQUIRE, metatype = true)
 public class HealthCheckExecutorServlet extends HttpServlet {
 private static final long serialVersionUID = 8013511523994541848L;
 
@@ -126,6 +125,8 @@ public class HealthCheckExecutorServlet
 description = "Servlet path (defaults to " + SERVLET_PATH_DEFAULT 
+ " in order to not be accessible via Apache/Internet)", value = 
SERVLET_PATH_DEFAULT)
 private String servletPath;
 
+private String[] servletPaths;
+
 public static final String PROPERTY_DISABLED = "disabled";
 @Property(name = PROPERTY_DISABLED, label = "Disabled",
 description = "Allows to disable the servlet if required for 
security reasons", boolValue = false)
@@ -149,40 +150,52 @@ public class HealthCheckExecutorServlet
 @Activate
 protected final void activate(final ComponentContext context) {
 final Dictionary properties = context.getProperties();
-this.servletPath = (String) properties.get(PROPERTY_SERVLET_PATH);
+this.servletPath = 
PropertiesUtil.toString(properties.get(PROPERTY_SERVLET_PATH), 
SERVLET_PATH_DEFAULT);
 this.disabled = 
PropertiesUtil.toBoolean(properties.get(PROPERTY_DISABLED), false);
 
+Map<String, HttpServlet> servletsToRegister = new HashMap<String, 
HttpServlet>();
+servletsToRegister.put(this.servletPath, this);
+servletsToRegister.put(this.servletPath + "." + FORMAT_HTML, new 
ProxyServlet(FORMAT_HTML));
+servletsToRegister.put(this.servletPath + "." + FORMAT_JSON, new 
ProxyServlet(FORMAT_JSON));
+servletsToRegister.put(this.servletPath + "." + FORMAT_JSONP, new 
ProxyServlet(FORMAT_JSONP));
+servletsToRegister.put(this.servletPath + "." + FORMAT_TXT, new 
ProxyServlet(FORMAT_TXT));
+
+
 if (disabled) {
 LOG.info("Health Check Servlet is disabled by configuration");
 return;
 }
 
-try {
-LOG.debug("Registering {} to path {}", getClass().getSimpleName(), 
this.servletPath);
-this.httpService.registerServlet(this.servletPath, this, null, 
null);
-} catch (Exception e) {
-LOG.error("Could not register health check servlet: " + e, e);
+for (final Map.Entry<String, HttpServlet> servlet : 
servletsToRegister.entrySet()) {
+try {
+LOG.debug("Registering {} to path {}", 
getClass().getSimpleName(), servlet.getKey());
+this.httpService.registerServlet(servlet.getKey(), 
servlet.getValue(), null, null);
+} catch (Exception e) {
+LOG.error("Could not register health check servlet: " + e, e);
+}
 }
+this.servletPaths = servletsToRegister.keySet().toArray(new String[0]);
 
 }
 
 @Deactivate
 public void deactivate(final ComponentContext componentContext) {
-if (disabled) {
+if (disabled || this.servletPaths == null) {
 return;
 }
 
-try {
-LOG.debug("Unregistering path {}", this.servletPath);
-this.httpService.unregister(this.servletPath);

svn commit: r1793558 - /sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java

2017-05-02 Thread justin
Author: justin
Date: Tue May  2 16:14:13 2017
New Revision: 1793558

URL: http://svn.apache.org/viewvc?rev=1793558=rev
Log:
SLING-6822 - include separate Finished At column header

Modified:

sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java

Modified: 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java?rev=1793558=1793557=1793558=diff
==
--- 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
 (original)
+++ 
sling/trunk/bundles/extensions/healthcheck/core/src/main/java/org/apache/sling/hc/core/impl/servlet/ResultHtmlSerializer.java
 Tue May  2 16:14:13 2017
@@ -81,7 +81,7 @@ public class ResultHtmlSerializer {
 final DateFormat dfLong = new SimpleDateFormat("-MM-dd HH:mm");
 
 writer.println("");
-writer.println("Health 
CheckStatusLogExecution 
Time");
+writer.println("Health 
CheckStatusLogFinished AtExecution 
Time");
 for (HealthCheckExecutionResult executionResult : executionResults) {
 Result result = executionResult.getHealthCheckResult();
 writer.println("

svn commit: r1011512 - in /websites/production/sling/content: ./ components/

2017-05-02 Thread justin
Author: justin
Date: Tue May  2 14:15:46 2017
New Revision: 1011512

Log:
Publishing svnmucc operation to sling site by justin

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



svn commit: r1793496 - in /sling/site/trunk/content: downloads.list news.mdtext

2017-05-02 Thread justin
Author: justin
Date: Tue May  2 14:15:00 2017
New Revision: 1793496

URL: http://svn.apache.org/viewvc?rev=1793496=rev
Log:
announcement of new Sling Models releases

Modified:
sling/site/trunk/content/downloads.list
sling/site/trunk/content/news.mdtext

Modified: sling/site/trunk/content/downloads.list
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/downloads.list?rev=1793496=1793495=1793496=diff
==
--- sling/site/trunk/content/downloads.list (original)
+++ sling/site/trunk/content/downloads.list Tue May  2 14:15:00 2017
@@ -138,9 +138,9 @@ Launchpad Integration Tests|org.apache.s
 Launchpad Testing Services|org.apache.sling.launchpad.test-services|2.0.10
 Launchpad Testing Services 
WAR|org.apache.sling.launchpad.test-services-war|2.0.10||war
 Log Tracer|org.apache.sling.tracer|1.0.2
-Models API|org.apache.sling.models.api|1.3.2
+Models API|org.apache.sling.models.api|1.3.4
 Models bnd Plugin|org.apache.sling.bnd.models|1.0.0
-Models Implementation|org.apache.sling.models.impl|1.3.8
+Models Implementation|org.apache.sling.models.impl|1.4.0
 Models Jackson Exporter|org.apache.sling.models.jacksonexporter|1.0.6
 NoSQL Generic Resource Provider|org.apache.sling.nosql.generic|1.1.0
 NoSQL Couchbase Client|org.apache.sling.nosql.couchbase-client|1.0.2

Modified: sling/site/trunk/content/news.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/news.mdtext?rev=1793496=1793495=1793496=diff
==
--- sling/site/trunk/content/news.mdtext (original)
+++ sling/site/trunk/content/news.mdtext Tue May  2 14:15:00 2017
@@ -1,5 +1,6 @@
 Title: News
 
+* New Releases: Apache Sling Models API 1.3.4 and Models Implementation 1.4.0 
(May 1st, 2017)
 * New Release: Apache Sling JCR Installer Provider 3.1.26 (May 1st, 2017) 
 * New Release: Apache Sling JCR Resource 3.0.0 (May 1st, 2017) 
 * New Release: Apache Sling Sling Slingstart Maven Plugin 1.7.4, Apache Sling 
Service User Mapper 1.3.0, Apache Sling Scripting API 2.2.0 and Tooling Support 
Source 1.0.2 (May 1th, 2017)




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

2017-05-02 Thread justin
Author: justin
Date: Tue May  2 13:39:57 2017
New Revision: 1793493

URL: http://svn.apache.org/viewvc?rev=1793493=rev
Log:
SLING-6818 - only attach the sources jar generated by the shade plugin

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=1793493=1793492=1793493=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Tue May  2 13:39:57 2017
@@ -119,13 +119,20 @@
 
 
 
+
+org.apache.maven.plugins
+maven-source-plugin
+
+false
+
+
 
 
 
 
 org.apache.sling
 org.apache.sling.models.api
-1.3.5-SNAPSHOT
+1.3.4
 provided
 
 




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

2017-05-01 Thread justin
Author: justin
Date: Mon May  1 16:56:32 2017
New Revision: 1793374

URL: http://svn.apache.org/viewvc?rev=1793374=rev
Log:
SLING-6815 - add allow private package registration property to Sling Models 
registered Adapter Factories

Modified:

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

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java?rev=1793374=1793373=1793374=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
 Mon May  1 16:56:32 2017
@@ -68,6 +68,11 @@ public class ModelPackageBundleListener
  */
 private static final String PROP_IMPLEMENTATION_CLASS = 
"models.adapter.implementationClass";
 
+/**
+ * Service registration property letting the Adapter Manager the adapter 
is OK to be in a private package
+ */
+public static final String PROP_ALLOWED_IN_PRIVATE = 
"adapter.allowed.in.private.package";
+
 private static final Logger log = 
LoggerFactory.getLogger(ModelPackageBundleListener.class);
 
 private final BundleContext bundleContext;
@@ -261,6 +266,7 @@ public class ModelPackageBundleListener
 registrationProps.put(AdapterFactory.ADAPTER_CLASSES, 
toStringArray(adapterTypes));
 registrationProps.put(AdapterFactory.ADAPTABLE_CLASSES, 
toStringArray(adaptableTypes));
 registrationProps.put(PROP_IMPLEMENTATION_CLASS, implType.getName());
+registrationProps.put(PROP_ALLOWED_IN_PRIVATE, true);
 
 if (StringUtils.isNotBlank(condition)) {
 registrationProps.put(PROP_ADAPTER_CONDITION, condition);




svn commit: r1793373 - in /sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal: AdapterManagerImpl.java AdapterWebConsolePlugin.java

2017-05-01 Thread justin
Author: justin
Date: Mon May  1 16:56:25 2017
New Revision: 1793373

URL: http://svn.apache.org/viewvc?rev=1793373=rev
Log:
SLING-6815 - allow suppression of private package warning in adapter 
registration and web console plugin

Modified:

sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java

sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterWebConsolePlugin.java

Modified: 
sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java?rev=1793373=1793372=1793373=diff
==
--- 
sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java
 (original)
+++ 
sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterManagerImpl.java
 Mon May  1 16:56:25 2017
@@ -67,6 +67,8 @@ public class AdapterManagerImpl implemen
 
 private final Logger log = LoggerFactory.getLogger(getClass());
 
+static final String ALLOWED_IN_PRIVATE = 
"adapter.allowed.in.private.package";
+
 /**
  * The OSGi ComponentContext to retrieve
  * {@link AdapterFactory} service instances.
@@ -244,6 +246,7 @@ public class AdapterManagerImpl implemen
 final ServiceReference reference) {
 final String[] adaptables = 
PropertiesUtil.toStringArray(reference.getProperty(ADAPTABLE_CLASSES));
 final String[] adapters = 
PropertiesUtil.toStringArray(reference.getProperty(ADAPTER_CLASSES));
+final boolean allowedInPrivatePackage = 
PropertiesUtil.toBoolean(reference.getProperty(ALLOWED_IN_PRIVATE), false);
 
 if (adaptables == null || adaptables.length == 0 || adapters == null
 || adapters.length == 0) {
@@ -251,13 +254,13 @@ public class AdapterManagerImpl implemen
 }
 
 for (String clazz : adaptables) {
-if (!checkPackage(packageAdmin, clazz)) {
+if (!allowedInPrivatePackage && !checkPackage(packageAdmin, 
clazz)) {
 log.warn("Adaptable class {} in factory service {} is not in 
an exported package.", clazz, reference.getProperty(Constants.SERVICE_ID));
 }
 }
 
 for (String clazz : adapters) {
-if (!checkPackage(packageAdmin, clazz)) {
+if (!allowedInPrivatePackage && !checkPackage(packageAdmin, 
clazz)) {
 log.warn("Adapter class {} in factory service {} is not in an 
exported package.", clazz, reference.getProperty(Constants.SERVICE_ID));
 }
 }

Modified: 
sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterWebConsolePlugin.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterWebConsolePlugin.java?rev=1793373=1793372=1793373=diff
==
--- 
sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterWebConsolePlugin.java
 (original)
+++ 
sling/trunk/bundles/extensions/adapter/src/main/java/org/apache/sling/adapter/internal/AdapterWebConsolePlugin.java
 Mon May  1 16:56:25 2017
@@ -114,6 +114,7 @@ public class AdapterWebConsolePlugin ext
 final boolean deprecated = 
PropertiesUtil.toBoolean(reference.getProperty(ADAPTER_DEPRECATED), false);
 final String[] adaptables = 
PropertiesUtil.toStringArray(reference.getProperty(ADAPTABLE_CLASSES));
 final List descriptions = new 
ArrayList<>(adaptables.length);
+final boolean allowedInPrivatePackage = 
PropertiesUtil.toBoolean(reference.getProperty(AdapterManagerImpl.ALLOWED_IN_PRIVATE),
 false);
 for (final String adaptable : adaptables) {
 descriptions.add(new AdaptableDescription(reference.getBundle(), 
adaptable, adapters, condition, deprecated));
 }




svn commit: r19418 - /release/sling/

2017-05-01 Thread justin
Author: justin
Date: Mon May  1 11:35:26 2017
New Revision: 19418

Log:
Sling Models API 1.3.4 / Impl 1.4.0 release

Added:
release/sling/org.apache.sling.models.api-1.3.4-javadoc.jar   (with props)
release/sling/org.apache.sling.models.api-1.3.4-javadoc.jar.asc
release/sling/org.apache.sling.models.api-1.3.4-javadoc.jar.md5
release/sling/org.apache.sling.models.api-1.3.4-javadoc.jar.sha1
release/sling/org.apache.sling.models.api-1.3.4-source-release.zip   (with 
props)
release/sling/org.apache.sling.models.api-1.3.4-source-release.zip.asc
release/sling/org.apache.sling.models.api-1.3.4-source-release.zip.md5
release/sling/org.apache.sling.models.api-1.3.4-source-release.zip.sha1
release/sling/org.apache.sling.models.api-1.3.4-sources.jar   (with props)
release/sling/org.apache.sling.models.api-1.3.4-sources.jar.asc
release/sling/org.apache.sling.models.api-1.3.4-sources.jar.md5
release/sling/org.apache.sling.models.api-1.3.4-sources.jar.sha1
release/sling/org.apache.sling.models.api-1.3.4.jar   (with props)
release/sling/org.apache.sling.models.api-1.3.4.jar.asc
release/sling/org.apache.sling.models.api-1.3.4.jar.md5
release/sling/org.apache.sling.models.api-1.3.4.jar.sha1
release/sling/org.apache.sling.models.api-1.3.4.pom
release/sling/org.apache.sling.models.api-1.3.4.pom.asc
release/sling/org.apache.sling.models.api-1.3.4.pom.md5
release/sling/org.apache.sling.models.api-1.3.4.pom.sha1
release/sling/org.apache.sling.models.impl-1.4.0-javadoc.jar   (with props)
release/sling/org.apache.sling.models.impl-1.4.0-javadoc.jar.asc
release/sling/org.apache.sling.models.impl-1.4.0-javadoc.jar.md5
release/sling/org.apache.sling.models.impl-1.4.0-javadoc.jar.sha1
release/sling/org.apache.sling.models.impl-1.4.0-source-release.zip   (with 
props)
release/sling/org.apache.sling.models.impl-1.4.0-source-release.zip.asc
release/sling/org.apache.sling.models.impl-1.4.0-source-release.zip.md5
release/sling/org.apache.sling.models.impl-1.4.0-source-release.zip.sha1
release/sling/org.apache.sling.models.impl-1.4.0-sources.jar   (with props)
release/sling/org.apache.sling.models.impl-1.4.0-sources.jar.asc
release/sling/org.apache.sling.models.impl-1.4.0-sources.jar.md5
release/sling/org.apache.sling.models.impl-1.4.0-sources.jar.sha1
release/sling/org.apache.sling.models.impl-1.4.0.jar   (with props)
release/sling/org.apache.sling.models.impl-1.4.0.jar.asc
release/sling/org.apache.sling.models.impl-1.4.0.jar.md5
release/sling/org.apache.sling.models.impl-1.4.0.jar.sha1
release/sling/org.apache.sling.models.impl-1.4.0.pom
release/sling/org.apache.sling.models.impl-1.4.0.pom.asc
release/sling/org.apache.sling.models.impl-1.4.0.pom.md5
release/sling/org.apache.sling.models.impl-1.4.0.pom.sha1
Removed:
release/sling/org.apache.sling.models.api-1.3.2-javadoc.jar
release/sling/org.apache.sling.models.api-1.3.2-javadoc.jar.asc
release/sling/org.apache.sling.models.api-1.3.2-javadoc.jar.md5
release/sling/org.apache.sling.models.api-1.3.2-javadoc.jar.sha1
release/sling/org.apache.sling.models.api-1.3.2-source-release.zip
release/sling/org.apache.sling.models.api-1.3.2-source-release.zip.asc
release/sling/org.apache.sling.models.api-1.3.2-source-release.zip.md5
release/sling/org.apache.sling.models.api-1.3.2-source-release.zip.sha1
release/sling/org.apache.sling.models.api-1.3.2-sources.jar
release/sling/org.apache.sling.models.api-1.3.2-sources.jar.asc
release/sling/org.apache.sling.models.api-1.3.2-sources.jar.md5
release/sling/org.apache.sling.models.api-1.3.2-sources.jar.sha1
release/sling/org.apache.sling.models.api-1.3.2.jar
release/sling/org.apache.sling.models.api-1.3.2.jar.asc
release/sling/org.apache.sling.models.api-1.3.2.jar.md5
release/sling/org.apache.sling.models.api-1.3.2.jar.sha1
release/sling/org.apache.sling.models.api-1.3.2.pom
release/sling/org.apache.sling.models.api-1.3.2.pom.asc
release/sling/org.apache.sling.models.api-1.3.2.pom.md5
release/sling/org.apache.sling.models.api-1.3.2.pom.sha1
release/sling/org.apache.sling.models.impl-1.3.8-javadoc.jar
release/sling/org.apache.sling.models.impl-1.3.8-javadoc.jar.asc
release/sling/org.apache.sling.models.impl-1.3.8-javadoc.jar.md5
release/sling/org.apache.sling.models.impl-1.3.8-javadoc.jar.sha1
release/sling/org.apache.sling.models.impl-1.3.8-source-release.zip
release/sling/org.apache.sling.models.impl-1.3.8-source-release.zip.asc
release/sling/org.apache.sling.models.impl-1.3.8-source-release.zip.md5
release/sling/org.apache.sling.models.impl-1.3.8-source-release.zip.sha1
release/sling/org.apache.sling.models.impl-1.3.8-sources.jar
release/sling/org.apache.sling.models.impl-1.3.8-sources.jar.asc
release/sling/org.apache.sling.models.impl-1.3.8-sources.jar.md5
release/sling

svn commit: r1792891 - /sling/tags/org.apache.sling.models.impl-1.4.0/

2017-04-27 Thread justin
Author: justin
Date: Thu Apr 27 13:43:18 2017
New Revision: 1792891

URL: http://svn.apache.org/viewvc?rev=1792891=rev
Log:
[maven-release-plugin] copy for tag org.apache.sling.models.impl-1.4.0

Added:
sling/tags/org.apache.sling.models.impl-1.4.0/   (props changed)
  - copied from r1792890, sling/trunk/bundles/extensions/models/impl/

Propchange: sling/tags/org.apache.sling.models.impl-1.4.0/
--
--- svn:ignore (added)
+++ svn:ignore Thu Apr 27 13:43:18 2017
@@ -0,0 +1,11 @@
+*.iml
+*.ipr
+*.iws
+.classpath
+.externalToolBuilders
+.project
+.settings
+bin
+dependency-reduced-pom.xml
+maven-eclipse.xml
+target

Propchange: sling/tags/org.apache.sling.models.impl-1.4.0/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Apr 27 13:43:18 2017
@@ -0,0 +1 @@
+/sling/whiteboard/sseifert/SLING-4112_models_tuning/impl:1635259-1639316




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

2017-04-27 Thread justin
Author: justin
Date: Thu Apr 27 13:43:20 2017
New Revision: 1792892

URL: http://svn.apache.org/viewvc?rev=1792892=rev
Log:
[maven-release-plugin] prepare for next development iteration

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=1792892=1792891=1792892=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Thu Apr 27 13:43:20 2017
@@ -27,14 +27,14 @@
 
 org.apache.sling.models.impl
 bundle
-1.4.0
+1.4.1-SNAPSHOT
 Apache Sling Models Implementation
 Apache Sling Models Implementation
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.impl-1.4.0
- 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.impl-1.4.0
-
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.impl-1.4.0
+
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
+
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl
 
 
 7




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

2017-04-27 Thread justin
Author: justin
Date: Thu Apr 27 13:43:06 2017
New Revision: 1792890

URL: http://svn.apache.org/viewvc?rev=1792890=rev
Log:
[maven-release-plugin] prepare release org.apache.sling.models.impl-1.4.0

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=1792890=1792889=1792890=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Thu Apr 27 13:43:06 2017
@@ -1,237 +1,237 @@
-
-
-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;>
-4.0.0
-
-org.apache.sling
-sling
-26
-
-
-org.apache.sling.models.impl
-bundle
-1.3.9-SNAPSHOT
-Apache Sling Models Implementation
-Apache Sling Models Implementation
-
-
-
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
- 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
-
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl
-
-
-7
-
-
-
-
-org.apache.felix
-maven-scr-plugin
-
-
-org.apache.felix
-maven-bundle-plugin
-true
-
-  
-
-  *;artifactId=commons-beanutils;groupId=commons-beanutils
-
-
-
-  !org.apache.sling.commons.osgi,
-  !org.apache.sling.scripting.core.impl.helper,
-  *
-
-  
-
-
-
-org.apache.maven.plugins
-maven-shade-plugin
-2.4.3
-
-
-package
-
-shade
-
-
-true
-true
-
-
-
org.apache.sling:org.apache.sling.commons.osgi
-
org.apache.sling:org.apache.sling.scripting.core
-
-
-
-
-
org.apache.sling.commons.osgi
-
slingmodelsimpl.org.apache.sling.commons.osgi
-
-
-
org.apache.sling.scripting.core.impl.helper
-
slingmodelsimpl.org.apache.sling.scripting.core.impl.helper
-
-
-
-
-
org.apache.sling:org.apache.sling.commons.osgi
-
-
org/apache/sling/commons/osgi/**
-
-
-
-
org.apache.sling:org.apache.sling.scripting.core
-
-
org/apache/sling/scripting/core/impl/helper/ProtectedBindings*
-
-
-
-
-
-
-
-
-org.apache.rat
-apache-rat-plugin
-
-
-dependency-reduced-pom.xml
-
-
-
-
-
-
-
-org.apache.sling
-org.apache.sling.models.api
-1.3.4
-provided
-
-
-javax.servlet
-servlet-api
-provided
-
-
-org.osgi
-org.osgi.compendium
-4.2.0
-provided
-
-
-org.osgi
-org.osgi.core
-provided
-
-
-org.apache.sling
-org.apache.sling.api
-2.4.0
-provided
-
-
-org.apache.sling
-org.apache.sling.scripting.api
-2.1.6
-   

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

2017-04-27 Thread justin
Author: justin
Date: Thu Apr 27 13:42:38 2017
New Revision: 1792889

URL: http://svn.apache.org/viewvc?rev=1792889=rev
Log:
use released api

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=1792889=1792888=1792889=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Thu Apr 27 13:42:38 2017
@@ -125,7 +125,7 @@
 
 org.apache.sling
 org.apache.sling.models.api
-1.3.3-SNAPSHOT
+1.3.4
 provided
 
 




svn commit: r1792887 - /sling/tags/org.apache.sling.models.api-1.3.4/

2017-04-27 Thread justin
Author: justin
Date: Thu Apr 27 13:41:08 2017
New Revision: 1792887

URL: http://svn.apache.org/viewvc?rev=1792887=rev
Log:
[maven-release-plugin] copy for tag org.apache.sling.models.api-1.3.4

Added:
sling/tags/org.apache.sling.models.api-1.3.4/   (props changed)
  - copied from r1792886, sling/trunk/bundles/extensions/models/api/

Propchange: sling/tags/org.apache.sling.models.api-1.3.4/
--
--- svn:ignore (added)
+++ svn:ignore Thu Apr 27 13:41:08 2017
@@ -0,0 +1,13 @@
+target
+bin
+*.iml
+*.ipr
+*.iws
+.settings
+.project
+.classpath
+.externalToolBuilders
+maven-eclipse.xml
+
+
+

Propchange: sling/tags/org.apache.sling.models.api-1.3.4/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Apr 27 13:41:08 2017
@@ -0,0 +1 @@
+/sling/whiteboard/sseifert/SLING-4112_models_tuning/api:1635259-1639316




svn commit: r1792886 - /sling/trunk/bundles/extensions/models/api/pom.xml

2017-04-27 Thread justin
Author: justin
Date: Thu Apr 27 13:40:56 2017
New Revision: 1792886

URL: http://svn.apache.org/viewvc?rev=1792886=rev
Log:
[maven-release-plugin] prepare release org.apache.sling.models.api-1.3.4

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

Modified: sling/trunk/bundles/extensions/models/api/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/pom.xml?rev=1792886=1792885=1792886=diff
==
--- sling/trunk/bundles/extensions/models/api/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/api/pom.xml Thu Apr 27 13:40:56 2017
@@ -1,98 +1,98 @@
-
-
-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;>
-4.0.0
-
-org.apache.sling
-sling
-26
-
-
-
-org.apache.sling.models.api
-bundle
-1.3.3-SNAPSHOT
-Apache Sling Models API
-Apache Sling Models API
-
-
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api
- 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api
-
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api
-
-
-
-7
-
-
-
-
-org.apache.felix
-maven-scr-plugin
-
-
-org.apache.felix
-maven-bundle-plugin
-true
-
-   
-
org.apache.sling.models.*
-
org.apache.sling.validation.api.*
-   
-
-
-
-
-
-
-javax.inject
-javax.inject
-1
-provided
-
-
-com.google.code.findbugs
-jsr305
-3.0.0
-provided
-
-
-org.apache.sling
-org.apache.sling.api
-2.2.0
-provided
-
-
-javax.servlet
-servlet-api
-
-
-
-junit
-junit
-test
-
-
-org.hamcrest
-hamcrest-junit
-2.0.0.0
-test
-
-
-
+
+
+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;>
+4.0.0
+
+org.apache.sling
+sling
+26
+
+
+
+org.apache.sling.models.api
+bundle
+1.3.4
+Apache Sling Models API
+Apache Sling Models API
+
+
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.4
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.4
+
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.api-1.3.4
+
+
+
+7
+
+
+
+
+org.apache.felix
+maven-scr-plugin
+
+
+org.apache.felix
+maven-bundle-plugin
+true
+
+   
+
org.apache.sling.models.*
+
org.apache.sling.validation.api.*
+   
+
+
+
+
+
+
+javax.inject
+javax.inject
+1
+provided
+
+
+com.google.code.findbugs
+jsr305
+3.0.0
+provided
+
+
+org.apache.sling
+org.apache.sling.api
+2.2.0
+provided
+
+
+javax.servlet
+servlet-api
+
+
+
+junit
+junit
+test
+
+
+org.hamcrest
+hamcrest-junit
+2.0.0.0
+test
+
+
+




svn commit: r1792888 - /sling/trunk/bundles/extensions/models/api/pom.xml

2017-04-27 Thread justin
Author: justin
Date: Thu Apr 27 13:41:10 2017
New Revision: 1792888

URL: http://svn.apache.org/viewvc?rev=1792888=rev
Log:
[maven-release-plugin] prepare for next development iteration

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

Modified: sling/trunk/bundles/extensions/models/api/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/pom.xml?rev=1792888=1792887=1792888=diff
==
--- sling/trunk/bundles/extensions/models/api/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/api/pom.xml Thu Apr 27 13:41:10 2017
@@ -28,13 +28,13 @@
 
 org.apache.sling.models.api
 bundle
-1.3.4
+1.3.5-SNAPSHOT
 Apache Sling Models API
 Apache Sling Models API
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.4
- 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.api-1.3.4
-
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.api-1.3.4
+
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api
+
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api
 
 
 




svn commit: r1792884 - in /sling/trunk/bundles/extensions/models: api/src/main/java/org/apache/sling/models/annotations/ impl/src/main/java/org/apache/sling/models/impl/ impl/src/test/java/org/apache/

2017-04-27 Thread justin
Author: justin
Date: Thu Apr 27 13:37:01 2017
New Revision: 1792884

URL: http://svn.apache.org/viewvc?rev=1792884=rev
Log:
SLING-6785 - support caching for adaptations

Added:

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

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/testmodels/classes/CachedModel.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/testmodels/classes/UncachedModel.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/testmodels/interfaces/CachedModel.java

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/testmodels/interfaces/UncachedModel.java
Modified:

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

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

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=1792884=1792883=1792884=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
 Thu Apr 27 13:37:01 2017
@@ -67,4 +67,11 @@ public @interface Model {
  */
 public String[] resourceType() default {};
 
+/**
+ *
+ * @return whether or not the model should be cached for the lifecycle of 
the adaptable
+ */
+public boolean cache() default false;
+
+
 }

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=1792884=1792883=1792884=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
 Thu Apr 27 13:37:01 2017
@@ -35,6 +35,7 @@ import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.WeakHashMap;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 
@@ -216,6 +217,13 @@ public class ModelAdapterFactory impleme
 // Use threadlocal to count recursive invocations and break recursing if a 
max. limit is reached (to avoid cyclic dependencies)
 private ThreadLocal invocationCountThreadLocal;
 
+private Map<Object, Map<Class, Object>> adapterCache;
+
+// use a smaller initial capacity than the default as we expect a 
relatively small number of
+// adapters per adaptable
+private final int INNER_CACHE_INITIAL_CAPACITY = 4;
+
+
 public  AdapterType getAdapter(Object adaptable, 
Class type) {
 Result result = internalCreateModel(adaptable, type);
 if (!result.wasSuccessful()) {
@@ -297,7 +305,7 @@ public class ModelAdapterFactory impleme
 }
 
 @SuppressWarnings("unchecked")
-private  Result internalCreateModel(Object 
adaptable, Class requestedType) {
+private  Result internalCreateModel(final Object 
adaptable, final Class requestedType) {
 Result result;
 ThreadInvocationCounter threadInvocationCounter = 
invocationCountThreadLocal.get();
 if (threadInvocationCounter.isMaximumReached()) {
@@ -317,6 +325,17 @@ public class ModelAdapterFactory impleme
 boolean isAdaptable = false;
 
 Model modelAnnotation = modelClass.getModelAnnotation();
+
+if (modelAnnotation.cache()) {
+Map<Class, Object> adaptableCache = 
adapterCache.get(adaptable);
+if (adaptableCache != null) {
+ModelType cachedObject = (ModelType) 
adaptableCache.get(requestedType);
+if (cachedObject != null) {
+return new Result(cachedObject);
+}
+}
+}
+
 Class[] declaredAdaptable = modelAnnotation.adaptables();
 for (Class clazz : declaredAdaptable) {
 if (clazz.isInstance(adaptable)) {
@@ -335,6 +354,16 @@ public class ModelAdapterFactory impleme
 Result handlerResult = 
createInvocationHandler(adaptable, modelClass);
 if (handlerResult.wasSuccessful()) {
 

svn propchange: r1792071 - svn:log

2017-04-20 Thread justin
Author: justin
Revision: 1792071
Modified property: svn:log

Modified: svn:log at Thu Apr 20 15:09:20 2017
--
--- svn:log (original)
+++ svn:log Thu Apr 20 15:09:20 2017
@@ -1,4 +1 @@
-Merge branch 'via-resource-type-force'
-
-# Conflicts:
-#  
bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/package-info.java
+SLING-5739 - pluggable @Via providers / SLING-6778 - supporting delegate models



svn commit: r1792071 - in /sling/trunk/bundles/extensions/models: api/src/main/java/org/apache/sling/models/annotations/ api/src/main/java/org/apache/sling/models/annotations/via/ api/src/main/java/or

2017-04-20 Thread justin
Author: justin
Date: Thu Apr 20 15:06:03 2017
New Revision: 1792071

URL: http://svn.apache.org/viewvc?rev=1792071=rev
Log:
Merge branch 'via-resource-type-force'

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

Added:

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/ViaProviderType.java
  - copied, changed from r1792046, 
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/annotations/via/

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/via/BeanProperty.java
  - copied, changed from r1792046, 
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/annotations/via/ChildResource.java
  - copied, changed from r1792046, 
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/annotations/via/ForcedResourceType.java
  - copied, changed from r1792046, 
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/annotations/via/ResourceSuperType.java
  - copied, changed from r1792046, 
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/annotations/via/package-info.java
  - copied, changed from r1792046, 
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/spi/ViaProvider.java
  - copied, changed from r1792046, 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/Via.java

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

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

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

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

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

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

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/testmodels/classes/ChildResourceViaModel.java
  - copied, changed from r1792046, 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/Via.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/DelegateRequestTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/DelegateResourceTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/request/

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/request/DelegateBaseModel.java
  - copied, changed from r1792046, 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/Via.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/request/DelegateExtendedModel.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/request/DelegateInterface.java
  - copied, changed from r1792046, 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/package-info.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/resource/

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/delegate/resource/DelegateBaseModel.java
  - copied, changed from r1792046, 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/annotations/Via.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling

svn commit: r1790424 - /sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/ModelWithOptionalImport.java

2017-04-06 Thread justin
Author: justin
Date: Thu Apr  6 15:46:33 2017
New Revision: 1790424

URL: http://svn.apache.org/viewvc?rev=1790424=rev
Log:
forgot to include this file with r1789734

Added:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/ModelWithOptionalImport.java

Added: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/ModelWithOptionalImport.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/ModelWithOptionalImport.java?rev=1790424=auto
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/ModelWithOptionalImport.java
 (added)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/models/ModelWithOptionalImport.java
 Thu Apr  6 15:46:33 2017
@@ -0,0 +1,30 @@
+/*
+ * 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.it.models;
+
+
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.models.annotations.Model;
+
+@Model(adaptables=Resource.class)
+public class ModelWithOptionalImport {
+
+// this class is not available at runtime. The containing package has an 
optional import so the bundle
+// still resolves
+private BeanUtils beanUtils = new BeanUtils();
+}




svn commit: r1789734 - in /sling/trunk/bundles/extensions/models: impl/src/main/java/org/apache/sling/models/impl/ impl/src/test/java/org/apache/sling/models/impl/ integration-tests/

2017-03-31 Thread justin
Author: justin
Date: Fri Mar 31 19:14:48 2017
New Revision: 1789734

URL: http://svn.apache.org/viewvc?rev=1789734=rev
Log:
SLING-6764 - Guard against reflection failures when registering Sling Model 
classes

Modified:

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

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

sling/trunk/bundles/extensions/models/impl/src/test/java/org/apache/sling/models/impl/AdapterImplementationsTest.java
sling/trunk/bundles/extensions/models/integration-tests/pom.xml

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.java?rev=1789734=1789733=1789734=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.java
 Fri Mar 31 19:14:48 2017
@@ -102,38 +102,52 @@ final class AdapterImplementations {
 }
 
 /** Add implementation mapping for the given model class (implementation 
is the model class itself).
- * Only used for testing purposes. Use {@link #add(Class, Class)} in case 
you want to register a different implementation.
+ * Only used for testing purposes. Use {@link #addAll(Class, Class...)} in 
case you want to register a different implementation.
  * @param modelClasses the model classes to register
  */
 protected void addClassesAsAdapterAndImplementation(Class... 
modelClasses) {
 for (Class modelClass : modelClasses) {
-add(modelClass, modelClass);
+addAll(modelClass, modelClass);
 }
 }
 
 /**
- * Add implementation mapping for the given adapter type.
- * @param adapterType Adapter type
+ * Add implementation mapping for the given adapter types.
  * @param implType Implementation type
+ * @param adapterTypes Adapter types
+ * @result true if adapters were successfully added
  */
 @SuppressWarnings("unchecked")
-public void add(Class adapterType, Class implType) {
-String key = adapterType.getName();
-if (adapterType == implType) {
-modelClasses.put(key, new ModelClass(implType, 
sortedStaticInjectAnnotationProcessorFactories));
+boolean addAll(Class implType, Class... adapterTypes) {
+ModelClass modelClass = null;
+try {
+modelClass = new ModelClass(implType, 
sortedStaticInjectAnnotationProcessorFactories);
+} catch (Exception e) {
+log.warn("Unable to reflect on " + implType.getName(), e);
+return false;
+} catch (NoClassDefFoundError e) {
+log.warn("Unable to reflect on " + implType.getName(), e);
+return false;
 }
-else {
-// although we already use a ConcurrentMap synchronize explicitly 
because we apply non-atomic operations on it
-synchronized (adapterImplementations) {
-ConcurrentNavigableMap<String,ModelClass> implementations = 
adapterImplementations.get(key);
-if (implementations == null) {
-// to have a consistent ordering independent of bundle 
loading use a ConcurrentSkipListMap that sorts by class name
-implementations = new 
ConcurrentSkipListMap<String,ModelClass>();
-adapterImplementations.put(key, implementations);
+
+for (Class adapterType : adapterTypes) {
+String key = adapterType.getName();
+if (adapterType == implType) {
+modelClasses.put(key, modelClass);
+} else {
+// although we already use a ConcurrentMap synchronize 
explicitly because we apply non-atomic operations on it
+synchronized (adapterImplementations) {
+ConcurrentNavigableMap<String, ModelClass> 
implementations = adapterImplementations.get(key);
+if (implementations == null) {
+// to have a consistent ordering independent of bundle 
loading use a ConcurrentSkipListMap that sorts by class name
+implementations = new ConcurrentSkipListMap<String, 
ModelClass>();
+adapterImplementations.put(key, implementations);
+}
+implementations.put(implType.getName(), modelClass);
 }
-implementations.put(implType.getName(), new 
ModelClass(im

svn commit: r1789419 - in /sling/trunk/bundles/extensions/models: api/src/main/java/org/apache/sling/models/spi/ impl/ impl/src/main/java/org/apache/sling/models/impl/ impl/src/main/java/org/apache/sl

2017-03-29 Thread justin
Author: justin
Date: Wed Mar 29 22:43:15 2017
New Revision: 1789419

URL: http://svn.apache.org/viewvc?rev=1789419=rev
Log:
SLING-6748 - move ValuePreparer to API

Added:

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/ValuePreparer.java
  - copied, changed from r1789399, 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValuePreparer.java
Removed:

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValuePreparer.java
Modified:

sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/package-info.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/injectors/BindingsInjector.java

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

Copied: 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/ValuePreparer.java
 (from r1789399, 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValuePreparer.java)
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/ValuePreparer.java?p2=sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/ValuePreparer.java=sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValuePreparer.java=1789399=1789419=1789419=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValuePreparer.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/ValuePreparer.java
 Wed Mar 29 22:43:15 2017
@@ -14,7 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sling.models.impl.injectors;
+package org.apache.sling.models.spi;
+
+import aQute.bnd.annotation.ConsumerType;
 
 import javax.annotation.Nonnull;
 
@@ -23,6 +25,7 @@ import javax.annotation.Nonnull;
  * based on the adaptable. If an Injector implements this interface, it must 
also be prepared
  * to handle the case where ObjectUtils.NULL is passed as the adaptable.
  */
+@ConsumerType
 public interface ValuePreparer {
 
 /**

Modified: 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/package-info.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/package-info.java?rev=1789419=1789418=1789419=diff
==
--- 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/package-info.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/api/src/main/java/org/apache/sling/models/spi/package-info.java
 Wed Mar 29 22:43:15 2017
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-@Version("1.1.1")
+@Version("1.2.0")
 package org.apache.sling.models.spi;
 
 import aQute.bnd.annotation.Version;
\ No newline at end of file

Modified: sling/trunk/bundles/extensions/models/impl/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/pom.xml?rev=1789419=1789418=1789419=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Wed Mar 29 22:43:15 2017
@@ -125,7 +125,7 @@
 
 org.apache.sling
 org.apache.sling.models.api
-1.3.2
+1.3.3-SNAPSHOT
 provided
 
 

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=1789419=1789418=1789419=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
 Wed Mar 29 22:43:15 2017
@@ -73,7 +73,6 @@ import org.apache.sling.models.factory.M
 import org.apache.sling.models.factory.ModelFactory;
 import org.apache.sling.models.factory.PostConstru

svn commit: r1787388 - in /sling/trunk/bundles/extensions/models: impl/src/main/java/org/apache/sling/models/impl/ integration-tests/ integration-tests/src/main/java/org/apache/sling/models/it/exporte

2017-03-17 Thread justin
Author: justin
Date: Fri Mar 17 13:56:20 2017
New Revision: 1787388

URL: http://svn.apache.org/viewvc?rev=1787388=rev
Log:
SLING-6652 - allow for multiple classes to export the same resourceType

This closes #207

Added:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/DoubledFirstComponent.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/DoubledSecondComponent.java
Modified:

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

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
sling/trunk/bundles/extensions/models/integration-tests/pom.xml

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java?rev=1787388=1787387=1787388=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java
 Fri Mar 17 13:56:20 2017
@@ -182,17 +182,33 @@ class ExportServlet extends SlingSafeMet
 String getExportedString(SlingHttpServletRequest request, Map<String, 
String> options, ModelFactory modelFactory, String exporterName) throws 
ExportException, MissingExporterException;
 }
 
-public static final ExportedObjectAccessor RESOURCE_ACCESSOR = new 
ExportedObjectAccessor() {
+public static final class ResourceAccessor implements 
ExportedObjectAccessor {
+
+private final Class adapterClass;
+
+public ResourceAccessor(Class adapterClass) {
+this.adapterClass = adapterClass;
+}
+
 @Override
 public String getExportedString(SlingHttpServletRequest request, 
Map<String, String> options, ModelFactory modelFactory, String exporterName) 
throws ExportException, MissingExporterException {
-return modelFactory.exportModelForResource(request.getResource(), 
exporterName, String.class, options);
+Object adapter = modelFactory.createModel(request.getResource(), 
adapterClass);
+return modelFactory.exportModel(adapter, exporterName, 
String.class, options);
+}
+}
+
+public static final class RequestAccessor implements 
ExportedObjectAccessor {
+
+private final Class adapterClass;
+
+public RequestAccessor(Class adapterClass) {
+this.adapterClass = adapterClass;
 }
-};
 
-public static final ExportedObjectAccessor REQUEST_ACCESSOR = new 
ExportedObjectAccessor() {
 @Override
 public String getExportedString(SlingHttpServletRequest request, 
Map<String, String> options, ModelFactory modelFactory, String exporterName) 
throws ExportException, MissingExporterException {
-return modelFactory.exportModelForRequest(request, exporterName, 
String.class, options);
+Object adapter = modelFactory.createModel(request, adapterClass);
+return modelFactory.exportModel(adapter, exporterName, 
String.class, options);
 }
 };
 

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java?rev=1787388=1787387=1787388=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
 Fri Mar 17 13:56:20 2017
@@ -162,9 +162,9 @@ public class ModelPackageBundleListener
 
adapterImplementations.registerModelToResourceType(bundle, resourceType, 
adaptable, implType);
 ExportServlet.ExportedObjectAccessor accessor 
= null;
 if (adaptable == Resource.class) {
-accessor = ExportServlet.RESOURCE_ACCESSOR;
+accessor = new 
ExportServlet.ResourceAccessor(implType);
 } else if (adaptable == 
SlingHttpServletRequest.class) {
-accessor = ExportServle

svn commit: r1787379 - in /sling/trunk/bundles/extensions/models: impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java integration-tests/src/main/java/org/apache/sling/model

2017-03-17 Thread justin
Author: justin
Date: Fri Mar 17 13:39:06 2017
New Revision: 1787379

URL: http://svn.apache.org/viewvc?rev=1787379=rev
Log:
SLING-6658 - always include implementation class in adapterTypes list. Thanks 
to Dirk Rudolph for the patch!

This closes #206

Modified:

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

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ImplementsExtendsTest.java

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java?rev=1787379=1787378=1787379=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelPackageBundleListener.java
 Fri Mar 17 13:39:06 2017
@@ -26,6 +26,7 @@ import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.adapter.AdapterFactory;
@@ -143,6 +144,8 @@ public class ModelPackageBundleListener
 Class[] adapterTypes = annotation.adapters();
 if (adapterTypes.length == 0) {
 adapterTypes = new Class[] { implType };
+} else if (!ArrayUtils.contains(adapterTypes, implType)) {
+adapterTypes = (Class[]) ArrayUtils.add(adapterTypes, 
implType);
 }
 // register adapter only if given adapters are valid
 if (validateAdapterClasses(implType, adapterTypes)) {
@@ -156,7 +159,7 @@ public class ModelPackageBundleListener
 for (String resourceType : resourceTypes) {
 if (StringUtils.isNotEmpty(resourceType)) {
 for (Class adaptable : annotation.adaptables()) 
{
-
adapterImplementations.registerModelToResourceType(bundle, resourceType, 
adaptable, adapterTypes[0]);
+
adapterImplementations.registerModelToResourceType(bundle, resourceType, 
adaptable, implType);
 ExportServlet.ExportedObjectAccessor accessor 
= null;
 if (adaptable == Resource.class) {
 accessor = ExportServlet.RESOURCE_ACCESSOR;

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ImplementsExtendsTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ImplementsExtendsTest.java?rev=1787379=1787378=1787379=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ImplementsExtendsTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/ImplementsExtendsTest.java
 Fri Mar 17 13:39:06 2017
@@ -85,12 +85,12 @@ public class ImplementsExtendsTest {
 }
 
 /**
- * Ensure that the implementation class itself cannot be adapted to if it 
is not part of the "adapter" property in the annotation.
+ * Ensure that the implementation class itself can be adapted to, even if 
it is not part of the "adapter" property in the annotation.
  */
 @Test
-public void testImplementsInterfaceModel_ImplClassNotMapped() {
+public void testImplementsInterfaceModel_ImplClassImplicitlyMapped() {
 ImplementsInterfacePropertyModel model = 
adapterManager.getAdapter(resource, ImplementsInterfacePropertyModel.class);
-assertNull(model);
+assertNotNull(model);
 }
 
 /**




svn commit: r18590 - /release/sling/

2017-03-07 Thread justin
Author: justin
Date: Tue Mar  7 13:56:46 2017
New Revision: 18590

Log:
Sling Resource Resolver 1.5.18 release

Added:
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip   
(with props)

release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.asc

release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.md5

release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.sha1
release/sling/org.apache.sling.resourceresolver-1.5.18-sources.jar   (with 
props)
release/sling/org.apache.sling.resourceresolver-1.5.18-sources.jar.asc
release/sling/org.apache.sling.resourceresolver-1.5.18-sources.jar.md5
release/sling/org.apache.sling.resourceresolver-1.5.18-sources.jar.sha1
release/sling/org.apache.sling.resourceresolver-1.5.18.jar   (with props)
release/sling/org.apache.sling.resourceresolver-1.5.18.jar.asc
release/sling/org.apache.sling.resourceresolver-1.5.18.jar.md5
release/sling/org.apache.sling.resourceresolver-1.5.18.jar.sha1
release/sling/org.apache.sling.resourceresolver-1.5.18.pom
release/sling/org.apache.sling.resourceresolver-1.5.18.pom.asc
release/sling/org.apache.sling.resourceresolver-1.5.18.pom.md5
release/sling/org.apache.sling.resourceresolver-1.5.18.pom.sha1
Removed:
release/sling/org.apache.sling.resourceresolver-1.5.14-source-release.zip

release/sling/org.apache.sling.resourceresolver-1.5.14-source-release.zip.asc

release/sling/org.apache.sling.resourceresolver-1.5.14-source-release.zip.md5

release/sling/org.apache.sling.resourceresolver-1.5.14-source-release.zip.sha1
release/sling/org.apache.sling.resourceresolver-1.5.14-sources.jar
release/sling/org.apache.sling.resourceresolver-1.5.14-sources.jar.asc
release/sling/org.apache.sling.resourceresolver-1.5.14-sources.jar.md5
release/sling/org.apache.sling.resourceresolver-1.5.14-sources.jar.sha1
release/sling/org.apache.sling.resourceresolver-1.5.14.jar
release/sling/org.apache.sling.resourceresolver-1.5.14.jar.asc
release/sling/org.apache.sling.resourceresolver-1.5.14.jar.md5
release/sling/org.apache.sling.resourceresolver-1.5.14.jar.sha1
release/sling/org.apache.sling.resourceresolver-1.5.14.pom
release/sling/org.apache.sling.resourceresolver-1.5.14.pom.asc
release/sling/org.apache.sling.resourceresolver-1.5.14.pom.md5
release/sling/org.apache.sling.resourceresolver-1.5.14.pom.sha1

Added: release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip
==
Binary file - no diff available.

Propchange: 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip
--
svn:mime-type = application/octet-stream

Added: 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.asc
==
--- 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.asc 
(added)
+++ 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.asc 
Tue Mar  7 13:56:46 2017
@@ -0,0 +1,7 @@
+-BEGIN PGP SIGNATURE-
+Comment: GPGTools - https://gpgtools.org
+
+iEYEABECAAYFAli4kcIACgkQh9vwWhNLFFzHsQCdGoAHfd5fIpFwALscmDmpxTn0
+1KMAn1us+ZKN7MlK0lXNrLj4PueJasci
+=9Hpj
+-END PGP SIGNATURE-

Added: 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.md5
==
--- 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.md5 
(added)
+++ 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.md5 
Tue Mar  7 13:56:46 2017
@@ -0,0 +1 @@
+d3a3f4974c4f810c9ed448fc58d8da9e
\ No newline at end of file

Added: 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.sha1
==
--- 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.sha1 
(added)
+++ 
release/sling/org.apache.sling.resourceresolver-1.5.18-source-release.zip.sha1 
Tue Mar  7 13:56:46 2017
@@ -0,0 +1 @@
+1a4023ba60f8ed852f8cc3aea6958d8b178779c5
\ No newline at end of file

Added: release/sling/org.apache.sling.resourceresolver-1.5.18-sources.jar
==
Binary file - no diff available.

Propchange: release/sling/org.apache.sling.resourceresolver-1.5.18-sources.jar
--
svn:mime-type = application/octet-stream

Added: release/sling/org.apache.sling.resourceresolver-1.5.18-sources.jar.asc
==
--- release/sling/org.apache.sling.resourceresolver-1.5.18

svn commit: r1785299 - /sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java

2017-03-03 Thread justin
Author: justin
Date: Fri Mar  3 13:44:34 2017
New Revision: 1785299

URL: http://svn.apache.org/viewvc?rev=1785299=rev
Log:
fix failing test

Modified:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java?rev=1785299=1785298=1785299=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
 Fri Mar  3 13:44:34 2017
@@ -153,7 +153,7 @@ public class ExporterTest {
 Assert.assertTrue(resource.getBoolean("sampleBooleanValue"));
 Assert.assertEquals(1, resource.getLong("sampleLongValue"));
 Assert.assertEquals(3, resource.getLong(":sampleBinary"));
-Assert.assertEquals(0, resource.getJSONArray("sampleEmptyArray"));
+Assert.assertEquals(0, 
resource.getJSONArray("sampleEmptyArray").length());
 
 final Resource extendedComponentResource = 
resolver.getResource(extendedComponentPath);
 Assert.assertNotNull(extendedComponentResource);




svn commit: r1785196 - /sling/tags/org.apache.sling.resourceresolver-1.5.18/

2017-03-02 Thread justin
Author: justin
Date: Thu Mar  2 21:42:01 2017
New Revision: 1785196

URL: http://svn.apache.org/viewvc?rev=1785196=rev
Log:
[maven-release-plugin] copy for tag org.apache.sling.resourceresolver-1.5.18

Added:
sling/tags/org.apache.sling.resourceresolver-1.5.18/   (props changed)
  - copied from r1785195, sling/trunk/bundles/resourceresolver/

Propchange: sling/tags/org.apache.sling.resourceresolver-1.5.18/
--
--- svn:ignore (added)
+++ svn:ignore Thu Mar  2 21:42:01 2017
@@ -0,0 +1,11 @@
+target
+bin
+derby.log
+*.iml
+*.ipr
+*.iws
+.settings
+.project
+.classpath
+.externalToolBuilders
+maven-eclipse.xml

Propchange: sling/tags/org.apache.sling.resourceresolver-1.5.18/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Mar  2 21:42:01 2017
@@ -0,0 +1,2 @@
+/sling/whiteboard/fmeschbe/deprecate_login_administrative/resourceresolver:1458693-1499675
+/sling/whiteboard/fmeschbe/featureflags/resourceresolver:1559092-1562000




svn commit: r1785197 - /sling/trunk/bundles/resourceresolver/pom.xml

2017-03-02 Thread justin
Author: justin
Date: Thu Mar  2 21:42:02 2017
New Revision: 1785197

URL: http://svn.apache.org/viewvc?rev=1785197=rev
Log:
[maven-release-plugin] prepare for next development iteration

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

Modified: sling/trunk/bundles/resourceresolver/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/pom.xml?rev=1785197=1785196=1785197=diff
==
--- sling/trunk/bundles/resourceresolver/pom.xml (original)
+++ sling/trunk/bundles/resourceresolver/pom.xml Thu Mar  2 21:42:02 2017
@@ -27,7 +27,7 @@
 
 
 org.apache.sling.resourceresolver
-1.5.18
+1.5.19-SNAPSHOT
 bundle
 
 Apache Sling Resource Resolver
@@ -37,13 +37,13 @@
 
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.resourceresolver-1.5.18
+
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/resourceresolver
 
 
-
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.resourceresolver-1.5.18
+
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/resourceresolver
 
 
-
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.resourceresolver-1.5.18
+http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver
 
 
 




svn commit: r1785195 - /sling/trunk/bundles/resourceresolver/pom.xml

2017-03-02 Thread justin
Author: justin
Date: Thu Mar  2 21:41:49 2017
New Revision: 1785195

URL: http://svn.apache.org/viewvc?rev=1785195=rev
Log:
[maven-release-plugin] prepare release org.apache.sling.resourceresolver-1.5.18

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

Modified: sling/trunk/bundles/resourceresolver/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver/pom.xml?rev=1785195=1785194=1785195=diff
==
--- sling/trunk/bundles/resourceresolver/pom.xml (original)
+++ sling/trunk/bundles/resourceresolver/pom.xml Thu Mar  2 21:41:49 2017
@@ -27,7 +27,7 @@
 
 
 org.apache.sling.resourceresolver
-1.5.17-SNAPSHOT
+1.5.18
 bundle
 
 Apache Sling Resource Resolver
@@ -37,13 +37,13 @@
 
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/resourceresolver
+
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.resourceresolver-1.5.18
 
 
-
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/resourceresolver
+
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.resourceresolver-1.5.18
 
 
-http://svn.apache.org/viewvc/sling/trunk/bundles/resourceresolver
+
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.resourceresolver-1.5.18
 
 
 




svn commit: r1784960 - in /sling/trunk/bundles/extensions/models/impl: ./ src/main/java/org/apache/sling/models/impl/ src/main/java/org/apache/sling/models/impl/model/ src/test/java/org/apache/sling/m

2017-03-01 Thread justin
Author: justin
Date: Wed Mar  1 14:58:55 2017
New Revision: 1784960

URL: http://svn.apache.org/viewvc?rev=1784960=rev
Log:
SLING-6584 - synchronize setAccessible calls

Modified:
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/model/InjectableField.java

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

Modified: sling/trunk/bundles/extensions/models/impl/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/pom.xml?rev=1784960=1784959=1784960=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Wed Mar  1 14:58:55 2017
@@ -125,7 +125,7 @@
 
 org.apache.sling
 org.apache.sling.models.api
-1.3.3-SNAPSHOT
+1.3.2
 provided
 
 

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=1784960=1784959=1784960=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
 Wed Mar  1 14:58:55 2017
@@ -799,23 +799,9 @@ public class ModelAdapterFactory impleme
 }
 
 private RuntimeException setField(InjectableField injectableField, Object 
createdObject, Object value) {
-Field field = injectableField.getField();
-Result result = adaptIfNecessary(value, field.getType(), 
field.getGenericType());
+Result result = adaptIfNecessary(value, 
injectableField.getFieldType(), injectableField.getFieldGenericType());
 if (result.wasSuccessful()) {
-boolean accessible = field.isAccessible();
-try {
-if (!accessible) {
-field.setAccessible(true);
-}
-field.set(createdObject, result.getValue());
-} catch (Exception e) {
-return new ModelClassException("Could not inject field due to 
reflection issues", e);
-} finally {
-if (!accessible) {
-field.setAccessible(false);
-}
-}
-return null;
+return injectableField.set(createdObject, result);
 } else {
 return result.getThrowable();
 }

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/InjectableField.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/InjectableField.java?rev=1784960=1784959=1784960=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/InjectableField.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/model/InjectableField.java
 Wed Mar  1 14:58:55 2017
@@ -19,9 +19,12 @@
 package org.apache.sling.models.impl.model;
 
 import java.lang.reflect.Field;
+import java.lang.reflect.Type;
 
 import org.apache.sling.models.annotations.DefaultInjectionStrategy;
+import org.apache.sling.models.factory.ModelClassException;
 import org.apache.sling.models.impl.ReflectionUtil;
+import org.apache.sling.models.impl.Result;
 import 
org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory;
 
 public class InjectableField extends AbstractInjectableElement {
@@ -32,13 +35,35 @@ public class InjectableField extends Abs
 super(field, 
ReflectionUtil.mapPrimitiveClasses(field.getGenericType()), field.getName(), 
processorFactories, defaultInjectionStrategy);
 this.field = field;
 }
-
-public Field getField() {
-return field;
+
+public RuntimeException set(Object createdObject, Result result) {
+synchronized (field) {
+boolean accessible = field.isAccessible();
+try {
+if (!accessible) {
+field.setAccessible(true);
+}
+field.set(createdObject, result.getValue());
+} catch (Exception e) {
+return new ModelClassException("Could not inject field due to 
reflection issues", e);
+ 

svn commit: r1780096 - /sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java

2017-01-24 Thread justin
Author: justin
Date: Tue Jan 24 17:35:35 2017
New Revision: 1780096

URL: http://svn.apache.org/viewvc?rev=1780096=rev
Log:
SLING-6187 - using more generic error response code

Modified:

sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java

Modified: 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java?rev=1780096=1780095=1780096=diff
==
--- 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java
 (original)
+++ 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java
 Tue Jan 24 17:35:35 2017
@@ -121,7 +121,7 @@ public abstract class AbstractPostOperat
 if (modificationSourcesContainingPostfix.size() > 0) {
 for (final Map.Entry<String, String> sourceToCheck : 
modificationSourcesContainingPostfix.entrySet()) {
 if 
(allModificationSources.contains(sourceToCheck.getKey())) {
-
response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED,
+
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
 "Postfix-containing path " + 
sourceToCheck.getValue() +
 " contained in the modification list. Check 
configuration.");
 return;




svn commit: r1780088 - in /sling/trunk/bundles/servlets/post/src: main/java/org/apache/sling/servlets/post/AbstractPostOperation.java test/java/org/apache/sling/servlets/post/AbstractPostOperationTest

2017-01-24 Thread justin
Author: justin
Date: Tue Jan 24 16:24:47 2017
New Revision: 1780088

URL: http://svn.apache.org/viewvc?rev=1780088=rev
Log:
SLING-6187 - check modification list to ensure that no changes include an 
@postfix where the base path is also present

Added:

sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/AbstractPostOperationTest.java
Modified:

sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java

Modified: 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java?rev=1780088=1780087=1780088=diff
==
--- 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java
 (original)
+++ 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/AbstractPostOperation.java
 Tue Jan 24 16:24:47 2017
@@ -18,9 +18,12 @@ package org.apache.sling.servlets.post;
 
 import java.util.ArrayList;
 import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Set;
 
@@ -30,6 +33,7 @@ import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
@@ -99,6 +103,32 @@ public abstract class AbstractPostOperat
 }
 }
 
+// check modifications for remaining postfix and store the base 
path
+final Map<String, String> modificationSourcesContainingPostfix = 
new HashMap<String, String>();
+final Set allModificationSources = new 
HashSet(changes.size());
+for (final Modification modification : changes) {
+final String source = modification.getSource();
+if (source != null) {
+allModificationSources.add(source);
+final int atIndex = source.indexOf('@');
+if (atIndex > 0) {
+
modificationSourcesContainingPostfix.put(source.substring(0, atIndex), source);
+}
+}
+}
+
+// fail if any of the base paths (before the postfix) which had a 
postfix are contained in the modification set
+if (modificationSourcesContainingPostfix.size() > 0) {
+for (final Map.Entry<String, String> sourceToCheck : 
modificationSourcesContainingPostfix.entrySet()) {
+if 
(allModificationSources.contains(sourceToCheck.getKey())) {
+
response.setStatus(HttpServletResponse.SC_EXPECTATION_FAILED,
+"Postfix-containing path " + 
sourceToCheck.getValue() +
+" contained in the modification list. Check 
configuration.");
+return;
+}
+}
+}
+
 final Set nodesToCheckin = new LinkedHashSet();
 
 // set changes on html response

Added: 
sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/AbstractPostOperationTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/AbstractPostOperationTest.java?rev=1780088=auto
==
--- 
sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/AbstractPostOperationTest.java
 (added)
+++ 
sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/AbstractPostOperationTest.java
 Tue Jan 24 16:24:47 2017
@@ -0,0 +1,124 @@
+/*
+ * 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

svn commit: r1777928 - in /sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter: BaseRequestComponent.java ExporterTest.java ExtendedRequestCompone

2017-01-08 Thread justin
Author: justin
Date: Mon Jan  9 05:15:48 2017
New Revision: 1777928

URL: http://svn.apache.org/viewvc?rev=1777928=rev
Log:
additional ITs for Sling Models Jackson Exporter

Modified:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExtendedRequestComponent.java

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java?rev=1777928=1777927=1777928=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
 Mon Jan  9 05:15:48 2017
@@ -20,6 +20,7 @@ import com.fasterxml.jackson.annotation.
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.models.annotations.Exporter;
+import org.apache.sling.models.annotations.ExporterOption;
 import org.apache.sling.models.annotations.Model;
 import org.apache.sling.models.annotations.Via;
 import org.apache.sling.models.annotations.injectorspecific.SlingObject;
@@ -30,7 +31,9 @@ import javax.servlet.http.HttpServletReq
 import java.util.Map;
 
 @Model(adaptables = { SlingHttpServletRequest.class }, resourceType = 
"sling/exp-request/base")
-@Exporter(name = "jackson", extensions = "json")
+@Exporter(name = "jackson", extensions = "json", options = {
+@ExporterOption(name = "MapperFeature.SORT_PROPERTIES_ALPHABETICALLY", 
value = "true")
+})
 public class BaseRequestComponent {
 
 @Inject @SlingObject

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java?rev=1777928=1777927=1777928=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
 Mon Jan  9 05:15:48 2017
@@ -16,6 +16,9 @@
  */
 package org.apache.sling.models.it.exporter;
 
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.text.Format;
 import java.util.Calendar;
 import java.util.Collections;
 import java.util.HashMap;
@@ -23,9 +26,8 @@ import java.util.Map;
 import java.util.TimeZone;
 
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.FastDateFormat;
 import org.apache.sling.api.SlingConstants;
-import org.apache.sling.api.resource.LoginException;
-import org.apache.sling.api.resource.PersistenceException;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceResolverFactory;
@@ -62,13 +64,25 @@ public class ExporterTest {
 private final String interfaceRequestComponentPath = 
"/content/exp-request/interfaceComponent";
 private Calendar testDate;
 
+private Format dateFormat = 
FastDateFormat.getInstance("-MM-dd'T'HH:mm:ss.SSSZ");
+
 @Before
-public void setup() throws LoginException, PersistenceException {
+public void setup() throws Exception {
 ResourceResolver adminResolver = null;
 try {
 adminResolver = rrFactory.getAdministrativeResourceResolver(null);
 Map<String, Object> properties = new HashMap<String, Object>();
 properties.put("sampleValue", "baseTESTValue");
+properties.put("sampleBooleanValue", true);
+properties.put("sampleLongValue", 1l);
+properties.put("sampleDoubleValue", 1d);
+properties.put("sampleArray", new String[] { "a", "b", "c" });
+properties.put("sampleEmptyArray", new String[0]);
+properties.put("sampleBinary", new 
ByteArrayInputStream("abc".getByte

svn commit: r1777332 - in /sling/trunk/contrib/extensions/rewriter/src: main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java test/java/org/apache/sling/rewriter/impl/ProcessorConfi

2017-01-04 Thread justin
Author: justin
Date: Wed Jan  4 16:14:53 2017
New Revision: 1777332

URL: http://svn.apache.org/viewvc?rev=1777332=rev
Log:
Merge branch 'issue/force-rewriter-pipeline'

Modified:

sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java

sling/trunk/contrib/extensions/rewriter/src/test/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImplTest.java

Modified: 
sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java?rev=1777332=1777331=1777332=diff
==
--- 
sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java
 (original)
+++ 
sling/trunk/contrib/extensions/rewriter/src/main/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImpl.java
 Wed Jan  4 16:14:53 2017
@@ -65,6 +65,8 @@ public class ProcessorConfigurationImpl
 
 static final String PROPERTY_PROCESS_ERROR = "processError";
 
+static final String ATTR_PIPELINE = "org.apache.sling.rewriter.pipeline";
+
 
 /** For which content types should this processor be applied. */
 private final String[] contentTypes;
@@ -112,6 +114,8 @@ public class ProcessorConfigurationImpl
 
 private final String descString;
 
+private final String name;
+
 /**
  * This is the constructor for a pipeline
  */
@@ -126,6 +130,7 @@ public class ProcessorConfigurationImpl
   ProcessingComponentConfiguration[] 
transformerConfigs,
   ProcessingComponentConfiguration 
serializerConfig,
   boolean processErrorResponse) {
+this.name = null;
 this.contentTypes = contentTypes;
 this.resourceTypes = resourceTypes;
 this.unwrapResources = unwrapResources;
@@ -160,6 +165,7 @@ public class ProcessorConfigurationImpl
  * This constructor reads the configuration from the specified resource.
  */
 public ProcessorConfigurationImpl(final Resource resource) {
+this.name = resource.getName();
 final ValueMap properties = ResourceUtil.getValueMap(resource);
 this.contentTypes = properties.get(PROPERTY_CONTENT_TYPES, 
String[].class);
 this.resourceTypes = properties.get(PROPERTY_RESOURCE_TYPES, 
String[].class);
@@ -198,6 +204,10 @@ public class ProcessorConfigurationImpl
 }
 
 void printConfiguration(final PrintWriter pw) {
+if ( this.name != null ) {
+pw.print("Name : ");
+pw.println(this.name);
+}
 if ( this.contentTypes != null ) {
 pw.print("Content Types : ");
 pw.println(Arrays.toString(this.contentTypes));
@@ -370,6 +380,12 @@ public class ProcessorConfigurationImpl
 if ( !this.processErrorResponse && 
processContext.getRequest().getAttribute("javax.servlet.error.status_code") != 
null ) {
 return false;
 }
+
+final Object pipelineName = 
processContext.getRequest().getAttribute(ATTR_PIPELINE);
+if (pipelineName != null && !pipelineName.equals(this.name)) {
+return false;
+}
+
 String contentType = processContext.getContentType();
 // if no content type is supplied, we assume html
 if ( contentType == null ) {

Modified: 
sling/trunk/contrib/extensions/rewriter/src/test/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImplTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/contrib/extensions/rewriter/src/test/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImplTest.java?rev=1777332=1777331=1777332=diff
==
--- 
sling/trunk/contrib/extensions/rewriter/src/test/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImplTest.java
 (original)
+++ 
sling/trunk/contrib/extensions/rewriter/src/test/java/org/apache/sling/rewriter/impl/ProcessorConfigurationImplTest.java
 Wed Jan  4 16:14:53 2017
@@ -175,4 +175,18 @@ public class ProcessorConfigurationImplT
 assertMatch(ImmutableMap.<String,Object>of(PROPERTY_SELECTORS, new 
String[] {"sel1"}));
 }
 
+@Test
+public void testNoMatchRequestAttribute() {
+
context.request().setAttribute(ProcessorConfigurationImpl.ATTR_PIPELINE, 
"config2");
+context.requestPathInfo().setResourcePath("/content/test");
+assertNoMatch(ImmutableMap.<String,Object>of(PROPERTY_PATHS, new 
String[] {"/apps","/content"}));
+}
+
+@Test
+public void testNoMatchReques

svn commit: r1774054 - in /sling/trunk/bundles/servlets/post/src: main/java/org/apache/sling/servlets/post/impl/ test/java/org/apache/sling/servlets/post/impl/ test/java/org/apache/sling/servlets/post

2016-12-13 Thread justin
Author: justin
Date: Tue Dec 13 16:52:21 2016
New Revision: 1774054

URL: http://svn.apache.org/viewvc?rev=1774054=rev
Log:
Revert "SLING-6187 - implement requiredPostProcessors parameter"

This reverts commit e5fa0f742dbbcb93cec5a30b58b9e9f5bbddb0f6.

Modified:

sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java

sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/impl/SlingPostServletTest.java

sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/impl/helper/MockSlingHttpServlet3Response.java

Modified: 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java?rev=1774054=1774053=1774054=diff
==
--- 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
 (original)
+++ 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
 Tue Dec 13 16:52:21 2016
@@ -20,7 +20,6 @@ import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
@@ -139,10 +138,6 @@ public class SlingPostServlet extends Sl
 
 private static final String PARAM_AUTO_CHECKIN = ":autoCheckin";
 
-private static final String PARAM_REQUIRED_POST_PROCESSORS = 
":requiredPostProcessors";
-
-private static final String PROP_POST_PROCESSOR_NAME = 
"postProcessor.name";
-
 private static final String DEFAULT_IGNORED_PARAMETER_NAME_PATTERN = 
"j_.*";
 
 @Property(value = DEFAULT_IGNORED_PARAMETER_NAME_PATTERN)
@@ -163,9 +158,6 @@ public class SlingPostServlet extends Sl
 /** Cached list of post processors, used during request processing. */
 private SlingPostProcessor[] cachedPostProcessors = new 
SlingPostProcessor[0];
 
-/** Cached list of post processor names, used during request processing. */
-private String[] cachedPostProcessorNames = new String[0];
-
 /** Sorted list of node name generator holders. */
 private final List nodeNameGenerators = new 
ArrayList();
 
@@ -206,25 +198,19 @@ public class SlingPostServlet extends Sl
 "Invalid operation specified for POST request");
 
 } else {
+request.getRequestProgressTracker().log(
+"Calling PostOperation: {0}", 
operation.getClass().getName());
 final SlingPostProcessor[] processors = this.cachedPostProcessors;
-final String[] processorNames = this.cachedPostProcessorNames;
-if (checkPostProcessors(request, processorNames)) {
-request.getRequestProgressTracker().log(
-"Calling PostOperation: {0}", 
operation.getClass().getName());
-try {
-operation.run(request, htmlResponse, processors);
-} catch (ResourceNotFoundException rnfe) {
-htmlResponse.setStatus(HttpServletResponse.SC_NOT_FOUND,
-rnfe.getMessage());
-} catch (final Exception exception) {
-log.warn("Exception while handling POST "
-+ request.getResource().getPath() + " with "
-+ operation.getClass().getName(), exception);
-htmlResponse.setError(exception);
-}
-} else {
-htmlResponse.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED,
-"At least one of the expected PostProcessors was not 
available.");
+try {
+operation.run(request, htmlResponse, processors);
+} catch (ResourceNotFoundException rnfe) {
+htmlResponse.setStatus(HttpServletResponse.SC_NOT_FOUND,
+rnfe.getMessage());
+} catch (final Exception exception) {
+log.warn("Exception while handling POST "
++ request.getResource().getPath() + " with "
++ operation.getClass().getName(), exception);
+htmlResponse.setError(exception);
 }
 
 }
@@ -274,13 +260,13 @@ public class SlingPostServlet extends Sl
 /**
  * Creates an instance of a PostResponse.
  * @param req The request being serviced
- * @return a {@link org.apache.sling.servlets.post.JSONResponse} if any of 
these conditions are true:
+ * @return a {@link 
org.apache.sling.servlets.post.impl.helper.JSONResponse} if any of these 
c

svn commit: r1774040 - in /sling/trunk/bundles/servlets/post/src: main/java/org/apache/sling/servlets/post/impl/ test/java/org/apache/sling/servlets/post/impl/ test/java/org/apache/sling/servlets/post

2016-12-13 Thread justin
Author: justin
Date: Tue Dec 13 15:46:36 2016
New Revision: 1774040

URL: http://svn.apache.org/viewvc?rev=1774040=rev
Log:
SLING-6187 - implement requiredPostProcessors parameter

Modified:

sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java

sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/impl/SlingPostServletTest.java

sling/trunk/bundles/servlets/post/src/test/java/org/apache/sling/servlets/post/impl/helper/MockSlingHttpServlet3Response.java

Modified: 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java?rev=1774040=1774039=1774040=diff
==
--- 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
 (original)
+++ 
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/SlingPostServlet.java
 Tue Dec 13 15:46:36 2016
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
@@ -138,6 +139,10 @@ public class SlingPostServlet extends Sl
 
 private static final String PARAM_AUTO_CHECKIN = ":autoCheckin";
 
+private static final String PARAM_REQUIRED_POST_PROCESSORS = 
":requiredPostProcessors";
+
+private static final String PROP_POST_PROCESSOR_NAME = 
"postProcessor.name";
+
 private static final String DEFAULT_IGNORED_PARAMETER_NAME_PATTERN = 
"j_.*";
 
 @Property(value = DEFAULT_IGNORED_PARAMETER_NAME_PATTERN)
@@ -158,6 +163,9 @@ public class SlingPostServlet extends Sl
 /** Cached list of post processors, used during request processing. */
 private SlingPostProcessor[] cachedPostProcessors = new 
SlingPostProcessor[0];
 
+/** Cached list of post processor names, used during request processing. */
+private String[] cachedPostProcessorNames = new String[0];
+
 /** Sorted list of node name generator holders. */
 private final List nodeNameGenerators = new 
ArrayList();
 
@@ -198,19 +206,25 @@ public class SlingPostServlet extends Sl
 "Invalid operation specified for POST request");
 
 } else {
-request.getRequestProgressTracker().log(
-"Calling PostOperation: {0}", 
operation.getClass().getName());
 final SlingPostProcessor[] processors = this.cachedPostProcessors;
-try {
-operation.run(request, htmlResponse, processors);
-} catch (ResourceNotFoundException rnfe) {
-htmlResponse.setStatus(HttpServletResponse.SC_NOT_FOUND,
-rnfe.getMessage());
-} catch (final Exception exception) {
-log.warn("Exception while handling POST "
-+ request.getResource().getPath() + " with "
-+ operation.getClass().getName(), exception);
-htmlResponse.setError(exception);
+final String[] processorNames = this.cachedPostProcessorNames;
+if (checkPostProcessors(request, processorNames)) {
+request.getRequestProgressTracker().log(
+"Calling PostOperation: {0}", 
operation.getClass().getName());
+try {
+operation.run(request, htmlResponse, processors);
+} catch (ResourceNotFoundException rnfe) {
+htmlResponse.setStatus(HttpServletResponse.SC_NOT_FOUND,
+rnfe.getMessage());
+} catch (final Exception exception) {
+log.warn("Exception while handling POST "
++ request.getResource().getPath() + " with "
++ operation.getClass().getName(), exception);
+htmlResponse.setError(exception);
+}
+} else {
+htmlResponse.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED,
+"At least one of the expected PostProcessors was not 
available.");
 }
 
 }
@@ -260,13 +274,13 @@ public class SlingPostServlet extends Sl
 /**
  * Creates an instance of a PostResponse.
  * @param req The request being serviced
- * @return a {@link 
org.apache.sling.servlets.post.impl.helper.JSONResponse} if any of these 
conditions are true:
+ * @return a {@link org.apache.sling.servlets.post.JSONResponse} if any of 
these conditions are true:
  * 
  *the request has an Accept header of 
appl

svn commit: r17346 - /release/sling/

2016-12-09 Thread justin
Author: justin
Date: Fri Dec  9 16:09:12 2016
New Revision: 17346

Log:
Sling Models Impl 1.3.6 and Jackson Exporter 1.0.6 release

Added:
release/sling/org.apache.sling.models.impl-1.3.6-javadoc.jar   (with props)
release/sling/org.apache.sling.models.impl-1.3.6-javadoc.jar.asc
release/sling/org.apache.sling.models.impl-1.3.6-javadoc.jar.md5
release/sling/org.apache.sling.models.impl-1.3.6-javadoc.jar.sha1
release/sling/org.apache.sling.models.impl-1.3.6-source-release.zip   (with 
props)
release/sling/org.apache.sling.models.impl-1.3.6-source-release.zip.asc
release/sling/org.apache.sling.models.impl-1.3.6-source-release.zip.md5
release/sling/org.apache.sling.models.impl-1.3.6-source-release.zip.sha1
release/sling/org.apache.sling.models.impl-1.3.6-sources.jar   (with props)
release/sling/org.apache.sling.models.impl-1.3.6-sources.jar.asc
release/sling/org.apache.sling.models.impl-1.3.6-sources.jar.md5
release/sling/org.apache.sling.models.impl-1.3.6-sources.jar.sha1
release/sling/org.apache.sling.models.impl-1.3.6.jar   (with props)
release/sling/org.apache.sling.models.impl-1.3.6.jar.asc
release/sling/org.apache.sling.models.impl-1.3.6.jar.md5
release/sling/org.apache.sling.models.impl-1.3.6.jar.sha1
release/sling/org.apache.sling.models.impl-1.3.6.pom
release/sling/org.apache.sling.models.impl-1.3.6.pom.asc
release/sling/org.apache.sling.models.impl-1.3.6.pom.md5
release/sling/org.apache.sling.models.impl-1.3.6.pom.sha1
release/sling/org.apache.sling.models.jacksonexporter-1.0.6-javadoc.jar   
(with props)
release/sling/org.apache.sling.models.jacksonexporter-1.0.6-javadoc.jar.asc
release/sling/org.apache.sling.models.jacksonexporter-1.0.6-javadoc.jar.md5
release/sling/org.apache.sling.models.jacksonexporter-1.0.6-javadoc.jar.sha1

release/sling/org.apache.sling.models.jacksonexporter-1.0.6-source-release.zip  
 (with props)

release/sling/org.apache.sling.models.jacksonexporter-1.0.6-source-release.zip.asc

release/sling/org.apache.sling.models.jacksonexporter-1.0.6-source-release.zip.md5

release/sling/org.apache.sling.models.jacksonexporter-1.0.6-source-release.zip.sha1
release/sling/org.apache.sling.models.jacksonexporter-1.0.6-sources.jar   
(with props)
release/sling/org.apache.sling.models.jacksonexporter-1.0.6-sources.jar.asc
release/sling/org.apache.sling.models.jacksonexporter-1.0.6-sources.jar.md5
release/sling/org.apache.sling.models.jacksonexporter-1.0.6-sources.jar.sha1
release/sling/org.apache.sling.models.jacksonexporter-1.0.6.jar   (with 
props)
release/sling/org.apache.sling.models.jacksonexporter-1.0.6.jar.asc
release/sling/org.apache.sling.models.jacksonexporter-1.0.6.jar.md5
release/sling/org.apache.sling.models.jacksonexporter-1.0.6.jar.sha1
release/sling/org.apache.sling.models.jacksonexporter-1.0.6.pom
release/sling/org.apache.sling.models.jacksonexporter-1.0.6.pom.asc
release/sling/org.apache.sling.models.jacksonexporter-1.0.6.pom.md5
release/sling/org.apache.sling.models.jacksonexporter-1.0.6.pom.sha1
Removed:
release/sling/org.apache.sling.models.impl-1.3.4-javadoc.jar
release/sling/org.apache.sling.models.impl-1.3.4-javadoc.jar.asc
release/sling/org.apache.sling.models.impl-1.3.4-javadoc.jar.md5
release/sling/org.apache.sling.models.impl-1.3.4-javadoc.jar.sha1
release/sling/org.apache.sling.models.impl-1.3.4-source-release.zip
release/sling/org.apache.sling.models.impl-1.3.4-source-release.zip.asc
release/sling/org.apache.sling.models.impl-1.3.4-source-release.zip.md5
release/sling/org.apache.sling.models.impl-1.3.4-source-release.zip.sha1
release/sling/org.apache.sling.models.impl-1.3.4-sources.jar
release/sling/org.apache.sling.models.impl-1.3.4-sources.jar.asc
release/sling/org.apache.sling.models.impl-1.3.4-sources.jar.md5
release/sling/org.apache.sling.models.impl-1.3.4-sources.jar.sha1
release/sling/org.apache.sling.models.impl-1.3.4.jar
release/sling/org.apache.sling.models.impl-1.3.4.jar.asc
release/sling/org.apache.sling.models.impl-1.3.4.jar.md5
release/sling/org.apache.sling.models.impl-1.3.4.jar.sha1
release/sling/org.apache.sling.models.impl-1.3.4.pom
release/sling/org.apache.sling.models.impl-1.3.4.pom.asc
release/sling/org.apache.sling.models.impl-1.3.4.pom.md5
release/sling/org.apache.sling.models.impl-1.3.4.pom.sha1
release/sling/org.apache.sling.models.jacksonexporter-1.0.4-javadoc.jar
release/sling/org.apache.sling.models.jacksonexporter-1.0.4-javadoc.jar.asc
release/sling/org.apache.sling.models.jacksonexporter-1.0.4-javadoc.jar.md5
release/sling/org.apache.sling.models.jacksonexporter-1.0.4-javadoc.jar.sha1

release/sling/org.apache.sling.models.jacksonexporter-1.0.4-source-release.zip

release/sling/org.apache.sling.models.jacksonexporter-1.0.4-source-release.zip.asc

release/sling

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

2016-12-05 Thread justin
Author: justin
Date: Mon Dec  5 19:14:02 2016
New Revision: 1772746

URL: http://svn.apache.org/viewvc?rev=1772746=rev
Log:
[maven-release-plugin] prepare release org.apache.sling.models.impl-1.3.6

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=1772746=1772745=1772746=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Mon Dec  5 19:14:02 2016
@@ -27,14 +27,14 @@
 
 org.apache.sling.models.impl
 bundle
-1.3.5-SNAPSHOT
+1.3.6
 Apache Sling Models Implementation
 Apache Sling Models Implementation
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
- 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
-
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl
+
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.impl-1.3.6
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.impl-1.3.6
+
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.impl-1.3.6
 
 
 




svn commit: r1772747 - /sling/tags/org.apache.sling.models.impl-1.3.6/

2016-12-05 Thread justin
Author: justin
Date: Mon Dec  5 19:14:14 2016
New Revision: 1772747

URL: http://svn.apache.org/viewvc?rev=1772747=rev
Log:
[maven-release-plugin] copy for tag org.apache.sling.models.impl-1.3.6

Added:
sling/tags/org.apache.sling.models.impl-1.3.6/   (props changed)
  - copied from r1772746, sling/trunk/bundles/extensions/models/impl/

Propchange: sling/tags/org.apache.sling.models.impl-1.3.6/
--
--- svn:ignore (added)
+++ svn:ignore Mon Dec  5 19:14:14 2016
@@ -0,0 +1,13 @@
+target
+bin
+*.iml
+*.ipr
+*.iws
+.settings
+.project
+.classpath
+.externalToolBuilders
+maven-eclipse.xml
+
+
+

Propchange: sling/tags/org.apache.sling.models.impl-1.3.6/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Mon Dec  5 19:14:14 2016
@@ -0,0 +1 @@
+/sling/whiteboard/sseifert/SLING-4112_models_tuning/impl:1635259-1639316




svn commit: r1772749 - /sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml

2016-12-05 Thread justin
Author: justin
Date: Mon Dec  5 19:16:31 2016
New Revision: 1772749

URL: http://svn.apache.org/viewvc?rev=1772749=rev
Log:
[maven-release-plugin] prepare release 
org.apache.sling.models.jacksonexporter-1.0.6

Modified:
sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml

Modified: sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml?rev=1772749=1772748=1772749=diff
==
--- sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml Mon Dec  5 
19:16:31 2016
@@ -19,15 +19,15 @@
 
 
 org.apache.sling.models.jacksonexporter
-1.0.5-SNAPSHOT
+1.0.6
 bundle
 Apache Sling Models Model Exporter - Jackson
 Apache Sling Models Client Model Exporter - 
Jackson
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/jackson-exporter
- 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/jackson-exporter
-
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter
+
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.jacksonexporter-1.0.6
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.jacksonexporter-1.0.6
+
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.jacksonexporter-1.0.6
 
 
 




svn commit: r1772751 - /sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml

2016-12-05 Thread justin
Author: justin
Date: Mon Dec  5 19:16:46 2016
New Revision: 1772751

URL: http://svn.apache.org/viewvc?rev=1772751=rev
Log:
[maven-release-plugin] prepare for next development iteration

Modified:
sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml

Modified: sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml?rev=1772751=1772750=1772751=diff
==
--- sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml Mon Dec  5 
19:16:46 2016
@@ -19,15 +19,15 @@
 
 
 org.apache.sling.models.jacksonexporter
-1.0.6
+1.0.7-SNAPSHOT
 bundle
 Apache Sling Models Model Exporter - Jackson
 Apache Sling Models Client Model Exporter - 
Jackson
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.jacksonexporter-1.0.6
- 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.jacksonexporter-1.0.6
-
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.jacksonexporter-1.0.6
+
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/jackson-exporter
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/jackson-exporter
+
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter
 
 
 




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

2016-12-05 Thread justin
Author: justin
Date: Mon Dec  5 19:14:16 2016
New Revision: 1772748

URL: http://svn.apache.org/viewvc?rev=1772748=rev
Log:
[maven-release-plugin] prepare for next development iteration

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=1772748=1772747=1772748=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Mon Dec  5 19:14:16 2016
@@ -27,14 +27,14 @@
 
 org.apache.sling.models.impl
 bundle
-1.3.6
+1.3.7-SNAPSHOT
 Apache Sling Models Implementation
 Apache Sling Models Implementation
 
 
-
scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.impl-1.3.6
- 
scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.models.impl-1.3.6
-
http://svn.apache.org/viewvc/sling/tags/org.apache.sling.models.impl-1.3.6
+
scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
+ 
scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/impl
+
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl
 
 
 




svn commit: r1772745 - /sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ChildResourceInjector.java

2016-12-05 Thread justin
Author: justin
Date: Mon Dec  5 19:10:51 2016
New Revision: 1772745

URL: http://svn.apache.org/viewvc?rev=1772745=rev
Log:
internal variable rename

Modified:

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

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ChildResourceInjector.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ChildResourceInjector.java?rev=1772745=1772744=1772745=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ChildResourceInjector.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ChildResourceInjector.java
 Mon Dec  5 19:10:51 2016
@@ -62,11 +62,11 @@ public class ChildResourceInjector exten
 return null;
 }
 
-private Object getValue(Resource adaptable, Type declaredType) {
+private Object getValue(Resource child, Type declaredType) {
 if (declaredType instanceof Class) {
-return adaptable;
+return child;
 } else if (isDeclaredTypeCollection(declaredType)) {
-return getResultList(adaptable, declaredType);
+return getResultList(child, declaredType);
 } else {
 return null;
 }




svn commit: r1772744 - in /sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl: AdapterImplementations.java ModelAdapterFactory.java ModelConfigurationPrinter.java Mo

2016-12-05 Thread justin
Author: justin
Date: Mon Dec  5 19:10:36 2016
New Revision: 1772744

URL: http://svn.apache.org/viewvc?rev=1772744=rev
Log:
SLING-6366 - add new data to Sling Models Configuration Printer

Modified:

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.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/ModelConfigurationPrinter.java

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

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.java?rev=1772744=1772743=1772744=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/AdapterImplementations.java
 Mon Dec  5 19:10:36 2016
@@ -19,6 +19,7 @@
 package org.apache.sling.models.impl;
 
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -329,4 +330,12 @@ final class AdapterImplementations {
 }
 return modelClass;
 }
+
+Map<String, Class> getResourceTypeMappingsForRequests() {
+return Collections.unmodifiableMap(resourceTypeMappingsForRequests);
+}
+
+Map<String, Class> getResourceTypeMappingsForResources() {
+return Collections.unmodifiableMap(resourceTypeMappingsForResources);
+}
 }

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=1772744=1772743=1772744=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 Dec  5 19:10:36 2016
@@ -975,7 +975,7 @@ public class ModelAdapterFactory impleme
 printerProps.put("felix.webconsole.configprinter.modes", "always");
 
 this.configPrinterRegistration = 
bundleContext.registerService(Object.class.getName(),
-new ModelConfigurationPrinter(this), printerProps);
+new ModelConfigurationPrinter(this, bundleContext, 
adapterImplementations), printerProps);
 }
 
 @Deactivate

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelConfigurationPrinter.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelConfigurationPrinter.java?rev=1772744=1772743=1772744=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelConfigurationPrinter.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ModelConfigurationPrinter.java
 Mon Dec  5 19:10:36 2016
@@ -18,20 +18,32 @@ package org.apache.sling.models.impl;
 
 import java.io.PrintWriter;
 import java.util.Collection;
+import java.util.Map;
 
 import org.apache.sling.models.spi.ImplementationPicker;
 import org.apache.sling.models.spi.Injector;
 import 
org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory;
 import 
org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory2;
 import 
org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+import javax.servlet.Servlet;
 
 @SuppressWarnings("deprecation")
 public class ModelConfigurationPrinter {
 
+private static final String EXPORT_SERVLET_FILTER = "(" + 
ModelPackageBundleListener.PROP_EXPORTER_SERVLET_CLASS + "=*)";
+
 private final ModelAdapterFactory modelAdapterFactory;
+private final BundleContext bundleContext;
+private final AdapterImplementations adapterImplementations;
 
-ModelConfigurationPrinter(ModelAdapterFactory modelAdapterFactory) {
+ModelConfigurationPrinter(ModelAdapterFactory modelAdapte

svn commit: r1772340 - in /sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it: exporter/BaseRequestComponent.java exporter/ExporterTest.java services/Anot

2016-12-02 Thread justin
Author: justin
Date: Fri Dec  2 12:50:14 2016
New Revision: 1772340

URL: http://svn.apache.org/viewvc?rev=1772340=rev
Log:
Add a test for a Sling Models Exporter-specific BVP

Added:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/AnotherTestBindingsValuesProvider.java
Modified:

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java?rev=1772340=1772339=1772340=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
 Fri Dec  2 12:50:14 2016
@@ -42,6 +42,9 @@ public class BaseRequestComponent {
 @Inject
 private Map<String, Object> testBindingsObject;
 
+@Inject
+private Map<String, Object> testBindingsObject2;
+
 private final SlingHttpServletRequest request;
 
 public BaseRequestComponent(SlingHttpServletRequest request) {
@@ -69,6 +72,10 @@ public class BaseRequestComponent {
 return testBindingsObject;
 }
 
+public Map<String, Object> getTestBindingsObject2() {
+return testBindingsObject2;
+}
+
 public SlingHttpServletRequest getSlingHttpServletRequest() {
 return request;
 }

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java?rev=1772340=1772339=1772340=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java
 Fri Dec  2 12:50:14 2016
@@ -214,6 +214,9 @@ public class ExporterTest {
 Assert.assertTrue(obj.has("testBindingsObject"));
 JSONObject testBindingsObject = 
obj.getJSONObject("testBindingsObject");
 Assert.assertEquals("value", testBindingsObject.getString("name"));
+Assert.assertTrue(obj.has("testBindingsObject2"));
+JSONObject testBindingsObject2 = 
obj.getJSONObject("testBindingsObject2");
+Assert.assertEquals("value2", 
testBindingsObject2.getString("name2"));
 Assert.assertEquals(baseRequestComponentPath, obj.getString("id"));
 
 response = new FakeResponse();

Added: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/AnotherTestBindingsValuesProvider.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/AnotherTestBindingsValuesProvider.java?rev=1772340=auto
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/AnotherTestBindingsValuesProvider.java
 (added)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/AnotherTestBindingsValuesProvider.java
 Fri Dec  2 12:50:14 2016
@@ -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 la

svn commit: r1772292 - /sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java

2016-12-01 Thread justin
Author: justin
Date: Thu Dec  1 23:47:36 2016
New Revision: 1772292

URL: http://svn.apache.org/viewvc?rev=1772292=rev
Log:
SLING-6355 - explicltly defining service interface

Modified:

sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java

Modified: 
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java?rev=1772292=1772291=1772292=diff
==
--- 
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java
 (original)
+++ 
sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextImpl.java
 Thu Dec  1 23:47:36 2016
@@ -54,7 +54,7 @@ import org.slf4j.LoggerFactory;
 
 /** Our default {@link BindingsValuesProvidersByContext} implementation */
 @Component
-@Service
+@Service(BindingsValuesProvidersByContext.class)
 public class BindingsValuesProvidersByContextImpl implements 
BindingsValuesProvidersByContext, ServiceTrackerCustomizer {
 
 private final Map<String, ContextBvpCollector> customizers = new 
HashMap<String, ContextBvpCollector>();




svn commit: r1772273 - in /sling/trunk/bundles/extensions/models: impl/ impl/src/main/java/org/apache/sling/models/impl/ impl/src/main/java/org/apache/sling/models/impl/injectors/ impl/src/test/java/o

2016-12-01 Thread justin
Author: justin
Date: Thu Dec  1 20:59:38 2016
New Revision: 1772273

URL: http://svn.apache.org/viewvc?rev=1772273=rev
Log:
SLING-6354 - fix support for SlingBindings injections in ExportServlet

Added:

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

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/services/TestBindingsValuesProvider.java
Modified:
sling/trunk/bundles/extensions/models/impl/pom.xml

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.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/ModelPackageBundleListener.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/test/java/org/apache/sling/models/impl/OSGiInjectionTest.java

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

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/ExporterTest.java

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/FakeRequest.java

Modified: sling/trunk/bundles/extensions/models/impl/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/pom.xml?rev=1772273=1772272=1772273=diff
==
--- sling/trunk/bundles/extensions/models/impl/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/impl/pom.xml Thu Dec  1 20:59:38 2016
@@ -50,9 +50,9 @@
 
 
 *;scope=compile,
-
org.osgi.compendium;inline="org/osgi/util/tracker/*"
-
-
org.apache.sling.commons.osgi
+org.apache.sling.commons.osgi;inline=true,
+
org.apache.sling.scripting.core;inline="org/apache/sling/scripting/core/impl/helper/ProtectedBindings.class"
+
 
 
 
@@ -88,6 +88,18 @@
 provided
 
 
+org.apache.sling
+org.apache.sling.scripting.api
+2.1.6
+provided
+
+
+org.apache.sling
+org.apache.sling.scripting.core
+2.0.20
+provided
+
+
 org.slf4j
 slf4j-api
 provided

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java?rev=1772273=1772272=1772273=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/ExportServlet.java
 Thu Dec  1 20:59:38 2016
@@ -19,39 +19,75 @@
 package org.apache.sling.models.impl;
 
 import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Set;
 
+import javax.script.ScriptEngineFactory;
+import javax.script.SimpleBindings;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
+import org.apache.sling.api.scripting.SlingBindings;
+import org.apache.sling.api.scripting.SlingScriptHelper;
 import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
 import org.apache.sling.models.factory.ExportException;
 import org.apache.sling.models.factory.MissingExporterException;
 import org.apache.sling.models.factory.ModelFactory;
+import org.apache.sling.scripting.api.BindingsValuesProvider;
+import org.apache.sling.scripting.api.BindingsValuesProvidersByContext;
+import org.apache.sling.scripting.core.ScriptHelper;
+import org.apache.sling.scripting.core.impl.helper.ProtectedBindings;
+import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.apache.sling.api.scripting.SlingBindings.*;
+
 @SuppressWarni

svn commit: r1772272 - in /sling/trunk/bundles/scripting: api/pom.xml core/pom.xml

2016-12-01 Thread justin
Author: justin
Date: Thu Dec  1 20:59:28 2016
New Revision: 1772272

URL: http://svn.apache.org/viewvc?rev=1772272=rev
Log:
use latest snapshot to get trunk build to work locally (should revert to 2.16.0 
after release passes)

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

Modified: sling/trunk/bundles/scripting/api/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/api/pom.xml?rev=1772272=1772271=1772272=diff
==
--- sling/trunk/bundles/scripting/api/pom.xml (original)
+++ sling/trunk/bundles/scripting/api/pom.xml Thu Dec  1 20:59:28 2016
@@ -56,7 +56,7 @@
 
 org.apache.sling
 org.apache.sling.api
-2.15.1-SNAPSHOT
+2.16.1-SNAPSHOT
 provided
 
 

Modified: sling/trunk/bundles/scripting/core/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/pom.xml?rev=1772272=1772271=1772272=diff
==
--- sling/trunk/bundles/scripting/core/pom.xml (original)
+++ sling/trunk/bundles/scripting/core/pom.xml Thu Dec  1 20:59:28 2016
@@ -124,7 +124,7 @@
 
 org.apache.sling
 org.apache.sling.api
-2.15.1-SNAPSHOT
+2.16.1-SNAPSHOT
 provided
 
 




svn commit: r1772113 - in /sling/trunk/bundles/extensions/models: integration-tests/ integration-tests/src/main/java/org/apache/sling/models/it/exporter/ jackson-exporter/ jackson-exporter/src/main/ja

2016-11-30 Thread justin
Author: justin
Date: Wed Nov 30 20:36:27 2016
New Revision: 1772113

URL: http://svn.apache.org/viewvc?rev=1772113=rev
Log:
SLING-6349 - provide custom serialization for request objects

Added:

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/HttpServletRequestMixin.java

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/RequestModuleProvider.java

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ServletRequestMixin.java

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/SlingHttpServletRequestMixin.java
Modified:
sling/trunk/bundles/extensions/models/integration-tests/pom.xml

sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
sling/trunk/bundles/extensions/models/jackson-exporter/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=1772113=1772112=1772113=diff
==
--- sling/trunk/bundles/extensions/models/integration-tests/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/integration-tests/pom.xml Wed Nov 30 
20:36:27 2016
@@ -312,7 +312,7 @@
 
 org.apache.sling
 org.apache.sling.models.jacksonexporter
-1.0.1-SNAPSHOT
+1.0.5-SNAPSHOT
 provided
 
 

Modified: 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java?rev=1772113=1772112=1772113=diff
==
--- 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/integration-tests/src/main/java/org/apache/sling/models/it/exporter/BaseRequestComponent.java
 Wed Nov 30 20:36:27 2016
@@ -25,6 +25,8 @@ import org.apache.sling.models.annotatio
 import org.apache.sling.models.annotations.injectorspecific.SlingObject;
 
 import javax.inject.Inject;
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
 
 @Model(adaptables = { SlingHttpServletRequest.class }, resourceType = 
"sling/exp-request/base")
 @Exporter(name = "jackson", extensions = "json")
@@ -59,4 +61,16 @@ public class BaseRequestComponent {
 return resource;
 }
 
+public SlingHttpServletRequest getSlingHttpServletRequest() {
+return request;
+}
+
+public HttpServletRequest getHttpServletRequest() {
+return request;
+}
+
+public ServletRequest getServletRequest() {
+return request;
+}
+
 }

Modified: sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml?rev=1772113=1772112=1772113=diff
==
--- sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml (original)
+++ sling/trunk/bundles/extensions/models/jackson-exporter/pom.xml Wed Nov 30 
20:36:27 2016
@@ -115,6 +115,17 @@
 2.4.0
 provided
 
+
+javax.servlet
+servlet-api
+provided
+
+
+commons-collections
+commons-collections
+3.2.1
+provided
+
 
 
 

Added: 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java?rev=1772113=auto
==
--- 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java
 (added)
+++ 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/EnumerationSerializer.java
 Wed Nov 30 20:36:27 2016
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Softw

svn commit: r1772112 - /sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/JacksonExporter.java

2016-11-30 Thread justin
Author: justin
Date: Wed Nov 30 20:36:22 2016
New Revision: 1772112

URL: http://svn.apache.org/viewvc?rev=1772112=rev
Log:
code cleanup

Modified:

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/JacksonExporter.java

Modified: 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/JacksonExporter.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/JacksonExporter.java?rev=1772112=1772111=1772112=diff
==
--- 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/JacksonExporter.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/JacksonExporter.java
 Wed Nov 30 20:36:22 2016
@@ -23,7 +23,6 @@ import java.io.StringWriter;
 import java.util.Map;
 
 import com.fasterxml.jackson.databind.MapperFeature;
-import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Reference;
 import org.apache.felix.scr.annotations.ReferenceCardinality;
@@ -41,8 +40,6 @@ import com.fasterxml.jackson.core.io.Cha
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
 import org.apache.sling.models.jacksonexporter.ModuleProvider;
-import org.apache.sling.models.spi.Injector;
-import 
org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessorFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -64,15 +61,15 @@ public class JacksonExporter implements
 
 @Reference(name = "moduleProvider", referenceInterface = 
ModuleProvider.class,
 cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy = 
ReferencePolicy.DYNAMIC)
-private final @Nonnull RankedServices moduleProviders = 
new RankedServices(Order.ASCENDING);
+private final RankedServices moduleProviders = new 
RankedServices(Order.ASCENDING);
 
 @Override
-public boolean isSupported(Class clazz) {
+public boolean isSupported(@Nonnull Class clazz) {
 return clazz.equals(String.class) || clazz.equals(Map.class);
 }
 
 @Override
-public  T export(Object model, Class clazz, Map<String, String> 
options)
+public  T export(@Nonnull Object model, @Nonnull Class clazz, 
@Nonnull Map<String, String> options)
 throws ExportException {
 ObjectMapper mapper = new ObjectMapper();
 for (Map.Entry<String, String> optionEntry : options.entrySet()) {
@@ -137,14 +134,14 @@ public class JacksonExporter implements
 }
 
 @Override
-public String getName() {
+public @Nonnull String getName() {
 return "jackson";
 }
 
 private static class EscapeCloseScriptBlocks extends CharacterEscapes {
 private final int[] escapes;
 
-public EscapeCloseScriptBlocks() {
+EscapeCloseScriptBlocks() {
 int[] baseEscapes = standardAsciiEscapesForJSON();
 baseEscapes['<'] = CharacterEscapes.ESCAPE_STANDARD;
 baseEscapes['>'] = CharacterEscapes.ESCAPE_STANDARD;




svn commit: r1772104 - in /sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl: ResourceModelProvider.java ResourceModuleProvider.java

2016-11-30 Thread justin
Author: justin
Date: Wed Nov 30 19:18:16 2016
New Revision: 1772104

URL: http://svn.apache.org/viewvc?rev=1772104=rev
Log:
SLING-6348 - correct class name

Added:

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java
  - copied, changed from r1772094, 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModelProvider.java
Removed:

sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModelProvider.java

Copied: 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java
 (from r1772094, 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModelProvider.java)
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java?p2=sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java=sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModelProvider.java=1772094=1772104=1772104=diff
==
--- 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModelProvider.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/jackson-exporter/src/main/java/org/apache/sling/models/jacksonexporter/impl/ResourceModuleProvider.java
 Wed Nov 30 19:18:16 2016
@@ -34,7 +34,7 @@ import java.util.Map;
 description = "Provider of a Jackson Module which enables support for 
proper serialization of Resource objects")
 @Service
 @Property(name = Constants.SERVICE_RANKING, intValue = 0, propertyPrivate = 
true)
-public class ResourceModelProvider implements ModuleProvider {
+public class ResourceModuleProvider implements ModuleProvider {
 
 private static final int DEFAULT_MAX_RECURSION_LEVELS = -1;
 




svn commit: r1772093 - in /sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl: ModelAdapterFactory.java injectors/BindingsInjector.java injectors/ValueMapInjector.ja

2016-11-30 Thread justin
Author: justin
Date: Wed Nov 30 17:47:13 2016
New Revision: 1772093

URL: http://svn.apache.org/viewvc?rev=1772093=rev
Log:
SLING-6318 - improve optimization by avoiding null return values from 
prepareValues

Modified:

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/ValueMapInjector.java

sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValuePreparer.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=1772093=1772092=1772093=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
 Wed Nov 30 17:47:13 2016
@@ -458,18 +458,10 @@ public class ModelAdapterFactory impleme
 final ValuePreparer preparer = (ValuePreparer) 
injector;
 Object fromMap = preparedValues.get(preparer);
 if (fromMap != null) {
-if (ObjectUtils.NULL.equals(fromMap)) {
-preparedValue = null;
-} else {
-preparedValue = fromMap;
-}
+preparedValue = fromMap;
 } else {
 preparedValue = 
preparer.prepareValue(injectionAdaptable);
-if (preparedValue == null) {
-preparedValues.put(preparer, ObjectUtils.NULL);
-} else {
-preparedValues.put(preparer, preparedValue);
-}
+preparedValues.put(preparer, preparedValue);
 }
 }
 

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/BindingsInjector.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/BindingsInjector.java?rev=1772093=1772092=1772093=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/BindingsInjector.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/BindingsInjector.java
 Wed Nov 30 17:47:13 2016
@@ -22,6 +22,7 @@ import java.lang.reflect.Type;
 import javax.annotation.Nonnull;
 import javax.servlet.ServletRequest;
 
+import org.apache.commons.lang.ObjectUtils;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Property;
 import org.apache.felix.scr.annotations.Service;
@@ -51,6 +52,9 @@ public class BindingsInjector implements
 
 public Object getValue(@Nonnull Object adaptable, String name, @Nonnull 
Type type, @Nonnull AnnotatedElement element,
 @Nonnull DisposalCallbackRegistry callbackRegistry) {
+if (adaptable == ObjectUtils.NULL) {
+return null;
+}
 SlingBindings bindings = getBindings(adaptable);
 if (bindings == null) {
 return null;
@@ -86,7 +90,8 @@ public class BindingsInjector implements
 
 @Override
 public Object prepareValue(Object adaptable) {
-return getBindings(adaptable);
+Object prepared = getBindings(adaptable);
+return prepared != null ? prepared : ObjectUtils.NULL;
 }
 
 private static class ScriptVariableAnnotationProcessor extends 
AbstractInjectAnnotationProcessor2 {

Modified: 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValueMapInjector.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValueMapInjector.java?rev=1772093=1772092=1772093=diff
==
--- 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValueMapInjector.java
 (original)
+++ 
sling/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/ValueMapInjector.java
 Wed Nov 30 17:47:13 2016
@@ -27,6

  1   2   3   4   5   6   7   8   9   10   >