Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-04-12 Thread beaudet
: http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4072780.html Sent from the Sling - Users mailing list archive at Nabble.com.

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-02-01 Thread Bertrand Delacretaz
Hi Lance, On Tue, Jan 31, 2017 at 10:25 PM, lancedolan wrote: > Aha! Solved Here's my solution for posterity thanks for sharing! Note that (and maybe I should have tried that earlier, sorry) you can also use our planets resource example on Sling 8 by building it as follows: svn co -r16

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-31 Thread Henry Saginor
st httpServletRequest, String path) { >return getResource(resourceResolver , path); >} > > //@Override >public Iterator listChildren(Resource resource) { > return null; >} > } > > And then you just create your own servlet, analogous to my ImageTypeServlet > which contains a static final String RESOURCE_TYPE > > > > -- > View this message in context: > http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4070023.html > Sent from the Sling - Users mailing list archive at Nabble.com.

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-31 Thread Henry Saginor
his ResourceWrapper class and how to create > ResourceMetadata.... > > > > -- > View this message in context: > http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4070022.html > Sent from the Sling - Users mailing list archive at Nabble.com.

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-31 Thread lancedolan
vlet which contains a static final String RESOURCE_TYPE -- View this message in context: http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4070023.html Sent from the Sling - Users mailing list archive at Nabble.com.

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-31 Thread lancedolan
it :) It seems I need to learn about this ResourceWrapper class and how to create ResourceMetadata -- View this message in context: http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4070022.html Sent from the Sling - Users mailing list archive at Nabble.com.

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-30 Thread Henry Saginor
: > http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4069998.html > Sent from the Sling - Users mailing list archive at Nabble.com.

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-30 Thread lancedolan
ymous can still GET /myservice/image. It seems authentication still succeeds, as my Servlet can see the user ID on the request, but the authorization via Effective Policies isn't happening. -- View this message in context: http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-30 Thread lancedolan
t paths? So, for /service/{id} which could service a million unpredictable ids, then I'd need to create a million nodes with names that I can't predict? -- View this message in context: http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4069997.html Sent from the Sling - Users mailing list archive at Nabble.com.

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-30 Thread Bertrand Delacretaz
Hi Lance, On Fri, Jan 27, 2017 at 10:27 PM, lancedolan wrote: > ...Bertrand suggests creating a ResourceProvider, as in the example here [1]. > However, that uses the spi package which is not in version 2.9.0 of > org.apache.sling.api, and thus, not available to me in Sling 8 We might need t

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-30 Thread Robert Munteanu
/trunk/launchpad/test-services/sr > c/main/java/org/apache/sling/launchpad/testservices/resourceprovider/ > PlanetsResourceProvider.java > > [2] http://stackoverflow.com/questions/41901337/how-to-use-jersey-in- > sling > > > > > > -- > View this message in context: http://apache-sling.73963.n3.nabble.com > /How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947.html > Sent from the Sling - Users mailing list archive at Nabble.com.

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-29 Thread Ben Fortuna
Hi Jason, Possibly I approached it from the wrong angle in my assessment, happy to hear it's been working for you and others. I may try again for APIs in future. That aside, after using sling for serving web content I can't recommend it enough. For me it certainly puts the fun back in web develop

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-29 Thread Jason E Bailey
I'm not sure how to correctly convey my confusion over your statement :) There may be some bias here, since I've been doing this for a while, but this is an incredibly easy platform for REST and I haven't ran across another that gives me the same flexibility. -- Jason On Sat, Jan 28, 2017, at 05:

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-29 Thread Jason E Bailey
In general I agree with you, that's the simplest OP had a dual need. which is storing information about the asset in the JCR at the same time, which I don't see how your solution handles. -- Jason On Sat, Jan 28, 2017, at 02:08 PM, Henry Saginor wrote: > In my opinion Sling is first and foremo

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-29 Thread Ben Fortuna
Hi Roy, Yes my reference to data/content was based on the OP stating he'll be storing data in JCR, so effectively yes he probably could just use a JCR repo backend. I'm not totally discounting Sling as an API platform, just that it probably won't integrate easily with other API frameworks (e.g. J

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-28 Thread Roy Teeuwen
Hey Ben, I have to argue you on that one though. The short definition of Apache Sling from the main site, definitely look at point 1: Apache Sling in five bullets points • REST based web framework • Content-driven, using a JCR content repository • Powered by OSGi

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-28 Thread Ben Fortuna
Hi Henry, I agree with what you say about keeping it simple and using a servlet. However there are many frameworks and platforms today geared towards making it easier to implement REST APIs, and I think non-trivial APIs would probably benefit from using one. As such, to me an API should live outs

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-28 Thread Henry Saginor
In my opinion Sling is first and foremost a REST framework specifically designed for this kind of thing. It’s not only to serve JCR content. The paradigm Steven described earlier in this thread is EXACTLY the way to implement it. In the Sling world the resource IS the RESTful object addressable

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-28 Thread Jason E Bailey
Its my understanding that the question on ACL's depends on where it is inheriting the ACL from. Taking your code as literal, you've declared that you own everything under /things and it would inherit the ACL of /. So if you put your ROOT as /content/remote/things You could set JCR ACLs on /content

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-28 Thread Roy Teeuwen
Hey Oli, Isnt that the whiteboard that I gave? https://github.com/apache/aries-jax-rs-whiteboard Greets Roy > On 28 Jan 2017, at 09:43, olimination wrote: > > Hi Lance, > > as Mike already mentioned the "Neba framework" offers you the full

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-28 Thread olimination
Hi Lance, as Mike already mentioned the "Neba framework" offers you the full Spring power, meaning you can easily write Spring controllers which then for example inject your needed OSGi services and you then do whatever you need to do plus you have access to all the possibilities Spring offers you

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-27 Thread Henry Saginor
Can’t you just create sling servlet registered to some resource type? You can then simply create JCR node(s) mapped to your resource type. You can also use a SynthaticResource via custom resource provider, which is the track you’re on and what Steven is suggesting. But I find that in most cases

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-27 Thread Steven Walters
On Sat, Jan 28, 2017 at 6:27 AM, lancedolan wrote: > Hi friends, > > I've tried routing questions through stackoverflow to cut down my mails to > this list. I'm losing lots of time on this one, though, and am stuck. > > I need to create APIs which don't represent Sling Resources. Example: > /servi

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-27 Thread Mike Nimer
he ultimate goal is just to provide a restful API in Sling 8 and the > static-path-declaration of SlingSafeMethodsServlet just doesn't cut it. > > Thanks a million guys... > > > > [1] > https://github.com/apache/sling/blob/trunk/launchpad/test-services/src/main/java/

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-27 Thread Andreas Schaefer Sr.
-- > View this message in context: > http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-Sling-8-tp4069947p4069949.html > Sent from the Sling - Users mailing list archive at Nabble.com.

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-27 Thread Roy Teeuwen
ugh the overall solution, and have considered you're > suggestion, but I don't want to give up on building APIs inside of > OSGI/Sling unless I really need to. > > > > -- > View this message in context: > http://apache-sling.73963.n3.nabble.com/How-to-create-Res

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-27 Thread lancedolan
still thinking through the overall solution, and have considered you're suggestion, but I don't want to give up on building APIs inside of OSGI/Sling unless I really need to. -- View this message in context: http://apache-sling.73963.n3.nabble.com/How-to-create-Rest-APIs-for-non-JCR-data-in-

Re: How to create Rest APIs for non-JCR data in Sling 8??

2017-01-27 Thread Ben Fortuna
vide a restful API in Sling 8 and the > static-path-declaration of SlingSafeMethodsServlet just doesn't cut it. > > Thanks a million guys... > > > > [1] > https://github.com/apache/sling/blob/trunk/launchpad/ > test-services/src/main/java/org/apache/sling/launchpad/ > testservices/resou

How to create Rest APIs for non-JCR data in Sling 8??

2017-01-27 Thread lancedolan
.. [1] https://github.com/apache/sling/blob/trunk/launchpad/test-services/src/main/java/org/apache/sling/launchpad/testservices/resourceprovider/PlanetsResourceProvider.java [2] http://stackoverflow.com/questions/41901337/how-to-use-jersey-in-sling -- View this message in context: h