[jira] [Created] (SLING-2726) allow wildcards in servlet paths

2013-02-08 Thread Nicolas Peltier (JIRA)
Nicolas Peltier created SLING-2726:
--

 Summary: allow wildcards in servlet paths
 Key: SLING-2726
 URL: https://issues.apache.org/jira/browse/SLING-2726
 Project: Sling
  Issue Type: Improvement
  Components: Servlets
Reporter: Nicolas Peltier
Priority: Minor


this would be nice to allow minimum wildcard for servlet paths, i.e. /a/b/* (no 
suffix), as some use cases can't be cover right now with jcr based resources + 
path servlets.
Basically every resource model where you don't need a jcr node for (while it's 
very convenient most of the time).
I'm thinking for example of having a profile servlet with a nice public 
/profile/jdoe.html url. Right now my possibilities are 
* to create a flat tree of fake user nodes under a profile node just for the 
sake of my urls (don't need righs handling, don't need other verbs for the same 
resource), 
* to have tons of vanityUrls (not meant for that kind of usage)
* to create my own ResourceProvider that map that kind of URLs to existing jcr 
resources.
* to switch to /profile.jdoe.html, or /profile.html?uid=jdoe

And i tend to think a tiny wildcard in a path parameter would be nicer :-)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2726) allow simple wildcards in servlet paths

2013-02-08 Thread Nicolas Peltier (JIRA)

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

Nicolas Peltier updated SLING-2726:
---

Description: 
While i'm a big fan/evangelist of sling unique servlet management. I tend to 
think this would be nice to allow minimum wildcard for servlet paths, i.e. 
/a/b/* (no suffix), as some use cases can't be cover right now with jcr based 
resources + path servlets.
Basically every resource model where you don't need a jcr node for (while it's 
very convenient most of the time).
I'm thinking for example of having a profile servlet with a nice public 
/profile/jdoe.html url. Right now my possibilities are 
* to create a flat tree of fake user nodes under a profile node just for the 
sake of my urls (don't need righs handling, don't need other verbs for the same 
resource), 
* to have tons of vanityUrls (not meant for that kind of usage)
* to create my own ResourceProvider that map that kind of URLs to existing jcr 
resources.
* to switch to /profile.jdoe.html, or /profile.html?uid=jdoe

And i tend to think a tiny wildcard in a path parameter would be nicer :-)

  was:
this would be nice to allow minimum wildcard for servlet paths, i.e. /a/b/* (no 
suffix), as some use cases can't be cover right now with jcr based resources + 
path servlets.
Basically every resource model where you don't need a jcr node for (while it's 
very convenient most of the time).
I'm thinking for example of having a profile servlet with a nice public 
/profile/jdoe.html url. Right now my possibilities are 
* to create a flat tree of fake user nodes under a profile node just for the 
sake of my urls (don't need righs handling, don't need other verbs for the same 
resource), 
* to have tons of vanityUrls (not meant for that kind of usage)
* to create my own ResourceProvider that map that kind of URLs to existing jcr 
resources.
* to switch to /profile.jdoe.html, or /profile.html?uid=jdoe

And i tend to think a tiny wildcard in a path parameter would be nicer :-)

Summary: allow simple wildcards in servlet paths  (was: allow wildcards 
in servlet paths)

> allow simple wildcards in servlet paths
> ---
>
> Key: SLING-2726
> URL: https://issues.apache.org/jira/browse/SLING-2726
> Project: Sling
>  Issue Type: Improvement
>  Components: Servlets
>Reporter: Nicolas Peltier
>Priority: Minor
>
> While i'm a big fan/evangelist of sling unique servlet management. I tend to 
> think this would be nice to allow minimum wildcard for servlet paths, i.e. 
> /a/b/* (no suffix), as some use cases can't be cover right now with jcr based 
> resources + path servlets.
> Basically every resource model where you don't need a jcr node for (while 
> it's very convenient most of the time).
> I'm thinking for example of having a profile servlet with a nice public 
> /profile/jdoe.html url. Right now my possibilities are 
> * to create a flat tree of fake user nodes under a profile node just for the 
> sake of my urls (don't need righs handling, don't need other verbs for the 
> same resource), 
> * to have tons of vanityUrls (not meant for that kind of usage)
> * to create my own ResourceProvider that map that kind of URLs to existing 
> jcr resources.
> * to switch to /profile.jdoe.html, or /profile.html?uid=jdoe
> And i tend to think a tiny wildcard in a path parameter would be nicer :-)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


Jenkins build is back to stable : sling-trunk-1.6 ยป Apache Sling Event Support #1569

2013-02-08 Thread Apache Jenkins Server
See 




Jenkins build is still unstable: sling-trunk-1.6 #1569

2013-02-08 Thread Apache Jenkins Server
See 



[jira] [Updated] (SLING-2708) ResourceUtil.isA() fails for adapted Resources unless user is admin

2013-02-08 Thread Julian Sedding (JIRA)

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

Julian Sedding updated SLING-2708:
--

Attachment: SLING-2708-using-adaptTo.patch

I have implemented a possible solution based on the adapter functionality, see 
attached patch. In a nutshell, the resource can be adapted to an immutable 
EffectiveResourceType object, which internally holds a list of all 
resource-types in the inheritance chain of the resource.

As Carsten suggested, this functionality is used in AbstractResource via 
adaptTo(EffectiveResourceType.class).

This moves the implementation to a dedicated service, like Alex said, namely 
the AdapterFactory.

Furthermore, I decided that resource-types are mostly related to script 
resolution and it would probably be sensible to (re)use the script-user 
configured for the SlingServletResolver. I believe that having a consistent 
view on the resource-types and scripts is beneficial. Also, the 
ResourceDecorator approach seems to follow the same rationale. In order not to 
overload the SlingServletResolver, this functionality mostly resides in the 
EffectiveResourceTypeFactory, which is created by the SlingServletResolver.

I'm not sure if the addition of the EffectiveResourceType interface to 
o.a.sling.api is desirable, however, adding it to another package would create 
a dependency. Maybe the EffectiveResourceType could also be made more useful. 
At the moment it is very simple and only solves the "isA" use-case.

> ResourceUtil.isA() fails for adapted Resources unless user is admin
> ---
>
> Key: SLING-2708
> URL: https://issues.apache.org/jira/browse/SLING-2708
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Reporter: Tyson Norris
> Attachments: SLING-2708-using-adaptTo.patch
>
>
> Summary - adapting a Resource to a specified type, loses the ability to test 
> the Resources super types using ResourceUtil.isA(), UNLESS user is admin
> 1. TypeA is defined as:
> class TypeA {
> private Resource res;
> public boolean isTypeB(){
> return ResourceUtil.isA(res, "some/type");
> }
> }
> 2. TypeA adapter is an AdapterFactory to adapt Resource -> TypeA
> 3. /some/res/path is a resource whose sling:resourceSuperType 2 levels up is 
> "/apps/some/type"
> 4. In a JSP, we use code like:
> TypeA typeA = resource.adaptTo(TypeA)
> if (!typeA.isTypeB()){
> //FAIL: typeA.isTypeB() is actually true
> }
> Note that:
> ResourceUtil.isA(resource, "some/type") == true
> but
> ResourceUtil.isA(typeA.resource, "some/type") == false
> (unless user is admin)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2727) Allow PerformanceRunner to run tests provided by a factory method

2013-02-08 Thread Andrei Dulvac (JIRA)

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

Andrei Dulvac updated SLING-2727:
-

Attachment: performance_factory.diff

> Allow PerformanceRunner to run tests provided by a factory method
> -
>
> Key: SLING-2727
> URL: https://issues.apache.org/jira/browse/SLING-2727
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Reporter: Andrei Dulvac
>Priority: Minor
> Attachments: performance_factory.diff
>
>
> 1. I have modified PerformanceRunner to be able to run tests provided through 
> a factory method annotated with @PerformanceTestFactory. The method should 
> return a scalar, an array or a list of objects which contain methods. 
> annotated with the existent @PerformanceTest. Optionally, the class(es) 
> returned by the factory method can implement an IdentifiableTestCase 
> interface, which gives the ability to have custom names for tests running on 
> different instances. The test collection is done statically, so this works 
> with the existing @Before/AfterMethodInvocation, allowing to have different 
> test setups at once.
> 2. Modified ReportLogger to log the test case name as well. Also, changed the 
> method signatures so that it's clear what is being logged. This is important 
> for patch 1 to distinguish between different test setups.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Created] (SLING-2727) Allow PerformanceRunner to run tests provided by a factory method

2013-02-08 Thread Andrei Dulvac (JIRA)
Andrei Dulvac created SLING-2727:


 Summary: Allow PerformanceRunner to run tests provided by a 
factory method
 Key: SLING-2727
 URL: https://issues.apache.org/jira/browse/SLING-2727
 Project: Sling
  Issue Type: Improvement
  Components: Testing
Reporter: Andrei Dulvac
Priority: Minor
 Attachments: performance_factory.diff

1. I have modified PerformanceRunner to be able to run tests provided through a 
factory method annotated with @PerformanceTestFactory. The method should return 
a scalar, an array or a list of objects which contain methods. annotated with 
the existent @PerformanceTest. Optionally, the class(es) returned by the 
factory method can implement an IdentifiableTestCase interface, which gives the 
ability to have custom names for tests running on different instances. The test 
collection is done statically, so this works with the existing 
@Before/AfterMethodInvocation, allowing to have different test setups at once.

2. Modified ReportLogger to log the test case name as well. Also, changed the 
method signatures so that it's clear what is being logged. This is important 
for patch 1 to distinguish between different test setups.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2727) Allow PerformanceRunner to run tests provided by a factory method

2013-02-08 Thread Andrei Dulvac (JIRA)

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

Andrei Dulvac updated SLING-2727:
-

Attachment: performance_reportlogger.diff

> Allow PerformanceRunner to run tests provided by a factory method
> -
>
> Key: SLING-2727
> URL: https://issues.apache.org/jira/browse/SLING-2727
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Reporter: Andrei Dulvac
>Priority: Minor
> Attachments: performance_reportlogger.diff
>
>
> 1. I have modified PerformanceRunner to be able to run tests provided through 
> a factory method annotated with @PerformanceTestFactory. The method should 
> return a scalar, an array or a list of objects which contain methods. 
> annotated with the existent @PerformanceTest. Optionally, the class(es) 
> returned by the factory method can implement an IdentifiableTestCase 
> interface, which gives the ability to have custom names for tests running on 
> different instances. The test collection is done statically, so this works 
> with the existing @Before/AfterMethodInvocation, allowing to have different 
> test setups at once.
> 2. Modified ReportLogger to log the test case name as well. Also, changed the 
> method signatures so that it's clear what is being logged. This is important 
> for patch 1 to distinguish between different test setups.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2727) Allow PerformanceRunner to run tests provided by a factory method

2013-02-08 Thread Andrei Dulvac (JIRA)

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

Andrei Dulvac updated SLING-2727:
-

Attachment: (was: performance_factory.diff)

> Allow PerformanceRunner to run tests provided by a factory method
> -
>
> Key: SLING-2727
> URL: https://issues.apache.org/jira/browse/SLING-2727
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Reporter: Andrei Dulvac
>Priority: Minor
> Attachments: performance_reportlogger.diff
>
>
> 1. I have modified PerformanceRunner to be able to run tests provided through 
> a factory method annotated with @PerformanceTestFactory. The method should 
> return a scalar, an array or a list of objects which contain methods. 
> annotated with the existent @PerformanceTest. Optionally, the class(es) 
> returned by the factory method can implement an IdentifiableTestCase 
> interface, which gives the ability to have custom names for tests running on 
> different instances. The test collection is done statically, so this works 
> with the existing @Before/AfterMethodInvocation, allowing to have different 
> test setups at once.
> 2. Modified ReportLogger to log the test case name as well. Also, changed the 
> method signatures so that it's clear what is being logged. This is important 
> for patch 1 to distinguish between different test setups.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2727) Allow PerformanceRunner to run tests provided by a factory method

2013-02-08 Thread Andrei Dulvac (JIRA)

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

Andrei Dulvac updated SLING-2727:
-

Attachment: (was: performance_reportlogger.diff)

> Allow PerformanceRunner to run tests provided by a factory method
> -
>
> Key: SLING-2727
> URL: https://issues.apache.org/jira/browse/SLING-2727
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Reporter: Andrei Dulvac
>Priority: Minor
>
> 1. I have modified PerformanceRunner to be able to run tests provided through 
> a factory method annotated with @PerformanceTestFactory. The method should 
> return a scalar, an array or a list of objects which contain methods. 
> annotated with the existent @PerformanceTest. Optionally, the class(es) 
> returned by the factory method can implement an IdentifiableTestCase 
> interface, which gives the ability to have custom names for tests running on 
> different instances. The test collection is done statically, so this works 
> with the existing @Before/AfterMethodInvocation, allowing to have different 
> test setups at once.
> 2. Modified ReportLogger to log the test case name as well. Also, changed the 
> method signatures so that it's clear what is being logged. This is important 
> for patch 1 to distinguish between different test setups.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2727) Allow PerformanceRunner to run tests provided by a factory method

2013-02-08 Thread Andrei Dulvac (JIRA)

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

Andrei Dulvac updated SLING-2727:
-

Attachment: performance_factory.patch

> Allow PerformanceRunner to run tests provided by a factory method
> -
>
> Key: SLING-2727
> URL: https://issues.apache.org/jira/browse/SLING-2727
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Reporter: Andrei Dulvac
>Priority: Minor
> Attachments: performance_factory.patch, performance_reportlogger.patch
>
>
> 1. I have modified PerformanceRunner to be able to run tests provided through 
> a factory method annotated with @PerformanceTestFactory. The method should 
> return a scalar, an array or a list of objects which contain methods. 
> annotated with the existent @PerformanceTest. Optionally, the class(es) 
> returned by the factory method can implement an IdentifiableTestCase 
> interface, which gives the ability to have custom names for tests running on 
> different instances. The test collection is done statically, so this works 
> with the existing @Before/AfterMethodInvocation, allowing to have different 
> test setups at once.
> 2. Modified ReportLogger to log the test case name as well. Also, changed the 
> method signatures so that it's clear what is being logged. This is important 
> for patch 1 to distinguish between different test setups.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2727) Allow PerformanceRunner to run tests provided by a factory method

2013-02-08 Thread Andrei Dulvac (JIRA)

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

Andrei Dulvac updated SLING-2727:
-

Attachment: performance_reportlogger.patch

> Allow PerformanceRunner to run tests provided by a factory method
> -
>
> Key: SLING-2727
> URL: https://issues.apache.org/jira/browse/SLING-2727
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Reporter: Andrei Dulvac
>Priority: Minor
> Attachments: performance_factory.patch, performance_reportlogger.patch
>
>
> 1. I have modified PerformanceRunner to be able to run tests provided through 
> a factory method annotated with @PerformanceTestFactory. The method should 
> return a scalar, an array or a list of objects which contain methods. 
> annotated with the existent @PerformanceTest. Optionally, the class(es) 
> returned by the factory method can implement an IdentifiableTestCase 
> interface, which gives the ability to have custom names for tests running on 
> different instances. The test collection is done statically, so this works 
> with the existing @Before/AfterMethodInvocation, allowing to have different 
> test setups at once.
> 2. Modified ReportLogger to log the test case name as well. Also, changed the 
> method signatures so that it's clear what is being logged. This is important 
> for patch 1 to distinguish between different test setups.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2727) Allow PerformanceRunner to run tests provided by a factory method

2013-02-08 Thread Andrei Dulvac (JIRA)

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

Andrei Dulvac updated SLING-2727:
-

Labels: PatchAvailable  (was: )

Added patches

> Allow PerformanceRunner to run tests provided by a factory method
> -
>
> Key: SLING-2727
> URL: https://issues.apache.org/jira/browse/SLING-2727
> Project: Sling
>  Issue Type: Improvement
>  Components: Testing
>Reporter: Andrei Dulvac
>Priority: Minor
>  Labels: PatchAvailable
> Attachments: performance_factory.patch, performance_reportlogger.patch
>
>
> 1. I have modified PerformanceRunner to be able to run tests provided through 
> a factory method annotated with @PerformanceTestFactory. The method should 
> return a scalar, an array or a list of objects which contain methods. 
> annotated with the existent @PerformanceTest. Optionally, the class(es) 
> returned by the factory method can implement an IdentifiableTestCase 
> interface, which gives the ability to have custom names for tests running on 
> different instances. The test collection is done statically, so this works 
> with the existing @Before/AfterMethodInvocation, allowing to have different 
> test setups at once.
> 2. Modified ReportLogger to log the test case name as well. Also, changed the 
> method signatures so that it's clear what is being logged. This is important 
> for patch 1 to distinguish between different test setups.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2708) ResourceUtil.isA() fails for adapted Resources unless user is admin

2013-02-08 Thread Julian Sedding (JIRA)

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

Julian Sedding updated SLING-2708:
--

Attachment: (was: SLING-2708-using-adaptTo.patch)

> ResourceUtil.isA() fails for adapted Resources unless user is admin
> ---
>
> Key: SLING-2708
> URL: https://issues.apache.org/jira/browse/SLING-2708
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Reporter: Tyson Norris
>
> Summary - adapting a Resource to a specified type, loses the ability to test 
> the Resources super types using ResourceUtil.isA(), UNLESS user is admin
> 1. TypeA is defined as:
> class TypeA {
> private Resource res;
> public boolean isTypeB(){
> return ResourceUtil.isA(res, "some/type");
> }
> }
> 2. TypeA adapter is an AdapterFactory to adapt Resource -> TypeA
> 3. /some/res/path is a resource whose sling:resourceSuperType 2 levels up is 
> "/apps/some/type"
> 4. In a JSP, we use code like:
> TypeA typeA = resource.adaptTo(TypeA)
> if (!typeA.isTypeB()){
> //FAIL: typeA.isTypeB() is actually true
> }
> Note that:
> ResourceUtil.isA(resource, "some/type") == true
> but
> ResourceUtil.isA(typeA.resource, "some/type") == false
> (unless user is admin)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2708) ResourceUtil.isA() fails for adapted Resources unless user is admin

2013-02-08 Thread Julian Sedding (JIRA)

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

Julian Sedding updated SLING-2708:
--

Attachment: SLING-2708-using-adaptTo.patch

I just realized there was a bug in my previous patch. A new version of the 
patch is attached, which should fix the issue.

> ResourceUtil.isA() fails for adapted Resources unless user is admin
> ---
>
> Key: SLING-2708
> URL: https://issues.apache.org/jira/browse/SLING-2708
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Reporter: Tyson Norris
> Attachments: SLING-2708-using-adaptTo.patch
>
>
> Summary - adapting a Resource to a specified type, loses the ability to test 
> the Resources super types using ResourceUtil.isA(), UNLESS user is admin
> 1. TypeA is defined as:
> class TypeA {
> private Resource res;
> public boolean isTypeB(){
> return ResourceUtil.isA(res, "some/type");
> }
> }
> 2. TypeA adapter is an AdapterFactory to adapt Resource -> TypeA
> 3. /some/res/path is a resource whose sling:resourceSuperType 2 levels up is 
> "/apps/some/type"
> 4. In a JSP, we use code like:
> TypeA typeA = resource.adaptTo(TypeA)
> if (!typeA.isTypeB()){
> //FAIL: typeA.isTypeB() is actually true
> }
> Note that:
> ResourceUtil.isA(resource, "some/type") == true
> but
> ResourceUtil.isA(typeA.resource, "some/type") == false
> (unless user is admin)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2708) ResourceUtil.isA() fails for adapted Resources unless user is admin

2013-02-08 Thread Julian Sedding (JIRA)

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

Julian Sedding updated SLING-2708:
--

Attachment: (was: SLING-2708-using-adaptTo.patch)

> ResourceUtil.isA() fails for adapted Resources unless user is admin
> ---
>
> Key: SLING-2708
> URL: https://issues.apache.org/jira/browse/SLING-2708
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Reporter: Tyson Norris
>
> Summary - adapting a Resource to a specified type, loses the ability to test 
> the Resources super types using ResourceUtil.isA(), UNLESS user is admin
> 1. TypeA is defined as:
> class TypeA {
> private Resource res;
> public boolean isTypeB(){
> return ResourceUtil.isA(res, "some/type");
> }
> }
> 2. TypeA adapter is an AdapterFactory to adapt Resource -> TypeA
> 3. /some/res/path is a resource whose sling:resourceSuperType 2 levels up is 
> "/apps/some/type"
> 4. In a JSP, we use code like:
> TypeA typeA = resource.adaptTo(TypeA)
> if (!typeA.isTypeB()){
> //FAIL: typeA.isTypeB() is actually true
> }
> Note that:
> ResourceUtil.isA(resource, "some/type") == true
> but
> ResourceUtil.isA(typeA.resource, "some/type") == false
> (unless user is admin)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Issue Comment Deleted] (SLING-2708) ResourceUtil.isA() fails for adapted Resources unless user is admin

2013-02-08 Thread Julian Sedding (JIRA)

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

Julian Sedding updated SLING-2708:
--

Comment: was deleted

(was: I just realized there was a bug in my previous patch. A new version of 
the patch is attached, which should fix the issue.)

> ResourceUtil.isA() fails for adapted Resources unless user is admin
> ---
>
> Key: SLING-2708
> URL: https://issues.apache.org/jira/browse/SLING-2708
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Reporter: Tyson Norris
>
> Summary - adapting a Resource to a specified type, loses the ability to test 
> the Resources super types using ResourceUtil.isA(), UNLESS user is admin
> 1. TypeA is defined as:
> class TypeA {
> private Resource res;
> public boolean isTypeB(){
> return ResourceUtil.isA(res, "some/type");
> }
> }
> 2. TypeA adapter is an AdapterFactory to adapt Resource -> TypeA
> 3. /some/res/path is a resource whose sling:resourceSuperType 2 levels up is 
> "/apps/some/type"
> 4. In a JSP, we use code like:
> TypeA typeA = resource.adaptTo(TypeA)
> if (!typeA.isTypeB()){
> //FAIL: typeA.isTypeB() is actually true
> }
> Note that:
> ResourceUtil.isA(resource, "some/type") == true
> but
> ResourceUtil.isA(typeA.resource, "some/type") == false
> (unless user is admin)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Updated] (SLING-2708) ResourceUtil.isA() fails for adapted Resources unless user is admin

2013-02-08 Thread Julian Sedding (JIRA)

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

Julian Sedding updated SLING-2708:
--

Attachment: SLING-2708-using-adaptTo.patch

I just realized there was a bug in my previous patch. A new version of the 
patch is attached, which should fix the issue. 

> ResourceUtil.isA() fails for adapted Resources unless user is admin
> ---
>
> Key: SLING-2708
> URL: https://issues.apache.org/jira/browse/SLING-2708
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Reporter: Tyson Norris
> Attachments: SLING-2708-using-adaptTo.patch
>
>
> Summary - adapting a Resource to a specified type, loses the ability to test 
> the Resources super types using ResourceUtil.isA(), UNLESS user is admin
> 1. TypeA is defined as:
> class TypeA {
> private Resource res;
> public boolean isTypeB(){
> return ResourceUtil.isA(res, "some/type");
> }
> }
> 2. TypeA adapter is an AdapterFactory to adapt Resource -> TypeA
> 3. /some/res/path is a resource whose sling:resourceSuperType 2 levels up is 
> "/apps/some/type"
> 4. In a JSP, we use code like:
> TypeA typeA = resource.adaptTo(TypeA)
> if (!typeA.isTypeB()){
> //FAIL: typeA.isTypeB() is actually true
> }
> Note that:
> ResourceUtil.isA(resource, "some/type") == true
> but
> ResourceUtil.isA(typeA.resource, "some/type") == false
> (unless user is admin)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Assigned] (SLING-2708) ResourceUtil.isA() fails for adapted Resources unless user is admin

2013-02-08 Thread Carsten Ziegeler (JIRA)

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

Carsten Ziegeler reassigned SLING-2708:
---

Assignee: Carsten Ziegeler

> ResourceUtil.isA() fails for adapted Resources unless user is admin
> ---
>
> Key: SLING-2708
> URL: https://issues.apache.org/jira/browse/SLING-2708
> Project: Sling
>  Issue Type: Bug
>  Components: ResourceResolver
>Reporter: Tyson Norris
>Assignee: Carsten Ziegeler
> Attachments: SLING-2708-using-adaptTo.patch
>
>
> Summary - adapting a Resource to a specified type, loses the ability to test 
> the Resources super types using ResourceUtil.isA(), UNLESS user is admin
> 1. TypeA is defined as:
> class TypeA {
> private Resource res;
> public boolean isTypeB(){
> return ResourceUtil.isA(res, "some/type");
> }
> }
> 2. TypeA adapter is an AdapterFactory to adapt Resource -> TypeA
> 3. /some/res/path is a resource whose sling:resourceSuperType 2 levels up is 
> "/apps/some/type"
> 4. In a JSP, we use code like:
> TypeA typeA = resource.adaptTo(TypeA)
> if (!typeA.isTypeB()){
> //FAIL: typeA.isTypeB() is actually true
> }
> Note that:
> ResourceUtil.isA(resource, "some/type") == true
> but
> ResourceUtil.isA(typeA.resource, "some/type") == false
> (unless user is admin)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira