[jira] [Updated] (SLING-7519) Add slf4j simple to get log output when running tests in eclipse

2018-03-02 Thread Oliver Lietz (JIRA)

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

Oliver Lietz updated SLING-7519:

Summary: Add slf4j simple to get log output when running tests in eclipse  
(was: Add webconsole ds module to SlingOptions)

> Add slf4j simple to get log output when running tests in eclipse
> 
>
> Key: SLING-7519
> URL: https://issues.apache.org/jira/browse/SLING-7519
> Project: Sling
>  Issue Type: Improvement
>Reporter: Christian Schneider
>Assignee: Robert Munteanu
>Priority: Major
> Fix For: Testing PaxExam 1.0.2
>
> Attachments: Toolbox.png
>
>
> Sling uses DS all over the place. We should add the ds module for the 
> webconsole to have more insight into the DS components in tests.
> I will supply a PR.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7519) Add webconsole ds module to SlingOptions

2018-03-02 Thread Oliver Lietz (JIRA)

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

Oliver Lietz commented on SLING-7519:
-

One of my goals for Sling Karaf (and Testing PaxExam) is giving users the 
choice and therefore keeping features fine-grained and minimal. When you 
install {{webconsole}} you get {{webconsole}} and required dependencies only. 
Keep in mind that Sling's Karaf features and Testing PaxExam options can be 
(_are_) used without Sling also (e.g. Sling Commons).
In fact those few basic options in {{SlingOptions.hbs}} are closer to Sling 
Starter/Launchpad than Sling Karaf (Felix HTTP Service vs Pax Web).

> Add webconsole ds module to SlingOptions
> 
>
> Key: SLING-7519
> URL: https://issues.apache.org/jira/browse/SLING-7519
> Project: Sling
>  Issue Type: Improvement
>Reporter: Christian Schneider
>Assignee: Robert Munteanu
>Priority: Major
> Fix For: Testing PaxExam 1.0.2
>
> Attachments: Toolbox.png
>
>
> Sling uses DS all over the place. We should add the ds module for the 
> webconsole to have more insight into the DS components in tests.
> I will supply a PR.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Re: [DISCUSSION] Make Sling shiny - Basic CMS

2018-03-02 Thread Daniel Klco
On Fri, Mar 2, 2018 at 7:26 AM, Ioan Eugen Stan  wrote:

> Hi,
>
> > Yep, indeed. Currently I'm working on building out some reference
> > components like search, lists, column controls, text editors, etc.
> That would be awesome. We would like to use such components in our setup
> and we might help with some development and maintenance along the way.
> That would take some time dough.
>

Yep. I've made some of these, but it's still pretty basic and some are a
bit clunky.


>
> IMO we should be able to make the artifacts available as part of a
> release process.
>

Absolutely. I'm thinking that these could be a standalone related project
so it can be versioned separately from the CMS as a whole.


> Is this part of the apache project or a you private project. I'm asking
> because I would like to do some work in that direction (release as often
> as possible).
>

It's in the Sling Whiteboard:
https://github.com/apache/sling-whiteboard/tree/master/cms


> >> - is there any relationship between sling-cms and Composum? It seems to
> >> me like both projects are heading in a similar direction and a
> >> colaboration might be beneficial. Composum provides Composum assests,
> >> Composum Pages, etc. That functionality could be reused.
> >>
> > Not at the moment, I did add in Compsum for the package and node explorer
> > capabilities, but I didn't realize Compsum Pages and Assets were so far
> > along.
> >
> Have you had time to check them out? Can Sling CMS use those compnents?
> Will they be used instead of internal/custom ones?
>

 I've looked through the documentation for Composum Pages / Assets. It
looks like they have taken a different approach, but the assets in
particular is really nice. I'll try to download it soon and check it out.


[jira] [Updated] (SLING-7519) Add webconsole ds module to SlingOptions

2018-03-02 Thread Oliver Lietz (JIRA)

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

Oliver Lietz updated SLING-7519:

Fix Version/s: (was: Sling Pax Exam Utilities 1.0.6)
   Testing PaxExam 1.0.2

> Add webconsole ds module to SlingOptions
> 
>
> Key: SLING-7519
> URL: https://issues.apache.org/jira/browse/SLING-7519
> Project: Sling
>  Issue Type: Improvement
>Reporter: Christian Schneider
>Assignee: Robert Munteanu
>Priority: Major
> Fix For: Testing PaxExam 1.0.2
>
> Attachments: Toolbox.png
>
>
> Sling uses DS all over the place. We should add the ds module for the 
> webconsole to have more insight into the DS components in tests.
> I will supply a PR.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (SLING-7519) Add webconsole ds module to SlingOptions

2018-03-02 Thread Oliver Lietz (JIRA)

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

Oliver Lietz updated SLING-7519:

Affects Version/s: (was: Sling Pax Exam Utilities 1.0.4)

> Add webconsole ds module to SlingOptions
> 
>
> Key: SLING-7519
> URL: https://issues.apache.org/jira/browse/SLING-7519
> Project: Sling
>  Issue Type: Improvement
>Reporter: Christian Schneider
>Assignee: Robert Munteanu
>Priority: Major
> Fix For: Testing PaxExam 1.0.2
>
> Attachments: Toolbox.png
>
>
> Sling uses DS all over the place. We should add the ds module for the 
> webconsole to have more insight into the DS components in tests.
> I will supply a PR.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7524) Sling Query - unique function does not not remove all duplicates

2018-03-02 Thread ASF GitHub Bot (JIRA)

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

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

JEBailey opened a new pull request #1: SLING-7524 updated unique function to 
only return unique items
URL: https://github.com/apache/sling-org-apache-sling-query/pull/1
 
 
   Method is similar to how the distinct method works in the Stream api and
   utilizes a HashSet of previously seen items


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


> Sling Query - unique function does not not remove all duplicates
> 
>
> Key: SLING-7524
> URL: https://issues.apache.org/jira/browse/SLING-7524
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Query
>Reporter: Jason E Bailey
>Assignee: Jason E Bailey
>Priority: Major
>
> the function for unique does not match the contract a unique function usually 
> provides including JQuery, rather it's providing a sequential deduplicator.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] JEBailey opened a new pull request #1: SLING-7524 updated unique function to only return unique items

2018-03-02 Thread GitBox
JEBailey opened a new pull request #1: SLING-7524 updated unique function to 
only return unique items
URL: https://github.com/apache/sling-org-apache-sling-query/pull/1
 
 
   Method is similar to how the distinct method works in the Stream api and
   utilizes a HashSet of previously seen items


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


With regards,
Apache Git Services


[jira] [Commented] (SLING-7524) Sling Query - unique function does not not remove all duplicates

2018-03-02 Thread Jason E Bailey (JIRA)

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

Jason E Bailey commented on SLING-7524:
---

[~tomek.rekawek] I like the laziness as well :)  the jQuery equivalent doesn't 
do ordering any more as of 1.4 it just returns unique items in the order that 
they were seen. So I'm seeing this as similar to the distinct method in the 
Streams api. I've got a solution for this that works in the same manner as the 
distinct method. I'll create a PR for you to take a look at

> Sling Query - unique function does not not remove all duplicates
> 
>
> Key: SLING-7524
> URL: https://issues.apache.org/jira/browse/SLING-7524
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Query
>Reporter: Jason E Bailey
>Assignee: Jason E Bailey
>Priority: Major
>
> the function for unique does not match the contract a unique function usually 
> provides including JQuery, rather it's providing a sequential deduplicator.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7524) Sling Query - unique function does not not remove all duplicates

2018-03-02 Thread JIRA

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

Tomek Rękawek commented on SLING-7524:
--

[~jebailey] - thanks for noticing this. Indeed, the name is a big misleading 
and the method has different semantics than the jQuery unique(). I'm not sure 
if we can change the implementation here - I think the global unique() would 
require sorting the collection, which would break the "laziness" and I'd like 
to avoid this.

How about deprecating the unique() and renaming it to, I don't know, 
deduplicate()?

> Sling Query - unique function does not not remove all duplicates
> 
>
> Key: SLING-7524
> URL: https://issues.apache.org/jira/browse/SLING-7524
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Query
>Reporter: Jason E Bailey
>Assignee: Jason E Bailey
>Priority: Major
>
> the function for unique does not match the contract a unique function usually 
> provides including JQuery, rather it's providing a sequential deduplicator.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7524) Sling Query - unique function does not not remove all duplicates

2018-03-02 Thread Jason E Bailey (JIRA)

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

Jason E Bailey commented on SLING-7524:
---

[~tomek.rekawek] not sure if this was deliberate or not. 

> Sling Query - unique function does not not remove all duplicates
> 
>
> Key: SLING-7524
> URL: https://issues.apache.org/jira/browse/SLING-7524
> Project: Sling
>  Issue Type: Improvement
>  Components: Sling Query
>Reporter: Jason E Bailey
>Assignee: Jason E Bailey
>Priority: Major
>
> the function for unique does not match the contract a unique function usually 
> provides including JQuery, rather it's providing a sequential deduplicator.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


Re: [DISCUSSION] Make Sling shiny - Basic CMS

2018-03-02 Thread Ioan Eugen Stan
Hi,

> Yep, indeed. Currently I'm working on building out some reference
> components like search, lists, column controls, text editors, etc.
That would be awesome. We would like to use such components in our setup
and we might help with some development and maintenance along the way.
That would take some time dough.

IMO we should be able to make the artifacts available as part of a
release process.
Is this part of the apache project or a you private project. I'm asking
because I would like to do some work in that direction (release as often
as possible).
>> - is there any relationship between sling-cms and Composum? It seems to
>> me like both projects are heading in a similar direction and a
>> colaboration might be beneficial. Composum provides Composum assests,
>> Composum Pages, etc. That functionality could be reused.
>>
> Not at the moment, I did add in Compsum for the package and node explorer
> capabilities, but I didn't realize Compsum Pages and Assets were so far
> along.
>
Have you had time to check them out? Can Sling CMS use those compnents?
Will they be used instead of internal/custom ones?




signature.asc
Description: OpenPGP digital signature


[jira] [Issue Comment Deleted] (SLING-7529) Log message layouts are not property inherited

2018-03-02 Thread Fryderyk Wysocki (JIRA)

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

Fryderyk Wysocki updated SLING-7529:

Comment: was deleted

(was: PR with the missing implementation raised on GitHub)

> Log message layouts are not property inherited
> --
>
> Key: SLING-7529
> URL: https://issues.apache.org/jira/browse/SLING-7529
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Log 5.1.2
>Reporter: Fryderyk Wysocki
>Priority: Major
>
> Steps to reproduce on AEM 6.3 with Apache Sling Commons Log 5.1.2:
> 1. Create Logger Configuration for Logger "my.project", log file "error.log", 
> log level 'Information" and message pattern "My project: \{5}"
> 2. Create an Slf4J logger for class my.project.Sample and use it to infolog 
> message "test foo"
> 3. Change the configuration created in step 1 - update logger to 
> "my.project.Sample"
> 4. Use the logger created in step 2 to infolog message "test bar"
> Expected result:
> 5. error.log file would contain messages "My project: test foo" and "My 
> project: test bar"
> Actual result:
> 5. error.log file contains the message "test foo" in the format configured as 
> the default format, but also contains the message "My project: test bar" - 
> the second message, in the appropriate format.
> Investigation:
> Checking the source code, I've discovered the following in class 
> 'LoggerSpecificEncoder', starting from line 47:
> {code:java}
> private Layout getLayout(String loggerName) {
> // TODO Handle layout inheritance wrt logger names
> Layout layout = layoutByCategory.get(loggerName);
> if (layout == null) {
> layout = defaultLayout;
> }
> return layout;
> }
> {code}
> Which means that, unless the configuration is created for the exact logger 
> name, the default one will be used - the functionality is not broken, but 
> simply not implemented.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Comment Edited] (SLING-7529) Log message layouts are not property inherited

2018-03-02 Thread Fryderyk Wysocki (JIRA)

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

Fryderyk Wysocki edited comment on SLING-7529 at 3/2/18 12:24 PM:
--

PR with the missing implementation raised on GitHub


was (Author: cptbartender):
I'll raise a PR on GitHub for this shortly...

> Log message layouts are not property inherited
> --
>
> Key: SLING-7529
> URL: https://issues.apache.org/jira/browse/SLING-7529
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Log 5.1.2
>Reporter: Fryderyk Wysocki
>Priority: Major
>
> Steps to reproduce on AEM 6.3 with Apache Sling Commons Log 5.1.2:
> 1. Create Logger Configuration for Logger "my.project", log file "error.log", 
> log level 'Information" and message pattern "My project: \{5}"
> 2. Create an Slf4J logger for class my.project.Sample and use it to infolog 
> message "test foo"
> 3. Change the configuration created in step 1 - update logger to 
> "my.project.Sample"
> 4. Use the logger created in step 2 to infolog message "test bar"
> Expected result:
> 5. error.log file would contain messages "My project: test foo" and "My 
> project: test bar"
> Actual result:
> 5. error.log file contains the message "test foo" in the format configured as 
> the default format, but also contains the message "My project: test bar" - 
> the second message, in the appropriate format.
> Investigation:
> Checking the source code, I've discovered the following in class 
> 'LoggerSpecificEncoder', starting from line 47:
> {code:java}
> private Layout getLayout(String loggerName) {
> // TODO Handle layout inheritance wrt logger names
> Layout layout = layoutByCategory.get(loggerName);
> if (layout == null) {
> layout = defaultLayout;
> }
> return layout;
> }
> {code}
> Which means that, unless the configuration is created for the exact logger 
> name, the default one will be used - the functionality is not broken, but 
> simply not implemented.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7529) Log message layouts are not property inherited

2018-03-02 Thread ASF GitHub Bot (JIRA)

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

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

CptBartender opened a new pull request #3: SLING-7529 - implemented layout 
inheritance in log encoder
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/3
 
 
   I've implemented a simple method that finds the best (longest) match among 
the registered layouts and put it in place of the //TODO tag within the code.
   
   I did not run the tests as these don't pass on my environment for unrelated 
reasons, however the class is not mentioned in any tests so I'm assuming this 
shouldn't break existing tests.


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


> Log message layouts are not property inherited
> --
>
> Key: SLING-7529
> URL: https://issues.apache.org/jira/browse/SLING-7529
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Log 5.1.2
>Reporter: Fryderyk Wysocki
>Priority: Major
>
> Steps to reproduce on AEM 6.3 with Apache Sling Commons Log 5.1.2:
> 1. Create Logger Configuration for Logger "my.project", log file "error.log", 
> log level 'Information" and message pattern "My project: \{5}"
> 2. Create an Slf4J logger for class my.project.Sample and use it to infolog 
> message "test foo"
> 3. Change the configuration created in step 1 - update logger to 
> "my.project.Sample"
> 4. Use the logger created in step 2 to infolog message "test bar"
> Expected result:
> 5. error.log file would contain messages "My project: test foo" and "My 
> project: test bar"
> Actual result:
> 5. error.log file contains the message "test foo" in the format configured as 
> the default format, but also contains the message "My project: test bar" - 
> the second message, in the appropriate format.
> Investigation:
> Checking the source code, I've discovered the following in class 
> 'LoggerSpecificEncoder', starting from line 47:
> {code:java}
> private Layout getLayout(String loggerName) {
> // TODO Handle layout inheritance wrt logger names
> Layout layout = layoutByCategory.get(loggerName);
> if (layout == null) {
> layout = defaultLayout;
> }
> return layout;
> }
> {code}
> Which means that, unless the configuration is created for the exact logger 
> name, the default one will be used - the functionality is not broken, but 
> simply not implemented.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] CptBartender opened a new pull request #3: SLING-7529 - implemented layout inheritance in log encoder

2018-03-02 Thread GitBox
CptBartender opened a new pull request #3: SLING-7529 - implemented layout 
inheritance in log encoder
URL: https://github.com/apache/sling-org-apache-sling-commons-log/pull/3
 
 
   I've implemented a simple method that finds the best (longest) match among 
the registered layouts and put it in place of the //TODO tag within the code.
   
   I did not run the tests as these don't pass on my environment for unrelated 
reasons, however the class is not mentioned in any tests so I'm assuming this 
shouldn't break existing tests.


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


With regards,
Apache Git Services


Re: repoinit just with oak

2018-03-02 Thread Ioan Eugen Stan
Hello Bertrand,

Thank you for the reply. I'm still working on the details of the
infrastructure.

We will have an instance of Sling and that would help us to run the
Repo-init instructions.

However, the contribution will still be helpful to ease JCR only
integration testing outside OSGI and we have such a use case.

I'll see if I can find some time to work on this and I will definitely
contribute to the changes upstream. Thank you for suggesting that.


Regards,


On 21.02.2018 18:24, Bertrand Delacretaz wrote:
> Hi,
>
> On Wed, Feb 21, 2018 at 2:47 PM, Ioan Eugen Stan  wrote:
>> ...I saw that I need to implement
>> |SlingRepositoryInitializer that brings in Sling API, which I shouldn't
>> need
> I think you can bypass that requirement. If you look at the
> RepositoryInitializer.processRepository method [1] the gist is parsing
> the statements and using JcrRepoInitOpsProcessor to process the
> result.
>
> However, as running outside of Sling hasn't been a requirement so far,
> I suppose there might be non-essential dependencies that get in the
> way of doing that, but depending on your environment they might not
> matter, maybe you just won't be able to use certain non-essential
> classes.
>
> The alternative is to extract the pure JCR parts out of the jcr
> repoinit bundle, if you need that I think that would be a useful
> contribution.
>
> You're right that technically the JCR parts of this belong to the Oak
> level, but as it's the Sling community which needed that the modules
> have been created here for convenience.
>
> -Bertrand
>
> [1] 
> https://github.com/apache/sling-org-apache-sling-jcr-repoinit/blob/master/src/main/java/org/apache/sling/jcr/repoinit/impl/RepositoryInitializer.java




