Re: [VOTE] Release Apache Sling SlingStart Maven Plugin 1.7.14 and Apache Sling Validation Core & Test Services version 1.0.4

2017-12-21 Thread Karl Pauls
+1

regards,

Karl

On Thu, Dec 21, 2017 at 8:44 AM, Konrad Windszus  wrote:
> Anyone else daring to vote here?
>
>> On 18. Dec 2017, at 18:12, Stefan Seifert  wrote:
>>
>> +1
>>
>>
>



-- 
Karl Pauls
karlpa...@gmail.com


RE: [VOTE] Release Apache Sling Commons Classloader 1.4.2

2017-12-21 Thread Stefan Seifert
+1



Re: [VOTE] Release Apache Sling SlingStart Maven Plugin 1.7.14 and Apache Sling Validation Core & Test Services version 1.0.4

2017-12-21 Thread Konrad Windszus
Here is my +1
Konrad

> On 21. Dec 2017, at 09:32, Karl Pauls  wrote:
> 
> +1
> 
> regards,
> 
> Karl
> 
> On Thu, Dec 21, 2017 at 8:44 AM, Konrad Windszus  wrote:
>> Anyone else daring to vote here?
>> 
>>> On 18. Dec 2017, at 18:12, Stefan Seifert  wrote:
>>> 
>>> +1
>>> 
>>> 
>> 
> 
> 
> 
> -- 
> Karl Pauls
> karlpa...@gmail.com



[RESULT] [VOTE] Release Apache Sling SlingStart Maven Plugin 1.7.14 and Apache Sling Validation Core & Test Services version 1.0.4

2017-12-21 Thread Konrad Windszus

Hi, The vote has passed with the following result: 

 +1 (binding): Stefan, Karl and myself

I will copy this release to the Sling dist directory and promote the artifacts 
to the central Maven repository.

Konrad



Re: [VOTE] Release Apache Sling Commons Classloader 1.4.2

2017-12-21 Thread Radu Cotescu
+1

On Thu, 21 Dec 2017 at 00:17 Karl Pauls  wrote:

> Please vote to approve these releases:
>
>   [ ] +1 Approve the releases
>   [ ]  0 Don't care
>   [ ] -1 Don't release, because ...
>


Re: [VOTE] Release Apache Sling Commons Classloader 1.4.2

2017-12-21 Thread Robert Munteanu
On Thu, 2017-12-21 at 00:16 +0100, Karl Pauls wrote:
> Please vote to approve these releases:

+1

Robert


[jira] [Updated] (SLING-7280) Repoinit: add support for empty rep:glob restriction

