Re: [VOTE] Release Apache Sling URL Rewriter 0.0.2

2015-02-25 Thread Robert Munteanu
On Tue, 2015-02-24 at 15:36 +0100, Oliver Lietz wrote:
 Please vote to approve this release:
 
   [ ] +1 Approve the release
   [ ]  0 Don't care
   [ ] -1 Don't release, because ...

+1

Robert



Re: [VOTE] Release Apache Sling Service User Mapper 1.1.0

2015-02-25 Thread Robert Munteanu
On Wed, 2015-02-25 at 09:53 +, Antonio Sanso wrote:
 Please vote to approve this release:
 
   [ ] +1 Approve the release
   [ ]  0 Don't care
   [ ] -1 Don't release, because ...

+1

Robert



Re: [VOTE] Release Apache Sling IDE Tooling 1.0.6

2015-02-25 Thread Robert Munteanu
+1

Robert

On Mon, Feb 23, 2015 at 6:18 PM, Robert Munteanu romb...@apache.org wrote:
 Hi,

 We solved 20 issues in this release:
 https://issues.apache.org/jira/browse/SLING/fixforversion/12328821

 There are still some outstanding issues:
 https://issues.apache.org/jira/browse/SLING/component/12320908

 The release candidate has been uploaded at
 https://dist.apache.org/repos/dist/dev/sling, The release artifact is
 the source bundle - sling-ide-tooling-1.0.6.zip - which can be used to
 build the project using

 mvn clean package

 The resulting binaries can be installed into an Eclipse instance from
 the update site which is found at p2update/target/repository after
 building the project.

 For convenience, a pre-built update site -
 org.apache.sling.ide.p2update- 1.0.6.zip - has also been uploaded.

 Please vote to approve this release:

   [ ] +1 Approve the release
   [ ]  0 Don't care
   [ ] -1 Don't release, because ...

 This majority vote is open for at least 72 hours

 Thanks,

 Robert


[jira] [Comment Edited] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336551#comment-14336551
 ] 

Konrad Windszus edited comment on SLING-4454 at 2/25/15 2:38 PM:
-

Since a {{ConcurrentSkipListMap}} is used in the {{UseRuntimeExtension}} with a 
{{ServiceReference}} as key, the natural ordering of a {{ServiceReference}} is 
followed: 
https://osgi.org/javadoc/r4v43/core/org/osgi/framework/ServiceReference.html#compareTo%28java.lang.Object%29.
That means lower service rankings are checked first - the javadoc in the 
UseProvider is correct, for all implementations the documentation is wrong.


was (Author: kwin):
Since a {{ConcurrentSkipListMap}} is used in the {{UseRuntimeExtension}} with 
{{ServiceReference}}s as keys, the natural ordering of a {{ServiceReference}} 
is followed: 
https://osgi.org/javadoc/r4v43/core/org/osgi/framework/ServiceReference.html#compareTo%28java.lang.Object%29.
That means lower service rankings are checked first - the javadoc in the 
UseProvider is correct, for all implementations the documentation is wrong.

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus

 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336551#comment-14336551
 ] 

Konrad Windszus commented on SLING-4454:


Since a {{ConcurrentSkipListMap}} is used in the {{UseRuntimeExtension}} with 
{{ServiceReference}}s as keys, the natural ordering of a {{ServiceReference}} 
is followed: 
https://osgi.org/javadoc/r4v43/core/org/osgi/framework/ServiceReference.html#compareTo%28java.lang.Object%29.
That means lower service rankings are checked first - the javadoc in the 
UseProvider is correct, for all implementations the documentation is wrong.

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus

 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336562#comment-14336562
 ] 

Konrad Windszus commented on SLING-4454:


Fixed javadoc and description of service properties in r1662230.

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-4447) Improve JavaUseProvider to not fall back to a simple Pojo instanciation in case a Java class with @Model annotation cannot be instanciated

2015-02-25 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336570#comment-14336570
 ] 

Konrad Windszus commented on SLING-4447:


I just figured out that the UseProvider must have a lower service ranking than 
the JavaUseProvider (to be queried first). 

 Improve JavaUseProvider to not fall back to a simple Pojo instanciation in 
 case a Java class with @Model annotation cannot be instanciated
 --

 Key: SLING-4447
 URL: https://issues.apache.org/jira/browse/SLING-4447
 Project: Sling
  Issue Type: Improvement
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Attachments: SLING-4447-v01.patch


 Currently in case a Java class is a Sling Model (i.e. has the Model 
 annotation) and cannot be instanciated (e.g. required injections not 
 possible) Sightly falls back to instanciate those as simple Pojos.
 This is never good, since a lot of NullPointerException happen then, because 
 all injections have not been performed then.
 Therefore in the following code should be used instead 
 {code}
 if (modelFactory.isModelClass(resource, cls)) {
   if (modelFactory.canCreateFromAdaptable(resource, cls)) {
 obj = modelFactory.createModel(resource, cls);
   } else if (modelFactory.canCreateFromAdaptable(request, cls)) {
 obj = modelFactory.createModel(request, cls);
   } else {
 throw new IllegalStateException(Could not adapt the given Sling Model 
 from neither resource nor request:  + cls);
   }
 }
 {code}
 That way, exceptions would be propagated in case a Sling model cannot be 
 instanciated and developers more easily see why the Sling Model does not work 
 (instead of running into NullPointerExceptions in their model because it was 
 instanciated as simple 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [VOTE] Release Apache Sling Service User Mapper 1.1.0

2015-02-25 Thread Carsten Ziegeler
+1

Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Marius Petria





On 2/25/15, 5:31 PM, Antonio Sanso asa...@adobe.com wrote:

Question on the implementation though.
What if the sub service name is not set for a mapping?


In my implementation if the subServiceName is null, then it is registered 
as empty string and can be bound as target=(subServiceName=).

Marius


[jira] [Resolved] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Konrad Windszus (JIRA)

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

Konrad Windszus resolved SLING-4454.

   Resolution: Fixed
Fix Version/s: Scripting Sightly Engine 1.0.0
 Assignee: Konrad Windszus

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Antonio Sanso
hi Marius
On Feb 25, 2015, at 12:17 PM, Marius Petria mpet...@adobe.com wrote:

 Hi Antonio,
 
 
 
 
 On 2/25/15, 12:36 PM, Antonio Sanso asa...@adobe.com wrote:
 
 Usually the person that set’s the OSGi configuration (aka the 
 administrator) is different than the one that 
 codes a bundle (aka the administrator). This can also happen in two 
 distinct phases of the project.
 I have the impression that this feature mixes the concerns…
 
 
 I think that is a perfect example why we should have such a dependency 
 mechanism, as the the phases are executed by different personas. As a 
 developer I would like to specify that my component should only be started 
 when the administrator has configured a subServiceName and that is ready 
 to be used.
 
 Using the Sling initial content in the same bundle as the component is 
 not always possible, for example if the component is 3rd party bundle. 
 Also I am not sure there is a guarantee to always work. Even more, the 
 solution relies on the fact the service user is configured by the 
 “developer” but as you said this can be configured by an “administrator. 
 As a side note I think we should even allow a component to be able to 
 restart when a mapping is changed as its security context is changed.

re-thinking again I finally agree with you.
Question on the implementation though.
What if the sub service name is not set for a mapping?

regards

antonio

 
 Marius
 
 
 



Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Carsten Ziegeler
Am 25.02.15 um 03:18 schrieb Antonio Sanso:
 hi Oliver
 On Feb 25, 2015, at 12:09 PM, Oliver Lietz apa...@oliverlietz.de wrote:
 
 On Wednesday 25 February 2015 10:50:36 Antonio Sanso wrote:
 hi *

 On Feb 24, 2015, at 6:00 PM, Oliver Lietz
 apa...@oliverlietz.demailto:apa...@oliverlietz.de wrote:

 On Friday 20 February 2015 17:53:02 Marius Petria wrote:
 Hi,

 hi Marius,

 I discovered an issue related to service users. Due to the indeterminism
 of OSGI a consumer of ServiceUserMapper cannot be sure that
 getServiceUserID will find a registered mapping even if that mapping has
 been configured. For example if a component starts roughly at the same
 time as the mapping is installed it can happen that the calls the
 component makes to loginService to fail. More concretely that can happen
 for example if one needs a session in an activate method to register jcr
 event listener, or to read some configuration properties from the
 repository.

 In order to make this behavior more predictable I created an issue [1]
 proposing to always register an osgi service (I called it
 ServiceUserMapping) right after a mapping is installed, such that consumer
 components can reference it and wait for the mapping to be available. I
 also worked out an implementation in [2].

 First, I would like to ask you if you think the problem is valid and if
 the approach is correct?
 Second, it will be really helpful if you can also comment on the issue
 around the provided implementation.

 I hadn't the time to look into the implementation but I have this use case
 right now. A service user mapping and a bundle with a service which relies
 on this mapping are deployed in a (AEM) package - service fails because of
 mapping not yet available when service gets activated. A ServiceUserMapping
 service as reference would solve this problem. So +1 for this approach and
 the name ServiceUserMapping.

 a valid alternative that will end up to a NOOP for SLING-4312 is to use
 Sling initial content in the same bundle rather than a package.

 hi Antonio,

 we have a dedicated bundle (with Sling-Initial-Content) for configurations 
 and 
 IMHO service user mappings (as well as other global configurations) should 
 be 
 kept at a single place and not spread around in different application 
 bundles.
 
 in general I do agree with you. This can be an exception though (hence why we 
 introduced the concept of mapping amendments aka 
 https://issues.apache.org/jira/browse/SLING-3578)
 

I don't think that initial content solves the problem. What happens if
an administrator of the system reconfigures the mapping, removes it,
changes it?
In that case the service is still active but does not work - at least
not for the time of reconfiguration.
OSGi configurations are dynamic and we should accept this fact.

Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Marius Petria





On 2/25/15, 6:28 PM, Antonio Sanso asa...@adobe.com wrote:


On 2/25/15, 5:31 PM, Antonio Sanso asa...@adobe.com wrote:
Question on the implementation though.
What if the sub service name is not set for a mapping?
In my implementation if the subServiceName is null, then it is 
registered 
as empty string and can be bound as target=(subServiceName=)”.

so which is the Service User that is supposed to be bound by @Reference 
in this case?

The intent of target=(subServiceName=)” (using an empty subServiceName) 
is for the component to start when there is a registered mapping with no 
subservice defined. So, if com.mybundle=serviceUser is registered then the 
@Reference will be bound to an object representing that mapping.

Marius


[jira] [Commented] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Radu Cotescu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336767#comment-14336767
 ] 

Radu Cotescu commented on SLING-4454:
-

[~kwin], the JavaDoc from the providers was correct - the higher the service 
ranking the sooner a provider will be called in the chain. So while the 
providers are indeed ordered in their ascending natural order, they are 
actually queried from highest to lowest. See \[0\] for more details.

\[0\] - 
https://github.com/apache/sling/blob/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/UseRuntimeExtension.java#L85

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-3374) Overlay sendRedirect to set relative Location header

2015-02-25 Thread Nitin Seth (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336764#comment-14336764
 ] 

Nitin Seth commented on SLING-3374:
---

One of my customer reported the issue in AEM 6.0

Steps to reproduce the issue:

Install a vanilla 5.4 instance.
Add a page to the geometrixx site.
Go to advanced properties of the new page and add a redirect to the triangle 
product page
Open new page and observe Location Response Header -- note that it has no 
scheme/server (a desired trait)

*Location   /content/geometrixx.html*

Install a vanilla 6.0 instance
Add a page to the geometrixx site
Go to the advanced properties of the new page and add a redirect to the 
triangle product page
Open the new page and observe Location Response Header -- note that it has the 
scheme and server (not desirable)

*Location   http://localhost:5665/content/geometrixx.html*

*Note:* Issue is also reproducible at 6.0 SP2.