signature.asc
Description: OpenPGP digital signature


[jira] [Commented] (SLING-7509) Add QueryClient

2018-03-02 Thread ASF GitHub Bot (JIRA)

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

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

volteanu commented on issue #5: SLING-7509 - Add QueryClient
URL: 
https://github.com/apache/sling-org-apache-sling-testing-clients/pull/5#issuecomment-369903060
 
 
   Squashed the commits. The branch should be merge-able. 


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


> Add QueryClient
> ---
>
> Key: SLING-7509
> URL: https://issues.apache.org/jira/browse/SLING-7509
> Project: Sling
>  Issue Type: New Feature
>  Components: Apache Sling Testing Clients
>Reporter: Valentin Olteanu
>Priority: Major
>
> Currently, there is no way to run queries in sling using the clients. This is 
> needed in several tests to search content and assert the effects of a feature.
>  
> The solution proposed in 
> [https://github.com/apache/sling-org-apache-sling-testing-clients/pull/5] 
>  * installs a custom query servlet
>  * runs the query in any of the supported format
>  * returns results as json



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7529) Log message layouts are not property inherited

2018-03-02 Thread Fryderyk Wysocki (JIRA)

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

Fryderyk Wysocki commented on SLING-7529:
-

I'll raise a PR on GitHub for this shortly...

> Log message layouts are not property inherited
> --
>
> Key: SLING-7529
> URL: https://issues.apache.org/jira/browse/SLING-7529
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Log 5.1.2
>Reporter: Fryderyk Wysocki
>Priority: Major
>
> Steps to reproduce on AEM 6.3 with Apache Sling Commons Log 5.1.2:
> 1. Create Logger Configuration for Logger "my.project", log file "error.log", 
> log level 'Information" and message pattern "My project: \{5}"
> 2. Create an Slf4J logger for class my.project.Sample and use it to infolog 
> message "test foo"
> 3. Change the configuration created in step 1 - update logger to 
> "my.project.Sample"
> 4. Use the logger created in step 2 to infolog message "test bar"
> Expected result:
> 5. error.log file would contain messages "My project: test foo" and "My 
> project: test bar"
> Actual result:
> 5. error.log file contains the message "test foo" in the format configured as 
> the default format, but also contains the message "My project: test bar" - 
> the second message, in the appropriate format.
> Investigation:
> Checking the source code, I've discovered the following in class 
> 'LoggerSpecificEncoder', starting from line 47:
> {code:java}
> private Layout getLayout(String loggerName) {
> // TODO Handle layout inheritance wrt logger names
> Layout layout = layoutByCategory.get(loggerName);
> if (layout == null) {
> layout = defaultLayout;
> }
> return layout;
> }
> {code}
> Which means that, unless the configuration is created for the exact logger 
> name, the default one will be used - the functionality is not broken, but 
> simply not implemented.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (SLING-7529) Log message layouts are not property inherited

2018-03-02 Thread Fryderyk Wysocki (JIRA)
Fryderyk Wysocki created SLING-7529:
---

 Summary: Log message layouts are not property inherited
 Key: SLING-7529
 URL: https://issues.apache.org/jira/browse/SLING-7529
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Log 5.1.2
Reporter: Fryderyk Wysocki


Steps to reproduce on AEM 6.3 with Apache Sling Commons Log 5.1.2:
1. Create Logger Configuration for Logger "my.project", log file "error.log", 
log level 'Information" and message pattern "My project: \{5}"
2. Create an Slf4J logger for class my.project.Sample and use it to infolog 
message "test foo"
3. Change the configuration created in step 1 - update logger to 
"my.project.Sample"
4. Use the logger created in step 2 to infolog message "test bar"

Expected result:
5. error.log file would contain messages "My project: test foo" and "My 
project: test bar"

Actual result:
5. error.log file contains the message "test foo" in the format configured as 
the default format, but also contains the message "My project: test bar" - the 
second message, in the appropriate format.

Investigation:
Checking the source code, I've discovered the following in class 
'LoggerSpecificEncoder', starting from line 47:
{code:java}
private Layout getLayout(String loggerName) {
// TODO Handle layout inheritance wrt logger names
Layout layout = layoutByCategory.get(loggerName);
if (layout == null) {
layout = defaultLayout;
}
return layout;
}
{code}
Which means that, unless the configuration is created for the exact logger 
name, the default one will be used - the functionality is not broken, but 
simply not implemented.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7528) org.apache.sling.jcr.webdav fails for files containing "%"