2017-12-21 Thread Bertrand Delacretaz (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bertrand Delacretaz updated SLING-7280:
---
Affects Version/s: Repoinit JCR 1.1.6

> Repoinit: add support for empty rep:glob restriction
> 
>
> Key: SLING-7280
> URL: https://issues.apache.org/jira/browse/SLING-7280
> Project: Sling
>  Issue Type: Bug
>  Components: Repoinit
>Affects Versions: Repoinit JCR 1.1.6
>Reporter: angela
> Fix For: Repoinit JCR 1.1.8
>
>
> [~bdelacretaz], I was asked by a colleague at Adobe how to create a 
> _rep:glob_ restriction with an empty string value as it is possible and 
> documented with Jackrabbit API. I didn't find how to do that and suspect that 
> it's simply a bug in the repo init.
> I would appreciate if you could look into this and fix it.
> cc: [~marett]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (SLING-7280) Repoinit: add support for empty rep:glob restriction

2017-12-21 Thread Bertrand Delacretaz (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bertrand Delacretaz updated SLING-7280:
---
Fix Version/s: Repoinit JCR 1.1.8

> Repoinit: add support for empty rep:glob restriction
> 
>
> Key: SLING-7280
> URL: https://issues.apache.org/jira/browse/SLING-7280
> Project: Sling
>  Issue Type: Bug
>  Components: Repoinit
>Affects Versions: Repoinit JCR 1.1.6
>Reporter: angela
> Fix For: Repoinit JCR 1.1.8
>
>
> [~bdelacretaz], I was asked by a colleague at Adobe how to create a 
> _rep:glob_ restriction with an empty string value as it is possible and 
> documented with Jackrabbit API. I didn't find how to do that and suspect that 
> it's simply a bug in the repo init.
> I would appreciate if you could look into this and fix it.
> cc: [~marett]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (SLING-7280) Repoinit: add support for empty rep:glob restriction

2017-12-21 Thread Bertrand Delacretaz (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7280?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bertrand Delacretaz updated SLING-7280:
---
Summary: Repoinit: add support for empty rep:glob restriction  (was: Repo 
Init: Unable to create rep:glob restriction with empty string value)

> Repoinit: add support for empty rep:glob restriction
> 
>
> Key: SLING-7280
> URL: https://issues.apache.org/jira/browse/SLING-7280
> Project: Sling
>  Issue Type: Bug
>  Components: Repoinit
>Affects Versions: Repoinit JCR 1.1.6
>Reporter: angela
> Fix For: Repoinit JCR 1.1.8
>
>
> [~bdelacretaz], I was asked by a colleague at Adobe how to create a 
> _rep:glob_ restriction with an empty string value as it is possible and 
> documented with Jackrabbit API. I didn't find how to do that and suspect that 
> it's simply a bug in the repo init.
> I would appreciate if you could look into this and fix it.
> cc: [~marett]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7280) Repoinit: add support for empty rep:glob restriction

2017-12-21 Thread Bertrand Delacretaz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300098#comment-16300098
 ] 

Bertrand Delacretaz commented on SLING-7280:


Implemented in 
https://github.com/apache/sling-org-apache-sling-jcr-repoinit/commit/87994dd2f090591012721d79eb00727f7a2ba4b6

FWIW It looks like an empty rep:glob restriction does not work for all 
permissions, I initially tried with a {{jcr:modifyProperties}} permission and 
didn't get the expected behavior.

It works fine with {{jcr:read}} as in this example, similar to the test that I 
added in the above commit:

{code}
allow jcr:read on /someNode restriction (rep:glob)
{code}

And allows reading /someNode but not its children

Note the repoinit syntax with just {{rep:glob}} as opposed to {{rep:glob,""}} - 
this is already supported by the current repoinit parser module, but the 
repoinit JCR module didn't handle it so far.

> Repoinit: add support for empty rep:glob restriction
> 
>
> Key: SLING-7280
> URL: https://issues.apache.org/jira/browse/SLING-7280
> Project: Sling
>  Issue Type: Bug
>  Components: Repoinit
>Affects Versions: Repoinit JCR 1.1.6
>Reporter: angela
> Fix For: Repoinit JCR 1.1.8
>
>
> [~bdelacretaz], I was asked by a colleague at Adobe how to create a 
> _rep:glob_ restriction with an empty string value as it is possible and 
> documented with Jackrabbit API. I didn't find how to do that and suspect that 
> it's simply a bug in the repo init.
> I would appreciate if you could look into this and fix it.
> cc: [~marett]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread JIRA
Santiago García Pimentel created SLING-7321:
---

 Summary: ChildResourceViaProvider should be able to deal with 
SlingHttpServletRequest
 Key: SLING-7321
 URL: https://issues.apache.org/jira/browse/SLING-7321
 Project: Sling
  Issue Type: Improvement
Reporter: Santiago García Pimentel
Priority: Minor


The ForcedResourceType and ResourceSuperType are able to deal with Sling 
requests by creating a wrapper request that returns a wrapped Request.

Still, the ChildResourceViaProvider does not offer such possibility. I think 
that for sake of consistency it should.

I propose that if the adaptable is a SlingHttpServletRequest the 
ChildResourceViaProvider  should create a request wrapper that returns the 
child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Created] (SLING-7322) Provide Jackrabbit Vault feature

2017-12-21 Thread Oliver Lietz (JIRA)
Oliver Lietz created SLING-7322:
---

 Summary: Provide Jackrabbit Vault feature
 Key: SLING-7322
 URL: https://issues.apache.org/jira/browse/SLING-7322
 Project: Sling
  Issue Type: New Feature
  Components: Karaf
Reporter: Oliver Lietz
Assignee: Oliver Lietz
 Fix For: Karaf Features 0.2.0, Karaf Integration Tests 0.2.0






--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (SLING-7322) Provide Jackrabbit Vault feature

