SlingClient is removing double / triple slashes from the URL

2017-06-22 Thread Andreas Schaefer Sr.
Hi

If I call a SlingClient this way:

slingClient.doGet(“/api/test/move.json//path///content/test//to///content/new-test”,
 200)

Then what is called is:

“/api/test/move.json/path/content/test/to/content/new-test”

and hence the call fails.

Is there a way to fix that like sub-classing SlingClient and then override 
doStreamGet() ?

Thanks - Andy

Re: Sling Test Environment Setup with Maven and Content Packages

2017-06-22 Thread Andreas Schaefer Sr.
So far so good. I was able to fire up Sling and install my content packages 
using WCMIO content
package plugin.

It is not as slick as the provisioning model but gets the job done.

Cheers - Andy

> On Jun 22, 2017, at 2:27 PM, Andreas Schaefer Sr.  wrote:
> 
> Hi
> 
> I need to setup a Sling test instance (with slingstart or something alike) 
> and it needs to
> be manage by Maven and be able to install Content Packages.
> 
> Is there a way to include packages during the setup?
> 
> Thanks - Andy Schaefer



Sling Test Environment Setup with Maven and Content Packages

2017-06-22 Thread Andreas Schaefer Sr.
Hi

I need to setup a Sling test instance (with slingstart or something alike) and 
it needs to
be manage by Maven and be able to install Content Packages.

Is there a way to include packages during the setup?

Thanks - Andy Schaefer

[jira] [Updated] (SLING-6981) Adjust ResourceResolverFactoryImpl and CommonsResourceResolverFactoryImpl to reflect SLING-6963

2017-06-22 Thread angela (JIRA)

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

angela updated SLING-6981:
--
Attachment: SLING-6981-2.patch

updated patch that also adjusts 
{{CommonResourceResolverFactoryImpl.getServiceUserAuthenticationInfo}}