2018-03-02 Thread ASF GitHub Bot (JIRA)

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

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

reschke opened a new pull request #1: SLING-7528: remove broken attempt to 
handle URIs
URL: https://github.com/apache/sling-org-apache-sling-jcr-webdav/pull/1
 
 
   


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


> org.apache.sling.jcr.webdav fails for files containing "%"
> --
>
> Key: SLING-7528
> URL: https://issues.apache.org/jira/browse/SLING-7528
> Project: Sling
>  Issue Type: Bug
>  Components: JCR
>Affects Versions: JCR Webdav 2.3.8
>Reporter: Julian Reschke
>Priority: Major
> Fix For: JCR Webdav 2.3.10
>
>
> Adding (PUTting) a file with a properly escaped percent sign leads to:
> {noformat}
> 02.03.2018 10:04:10.301 *ERROR* [127.0.0.1 [1519981450286] PUT 
> /content/dam/test/10%20100%25%20Total%20Success.mp3 HTTP/1.1] 
> org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught 
> Throwable
> java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in 
> escape (%) pattern - For input string: " T"
>at java.net.URLDecoder.decode(URLDecoder.java:194)
>at 
> org.apache.sling.jcr.webdav.impl.helper.SlingTikaDetector.detect(SlingTikaDetector.java:68)
>  [org.apache.sling.jcr.webdav:2.3.8]
>at 
> org.apache.jackrabbit.server.io.ImportContextImpl.(ImportContextImpl.java:87)
>  [org.apache.sling.jcr.webdav:2.3.8]
>at 
> org.apache.jackrabbit.webdav.simple.DavResourceImpl.getImportContext(DavResourceImpl.java:888)
>  [org.apache.sling.jcr.webdav:2.3.8]
>at 
> org.apache.jackrabbit.webdav.simple.DavResourceImpl.addMember(DavResourceImpl.java:529)
>  [org.apache.sling.jcr.webdav:2.3.8]
> {noformat}
> This is because {{SlingTikaDetector}} tries to handle a URI where actually a 
> repository path is supplied (apart from that, the attempt to do URI parsing 
> is very interesting...).
> The proper fix seems to be to just remove any attempt to deal with URIs here.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7528) org.apache.sling.jcr.webdav fails for files containing "%"

2018-03-02 Thread Julian Reschke (JIRA)

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

Julian Reschke commented on SLING-7528:
---

Proposed patch: 
https://github.com/apache/sling-org-apache-sling-jcr-webdav/pull/1/commits/dcc9e38799fda9f16472576a6d5628966147a7d8

> org.apache.sling.jcr.webdav fails for files containing "%"
> --
>
> Key: SLING-7528
> URL: https://issues.apache.org/jira/browse/SLING-7528
> Project: Sling
>  Issue Type: Bug
>  Components: JCR
>Affects Versions: JCR Webdav 2.3.8
>Reporter: Julian Reschke
>Priority: Major
> Fix For: JCR Webdav 2.3.10
>
>
> Adding (PUTting) a file with a properly escaped percent sign leads to:
> {noformat}
> 02.03.2018 10:04:10.301 *ERROR* [127.0.0.1 [1519981450286] PUT 
> /content/dam/test/10%20100%25%20Total%20Success.mp3 HTTP/1.1] 
> org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught 
> Throwable
> java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in 
> escape (%) pattern - For input string: " T"
>at java.net.URLDecoder.decode(URLDecoder.java:194)
>at 
> org.apache.sling.jcr.webdav.impl.helper.SlingTikaDetector.detect(SlingTikaDetector.java:68)
>  [org.apache.sling.jcr.webdav:2.3.8]
>at 
> org.apache.jackrabbit.server.io.ImportContextImpl.(ImportContextImpl.java:87)
>  [org.apache.sling.jcr.webdav:2.3.8]
>at 
> org.apache.jackrabbit.webdav.simple.DavResourceImpl.getImportContext(DavResourceImpl.java:888)
>  [org.apache.sling.jcr.webdav:2.3.8]
>at 
> org.apache.jackrabbit.webdav.simple.DavResourceImpl.addMember(DavResourceImpl.java:529)
>  [org.apache.sling.jcr.webdav:2.3.8]
> {noformat}
> This is because {{SlingTikaDetector}} tries to handle a URI where actually a 
> repository path is supplied (apart from that, the attempt to do URI parsing 
> is very interesting...).
> The proper fix seems to be to just remove any attempt to deal with URIs here.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[GitHub] reschke opened a new pull request #1: SLING-7528: remove broken attempt to handle URIs