2017-12-21 Thread Oliver Lietz (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oliver Lietz updated SLING-7322:

Fix Version/s: Karaf Distribution 0.2.0

> Provide Jackrabbit Vault feature
> 
>
> Key: SLING-7322
> URL: https://issues.apache.org/jira/browse/SLING-7322
> Project: Sling
>  Issue Type: New Feature
>  Components: Karaf
>Reporter: Oliver Lietz
>Assignee: Oliver Lietz
> Fix For: Karaf Features 0.2.0, Karaf Integration Tests 0.2.0, 
> Karaf Distribution 0.2.0
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


GitPubSub broken for Sling Site

2017-12-21 Thread Konrad Windszus
Hi,
Where can I look up the state of the GitPubSub consumer which is responsible 
for publishing the website.
I published a site by pushing some commits to 
https://github.com/apache/sling-site/tree/asf-site 
 but it is still not live 
at http://sling.apache.org/components/slingstart-maven-plugin-archives/ 

Thanks for any pointers,
Konrad
 



[GitHub] santiagozky opened a new pull request #3: SLING-7321 ChildResourceViaProvider support wrapping request

2017-12-21 Thread GitBox
santiagozky opened a new pull request #3: SLING-7321 ChildResourceViaProvider 
support wrapping request
URL: https://github.com/apache/sling-org-apache-sling-models-impl/pull/3
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300174#comment-16300174
 ] 

ASF GitHub Bot commented on SLING-7321:
---

santiagozky opened a new pull request #3: SLING-7321 ChildResourceViaProvider 
support wrapping request
URL: https://github.com/apache/sling-org-apache-sling-models-impl/pull/3
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>Reporter: Santiago García Pimentel
>Priority: Minor
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus updated SLING-7321:
---
Affects Version/s: Sling Models Impl 1.4.6

> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300201#comment-16300201
 ] 

Konrad Windszus commented on SLING-7321:


Thanks [~santiagozky]. PR looks good to me.
[~justinedelson] Can you have a look as well?

> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus updated SLING-7321:
---
Component/s: Extensions

> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus updated SLING-7321:
---
Fix Version/s: Sling Models Impl 1.4.8

> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (SLING-7299) slingstart-maven-plugin: Do not always attach artifact in goal "package"

2017-12-21 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7299?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus closed SLING-7299.
--