> Adjust ResourceResolverFactoryImpl and CommonsResourceResolverFactoryImpl to 
> reflect SLING-6963
> ---
>
> Key: SLING-6981
> URL: https://issues.apache.org/jira/browse/SLING-6981
> Project: Sling
>  Issue Type: Improvement
>  Components: ResourceResolver
>Reporter: angela
> Attachments: SLING-6981-2.patch, SLING-6981.patch
>
>
> While testing the proposed extension to the service-user-mapping in a real 
> world scenario, I noticed that also the 
> {{ResourceResolverFactoryImpl#getServiceResourceResolver}} makes used of the 
> {{ServiceUserMapper}} and needs to be adjusted to reflect the fact that it 
> can be either a service-user-name or a set of service-principal-names.
> I can attach an initial patch for this but I have to admit that I am less 
> familiar with that part of Sling (compared to the service user mapper and the 
> jcr-component). So, I might have missed relevant parts or other areas around 
> the resource resolver that make use of the mapping.



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


[jira] [Updated] (SLING-6981) Adjust ResourceResolverFactoryImpl and CommonsResourceResolverFactoryImpl to reflect SLING-6963

2017-06-22 Thread angela (JIRA)

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

angela updated SLING-6981:
--
Summary: Adjust ResourceResolverFactoryImpl and 
CommonsResourceResolverFactoryImpl to reflect SLING-6963  (was: Adjust 
ResourceResolverFactoryImpl to reflect SLING-6963)

> Adjust ResourceResolverFactoryImpl and CommonsResourceResolverFactoryImpl to 
> reflect SLING-6963
> ---
>
> Key: SLING-6981
> URL: https://issues.apache.org/jira/browse/SLING-6981
> Project: Sling
>  Issue Type: Improvement
>  Components: ResourceResolver
>Reporter: angela
> Attachments: SLING-6981.patch
>
>
> While testing the proposed extension to the service-user-mapping in a real 
> world scenario, I noticed that also the 
> {{ResourceResolverFactoryImpl#getServiceResourceResolver}} makes used of the 
> {{ServiceUserMapper}} and needs to be adjusted to reflect the fact that it 
> can be either a service-user-name or a set of service-principal-names.
> I can attach an initial patch for this but I have to admit that I am less 
> familiar with that part of Sling (compared to the service user mapper and the 
> jcr-component). So, I might have missed relevant parts or other areas around 
> the resource resolver that make use of the mapping.



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


Re: Signed Urls, Authorization etc.

2017-06-22 Thread Ian Boston
On 22 June 2017 at 17:07, Bertrand Delacretaz 
wrote:

> On Thu, Jun 22, 2017 at 1:46 PM, Ian Boston  wrote:
> > ...I assume, with no responses, there isn't this capability, so I have
> created
> > [1] to build a PoC...
>
> Looks great, thanks!
>
> If you were planning to use an svn branch note that we also have
> https://svn.apache.org/repos/asf/sling/whiteboard/ for such things.
>

Completely forgot we are still in SVN.
BR
Ian


>
> -Bertrand
>


Re: Signed Urls, Authorization etc.

2017-06-22 Thread Bertrand Delacretaz
On Thu, Jun 22, 2017 at 1:46 PM, Ian Boston  wrote:
> ...I assume, with no responses, there isn't this capability, so I have created
> [1] to build a PoC...

Looks great, thanks!

If you were planning to use an svn branch note that we also have
https://svn.apache.org/repos/asf/sling/whiteboard/ for such things.

-Bertrand


[jira] [Updated] (SLING-6981) Adjust ResourceResolverFactoryImpl to reflect SLING-6963

2017-06-22 Thread angela (JIRA)

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

angela updated SLING-6981:
--
Attachment: SLING-6981.patch

proposed patch for {{ResourceResolverFactoryImpl.getServiceResolver}}. I was 
looking for some test coverage of that method to make sure I can provide test 
for the variant with principal-names mapping... but couldn't find any tests for 
that. Missing something?

> Adjust ResourceResolverFactoryImpl to reflect SLING-6963
> 
>
> Key: SLING-6981
> URL: https://issues.apache.org/jira/browse/SLING-6981
> Project: Sling
>  Issue Type: Improvement
>  Components: ResourceResolver
>Reporter: angela
> Attachments: SLING-6981.patch
>
>
> While testing the proposed extension to the service-user-mapping in a real 
> world scenario, I noticed that also the 
> {{ResourceResolverFactoryImpl#getServiceResourceResolver}} makes used of the 
> {{ServiceUserMapper}} and needs to be adjusted to reflect the fact that it 
> can be either a service-user-name or a set of service-principal-names.
> I can attach an initial patch for this but I have to admit that I am less 
> familiar with that part of Sling (compared to the service user mapper and the 
> jcr-component). So, I might have missed relevant parts or other areas around 
> the resource resolver that make use of the mapping.



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


[jira] [Commented] (SLING-6585) Switch to the ASF code signing service

2017-06-22 Thread Robert Munteanu (JIRA)

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

Robert Munteanu commented on SLING-6585:


Here's one possible way of solving this:

# Write the maven plugin that performs the signing
# Use the 
[tycho-p2-extras-plugin|https://wiki.eclipse.org/Tycho/Additional_Tools#tycho-p2-extras-plugin]
 to:
## mirror the source repository to another directory ( {{mirror}} goal )
## rebuild the p2 metadata ( {{publish-features-and-bundles}} goal )
# Use the antrun-maven-plugin to copy other files from the source directory ( 
index.html, p2.inf, etc )

> Switch to the ASF code signing service
> --
>
> Key: SLING-6585
> URL: https://issues.apache.org/jira/browse/SLING-6585
> Project: Sling
>  Issue Type: Task
>  Components: IDE
>Reporter: Robert Munteanu
>Assignee: Robert Munteanu
> Fix For: Sling Eclipse IDE 1.2.0
>
>
> The Eclipse tooling code signing was done with a personal certificate by 
> myself. I am no longer able to use that, so if we want to keep signing the 
> plug-ins, we should use the solution made available by the ASF ( see 
> https://reference.apache.org/pmc/codesigning ).



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


[jira] [Created] (SLING-6981) Adjust ResourceResolverFactoryImpl to reflect SLING-6963

2017-06-22 Thread angela (JIRA)
angela created SLING-6981:
-

 Summary: Adjust ResourceResolverFactoryImpl to reflect SLING-6963
 Key: SLING-6981
 URL: https://issues.apache.org/jira/browse/SLING-6981
 Project: Sling
  Issue Type: Improvement
  Components: ResourceResolver
Reporter: angela


While testing the proposed extension to the service-user-mapping in a real 
world scenario, I noticed that also the 
{{ResourceResolverFactoryImpl#getServiceResourceResolver}} makes used of the 
{{ServiceUserMapper}} and needs to be adjusted to reflect the fact that it can 
be either a service-user-name or a set of service-principal-names.

I can attach an initial patch for this but I have to admit that I am less 
familiar with that part of Sling (compared to the service user mapper and the 
jcr-component). So, I might have missed relevant parts or other areas around 
the resource resolver that make use of the mapping.



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


[jira] [Assigned] (SLING-5965) Metrics and a Health-Check for Scheduler to detect long-running Quartz-Jobs

2017-06-22 Thread Stefan Egli (JIRA)

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

Stefan Egli reassigned SLING-5965:
--

Assignee: Stefan Egli

> Metrics and a Health-Check for Scheduler to detect long-running Quartz-Jobs
> ---
>
> Key: SLING-5965
> URL: https://issues.apache.org/jira/browse/SLING-5965
> Project: Sling
>  Issue Type: New Feature
>  Components: Commons
>Affects Versions: Commons Scheduler 2.5.0
>Reporter: Stefan Egli
>Assignee: Stefan Egli
> Fix For: Commons Scheduler 2.6.4
>
> Attachments: SLING-5965.patch, SLING-5965.v2.patch.txt
>
>
> Sling Scheduler jobs (aka Quartz-Jobs) should typically be fast running jobs. 
> They are served from a thread-pool and should occupy that thread only for a 
> short amount of time.
> If there are 'misbehaving' quartz-jobs that run for a very long time, they 
> start to occupy threads from that thread-pool, thus have an influence on the 
> performance of other scheduled/quartz-jobs.
> We should have metrics (using 
> [sling.commons.metrics|https://sling.apache.org/documentation/bundles/metrics.html])
>  that provide information about internas of Sling Scheduler, such as average, 
> max etc duration of scheduled jobs, as well as how many jobs are currently 
> running and since when was the oldest job running.
> Based on this, a Health-Check can monitor the 'oldest job running' metric and 
> flag {{critical}} when eg the oldest job is older than {{60'000ms}} 
> (configurable, default).



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


Re: OsgiServiceUtil and R6 annotations

2017-06-22 Thread Tobias Bocanegra
Hi Antonio,

I just saw something similar today, where someone needed to instruct the bundle 
plugin to process the annotations early in order to get the tests run:

org.apache.felix
maven-bundle-plugin
true

  
  
  scr-metadata
  
manifest
  
  
true
  
  


regards, toby


On 22 June 2017 at 23:22:17, Robert Munteanu 
(romb...@apache.org) wrote:

Hi Antonio,

On Thu, 2017-06-22 at 07:12 +, Antonio Sanso wrote:
> anyone :S ?
>
> On Jun 21, 2017, at 9:12 AM, Antonio Sanso 
> wrote:
>
> > hi,
> >
> > I was investigating the test failure related to [0] and I thing I
> > found an issue/limitation with OsgiServiceUtil.
> > Indeed the activateDeactivate method doesn’t need to be able cope
> > with the new R6 annotations.
> > Fairly enough for case like ActivateDeactivate (aka [0]) being the
> > Config interface an inner one I would not know how OsgiServiceUtil
> > can be able to manage this scenario…

By my understanding the OsgiServiceUtil works on the XML metadata. That
metadata should be the same no matter what annotations are used.

I suggest to get an isolated test case and file a bug against the sling
osgi mocks.

Robert

> >
> > any idea?
> >
> > regards
> >
> > antonio
> >
> >
> > [0] https://issues.apache.org/jira/browse/SLING-6957
>
>



[jira] [Resolved] (SLING-6980) Missing internal_browser.gif icon on Eclipse Oxygen

2017-06-22 Thread Robert Munteanu (JIRA)

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

Robert Munteanu resolved SLING-6980.

Resolution: Fixed

Fixed in [r1799588|https://svn.apache.org/r1799588]

> Missing internal_browser.gif icon on Eclipse Oxygen
> ---
>
> Key: SLING-6980
> URL: https://issues.apache.org/jira/browse/SLING-6980
> Project: Sling
>  Issue Type: Bug
>  Components: IDE
>Reporter: Robert Munteanu
>Assignee: Robert Munteanu
>Priority: Minor
> Fix For: Sling Eclipse IDE 1.2.0
>
>
> We contribute an open command which picks up the browser icon from the 
> org.eclipse.ui.browser bundle
> {code:xml} 
> commandId="org.apache.sling.ide.eclipse.ui.actions.openHtmlInBrowserHandler"
>   
> icon="platform:/plugin/org.eclipse.ui.browser/icons/obj16/internal_browser.gif"
>   label="Open .html (on server) in browser">{code}
> This no longer works in Oxygen, I get the following error reported:
> {noformat}Exception:java.io.FileNotFoundException: 
> /icons/obj16/internal_browser.gif
>at 
> org.eclipse.osgi.storage.url.bundleentry.Handler.findBundleEntry(Handler.java:49)
>at 
> org.eclipse.osgi.storage.url.BundleResourceHandler.openConnection(BundleResourceHandler.java:169)
>at java.net.URL.openConnection(URL.java:979)
>at 
> org.eclipse.core.internal.boot.PlatformURLConnection.connect(PlatformURLConnection.java:112)
>at 
> org.eclipse.core.internal.boot.PlatformURLConnection.getURLAsLocal(PlatformURLConnection.java:237)
>at 
> org.eclipse.core.internal.runtime.PlatformURLConverter.toFileURL(PlatformURLConverter.java:34)
>at org.eclipse.core.runtime.FileLocator.toFileURL(FileLocator.java:207)
>at 
> org.eclipse.jface.resource.URLImageDescriptor.getFilePath(URLImageDescriptor.java:230)
>at 
> org.eclipse.jface.resource.URLImageDescriptor.access$2(URLImageDescriptor.java:218)
>at 
> org.eclipse.jface.resource.URLImageDescriptor$URLImageFileNameProvider.getImagePath(URLImageDescriptor.java:54)
>at 
> org.eclipse.swt.internal.DPIUtil.validateAndGetImagePathAtZoom(DPIUtil.java:408)
>at org.eclipse.swt.graphics.Image.(Image.java:771)
>at 
> org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:261)
>at 
> org.eclipse.jface.resource.ImageDescriptor.createResource(ImageDescriptor.java:180)
>at 
> org.eclipse.jface.resource.DeviceResourceManager.allocate(DeviceResourceManager.java:52)
>at 
> org.eclipse.jface.resource.AbstractResourceManager.create(AbstractResourceManager.java:85)
>at 
> org.eclipse.jface.resource.LocalResourceManager.allocate(LocalResourceManager.java:69)
>at 
> org.eclipse.jface.resource.AbstractResourceManager.create(AbstractResourceManager.java:85)
>at 
> org.eclipse.jface.resource.ResourceManager.createImage(ResourceManager.java:172)
>at 
> org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.getImage(AbstractContributionItem.java:148)
>at 
> org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.updateIcons(AbstractContributionItem.java:174)
>at 
> org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.update(AbstractContributionItem.java:124)
>at 
> org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.fill(AbstractContributionItem.java:261)
>at 
> org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:728)
>at org.eclipse.jface.action.MenuManager.update(MenuManager.java:810)
>at org.eclipse.jface.action.MenuManager.update(MenuManager.java:669)
>at 
> org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.scheduleManagerUpdate(MenuManagerRenderer.java:1212)
>at 
> org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.processContents(MenuManagerRenderer.java:649)
>at 
> org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.subscribeTopicChildAdded(MenuManagerRenderer.java:324)
>at sun.reflect.GeneratedMethodAccessor20.invoke(null:-1)
>at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>at java.lang.reflect.Method.invoke(Method.java:498)
>at 
> org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
>at 
> org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler$1.run(UIEventObjectSupplier.java:64)
>at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
>at 
> org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
>at org.eclipse.swt.widgets.Display.syncExec(Display.java:5439)
> 

[jira] [Created] (SLING-6980) Missing internal_browser.gif icon on Eclipse Oxygen

2017-06-22 Thread Robert Munteanu (JIRA)
Robert Munteanu created SLING-6980:
--

 Summary: Missing internal_browser.gif icon on Eclipse Oxygen
 Key: SLING-6980
 URL: https://issues.apache.org/jira/browse/SLING-6980
 Project: Sling
  Issue Type: Bug
  Components: IDE
Reporter: Robert Munteanu
Assignee: Robert Munteanu
Priority: Minor
 Fix For: Sling Eclipse IDE 1.2.0


We contribute an open command which picks up the browser icon from the 
org.eclipse.ui.browser bundle

{code:xml}  {code}

This no longer works in Oxygen, I get the following error reported:

{noformat}Exception:java.io.FileNotFoundException: 
/icons/obj16/internal_browser.gif
 at 
org.eclipse.osgi.storage.url.bundleentry.Handler.findBundleEntry(Handler.java:49)
 at 
org.eclipse.osgi.storage.url.BundleResourceHandler.openConnection(BundleResourceHandler.java:169)
 at java.net.URL.openConnection(URL.java:979)
 at 
org.eclipse.core.internal.boot.PlatformURLConnection.connect(PlatformURLConnection.java:112)
 at 
org.eclipse.core.internal.boot.PlatformURLConnection.getURLAsLocal(PlatformURLConnection.java:237)
 at 
org.eclipse.core.internal.runtime.PlatformURLConverter.toFileURL(PlatformURLConverter.java:34)
 at org.eclipse.core.runtime.FileLocator.toFileURL(FileLocator.java:207)
 at 
org.eclipse.jface.resource.URLImageDescriptor.getFilePath(URLImageDescriptor.java:230)
 at 
org.eclipse.jface.resource.URLImageDescriptor.access$2(URLImageDescriptor.java:218)
 at 
org.eclipse.jface.resource.URLImageDescriptor$URLImageFileNameProvider.getImagePath(URLImageDescriptor.java:54)
 at 
org.eclipse.swt.internal.DPIUtil.validateAndGetImagePathAtZoom(DPIUtil.java:408)
 at org.eclipse.swt.graphics.Image.(Image.java:771)
 at 
org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:261)
 at 
org.eclipse.jface.resource.ImageDescriptor.createResource(ImageDescriptor.java:180)
 at 
org.eclipse.jface.resource.DeviceResourceManager.allocate(DeviceResourceManager.java:52)
 at 
org.eclipse.jface.resource.AbstractResourceManager.create(AbstractResourceManager.java:85)
 at 
org.eclipse.jface.resource.LocalResourceManager.allocate(LocalResourceManager.java:69)
 at 
org.eclipse.jface.resource.AbstractResourceManager.create(AbstractResourceManager.java:85)
 at 
org.eclipse.jface.resource.ResourceManager.createImage(ResourceManager.java:172)
 at 
org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.getImage(AbstractContributionItem.java:148)
 at 
org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.updateIcons(AbstractContributionItem.java:174)
 at 
org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.update(AbstractContributionItem.java:124)
 at 
org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.fill(AbstractContributionItem.java:261)
 at 
org.eclipse.jface.action.MenuManager.doItemFill(MenuManager.java:728)
 at org.eclipse.jface.action.MenuManager.update(MenuManager.java:810)
 at org.eclipse.jface.action.MenuManager.update(MenuManager.java:669)
 at 
org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.scheduleManagerUpdate(MenuManagerRenderer.java:1212)
 at 
org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.processContents(MenuManagerRenderer.java:649)
 at 
org.eclipse.e4.ui.workbench.renderers.swt.MenuManagerRenderer.subscribeTopicChildAdded(MenuManagerRenderer.java:324)
 at sun.reflect.GeneratedMethodAccessor20.invoke(null:-1)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at 
org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
 at 
org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler$1.run(UIEventObjectSupplier.java:64)
 at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
 at 
org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
 at org.eclipse.swt.widgets.Display.syncExec(Display.java:5439)
 at 
org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:212)
 at 
org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler.handleEvent(UIEventObjectSupplier.java:61)
 at 
org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
 at 
org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
 at 
org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
 at 

Re: OsgiServiceUtil and R6 annotations

2017-06-22 Thread Robert Munteanu
Hi Antonio,

On Thu, 2017-06-22 at 07:12 +, Antonio Sanso wrote:
> anyone :S ?
> 
> On Jun 21, 2017, at 9:12 AM, Antonio Sanso 
> wrote:
> 
> > hi,
> > 
> > I was investigating the test failure related to [0] and I thing I
> > found an issue/limitation with OsgiServiceUtil.
> > Indeed the activateDeactivate method doesn’t need to be able cope
> > with the new R6 annotations.
> > Fairly enough for case like ActivateDeactivate (aka [0]) being the
> > Config interface an inner one I would not know how OsgiServiceUtil
> > can be able to manage this scenario…

By my understanding the OsgiServiceUtil works on the XML metadata. That
metadata should be the same no matter what annotations are used.

I suggest to get an isolated test case and file a bug against the sling
osgi mocks.

Robert

> > 
> > any idea?
> > 
> > regards
> > 
> > antonio
> > 
> > 
> > [0] https://issues.apache.org/jira/browse/SLING-6957
> 
> 



[jira] [Commented] (SLING-6977) Improve SCD compilation by suppressing warnings

2017-06-22 Thread Tommaso Teofili (JIRA)

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

Tommaso Teofili commented on SLING-6977:


thanks a lot Simo for your restless work on making our code cleaner and nicer!


> Improve SCD compilation by suppressing warnings
> ---
>
> Key: SLING-6977
> URL: https://issues.apache.org/jira/browse/SLING-6977
> Project: Sling
>  Issue Type: Improvement
>  Components: Content Distribution
>Reporter: Simone Tripodi
>Assignee: Tommaso Teofili
> Attachments: SLING-6977.patch
>
>
> After some cleanups, there are still compilation issues due to the fact we 
> want to be compliant to OSGi APIs that don't support generics, the incoming 
> patch will supply them in order to drastically reduce warnings in the IDEs 
> and on the compiler output.



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


[jira] [Updated] (SLING-6968) Resource Merger: Add another resource picker which merges two arbitrary resources given by path

2017-06-22 Thread Konrad Windszus (JIRA)

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

Konrad Windszus updated SLING-6968:
---
Summary: Resource Merger: Add another resource picker which merges two 
arbitrary resources given by path  (was: Resource Merger: Add another resource 
picker which explicitly merges two resources given by path)

> Resource Merger: Add another resource picker which merges two arbitrary 
> resources given by path
> ---
>
> Key: SLING-6968
> URL: https://issues.apache.org/jira/browse/SLING-6968
> Project: Sling
>  Issue Type: Improvement
>  Components: Extensions
>Affects Versions: Resource Merger 1.3.4
>Reporter: Konrad Windszus
>
> Currently both resource pickers "overlay" and "override" shipped with the 
> Sling Resource Merger determine only one resource from the given path url. 
> The underlying/overlying resources are determined either via 
> "sling:resourceSuperType" or via the resource resolver's search path.
> It would be useful to add a third resource picker which would allow to merge 
> two explicitly specified resources (because both paths are given in the 
> merged resource path).
> One concrete use case for that would be a composition pattern (in AEM: a 
> dialog definition being composed out of multiple dialog definition child 
> resources, being maintained somewhere in the repository but still allowing to 
> overwrite some of the properties of the referenced dialog definition child 
> resource).
> The only question is how to encode the two paths in the merged resource path 
> (what to use as separator). One idea is to separate via ";". So the merged 
> resource at {{/mnt/merge/;}} would merge the resource given at 
> {{}} with the resource given at {{}}.



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


Re: Signed Urls, Authorization etc.

2017-06-22 Thread Ian Boston
Hi,
I assume, with no responses, there isn't this capability, so I have created
[1] to build a PoC.
best Regards
Ian

1 https://issues.apache.org/jira/browse/SLING-6979

On 21 June 2017 at 10:10, Ian Boston  wrote:

> Hi,
> Does Sling already have a generic mechanism that would support generating
> something like an AWS policy signature [1] ?
>
> Obviously, an AWS policy signature is an implementation detail that I
> would expect would be hidden behind a SPI. The flow I am thinking of is:
>
> 1. http client requests authorization to perform an operation on a remote
> service.
> 2. Sling responds with some data that represents authorization the remote
> service understands.
> 3. http client uses the authorisation to perform the operation.
> 4. remote service validates the authorisation.
>
> I am thinking Sling would respond to step 1 with a servlet bound to a node
> with a resource type, that node containing some configuration.
>
> I know this sounds like an OAuth flow, and OAuth would be 1
> implementation, but there are others that dont use OAuth, like AWS[1].
>
> Does Sling have this already or is it something that I would need to
> explore in a whiteboard subtree ?
>
> Best Regards
> Ian
>
> 1 http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html
>
>
>
>
>
>


[jira] [Created] (SLING-6979) Support authorization of access to external content

2017-06-22 Thread Ian Boston (JIRA)
Ian Boston created SLING-6979:
-

 Summary: Support authorization of access to external content
 Key: SLING-6979
 URL: https://issues.apache.org/jira/browse/SLING-6979
 Project: Sling
  Issue Type: New Feature
Reporter: Ian Boston
Assignee: Ian Boston


This issue is a PoC. It adds a capability to Sling so that Sling can issue 
authorizations on request to access external data APIs. It will have a SPI 
allowing concrete implementations, as there are many different possible scheme. 
For instance, when configured with AWS S3 implementations of those SPIs, on 
request it will issue signed policy authorizations that allow a client to 
perform the authorised operation on the AWS S3 REST API, for a specific key, 
for a specific time period. This would support the client performing a direct 
upload to S3 as detailed in 
[http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html]. The 
same pattern with a different authorization mechanisms would allow Sling to 
emit  X-Accell-Redirect headers for a Proxy LN like nginX to stream directly 
from the storage. This effectively removes the task of streaming bytes through 
Sling from Sling ensuring that all request threads in Sling are short lived, 
not consuming survivour heap space. Long lived threads holding onto references 
from stack will cause those objects to land in survivor heap costing more to GC 
when the operation is complete, even if the transfer is streamed via the JVM.

Implementation will use a servlet attached to a resourceType. The Resource with 
that resource type will contain the configuration information and SPI 
implementation reference, so that requests to that Resource generate 
authorizations of the appropriate form. The configuration should be capable of 
mapping entire subtrees of individual resources. How the Resource path maps to 
a storage path is an implementation detail to follow Sling best practice in 
this area. (ie RESTfull)

The PoC will be done in a branch, and can be deleted if a complete failure.



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


[jira] [Created] (SLING-6978) [HApi] NPE if type is fetched from cache before the end of initialization

2017-06-22 Thread Andrei Dulvac (JIRA)
Andrei Dulvac created SLING-6978:


 Summary: [HApi] NPE if type is fetched from cache before the end 
of initialization
 Key: SLING-6978
 URL: https://issues.apache.org/jira/browse/SLING-6978
 Project: Sling
  Issue Type: Bug
  Components: HApi
Affects Versions: HApi 1.0.0
Reporter: Andrei Dulvac
 Fix For: HApi 1.0.2


An NPE can occur when accessing the type properties from a type before it was 
fully initialized.
{code}
org.apache.sling.hapi.sightly.HApiUse Failed to activate Use class
java.lang.NullPointerException: null
at java.util.HashMap.putMapEntries(HashMap.java:500)
at java.util.HashMap.putAll(HashMap.java:784)
at 
org.apache.sling.hapi.impl.HApiTypeImpl.getAllProperties(HApiTypeImpl.java:141)
at 
org.apache.sling.hapi.impl.MicrodataAttributeHelperImpl.itemtypeMap(MicrodataAttributeHelperImpl.java:63)
at org.apache.sling.hapi.sightly.HApiUse.activate(HApiUse.java:81)
at org.apache.sling.hapi.sightly.HApiUse.init(HApiUse.java:68)
at 
org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider.provide(JavaUseProvider.java:122)
at 
org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:72)
at 
org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:75)

{code}

The type is inserted in the cache too soon: 
https://github.com/apache/sling/blob/trunk/contrib/extensions/hapi/core/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java#L224



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


[jira] [Assigned] (SLING-6978) [HApi] NPE if type is fetched from cache before the end of initialization

2017-06-22 Thread Andrei Dulvac (JIRA)

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

Andrei Dulvac reassigned SLING-6978:


Assignee: Andrei Dulvac

> [HApi] NPE if type is fetched from cache before the end of initialization
> -
>
> Key: SLING-6978
> URL: https://issues.apache.org/jira/browse/SLING-6978
> Project: Sling
>  Issue Type: Bug
>  Components: HApi
>Affects Versions: HApi 1.0.0
>Reporter: Andrei Dulvac
>Assignee: Andrei Dulvac
> Fix For: HApi 1.0.2
>
>
> An NPE can occur when accessing the type properties from a type before it was 
> fully initialized.
> {code}
> org.apache.sling.hapi.sightly.HApiUse Failed to activate Use class
> java.lang.NullPointerException: null
> at java.util.HashMap.putMapEntries(HashMap.java:500)
> at java.util.HashMap.putAll(HashMap.java:784)
> at 
> org.apache.sling.hapi.impl.HApiTypeImpl.getAllProperties(HApiTypeImpl.java:141)
> at 
> org.apache.sling.hapi.impl.MicrodataAttributeHelperImpl.itemtypeMap(MicrodataAttributeHelperImpl.java:63)
> at org.apache.sling.hapi.sightly.HApiUse.activate(HApiUse.java:81)
> at org.apache.sling.hapi.sightly.HApiUse.init(HApiUse.java:68)
> at 
> org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider.provide(JavaUseProvider.java:122)
> at 
> org.apache.sling.scripting.sightly.impl.engine.extension.use.UseRuntimeExtension.call(UseRuntimeExtension.java:72)
> at 
> org.apache.sling.scripting.sightly.impl.engine.runtime.RenderContextImpl.call(RenderContextImpl.java:75)
> {code}
> The type is inserted in the cache too soon: 
> https://github.com/apache/sling/blob/trunk/contrib/extensions/hapi/core/src/main/java/org/apache/sling/hapi/impl/HApiUtilImpl.java#L224



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


[jira] [Commented] (SLING-6955) Convert Sling website to JBake and gitpubsub

2017-06-22 Thread Robert Munteanu (JIRA)

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

Robert Munteanu commented on SLING-6955:


Thanks, it's starting to look good :-) Some more notes besides what is listed 
in the README

* breadcrumbs are missing ; contrast 
http://localhost:8820/project-information/project-team.html with 
http://sling.apache.org/documentation/the-sling-engine.html .
* the sidebar design differs quite a bit. I think the old one was better. We 
don't have to keep it but I think we should improve what we have before going 
live
* the preformat area does not have any padding ( fixed with 
6931ba4fedd014824ecb643c31fede0b4e8826d9 )

A minor thing, but I think it would be good to get code highlighting back. It 
makes both java and HTML code much easier to read.

> Convert Sling website to JBake and gitpubsub
> 
>
> Key: SLING-6955
> URL: https://issues.apache.org/jira/browse/SLING-6955
> Project: Sling
>  Issue Type: Bug
>  Components: Site
>Reporter: Bertrand Delacretaz
>Assignee: Bertrand Delacretaz
>
> I've started experimenting with JBake to generate the Sling website. If that 
> works well we might switch to that + gitpubsub to have a more flexible way to 
> generate the site.
> My current experiment is at https://github.com/bdelacretaz/sling-jbake, at 
> this point the site starts looking like the current one and many pages work 
> well. 
> Internal links will need to be converted, all *.md files need a more complete 
> "front matter" section, currently I have a stub for that, and I think images 
> need to move under the assets folder.
> To play with that, generate the site with the bake.sh script (setup 
> shamelessly copied from https://github.com/apache/incubator-tamaya-site)



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


Re: Programmatically create a logger

2017-06-22 Thread Nicolas Peltier
Hi Chetan,

Good catch indeed! Specifying the location did the trick. 

Now I’m on the next issue :-) once configured, it looks that there is some gap 
before output switch is done from default logger to the specified logger.

log.info(“before”);
config.update(...)
log.info(“after”);
…
log.info(“long after”);

Will only show “long after” and after that one. Worse, there are logs “in the 
middle” that are lost (not on the default logger, nor on the configured one). 
Is there a trick for a flush/wait that would help?

(Btw is there a way I can unit test those outputs at all?)

Nicolas
> On 23 May 2017, at 05:55, Chetan Mehrotra  wrote:
> 
> On Fri, May 19, 2017 at 9:38 PM, Nicolas Peltier
>  wrote:
>> org.osgi.service.cm.Configuration.update(dict) from sling pipes bundle does 
>> not trigger LoggerManagedServiceFactory.updated
> 
> How are you creating the config instance from ConfigurationAdmin
> instance? You should use the listConfiguration approach [1] otherwise
> the config instance would get "bound" to the calling bundle [2] which
> would prevent that config from getting used by the Commons Log bundle
> 
> 
> Chetan Mehrotra
> [1] 
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fsling%2Fblob%2Ftrunk%2Finstaller%2Ffactories%2Fconfiguration%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fsling%2Finstaller%2Ffactories%2Fconfiguration%2Fimpl%2FConfigUtil.java%23L191=02%7C01%7C%7C9373bf816b1c4c223e1408d4a18fa0df%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636311085627988743=vKgCoaYjNYdTfXjSOk12Hg1R5tHFshf0h4gqXTM%2Fb84%3D=0
> [2] 
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fosgi.org%2Fjavadoc%2Fr4v42%2Forg%2Fosgi%2Fservice%2Fcm%2FConfigurationAdmin.html%23getConfiguration(java.lang.String=02%7C01%7C%7C9373bf816b1c4c223e1408d4a18fa0df%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636311085627988743=WHxtsSoaDuBR21lgq2E9HEyCQJmkduy%2BfTneSVh0oLI%3D=0)



[jira] [Commented] (SLING-920) Sling Jenkins setup

2017-06-22 Thread Robert Munteanu (JIRA)

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

Robert Munteanu commented on SLING-920:
---

Added {{ -XX:MaxPermSize=512m}} to the sling-ide due to recent build failure 
with OOME:

{noformat}Exception: java.lang.OutOfMemoryError thrown from the 
UncaughtExceptionHandler in thread "OsgiInstallerImpl"

---
 T E S T S
---
Running org.apache.sling.ide.test.impl.ServiceComponentHeaderValidatorTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.758 sec - in 
org.apache.sling.ide.test.impl.ServiceComponentHeaderValidatorTest
wildCardHeaderIsIgnored(org.apache.sling.ide.test.impl.ServiceComponentHeaderValidatorTest)
  Time elapsed: 1.677 sec
manifestNotUnderOutputDirectoryIsIgnored(org.apache.sling.ide.test.impl.ServiceComponentHeaderValidatorTest)
  Time elapsed: 0.927 sec
missingDescriptorIsReported(org.apache.sling.ide.test.impl.ServiceComponentHeaderValidatorTest)
  Time elapsed: 0.983 sec
presentDescriptorIsNotReported(org.apache.sling.ide.test.impl.ServiceComponentHeaderValidatorTest)
  Time elapsed: 2.144 sec
Running org.apache.sling.ide.test.impl.ContentImportTest
[WARNING] 
java.lang.OutOfMemoryError: PermGen space
[ERROR] Unexpected error in channel channel
java.lang.OutOfMemoryError: PermGen space{noformat}

> Sling Jenkins setup
> ---
>
> Key: SLING-920
> URL: https://issues.apache.org/jira/browse/SLING-920
> Project: Sling
>  Issue Type: Task
>  Components: CI
>Reporter: Bertrand Delacretaz
>
> Use this issue to record changes to the Jenkins setup at 
> https://builds.apache.org/view/S-Z/view/Sling/



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


[jira] [Resolved] (SLING-6970) Use versions of the tooling support bundles indepenendent of commons.json

2017-06-22 Thread Robert Munteanu (JIRA)

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

Robert Munteanu resolved SLING-6970.

Resolution: Fixed

Fixed with [r1799547|https://svn.apache.org/r1799547]

> Use versions of the tooling support bundles indepenendent of commons.json
> -
>
> Key: SLING-6970
> URL: https://issues.apache.org/jira/browse/SLING-6970
> Project: Sling
>  Issue Type: Task
>  Components: IDE
>Reporter: Robert Munteanu
>Assignee: Robert Munteanu
> Fix For: Sling Eclipse IDE 1.2.0
>
>
> Since the commons.json bundle has been removed from the Sling launchpad the 
> IDE tooling no longer works properly with it.
> We should update to the versions that simply rely on the embedded Felix 
> JSONWriter.



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


Re: [VOTE] Apache Sling Event 4.2.4

2017-06-22 Thread Stefan Egli
+1

Cheers,
Stefan

On 21/06/17 16:49, "Karl Pauls"  wrote:

>I would like to call a vote on the following release,
>
>Apache Sling Event 4.2.4
>
>We solved 6 issue in this release:
>https://issues.apache.org/jira/projects/SLING/versions/12339955
>
>Staging repository:
>https://repository.apache.org/content/repositories/orgapachesling-1746/
>
>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 1746 /tmp/sling-staging
>
>Please vote to approve these releases:
>
>  [ ] +1 Approve the releases
>  [ ]  0 Don't care
>  [ ] -1 Don't release, because ...




Re: OsgiServiceUtil and R6 annotations

2017-06-22 Thread Antonio Sanso
anyone :S ?

On Jun 21, 2017, at 9:12 AM, Antonio Sanso  wrote:

> hi,
> 
> I was investigating the test failure related to [0] and I thing I found an 
> issue/limitation with OsgiServiceUtil.
> Indeed the activateDeactivate method doesn’t need to be able cope with the 
> new R6 annotations.
> Fairly enough for case like ActivateDeactivate (aka [0]) being the Config 
> interface an inner one I would not know how OsgiServiceUtil can be able to 
> manage this scenario…
> 
> any idea?
> 
> regards
> 
> antonio
> 
> 
> [0] https://issues.apache.org/jira/browse/SLING-6957