2018-03-02 Thread GitBox
reschke opened a new pull request #1: SLING-7528: remove broken attempt to 
handle URIs
URL: https://github.com/apache/sling-org-apache-sling-jcr-webdav/pull/1
 
 
   


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


With regards,
Apache Git Services


[jira] [Created] (SLING-7528) org.apache.sling.jcr.webdav fails for files containing "%"

2018-03-02 Thread Julian Reschke (JIRA)
Julian Reschke created SLING-7528:
-

 Summary: org.apache.sling.jcr.webdav fails for files containing "%"
 Key: SLING-7528
 URL: https://issues.apache.org/jira/browse/SLING-7528
 Project: Sling
  Issue Type: Bug
  Components: JCR
Affects Versions: JCR Webdav 2.3.8
Reporter: Julian Reschke
 Fix For: JCR Webdav 2.3.10


Adding (PUTting) a file with a properly escaped percent sign leads to:
{noformat}
02.03.2018 10:04:10.301 *ERROR* [127.0.0.1 [1519981450286] PUT 
/content/dam/test/10%20100%25%20Total%20Success.mp3 HTTP/1.1] 
org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught 
Throwable
java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in 
escape (%) pattern - For input string: " T"
   at java.net.URLDecoder.decode(URLDecoder.java:194)
   at 
org.apache.sling.jcr.webdav.impl.helper.SlingTikaDetector.detect(SlingTikaDetector.java:68)
 [org.apache.sling.jcr.webdav:2.3.8]
   at 
org.apache.jackrabbit.server.io.ImportContextImpl.(ImportContextImpl.java:87)
 [org.apache.sling.jcr.webdav:2.3.8]
   at 
org.apache.jackrabbit.webdav.simple.DavResourceImpl.getImportContext(DavResourceImpl.java:888)
 [org.apache.sling.jcr.webdav:2.3.8]
   at 
org.apache.jackrabbit.webdav.simple.DavResourceImpl.addMember(DavResourceImpl.java:529)
 [org.apache.sling.jcr.webdav:2.3.8]
{noformat}

This is because {{SlingTikaDetector}} tries to handle a URI where actually a 
repository path is supplied (apart from that, the attempt to do URI parsing is 
very interesting...).

The proper fix seems to be to just remove any attempt to deal with URIs here.




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (SLING-7527) Update org.apache.sling.jcr.webdav to use latest stable jackrabbit webdav

2018-03-02 Thread Julian Reschke (JIRA)
Julian Reschke created SLING-7527:
-

 Summary: Update org.apache.sling.jcr.webdav to use latest stable 
jackrabbit webdav
 Key: SLING-7527
 URL: https://issues.apache.org/jira/browse/SLING-7527
 Project: Sling
  Issue Type: Task
  Components: JCR
Affects Versions: JCR Webdav 2.3.8
Reporter: Julian Reschke
 Fix For: JCR Webdav 2.3.10


Should use 2.16.1.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (SLING-7526) NPE in DefaultThreadPool$LoggingThreadLocalChangeListener.changed

2018-03-02 Thread Robert Munteanu (JIRA)

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

Robert Munteanu updated SLING-7526:
---
Fix Version/s: Commons Threads 3.2.18

> NPE in DefaultThreadPool$LoggingThreadLocalChangeListener.changed
> -
>
> Key: SLING-7526
> URL: https://issues.apache.org/jira/browse/SLING-7526
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Threads 3.2.16
> Environment: MacOS, jdk18
>Reporter: Krystian Nowak
>Priority: Major
> Fix For: Commons Threads 3.2.18
>
>
> Randomly a NullPointerException is happening in 
> _DefaultThreadPool$LoggingThreadLocalChangeListener.changed_:
> {noformat}
> Exception in thread "sling-oak-1" java.lang.NullPointerException
>   at 
> org.apache.sling.commons.threads.impl.DefaultThreadPool$LoggingThreadLocalChangeListener.changed(DefaultThreadPool.java:172)
>   at 
> org.apache.sling.commons.threads.impl.ThreadLocalCleaner.changed(ThreadLocalCleaner.java:210)
>   at 
> org.apache.sling.commons.threads.impl.ThreadLocalCleaner.diff(ThreadLocalCleaner.java:173)
>   at 
> org.apache.sling.commons.threads.impl.ThreadLocalCleaner.cleanup(ThreadLocalCleaner.java:148)
>   at 
> org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocals.afterExecute(ThreadPoolExecutorCleaningThreadLocals.java:75)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (SLING-7526) NPE in DefaultThreadPool$LoggingThreadLocalChangeListener.changed