> slingstart-maven-plugin: Do not always attach artifact in goal "package"
> 
>
> Key: SLING-7299
> URL: https://issues.apache.org/jira/browse/SLING-7299
> Project: Sling
>  Issue Type: Improvement
>Affects Versions: Slingstart Maven Plugin 1.7.10
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
> Fix For: Slingstart Maven Plugin 1.7.14
>
>
> In case the packaging is not {{slingstart}} that generated artifact is still 
> attached to the project (and therefore potentially also deployed via mvn 
> deploy) 
> (https://github.com/apache/sling-slingstart-maven-plugin/blob/master/src/main/java/org/apache/sling/maven/slingstart/PackageMojo.java#L95).
>  This is not desired in case the model is only used for running a local IT 
> against the server being generated from the model. Therefore there should be 
> an additional parameter which prevents the artifact from being attached.
> Since the attached artifact is currently also used from goal {{start}} 
> (https://github.com/apache/sling-slingstart-maven-plugin/blob/master/src/main/java/org/apache/sling/maven/slingstart/run/StartMojo.java#L396)
>  there must be another way introduced to detect slingstart artifacts which 
> have been generated through the same maven build by a previous step.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (SLING-7302) slingstart-maven-plugin: Also consider the project's version itself in the PomArtifactVersionResolver

2017-12-21 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus closed SLING-7302.
--

> slingstart-maven-plugin: Also consider the project's version itself in the 
> PomArtifactVersionResolver
> -
>
> Key: SLING-7302
> URL: https://issues.apache.org/jira/browse/SLING-7302
> Project: Sling
>  Issue Type: Improvement
>  Components: Maven Plugins and Archetypes
>Affects Versions: Slingstart Maven Plugin 1.7.10
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
> Fix For: Slingstart Maven Plugin 1.7.14
>
>
> In the context of using provisioning models with ITs it is often useful to 
> package the current bundle into the launchpad. Currently the parameter 
> {{usePomDependencies}} does not help though to make it possible to not 
> duplicate the current maven module's version in the model file again, as the 
> {{PomArtifactVersionResolver}} only considers versions being set explicitly 
> either in project dependencies or in the dependencyManagement. I propose to 
> also evaluate the current maven project's version.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (SLING-7289) Sling Validator Service does not free Validators correctly

2017-12-21 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7289?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus closed SLING-7289.
--

> Sling Validator Service does not free Validators correctly
> --
>
> Key: SLING-7289
> URL: https://issues.apache.org/jira/browse/SLING-7289
> Project: Sling
>  Issue Type: Bug
>  Components: Validation
>Affects Versions: Validation 1.0.0
>Reporter: Santiago García Pimentel
>Assignee: Konrad Windszus
>Priority: Critical
> Fix For: Validation Core 1.0.4
>
>
> When a bundle that contains Sling Validators is removed. the Sling Validation 
> Service does not correctly free them.
> The problem is in the ValidatorMap, which fails to remove the service from 
> the map in 
> https://github.com/apache/sling-org-apache-sling-validation-core/blob/master/src/main/java/org/apache/sling/validation/impl/ValidatorMap.java#L225



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (SLING-7298) Validation IT: Use slingstart-maven-plugin in favour of pax-exam

2017-12-21 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7298?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus closed SLING-7298.
--

> Validation IT: Use slingstart-maven-plugin in favour of pax-exam
> 
>
> Key: SLING-7298
> URL: https://issues.apache.org/jira/browse/SLING-7298
> Project: Sling
>  Issue Type: Improvement
>  Components: Validation
>Affects Versions: Validation 1.0.0
>Reporter: Konrad Windszus
>Assignee: Konrad Windszus
> Fix For: Validation Core 1.0.4
>
>
> Due to issues with pax-exam with the newest Oak 1.6.0 (described in 
> https://www.mail-archive.com/dev@sling.apache.org/msg72805.html) and also 
> because leveraging pax-exam with Sling is complex (to get all necessary 
> dependencies right) I propose to use the {{slingstart-maven-plugin}} together 
> with a custom Sling Launchpad instead. The according model is derived from 
> the default Sling 9 launchpad and only two additional bundles are added there.
> In addition the deprecated {{testing.tools}} dependency should be removed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Closed] (SLING-6776) Rename ValidationContextImpl to ValidatorContextImpl

2017-12-21 Thread Konrad Windszus (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-6776?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Konrad Windszus closed SLING-6776.
--

> Rename ValidationContextImpl to ValidatorContextImpl
> 
>
> Key: SLING-6776
> URL: https://issues.apache.org/jira/browse/SLING-6776
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions, Validation
>Affects Versions: Validation 1.0.0
>Reporter: Oliver Lietz
>Assignee: Konrad Windszus
> Fix For: Validation Core 1.0.4
>
>
> {{ValidationContextImpl}} implements {{ValidatorContext}} and should be named 
> accordingly.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


Re: GitPubSub broken for Sling Site

2017-12-21 Thread Konrad Windszus
Raised https://issues.apache.org/jira/browse/INFRA-15704 
 for that.

> On 21. Dec 2017, at 16:34, Konrad Windszus  wrote:
> 
> Hi,
> Where can I look up the state of the GitPubSub consumer which is responsible 
> for publishing the website.
> I published a site by pushing some commits to 
> https://github.com/apache/sling-site/tree/asf-site 
>  but it is still not live 
> at http://sling.apache.org/components/slingstart-maven-plugin-archives/ 
> 
> Thanks for any pointers,
> Konrad
> 
> 



[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread Justin Edelson (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300274#comment-16300274
 ] 

Justin Edelson commented on SLING-7321:
---

I have a few stylistic comments to make in GitHub, but generally I agree that 
this looks like a fine addition. Thanks!

> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] justinedelson commented on a change in pull request #3: SLING-7321 ChildResourceViaProvider support wrapping request

2017-12-21 Thread GitBox
justinedelson commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158327647
 
 

 ##
 File path: 
src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 ##
 @@ -0,0 +1,63 @@
+package org.apache.sling.models.impl.via;
+
+import static org.mockito.Mockito.when;
 
 Review comment:
   Please move down to rest of import section


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300277#comment-16300277
 ] 

ASF GitHub Bot commented on SLING-7321:
---

justinedelson commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158327647
 
 

 ##
 File path: 
src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 ##
 @@ -0,0 +1,63 @@
+package org.apache.sling.models.impl.via;
+
+import static org.mockito.Mockito.when;
 
 Review comment:
   Please move down to rest of import section


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300280#comment-16300280
 ] 

ASF GitHub Bot commented on SLING-7321:
---

justinedelson commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158327783
 
 

 ##
 File path: 
src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
 ##
 @@ -40,8 +46,36 @@ public Object getAdaptable(Object original, String value) {
 }
 if (original instanceof Resource) {
 return ((Resource) original).getChild(value);
+} else if (original instanceof SlingHttpServletRequest) {
+final SlingHttpServletRequest request = (SlingHttpServletRequest) 
original;
+final Resource resource = request.getResource();
+if (resource == null) {
+return null;
+}
+Resource child = resource.getChild(value);
+if (child == null) {
+log.debug("could not obtain child {} of resource {}", value, 
resource.getPath());
 
 Review comment:
   Please upper case "could" as "Could"


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300279#comment-16300279
 ] 

ASF GitHub Bot commented on SLING-7321:
---

justinedelson commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158327677
 
 

 ##
 File path: 
src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 ##
 @@ -0,0 +1,63 @@
+package org.apache.sling.models.impl.via;
 
 Review comment:
   Please move to below license to match other files.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300278#comment-16300278
 ] 

ASF GitHub Bot commented on SLING-7321:
---

justinedelson commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158327488
 
 

 ##
 File path: 
src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
 ##
 @@ -19,15 +19,21 @@
 import org.apache.commons.lang3.StringUtils;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper;
 import org.apache.sling.models.annotations.ViaProviderType;
 import org.apache.sling.models.annotations.via.ChildResource;
 import org.apache.sling.models.spi.ViaProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @Component
 @Service
 public class ChildResourceViaProvider implements ViaProvider {
 
+protected final Logger log = LoggerFactory.getLogger(getClass());
 
 Review comment:
   Please make `private static final` to match other classes.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] justinedelson commented on a change in pull request #3: SLING-7321 ChildResourceViaProvider support wrapping request

2017-12-21 Thread GitBox
justinedelson commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158327677
 
 

 ##
 File path: 
src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 ##
 @@ -0,0 +1,63 @@
+package org.apache.sling.models.impl.via;
 
 Review comment:
   Please move to below license to match other files.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] justinedelson commented on a change in pull request #3: SLING-7321 ChildResourceViaProvider support wrapping request

2017-12-21 Thread GitBox
justinedelson commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158327488
 
 

 ##
 File path: 
src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
 ##
 @@ -19,15 +19,21 @@
 import org.apache.commons.lang3.StringUtils;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper;
 import org.apache.sling.models.annotations.ViaProviderType;
 import org.apache.sling.models.annotations.via.ChildResource;
 import org.apache.sling.models.spi.ViaProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @Component
 @Service
 public class ChildResourceViaProvider implements ViaProvider {
 
+protected final Logger log = LoggerFactory.getLogger(getClass());
 
 Review comment:
   Please make `private static final` to match other classes.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] justinedelson commented on a change in pull request #3: SLING-7321 ChildResourceViaProvider support wrapping request

2017-12-21 Thread GitBox
justinedelson commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158327783
 
 

 ##
 File path: 
src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
 ##
 @@ -40,8 +46,36 @@ public Object getAdaptable(Object original, String value) {
 }
 if (original instanceof Resource) {
 return ((Resource) original).getChild(value);
+} else if (original instanceof SlingHttpServletRequest) {
+final SlingHttpServletRequest request = (SlingHttpServletRequest) 
original;
+final Resource resource = request.getResource();
+if (resource == null) {
+return null;
+}
+Resource child = resource.getChild(value);
+if (child == null) {
+log.debug("could not obtain child {} of resource {}", value, 
resource.getPath());
 
 Review comment:
   Please upper case "could" as "Could"


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] santiagozky commented on a change in pull request #3: SLING-7321 ChildResourceViaProvider support wrapping request

2017-12-21 Thread GitBox
santiagozky commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158329822
 
 

 ##
 File path: 
src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 ##
 @@ -0,0 +1,63 @@
+package org.apache.sling.models.impl.via;
+
+import static org.mockito.Mockito.when;
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] santiagozky commented on a change in pull request #3: SLING-7321 ChildResourceViaProvider support wrapping request