Would this be address in next AEM release (i,e AEM 6.1)?


 Overlay sendRedirect to set relative Location header
 

 Key: SLING-3374
 URL: https://issues.apache.org/jira/browse/SLING-3374
 Project: Sling
  Issue Type: Bug
Reporter: Laurie byrum

 Recently, Location headers returned from redirects started being absolute 
 instead of relative. 
 We should try to decorate this in sling.
 Can we replace the sendRedirect with a set-header set-status combination
 in sling?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Jenkins build is still unstable: sling-trunk-1.8 #790

2015-02-25 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.8/changes



[jira] [Comment Edited] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Radu Cotescu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336767#comment-14336767
 ] 

Radu Cotescu edited comment on SLING-4454 at 2/25/15 5:13 PM:
--

[~kwin], the JavaDoc from the providers was correct - the higher the service 
ranking the sooner a provider will be called in the chain. So while the 
providers are indeed ordered in their ascending natural order, they are 
actually queried from highest to lowest. See \[0\] for more details.

I will revert  r1662230 and correct the documentation where needed.

\[0\] - 
https://github.com/apache/sling/blob/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/UseRuntimeExtension.java#L85


was (Author: radu.cotescu):
[~kwin], the JavaDoc from the providers was correct - the higher the service 
ranking the sooner a provider will be called in the chain. So while the 
providers are indeed ordered in their ascending natural order, they are 
actually queried from highest to lowest. See \[0\] for more details.

\[0\] - 
https://github.com/apache/sling/blob/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/UseRuntimeExtension.java#L85

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Radu Cotescu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336767#comment-14336767
 ] 

Radu Cotescu edited comment on SLING-4454 at 2/25/15 5:14 PM:
--

[~kwin], the JavaDoc from the providers was correct - the higher the service 
ranking the sooner a provider will be called in the chain. So while the 
providers are indeed ordered in their ascending natural order in the collection 
that we use for storing them, they are actually queried from highest to lowest. 
See \[0\] for more details.

I will revert  r1662230 and correct the documentation where needed.

\[0\] - 
https://github.com/apache/sling/blob/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/UseRuntimeExtension.java#L85


was (Author: radu.cotescu):
[~kwin], the JavaDoc from the providers was correct - the higher the service 
ranking the sooner a provider will be called in the chain. So while the 
providers are indeed ordered in their ascending natural order, they are 
actually queried from highest to lowest. See \[0\] for more details.

I will revert  r1662230 and correct the documentation where needed.

\[0\] - 
https://github.com/apache/sling/blob/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/UseRuntimeExtension.java#L85

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Antonio Sanso

On Feb 25, 2015, at 5:07 PM, Marius Petria mpet...@adobe.com wrote:

 
 
 
 
 
 On 2/25/15, 5:31 PM, Antonio Sanso asa...@adobe.com wrote:
 
 Question on the implementation though.
 What if the sub service name is not set for a mapping?
 
 
 In my implementation if the subServiceName is null, then it is registered 
 as empty string and can be bound as target=(subServiceName=)”.

so which is the Service User that is supposed to be bound by @Reference in this 
case?

regards

antonio

 
 Marius



[jira] [Commented] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Radu Cotescu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336813#comment-14336813
 ] 

Radu Cotescu commented on SLING-4454:
-

No problem, I'm on it. ;)

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Radu Cotescu
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Issue Comment Deleted] (SLING-4447) Improve JavaUseProvider to not fall back to a simple Pojo instanciation in case a Java class with @Model annotation cannot be instanciated

2015-02-25 Thread Konrad Windszus (JIRA)

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

Konrad Windszus updated SLING-4447:
---
Comment: was deleted

(was: I just figured out that the UseProvider must have a lower service ranking 
than the JavaUseProvider (to be queried first). )

 Improve JavaUseProvider to not fall back to a simple Pojo instanciation in 
 case a Java class with @Model annotation cannot be instanciated
 --

 Key: SLING-4447
 URL: https://issues.apache.org/jira/browse/SLING-4447
 Project: Sling
  Issue Type: Improvement
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Attachments: SLING-4447-v01.patch


 Currently in case a Java class is a Sling Model (i.e. has the Model 
 annotation) and cannot be instanciated (e.g. required injections not 
 possible) Sightly falls back to instanciate those as simple Pojos.
 This is never good, since a lot of NullPointerException happen then, because 
 all injections have not been performed then.
 Therefore in the following code should be used instead 
 {code}
 if (modelFactory.isModelClass(resource, cls)) {
   if (modelFactory.canCreateFromAdaptable(resource, cls)) {
 obj = modelFactory.createModel(resource, cls);
   } else if (modelFactory.canCreateFromAdaptable(request, cls)) {
 obj = modelFactory.createModel(request, cls);
   } else {
 throw new IllegalStateException(Could not adapt the given Sling Model 
 from neither resource nor request:  + cls);
   }
 }
 {code}
 That way, exceptions would be propagated in case a Sling model cannot be 
 instanciated and developers more easily see why the Sling Model does not work 
 (instead of running into NullPointerExceptions in their model because it was 
 instanciated as simple 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Carsten Ziegeler
Am 25.02.15 um 08:28 schrieb Antonio Sanso:
 
 On Feb 25, 2015, at 5:07 PM, Marius Petria mpet...@adobe.com wrote:
 





 On 2/25/15, 5:31 PM, Antonio Sanso asa...@adobe.com wrote:

 Question on the implementation though.
 What if the sub service name is not set for a mapping?


 In my implementation if the subServiceName is null, then it is registered 
 as empty string and can be bound as target=(subServiceName=)”.
 
 so which is the Service User that is supposed to be bound by @Reference in 
 this case?
 
If the sub service name is not set, the service reg property is not set,
the
target is then target=(!(subServiceName=*))

Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org


Jenkins build is back to stable : sling-trunk-1.6 #3110

2015-02-25 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.6/3110/changes



[jira] [Reopened] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Konrad Windszus (JIRA)

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

Konrad Windszus reopened SLING-4454:

  Assignee: Radu Cotescu  (was: Konrad Windszus)

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Radu Cotescu
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Konrad Windszus (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336809#comment-14336809
 ] 

Konrad Windszus commented on SLING-4454:


[~radu.cotescu] Sorry and thanks for spotting this. I should have looked more 
carefully. Can you fix the javadoc then in 
org.apache.sling.scripting.sightly.use.UseProvider?

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (SLING-4447) Improve JavaUseProvider to not fall back to a simple Pojo instanciation in case a Java class with @Model annotation cannot be instanciated

2015-02-25 Thread Radu Cotescu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336917#comment-14336917
 ] 