2018-03-02 Thread Robert Munteanu (JIRA)

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

Robert Munteanu commented on SLING-7526:


Looking at the stack trace and the code, it seems that the listener is getting 
a null thread local value. There should be no impact other than

* the log entry
* the thread being terminated and another one being created


> NPE in DefaultThreadPool$LoggingThreadLocalChangeListener.changed
> -
>
> Key: SLING-7526
> URL: https://issues.apache.org/jira/browse/SLING-7526
> Project: Sling
>  Issue Type: Bug
>  Components: Commons
>Affects Versions: Commons Threads 3.2.16
> Environment: MacOS, jdk18
>Reporter: Krystian Nowak
>Priority: Major
> Fix For: Commons Threads 3.2.18
>
>
> Randomly a NullPointerException is happening in 
> _DefaultThreadPool$LoggingThreadLocalChangeListener.changed_:
> {noformat}
> Exception in thread "sling-oak-1" java.lang.NullPointerException
>   at 
> org.apache.sling.commons.threads.impl.DefaultThreadPool$LoggingThreadLocalChangeListener.changed(DefaultThreadPool.java:172)
>   at 
> org.apache.sling.commons.threads.impl.ThreadLocalCleaner.changed(ThreadLocalCleaner.java:210)
>   at 
> org.apache.sling.commons.threads.impl.ThreadLocalCleaner.diff(ThreadLocalCleaner.java:173)
>   at 
> org.apache.sling.commons.threads.impl.ThreadLocalCleaner.cleanup(ThreadLocalCleaner.java:148)
>   at 
> org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocals.afterExecute(ThreadPoolExecutorCleaningThreadLocals.java:75)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>   at java.lang.Thread.run(Thread.java:748)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (SLING-7526) NPE in DefaultThreadPool$LoggingThreadLocalChangeListener.changed

2018-03-02 Thread Krystian Nowak (JIRA)
Krystian Nowak created SLING-7526:
-

 Summary: NPE in 
DefaultThreadPool$LoggingThreadLocalChangeListener.changed
 Key: SLING-7526
 URL: https://issues.apache.org/jira/browse/SLING-7526
 Project: Sling
  Issue Type: Bug
  Components: Commons
Affects Versions: Commons Threads 3.2.16
 Environment: MacOS, jdk18
Reporter: Krystian Nowak


Randomly a NullPointerException is happening in 
_DefaultThreadPool$LoggingThreadLocalChangeListener.changed_:
{noformat}
Exception in thread "sling-oak-1" java.lang.NullPointerException
at 
org.apache.sling.commons.threads.impl.DefaultThreadPool$LoggingThreadLocalChangeListener.changed(DefaultThreadPool.java:172)
at 
org.apache.sling.commons.threads.impl.ThreadLocalCleaner.changed(ThreadLocalCleaner.java:210)
at 
org.apache.sling.commons.threads.impl.ThreadLocalCleaner.diff(ThreadLocalCleaner.java:173)
at 
org.apache.sling.commons.threads.impl.ThreadLocalCleaner.cleanup(ThreadLocalCleaner.java:148)
at 
org.apache.sling.commons.threads.impl.ThreadPoolExecutorCleaningThreadLocals.afterExecute(ThreadPoolExecutorCleaningThreadLocals.java:75)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1157)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
{noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Created] (SLING-7525) Content-Type missing after applying the ContentDispositionFilter twice

2018-03-02 Thread Orlowska (JIRA)
Orlowska created SLING-7525:
---

 Summary: Content-Type missing after applying the 
ContentDispositionFilter twice
 Key: SLING-7525
 URL: https://issues.apache.org/jira/browse/SLING-7525
 Project: Sling
  Issue Type: Bug
Affects Versions: Security 1.1.10, Security 1.1.8
Reporter: Orlowska


The issue started with the SLING-7219.

When the {{ContentDispositionFilter}} is called twice (as a request filter and 
as a forward filter) on a single request then the {{Content-Type}} is not 
propagated and missing in the Response.

 

On the second pass in the {{setContentType()}} the condition [1]
{code:java}
if (previousContentType != null && previousContentType.equals(type)){code}
will be fulfilled so the [2]
{code:java}
super.setContentType(type);{code}
will not be called.

 

[1] 
[https://github.com/apache/sling-org-apache-sling-security/blob/master/src/main/java/org/apache/sling/security/impl/ContentDispositionFilter.java#L208]

[2] 
[https://github.com/apache/sling-org-apache-sling-security/blob/master/src/main/java/org/apache/sling/security/impl/ContentDispositionFilter.java#L253]



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)