2017-12-21 Thread GitBox
santiagozky commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158329811
 
 

 ##
 File path: 
src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 ##
 @@ -0,0 +1,63 @@
+package org.apache.sling.models.impl.via;
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300293#comment-16300293
 ] 

ASF GitHub Bot commented on SLING-7321:
---

santiagozky commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158329822
 
 

 ##
 File path: 
src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 ##
 @@ -0,0 +1,63 @@
+package org.apache.sling.models.impl.via;
+
+import static org.mockito.Mockito.when;
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300292#comment-16300292
 ] 

ASF GitHub Bot commented on SLING-7321:
---

santiagozky commented on a change in pull request #3: SLING-7321 
ChildResourceViaProvider support wrapping request
URL: 
https://github.com/apache/sling-org-apache-sling-models-impl/pull/3#discussion_r158329811
 
 

 ##
 File path: 
src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 ##
 @@ -0,0 +1,63 @@
+package org.apache.sling.models.impl.via;
 
 Review comment:
   done


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread JIRA

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300296#comment-16300296
 ] 

Santiago García Pimentel commented on SLING-7321:
-

thank you [~justinedelson]. I've updated the PR

> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[GitHub] justinedelson closed pull request #3: SLING-7321 ChildResourceViaProvider support wrapping request

2017-12-21 Thread GitBox
justinedelson closed pull request #3: SLING-7321 ChildResourceViaProvider 
support wrapping request
URL: https://github.com/apache/sling-org-apache-sling-models-impl/pull/3
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java 
b/src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
index b35b9e0..f80a1a0 100644
--- 
a/src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
+++ 
b/src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
@@ -19,15 +19,21 @@
 import org.apache.commons.lang3.StringUtils;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper;
 import org.apache.sling.models.annotations.ViaProviderType;
 import org.apache.sling.models.annotations.via.ChildResource;
 import org.apache.sling.models.spi.ViaProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @Component
 @Service
 public class ChildResourceViaProvider implements ViaProvider {
 
+private static final Logger log = 
LoggerFactory.getLogger(ChildResourceViaProvider.class);
+
 @Override
 public Class getType() {
 return ChildResource.class;
@@ -40,8 +46,36 @@ public Object getAdaptable(Object original, String value) {
 }
 if (original instanceof Resource) {
 return ((Resource) original).getChild(value);
+} else if (original instanceof SlingHttpServletRequest) {
+final SlingHttpServletRequest request = (SlingHttpServletRequest) 
original;
+final Resource resource = request.getResource();
+if (resource == null) {
+return null;
+}
+Resource child = resource.getChild(value);
+if (child == null) {
+log.debug("Could not obtain child {} of resource {}", value, 
resource.getPath());
+return null;
+}
+return new ChildResourceRequestWrapper(request, child);
 } else {
+log.warn("Received unexpected adaptable of type {}.", 
original.getClass().getName());
 return null;
 }
 }
+
+private class ChildResourceRequestWrapper extends 
SlingHttpServletRequestWrapper {
+
+private final Resource resource;
+
+private ChildResourceRequestWrapper(SlingHttpServletRequest request, 
Resource resource) {
+super(request);
+this.resource = resource;
+}
+
+@Override
+public Resource getResource() {
+return resource;
+}
+}
 }
diff --git 
a/src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 
b/src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
new file mode 100644
index 000..7f32b6e
--- /dev/null
+++ 
b/src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
@@ -0,0 +1,63 @@
+/*
+ * 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.via;
+
+import static org.mockito.Mockito.when;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ChildResourceViaProviderTest {
+
+private ChildResourceViaProvider provider = new ChildResourceViaProvider();
+
+@Mock
+private Resource resource;
+
+@Mock
+private Resource childResource;
+
+@Mock
+private SlingHttpServletRequest request;
+
+@Before
+public void init() {
+when(resource.getChild("child")).thenRetu

[jira] [Commented] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16300301#comment-16300301
 ] 

ASF GitHub Bot commented on SLING-7321:
---

justinedelson closed pull request #3: SLING-7321 ChildResourceViaProvider 
support wrapping request
URL: https://github.com/apache/sling-org-apache-sling-models-impl/pull/3
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java 
b/src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
index b35b9e0..f80a1a0 100644
--- 
a/src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
+++ 
b/src/main/java/org/apache/sling/models/impl/via/ChildResourceViaProvider.java
@@ -19,15 +19,21 @@
 import org.apache.commons.lang3.StringUtils;
 import org.apache.felix.scr.annotations.Component;
 import org.apache.felix.scr.annotations.Service;
+import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.wrappers.SlingHttpServletRequestWrapper;
 import org.apache.sling.models.annotations.ViaProviderType;
 import org.apache.sling.models.annotations.via.ChildResource;
 import org.apache.sling.models.spi.ViaProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @Component
 @Service
 public class ChildResourceViaProvider implements ViaProvider {
 
+private static final Logger log = 
LoggerFactory.getLogger(ChildResourceViaProvider.class);
+
 @Override
 public Class getType() {
 return ChildResource.class;
@@ -40,8 +46,36 @@ public Object getAdaptable(Object original, String value) {
 }
 if (original instanceof Resource) {
 return ((Resource) original).getChild(value);
+} else if (original instanceof SlingHttpServletRequest) {
+final SlingHttpServletRequest request = (SlingHttpServletRequest) 
original;
+final Resource resource = request.getResource();
+if (resource == null) {
+return null;
+}
+Resource child = resource.getChild(value);
+if (child == null) {
+log.debug("Could not obtain child {} of resource {}", value, 
resource.getPath());
+return null;
+}
+return new ChildResourceRequestWrapper(request, child);
 } else {
+log.warn("Received unexpected adaptable of type {}.", 
original.getClass().getName());
 return null;
 }
 }
+
+private class ChildResourceRequestWrapper extends 
SlingHttpServletRequestWrapper {
+
+private final Resource resource;
+
+private ChildResourceRequestWrapper(SlingHttpServletRequest request, 
Resource resource) {
+super(request);
+this.resource = resource;
+}
+
+@Override
+public Resource getResource() {
+return resource;
+}
+}
 }
diff --git 
a/src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
 
b/src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
new file mode 100644
index 000..7f32b6e
--- /dev/null
+++ 
b/src/test/java/org/apache/sling/models/impl/via/ChildResourceViaProviderTest.java
@@ -0,0 +1,63 @@
+/*
+ * 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.via;
+
+import static org.mockito.Mockito.when;
+
+import org.apache.sling.api.SlingHttpServletRequest;
+import org.apache.sling.api.resource.Resource;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+@RunWith(MockitoJUnitRunner.class)
+public class ChildResourceViaProviderTest {
+
+private ChildResourceViaProvider provider = new ChildResourceViaP

[jira] [Resolved] (SLING-7321) ChildResourceViaProvider should be able to deal with SlingHttpServletRequest

2017-12-21 Thread Justin Edelson (JIRA)

 [ 
https://issues.apache.org/jira/browse/SLING-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Edelson resolved SLING-7321.
---
Resolution: Fixed
  Assignee: Justin Edelson

Pull request merged. Thanks a bunch for this.

> ChildResourceViaProvider should be able to deal with SlingHttpServletRequest
> 
>
> Key: SLING-7321
> URL: https://issues.apache.org/jira/browse/SLING-7321
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Sling Models Impl 1.4.6
>Reporter: Santiago García Pimentel
>Assignee: Justin Edelson
>Priority: Minor
> Fix For: Sling Models Impl 1.4.8
>
>
> The ForcedResourceType and ResourceSuperType are able to deal with Sling 
> requests by creating a wrapper request that returns a wrapped Request.
> Still, the ChildResourceViaProvider does not offer such possibility. I think 
> that for sake of consistency it should.
> I propose that if the adaptable is a SlingHttpServletRequest the 
> ChildResourceViaProvider  should create a request wrapper that returns the 
> child as given in 'value'



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)