Radu Cotescu edited comment on SLING-4447 at 2/25/15 6:32 PM:
--

I briefly reviewed the patch. Here are my comments:

* make the provider as lazy as possible: first check if the class exists by 
querying the DCLM, then do all the checks
* be consistent when errors occur: return a {{ProviderOutcome}} initialised 
with a failure cause  - {{ProviderOutcome#failure(Throwable cause)}}
* use a provider lower than 100 and higher than 90 - we want this 
{{UseProvider}} to kick in before the {{JavaUseProvider}} but after the 
{{RenderUnitProvider}}, for performance reasons

To overcome [~jsedding]'s concern we should mark Sightly as an optional package 
import.


was (Author: radu.cotescu):
I briefly reviewed the patch. Here are my comments:

* make the provider as lazy as possible: first check if the class exists by 
querying the DCLM, then do all the checks
* be consistent when errors occur: return a {{ProviderOutcome}} initialised 
with a failure cause  - {{ProviderOutcome#failure(Throwable cause)}}
* use a provider lower than 100 and higher than 90 - we want this 
{{UseProvider}} to kick in before the {{JavaUseProvider}} but after the 
{{RenderUnitProvider}}, for performance reasons

 Improve JavaUseProvider to not fall back to a simple Pojo instanciation in 
 case a Java class with @Model annotation cannot be instanciated
 --

 Key: SLING-4447
 URL: https://issues.apache.org/jira/browse/SLING-4447
 Project: Sling
  Issue Type: Improvement
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Attachments: SLING-4447-v01.patch


 Currently in case a Java class is a Sling Model (i.e. has the Model 
 annotation) and cannot be instanciated (e.g. required injections not 
 possible) Sightly falls back to instanciate those as simple Pojos.
 This is never good, since a lot of NullPointerException happen then, because 
 all injections have not been performed then.
 Therefore in the following code should be used instead 
 {code}
 if (modelFactory.isModelClass(resource, cls)) {
   if (modelFactory.canCreateFromAdaptable(resource, cls)) {
 obj = modelFactory.createModel(resource, cls);
   } else if (modelFactory.canCreateFromAdaptable(request, cls)) {
 obj = modelFactory.createModel(request, cls);
   } else {
 throw new IllegalStateException(Could not adapt the given Sling Model 
 from neither resource nor request:  + cls);
   }
 }
 {code}
 That way, exceptions would be propagated in case a Sling model cannot be 
 instanciated and developers more easily see why the Sling Model does not work 
 (instead of running into NullPointerExceptions in their model because it was 
 instanciated as simple 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Radu Cotescu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4454?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336898#comment-14336898
 ] 

Radu Cotescu commented on SLING-4454:
-

Fixed in 
[r1662289|https://svn.apache.org/viewvc?view=revisionrevision=1662289].

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Radu Cotescu
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-4436) org.apache.sling.scripting.sightly does not compile

2015-02-25 Thread Radu Cotescu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336955#comment-14336955
 ] 

Radu Cotescu commented on SLING-4436:
-

[~kwin], how should we move on with this issue? I can't reproduce it no matter 
how I approach this.

 org.apache.sling.scripting.sightly does not compile
 ---

 Key: SLING-4436
 URL: https://issues.apache.org/jira/browse/SLING-4436
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus

 The current 1.0.0-SNAPSHOT version of the 
 {{org.apache.sling.scripting.sightly}} Maven module doesn't compile, as it 
 can't find the {{org.eclipse.core:resources:jar:3.4.0}} transitive dependency 
 included in {{org.apache.sling.commons.compiler:2.0.0}}.
 In order to reproduce, clean your local Maven repository and try to compile 
 the aforementioned module.
 The fix would be to increase that dependency to 
 {{org.apache.sling.commons.compiler:2.2.0}}. Compare with SLING-4379.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (SLING-4447) Improve JavaUseProvider to not fall back to a simple Pojo instanciation in case a Java class with @Model annotation cannot be instanciated

2015-02-25 Thread Radu Cotescu (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336917#comment-14336917
 ] 

Radu Cotescu commented on SLING-4447:
-

I briefly reviewed the patch. Here are my comments:

* make the provider as lazy as possible: first check if the class exists by 
querying the DCLM, then do all the checks
* be consistent when errors occur: return a {{ProviderOutcome}} initialised 
with a failure cause  - {{ProviderOutcome#failure(Throwable cause)}}
* use a provider lower than 100 and higher than 90 - we want this 
{{UseProvider}} to kick in before the {{JavaUseProvider}} but after the 
{{RenderUnitProvider}}, for performance reasons

 Improve JavaUseProvider to not fall back to a simple Pojo instanciation in 
 case a Java class with @Model annotation cannot be instanciated
 --

 Key: SLING-4447
 URL: https://issues.apache.org/jira/browse/SLING-4447
 Project: Sling
  Issue Type: Improvement
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Konrad Windszus
 Attachments: SLING-4447-v01.patch


 Currently in case a Java class is a Sling Model (i.e. has the Model 
 annotation) and cannot be instanciated (e.g. required injections not 
 possible) Sightly falls back to instanciate those as simple Pojos.
 This is never good, since a lot of NullPointerException happen then, because 
 all injections have not been performed then.
 Therefore in the following code should be used instead 
 {code}
 if (modelFactory.isModelClass(resource, cls)) {
   if (modelFactory.canCreateFromAdaptable(resource, cls)) {
 obj = modelFactory.createModel(resource, cls);
   } else if (modelFactory.canCreateFromAdaptable(request, cls)) {
 obj = modelFactory.createModel(request, cls);
   } else {
 throw new IllegalStateException(Could not adapt the given Sling Model 
 from neither resource nor request:  + cls);
   }
 }
 {code}
 That way, exceptions would be propagated in case a Sling model cannot be 
 instanciated and developers more easily see why the Sling Model does not work 
 (instead of running into NullPointerExceptions in their model because it was 
 instanciated as simple 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

2015-02-25 Thread Radu Cotescu (JIRA)

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

Radu Cotescu resolved SLING-4454.
-
Resolution: Fixed

 Contradicting information about service.ranking in UseProvider and 
 JavaUseProvider
 --

 Key: SLING-4454
 URL: https://issues.apache.org/jira/browse/SLING-4454
 Project: Sling
  Issue Type: Bug
  Components: Scripting
Affects Versions: Scripting Sightly Engine 1.0.0
Reporter: Konrad Windszus
Assignee: Radu Cotescu
 Fix For: Scripting Sightly Engine 1.0.0


 The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the 
 javadoc:
 {code}
 {@code UseProvider} services are ranked according to the OSGi service
  * registration propertiy {@code service.ranking} which is an integer value.
  * {@code UseProvider} servies with lower ranking values are tried before
  * services with higher ranking values. The default value for the ranking if 
 the
  * property is missing is zero.
 {code}
 All implementations like 
 {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}}
  and sibling classes state
 {code}
 @Properties({
 @Property(
 name = Constants.SERVICE_RANKING,
 label = Service Ranking,
 description = The Service Ranking value acts as the priority 
 with which this Use Provider is queried to return an  +
 Use-object. A higher value represents a higher 
 priority.,
 intValue = 90,
 propertyPrivate = false
 )
 })
 {code}
 So what is true here? Are UseProvider with lower rankings queried first? What 
 happens if they return a result.
 Please clarify the javadoc here.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Jenkins build is still unstable: sling-trunk-1.8 #791

2015-02-25 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.8/changes



[jira] [Comment Edited] (SLING-3374) Overlay sendRedirect to set relative Location header

2015-02-25 Thread Justin Edelson (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336764#comment-14336764
 ] 

Justin Edelson edited comment on SLING-3374 at 2/25/15 7:10 PM:


One of my customer reported the issue in AEM 6.0

Steps to reproduce the issue:

Install a vanilla 5.4 instance.
Add a page to the geometrixx site.
Go to advanced properties of the new page and add a redirect to the triangle 
product page
Open new page and observe Location Response Header -- note that it has no 
scheme/server (a desired trait)

*Location   /content/geometrixx.html*

Install a vanilla 6.0 instance
Add a page to the geometrixx site
Go to the advanced properties of the new page and add a redirect to the 
triangle product page
Open the new page and observe Location Response Header -- note that it has the 
scheme and server (not desirable)

*Location   http://localhost:5665/content/geometrixx.html*

*Note:* Issue is also reproducible at 6.0 SP2.



was (Author: niseth):
One of my customer reported the issue in AEM 6.0

Steps to reproduce the issue:

Install a vanilla 5.4 instance.
Add a page to the geometrixx site.
Go to advanced properties of the new page and add a redirect to the triangle 
product page
Open new page and observe Location Response Header -- note that it has no 
scheme/server (a desired trait)

*Location   /content/geometrixx.html*

Install a vanilla 6.0 instance
Add a page to the geometrixx site
Go to the advanced properties of the new page and add a redirect to the 
triangle product page
Open the new page and observe Location Response Header -- note that it has the 
scheme and server (not desirable)

*Location   http://localhost:5665/content/geometrixx.html*

*Note:* Issue is also reproducible at 6.0 SP2.

Would this be address in next AEM release (i,e AEM 6.1)?


 Overlay sendRedirect to set relative Location header
 

 Key: SLING-3374
 URL: https://issues.apache.org/jira/browse/SLING-3374
 Project: Sling
  Issue Type: Bug
Reporter: Laurie byrum

 Recently, Location headers returned from redirects started being absolute 
 instead of relative. 
 We should try to decorate this in sling.
 Can we replace the sendRedirect with a set-header set-status combination
 in sling?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Antonio Sanso
hi *

On Feb 20, 2015, at 6:53 PM, Marius Petria mpet...@adobe.com wrote:

 Hi,
 
 I discovered an issue related to service users. Due to the indeterminism 
 of OSGI a consumer of ServiceUserMapper cannot be sure that 
 getServiceUserID will find a registered mapping even if that mapping has 
 been configured. For example if a component starts roughly at the same 
 time as the mapping is installed it can happen that the calls the 
 component makes to loginService to fail. More concretely that can happen 
 for example if one needs a session in an activate method to register jcr 
 event listener, or to read some configuration properties from the 
 repository.

I do acknoweledge the issue , said that..

 In order to make this behavior more predictable I created an issue [1] 
 proposing to always register an osgi service (I called it 
 ServiceUserMapping) right after a mapping is installed, such that consumer 
 components can reference it and wait for the mapping to be available. I 
 also worked out an implementation in [2].
 
 First, I would like to ask you if you think the problem is valid and if 
 the approach is correct?

… I agree with what Felix’s said in [1].
Usually the person that set’s the OSGi configuration (aka the administrator) is 
different than the one that 
codes a bundle (aka the administrator). This can also happen in two distinct 
phases of the project.
I have the impression that this feature mixes the concerns…

regards

antonio 

 Second, it will be really helpful if you can also comment on the issue 
 around the provided implementation.
 
 Marius
 
 [1] https://issues.apache.org/jira/browse/SLING-4312
 [2] https://github.com/mpetria/sling/compare/mpetria:trunk...dev-SLING-4312
 



Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Antonio Sanso
hi *

On Feb 24, 2015, at 6:00 PM, Oliver Lietz 
apa...@oliverlietz.demailto:apa...@oliverlietz.de wrote:

On Friday 20 February 2015 17:53:02 Marius Petria wrote:
Hi,

hi Marius,

I discovered an issue related to service users. Due to the indeterminism
of OSGI a consumer of ServiceUserMapper cannot be sure that
getServiceUserID will find a registered mapping even if that mapping has
been configured. For example if a component starts roughly at the same
time as the mapping is installed it can happen that the calls the
component makes to loginService to fail. More concretely that can happen
for example if one needs a session in an activate method to register jcr
event listener, or to read some configuration properties from the
repository.

In order to make this behavior more predictable I created an issue [1]
proposing to always register an osgi service (I called it
ServiceUserMapping) right after a mapping is installed, such that consumer
components can reference it and wait for the mapping to be available. I
also worked out an implementation in [2].

First, I would like to ask you if you think the problem is valid and if
the approach is correct?
Second, it will be really helpful if you can also comment on the issue
around the provided implementation.

I hadn't the time to look into the implementation but I have this use case
right now. A service user mapping and a bundle with a service which relies on
this mapping are deployed in a (AEM) package - service fails because of
mapping not yet available when service gets activated. A ServiceUserMapping
service as reference would solve this problem. So +1 for this approach and the
name ServiceUserMapping.

a valid alternative that will end up to a NOOP for SLING-4312 is to use Sling 
initial content in the same bundle rather than a package.

e.g. in your pom

instructions
Sling-Initial-Content
SLING-INF/content;path:=/libs/system/config;overwrite:=true;
/Sling-Initial-Content
/instructions

I did use this approach and works (for the record it works also in AEM)

regards

antonio



Regards,
O.

Marius

[1] https://issues.apache.org/jira/browse/SLING-4312
[2] https://github.com/mpetria/sling/compare/mpetria:trunk...dev-SLING-4312



[jira] [Updated] (SLING-4312) Register an osgi service for each available service user

2015-02-25 Thread Antonio Sanso (JIRA)

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

Antonio Sanso updated SLING-4312:
-
Fix Version/s: (was: Service User Mapper 1.1.0)

 Register an osgi service for each available service user 
 -

 Key: SLING-4312
 URL: https://issues.apache.org/jira/browse/SLING-4312
 Project: Sling
  Issue Type: Improvement
  Components: Service User Mapper
Reporter: Marius Petria
 Attachments: SLING-4312.diff


 In order to only activate osgi components when a service user mapping is 
 available it would be useful to have an osgi service registered for a service 
 user. A component can reference the registered service name and only start 
 when that becomes available.
 {code}
 @Reference(target=(name=serviceName))
 ServiceUserExists userExists;
 {code}
  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[VOTE] Release Apache Sling Service User Mapper 1.1.0

2015-02-25 Thread Antonio Sanso
Hi,

We solved 1 issue in this release:
https://issues.apache.org/jira/browse/SLING-3854

Staging repository:
https://repository.apache.org/content/repositories/orgapachesling-1196

You can use this UNIX script to download the release and verify the signatures:
http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh

Usage:
sh check_staged_release.sh 1196 /tmp/sling-staging

Please vote to approve this release:

  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...

This majority vote is open for at least 72 hours.

Re: [VOTE] Release Apache Sling Service User Mapper 1.1.0

2015-02-25 Thread Antonio Sanso
+1

regards

antonio

On Feb 25, 2015, at 10:53 AM, Antonio Sanso asa...@adobe.com wrote:

 Hi,
 
 We solved 1 issue in this release:
 https://issues.apache.org/jira/browse/SLING-3854
 
 Staging repository:
 https://repository.apache.org/content/repositories/orgapachesling-1196
 
 You can use this UNIX script to download the release and verify the 
 signatures:
 http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh
 
 Usage:
 sh check_staged_release.sh 1196 /tmp/sling-staging
 
 Please vote to approve this release:
 
  [ ] +1 Approve the release
  [ ]  0 Don't care
  [ ] -1 Don't release, because ...
 
 This majority vote is open for at least 72 hours.



[jira] [Updated] (SLING-4312) Register an osgi service for each available service user

2015-02-25 Thread Antonio Sanso (JIRA)

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

Antonio Sanso updated SLING-4312:
-
Fix Version/s: Service User Mapper 1.1.2

 Register an osgi service for each available service user 
 -

 Key: SLING-4312
 URL: https://issues.apache.org/jira/browse/SLING-4312
 Project: Sling
  Issue Type: Improvement
  Components: Service User Mapper
Reporter: Marius Petria
 Fix For: Service User Mapper 1.1.2

 Attachments: SLING-4312.diff


 In order to only activate osgi components when a service user mapping is 
 available it would be useful to have an osgi service registered for a service 
 user. A component can reference the registered service name and only start 
 when that becomes available.
 {code}
 @Reference(target=(name=serviceName))
 ServiceUserExists userExists;
 {code}
  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jira] [Commented] (SLING-3854) Add configuration option to restrict service user mapper to system users

2015-02-25 Thread Antonio Sanso
thanks a lot Marius,

I will proceed with the release so

regards

antonio

On Feb 24, 2015, at 7:20 PM, Marius Petria mpet...@adobe.com wrote:

 Hi Antonio,
 
 For SLING-4312 I am waiting for Felix’s answer as he raised some concerns 
 about the approach. Currently I have nothing in trunk as I reverted my 
 stuff due to a compilation error, so I think you can go ahead with the 
 release I can do another one once we are clear on SLING-4312.
 
 
 Marius
 
 
 
 On 2/24/15, 6:23 PM, Antonio Sanso asa...@adobe.com wrote:
 
 thanks Tomek,
 
 AFAIU we have also  https://issues.apache.org/jira/browse/SLING-4312 in 
 to the game.
 This approach is currently under discussion in the dev list.
 @Marius what is your take here.  Are we ready for a release?
 
 regards
 
 antonio
 
 On Feb 24, 2015, at 4:58 PM, Tomek Rękawek (JIRA) j...@apache.org wrote:
 
 
   [ 
 https://issues.apache.org/jira/browse/SLING-3854?page=com.atlassian.jira.
 plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14335026#c
 omment-14335026 ] 
 
 Tomek Rękawek commented on SLING-3854:
 --
 
 Hello,
 I'm interested in releasing the JCR Resource 2.5.0, which depends on 
 the Service User Mapper 1.0.5-SNAPSHOT. I think the dependency is caused 
 by this resolved task. Do you think we can release the Service User 
 Mapper to remove the SNAPSHOT dependency from the JCR Resource?
 
 Add configuration option to restrict service user mapper to system 
 users
 
 
 
   Key: SLING-3854
   URL: https://issues.apache.org/jira/browse/SLING-3854
   Project: Sling
Issue Type: Improvement
Components: Service User Mapper
  Reporter: angela
  Assignee: Antonio Sanso
   Fix For: Service User Mapper 1.1.0, JCR Resource 2.5.0
 
   Attachments: SLING-3854-patch2.txt, SLING-3854.patch
 
 
 JCR-3802 introduces the concept of system users that distinct from 
 regular user accounts and never have a password set. the API extensions 
 include to following ability to discover if a given User is actually a 
 system user: {{User.isSystemUser}}.
 It would be good if the service user mapping had a configuration 
 option that would restrict the mapping to dedicated service users i.e. 
 to users which are defined to be system users in case sling is running 
 on a JCR repository that implements jackrabbit API.
 
 
 
 --
 This message was sent by Atlassian JIRA
 (v6.3.4#6332)
 



[jira] [Commented] (SLING-4312) Register an osgi service for each available service user

2015-02-25 Thread Marius Petria (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-4312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336270#comment-14336270
 ] 

Marius Petria commented on SLING-4312:
--

Hi [~fmeschbe],

I changed the ServiceUserMapping interface to contain only the subServiceName, 
hence hiding the serviceName which might be considered an implementation 
detail. The entire code is at [1].


[1] https://github.com/mpetria/sling/compare/mpetria:trunk...dev-SLING-4312

 Register an osgi service for each available service user 
 -

 Key: SLING-4312
 URL: https://issues.apache.org/jira/browse/SLING-4312
 Project: Sling
  Issue Type: Improvement
  Components: Service User Mapper
Reporter: Marius Petria
 Fix For: Service User Mapper 1.1.0

 Attachments: SLING-4312.diff


 In order to only activate osgi components when a service user mapping is 
 available it would be useful to have an osgi service registered for a service 
 user. A component can reference the registered service name and only start 
 when that becomes available.
 {code}
 @Reference(target=(name=serviceName))
 ServiceUserExists userExists;
 {code}
  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Oliver Lietz
On Wednesday 25 February 2015 10:50:36 Antonio Sanso wrote:
 hi *
 
 On Feb 24, 2015, at 6:00 PM, Oliver Lietz
 apa...@oliverlietz.demailto:apa...@oliverlietz.de wrote:
 
 On Friday 20 February 2015 17:53:02 Marius Petria wrote:
 Hi,
 
 hi Marius,
 
 I discovered an issue related to service users. Due to the indeterminism
 of OSGI a consumer of ServiceUserMapper cannot be sure that
 getServiceUserID will find a registered mapping even if that mapping has
 been configured. For example if a component starts roughly at the same
 time as the mapping is installed it can happen that the calls the
 component makes to loginService to fail. More concretely that can happen
 for example if one needs a session in an activate method to register jcr
 event listener, or to read some configuration properties from the
 repository.
 
 In order to make this behavior more predictable I created an issue [1]
 proposing to always register an osgi service (I called it
 ServiceUserMapping) right after a mapping is installed, such that consumer
 components can reference it and wait for the mapping to be available. I
 also worked out an implementation in [2].
 
 First, I would like to ask you if you think the problem is valid and if
 the approach is correct?
 Second, it will be really helpful if you can also comment on the issue
 around the provided implementation.
 
 I hadn't the time to look into the implementation but I have this use case
 right now. A service user mapping and a bundle with a service which relies
 on this mapping are deployed in a (AEM) package - service fails because of
 mapping not yet available when service gets activated. A ServiceUserMapping
 service as reference would solve this problem. So +1 for this approach and
 the name ServiceUserMapping.
 
 a valid alternative that will end up to a NOOP for SLING-4312 is to use
 Sling initial content in the same bundle rather than a package.

hi Antonio,

we have a dedicated bundle (with Sling-Initial-Content) for configurations and 
IMHO service user mappings (as well as other global configurations) should be 
kept at a single place and not spread around in different application bundles.

Regards,
O.

 e.g. in your pom
 
 instructions
 Sling-Initial-Content
 SLING-INF/content;path:=/libs/system/config;overwrite:=true;
 /Sling-Initial-Content
 /instructions
 
 I did use this approach and works (for the record it works also in AEM)
 
 regards
 
 antonio
 
 
 
 Regards,
 O.
 
 Marius
 
 [1] https://issues.apache.org/jira/browse/SLING-4312
 [2] https://github.com/mpetria/sling/compare/mpetria:trunk...dev-SLING-4312



Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Marius Petria
Hi Antonio,




On 2/25/15, 12:36 PM, Antonio Sanso asa...@adobe.com wrote:

Usually the person that set’s the OSGi configuration (aka the 
administrator) is different than the one that 
codes a bundle (aka the administrator). This can also happen in two 
distinct phases of the project.
I have the impression that this feature mixes the concerns…


I think that is a perfect example why we should have such a dependency 
mechanism, as the the phases are executed by different personas. As a 
developer I would like to specify that my component should only be started 
when the administrator has configured a subServiceName and that is ready 
to be used.

Using the Sling initial content in the same bundle as the component is 
not always possible, for example if the component is 3rd party bundle. 
Also I am not sure there is a guarantee to always work. Even more, the 
solution relies on the fact the service user is configured by the 
“developer” but as you said this can be configured by an “administrator. 
As a side note I think we should even allow a component to be able to 
restart when a mapping is changed as its security context is changed.

Marius





[jira] [Commented] (SLING-3829) Add support for Content-Disposition attachment

2015-02-25 Thread Oliver Lietz (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336361#comment-14336361
 ] 

Oliver Lietz commented on SLING-3829:
-

Indeed. Can you provide a package or project for testing? UrlRewriteFilter 
provides an extension mechanism which could be exploited.

 Add support for Content-Disposition attachment 
 ---

 Key: SLING-3829
 URL: https://issues.apache.org/jira/browse/SLING-3829
 Project: Sling
  Issue Type: Improvement
  Components: Extensions
Reporter: Antonio Sanso
Assignee: Antonio Sanso
Priority: Minor

 In some situation will be useful (and safer) to force Content-Disposition 
 attachment for some Content-Type (configurable ) under some specific (and 
 sensitive) path (configurable)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: Discuss SLING-4312: Register an osgi service for each available service user

2015-02-25 Thread Antonio Sanso
hi Oliver
On Feb 25, 2015, at 12:09 PM, Oliver Lietz apa...@oliverlietz.de wrote:

 On Wednesday 25 February 2015 10:50:36 Antonio Sanso wrote:
 hi *
 
 On Feb 24, 2015, at 6:00 PM, Oliver Lietz
 apa...@oliverlietz.demailto:apa...@oliverlietz.de wrote:
 
 On Friday 20 February 2015 17:53:02 Marius Petria wrote:
 Hi,
 
 hi Marius,
 
 I discovered an issue related to service users. Due to the indeterminism
 of OSGI a consumer of ServiceUserMapper cannot be sure that
 getServiceUserID will find a registered mapping even if that mapping has
 been configured. For example if a component starts roughly at the same
 time as the mapping is installed it can happen that the calls the
 component makes to loginService to fail. More concretely that can happen
 for example if one needs a session in an activate method to register jcr
 event listener, or to read some configuration properties from the
 repository.
 
 In order to make this behavior more predictable I created an issue [1]
 proposing to always register an osgi service (I called it
 ServiceUserMapping) right after a mapping is installed, such that consumer
 components can reference it and wait for the mapping to be available. I
 also worked out an implementation in [2].
 
 First, I would like to ask you if you think the problem is valid and if
 the approach is correct?
 Second, it will be really helpful if you can also comment on the issue
 around the provided implementation.
 
 I hadn't the time to look into the implementation but I have this use case
 right now. A service user mapping and a bundle with a service which relies
 on this mapping are deployed in a (AEM) package - service fails because of
 mapping not yet available when service gets activated. A ServiceUserMapping
 service as reference would solve this problem. So +1 for this approach and
 the name ServiceUserMapping.
 
 a valid alternative that will end up to a NOOP for SLING-4312 is to use
 Sling initial content in the same bundle rather than a package.
 
 hi Antonio,
 
 we have a dedicated bundle (with Sling-Initial-Content) for configurations 
 and 
 IMHO service user mappings (as well as other global configurations) should be 
 kept at a single place and not spread around in different application bundles.

in general I do agree with you. This can be an exception though (hence why we 
introduced the concept of mapping amendments aka 
https://issues.apache.org/jira/browse/SLING-3578)

regards

antonio

 
 Regards,
 O.
 
 e.g. in your pom
 
instructions
Sling-Initial-Content
SLING-INF/content;path:=/libs/system/config;overwrite:=true;
/Sling-Initial-Content
/instructions
 
 I did use this approach and works (for the record it works also in AEM)
 
 regards
 
 antonio
 
 
 
 Regards,
 O.
 
 Marius
 
 [1] https://issues.apache.org/jira/browse/SLING-4312
 [2] https://github.com/mpetria/sling/compare/mpetria:trunk...dev-SLING-4312
 



[jira] [Commented] (SLING-3829) Add support for Content-Disposition attachment

2015-02-25 Thread Antonio Sanso (JIRA)

[ 
https://issues.apache.org/jira/browse/SLING-3829?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14336371#comment-14336371
 ] 

Antonio Sanso commented on SLING-3829:
--

[~olli] I am not clear what I am supposed to provide.
I just used the configuration you suggested above.

do you have any further details on this extension and how we can use ?

 Add support for Content-Disposition attachment 
 ---

 Key: SLING-3829
 URL: https://issues.apache.org/jira/browse/SLING-3829
 Project: Sling
  Issue Type: Improvement
  Components: Extensions
Reporter: Antonio Sanso
Assignee: Antonio Sanso
Priority: Minor

 In some situation will be useful (and safer) to force Content-Disposition 
 attachment for some Content-Type (configurable ) under some specific (and 
 sensitive) path (configurable)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [VOTE] Release Apache Sling Service User Mapper 1.1.0

2015-02-25 Thread Tomek Rękawek
+1 (non-binding)

Regards,
Tomek

On Wed, Feb 25, 2015 at 11:00 AM, Antonio Sanso asa...@adobe.com wrote:

 +1

 regards

 antonio

 On Feb 25, 2015, at 10:53 AM, Antonio Sanso asa...@adobe.com wrote:

  Hi,
 
  We solved 1 issue in this release:
  https://issues.apache.org/jira/browse/SLING-3854
 
  Staging repository:
  https://repository.apache.org/content/repositories/orgapachesling-1196
 
  You can use this UNIX script to download the release and verify the
 signatures:
  http://svn.apache.org/repos/asf/sling/trunk/check_staged_release.sh
 
  Usage:
  sh check_staged_release.sh 1196 /tmp/sling-staging
 
  Please vote to approve this release:
 
   [ ] +1 Approve the release
   [ ]  0 Don't care
   [ ] -1 Don't release, because ...
 
  This majority vote is open for at least 72 hours.




-- 
Tomek Rękawek
Senior Software Engineer

Cognifide Polska Sp. z o.o.
skype: trekawek

www.cognifide.com


Jenkins build is still unstable: sling-trunk-1.8 #789

2015-02-25 Thread Apache Jenkins Server
See https://builds.apache.org/job/sling-trunk-1.8/changes