You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Lukas Smith <sm...@pooteeweet.org> on 2014/06/27 10:29:20 UTC

HTTP binding

Aloha,

Yesterday we did a little hackday to explore Jackrabbit Oak the HTTP interface and discovered that since last summer quite a few things have changed there. In general the changes seem to make the API more RESTful, f.e. no longer support appending ".json" to get a JSON response and instead requiring the use of Accept headers.

However some important features seem to have been lost in Oak:

1) ability to fetch multiple nodes in one HTTP request: https://issues.apache.org/jira/browse/OAK-1923
2) ability to specify a fetch depth: https://issues.apache.org/jira/browse/OAK-1924

Furthermore we were struggling with the lack of documentation and we could also not find any test cases to help us figure out other changes. Like it seems the REPORT HTTP method is no longer used, which previously allowed us to fetch the node types.

BTW this wiki entry should likely be removed http://wiki.apache.org/jackrabbit/Oak-over-HTTP
or linked to https://github.com/apache/jackrabbit-oak/blob/trunk/oak-http/README.md which is more up to date/complete.

So if anyone has a hint on how we can best get a grip on the new HTTP API we would very much appreciate it! For the previous version of the HTTP we found http://jukkaz.wordpress.com/2009/11/24/jackrabbit-over-http/ very useful but did "reverse engineer" quite a lot by trail and error which isn't the most efficient way to get going :)

regards,
Lukas Kahwe Smith

Re: HTTP binding

Posted by Michael Dürig <md...@apache.org>.

On 10.7.14 3:03 , Lukas Kahwe Smith wrote:
> Ok, Angela told my co-worker that apparently what we found is the new
> HTTP API but the old HTTP API should also be around and it should be
> possible to enable it somehow. If someone has hints for how to go
> about doing this, we would very much appreciate it.

Have a look at 
org.apache.jackrabbit.oak.run.Main.HttpServer#HttpServer(java.lang.String, 
java.util.Map<org.apache.jackrabbit.oak.Oak,java.lang.String>)

This exposes the Oak API, via oak-http and the JCR API via JCR remoting 
and via Webdav.

Michael

Re: HTTP binding

Posted by Lukas Kahwe Smith <sm...@pooteeweet.org>.
On 10 Jul 2014, at 15:36, Angela Schreiber <an...@adobe.com> wrote:

> hi lukas
> 
> what you looked as is just initial draft.... nothing that you can
> use with your jackalope setup... it's still not ready and far away
> from being a 'native' implementation of the spi server side part
> that would allow you to remote the jcr calls without having yet
> another jcr implementation on the server side.
> 
> this latter setup should be feasible with oak instead of jackrabbit
> by replacing the jackrabbit-core repository factory by one that
> contains oak-jcr inside.
> 
> in other words: you would need to change jcr-server setup such that
> it uses the corresponding factory and configuring
> the repository-access-servlet accordingly.
> 
> i don't recall the very details by heart but you may want to
> look at the corresponding code in jackrabbit that ties
> the repository to the jcr-server.
> 
> if you want to contribute your solution to oak that would
> for sure be welcome.

ah .. so basically it should be possible to hook in the old http binding but the plan is to finish this new http binding. meaning if someone wants to use the old http binding with oak it will always require a compiling a custom package, it will not be a question of changing some configuration setting. so in the long run it would be better for us to integrate with the new http api but this is currently not mature yet to support what we need.

let me phrase the question slightly differently then ..
how important is the new http api binding to the core oak dev team?
from our understanding 2 years ago, the http api was supposed to have a higher priority than it had with jackrabbit 2.x but this is no longer the case?

regards,
Lukas Kahwe Smith
smith@pooteeweet.org




Re: HTTP binding

Posted by Angela Schreiber <an...@adobe.com>.
hi lukas

what you looked as is just initial draft.... nothing that you can
use with your jackalope setup... it's still not ready and far away
from being a 'native' implementation of the spi server side part
that would allow you to remote the jcr calls without having yet
another jcr implementation on the server side.

this latter setup should be feasible with oak instead of jackrabbit
by replacing the jackrabbit-core repository factory by one that
contains oak-jcr inside.

in other words: you would need to change jcr-server setup such that
it uses the corresponding factory and configuring
the repository-access-servlet accordingly.

i don't recall the very details by heart but you may want to
look at the corresponding code in jackrabbit that ties
the repository to the jcr-server.

if you want to contribute your solution to oak that would
for sure be welcome.

best regards
angela



On 10/07/14 15:03, "Lukas Kahwe Smith" <sm...@pooteeweet.org> wrote:

>
>On 27 Jun 2014, at 12:32, Lukas Smith <sm...@pooteeweet.org> wrote:
>
>>> 
>>> On 27 Jun 2014, at 11:37, Michael Dürig <md...@apache.org> wrote:
>>> 
>>> 
>>> Hi,
>>> 
>>> oak-http didn't have much priority so far as Apache Sling was perceived
>>> to be the "proper HTTP layer" so there is much room for future
>>> improvements here.
>>> 
>>>> On 27.6.14 10:29 , Lukas Smith wrote:
>>>> 1) ability to fetch multiple nodes in one HTTP request:
>>>> https://issues.apache.org/jira/browse/OAK-1923 2) ability to specify
>>>> a fetch depth: https://issues.apache.org/jira/browse/OAK-1924
>>> 
>>> Thanks for reporting these. Patches would be most welcome ;-)
>> 
>> I think it is possible that we can supply patches here. First I wanted
>>to know if there is agreement that these features should be retained in
>>Oak. Second I would be interested in discussing the API. From our review
>>of the changes we noticed a move towards a more RESTful implementation.
>>However the above 2 features go to the limits of what REST covers,
>>meaning there is a lot more room for "bike shedding" than with other
>>aspects of the HTTP API.
>> 
>> For multiple node fetches we would propose to keep the API the same as
>>what we implemented for Jackrabbit 2.x, ie. a POST on the root with a
>>list of nodes. This is inspired by the CouchDB API.
>> 
>> For fetch depth I would propose to use a query parameter as the
>>previous approach of adding the fetch depth to the URI does not fit with
>>the move towards a more RESTful API. I guess some people might however
>>prefer to use a header for this.
>> 
>> At any rate .. I guess I should move the discussion to the 2 above
>>tickets but it would be good to get some feedback to ensure that our
>>patches would match the general philosophy of the Oak HTTP API.
>
>Ok, Angela told my co-worker that apparently what we found is the new
>HTTP API but the old HTTP API should also be around and it should be
>possible to enable it somehow. If someone has hints for how to go about
>doing this, we would very much appreciate it.
>
>regards,
>Lukas Kahwe Smith
>smith@pooteeweet.org
>
>
>


Re: HTTP binding

Posted by Lukas Kahwe Smith <sm...@pooteeweet.org>.
On 27 Jun 2014, at 12:32, Lukas Smith <sm...@pooteeweet.org> wrote:

>> 
>> On 27 Jun 2014, at 11:37, Michael Dürig <md...@apache.org> wrote:
>> 
>> 
>> Hi,
>> 
>> oak-http didn't have much priority so far as Apache Sling was perceived
>> to be the "proper HTTP layer" so there is much room for future
>> improvements here.
>> 
>>> On 27.6.14 10:29 , Lukas Smith wrote:
>>> 1) ability to fetch multiple nodes in one HTTP request:
>>> https://issues.apache.org/jira/browse/OAK-1923 2) ability to specify
>>> a fetch depth: https://issues.apache.org/jira/browse/OAK-1924
>> 
>> Thanks for reporting these. Patches would be most welcome ;-)
> 
> I think it is possible that we can supply patches here. First I wanted to know if there is agreement that these features should be retained in Oak. Second I would be interested in discussing the API. From our review of the changes we noticed a move towards a more RESTful implementation. However the above 2 features go to the limits of what REST covers, meaning there is a lot more room for "bike shedding" than with other aspects of the HTTP API.
> 
> For multiple node fetches we would propose to keep the API the same as what we implemented for Jackrabbit 2.x, ie. a POST on the root with a list of nodes. This is inspired by the CouchDB API.
> 
> For fetch depth I would propose to use a query parameter as the previous approach of adding the fetch depth to the URI does not fit with the move towards a more RESTful API. I guess some people might however prefer to use a header for this.
> 
> At any rate .. I guess I should move the discussion to the 2 above tickets but it would be good to get some feedback to ensure that our patches would match the general philosophy of the Oak HTTP API.

Ok, Angela told my co-worker that apparently what we found is the new HTTP API but the old HTTP API should also be around and it should be possible to enable it somehow. If someone has hints for how to go about doing this, we would very much appreciate it.

regards,
Lukas Kahwe Smith
smith@pooteeweet.org




Re: HTTP binding

Posted by Lukas Smith <sm...@pooteeweet.org>.
> On 27 Jun 2014, at 11:37, Michael Dürig <md...@apache.org> wrote:
> 
> 
> Hi,
> 
> oak-http didn't have much priority so far as Apache Sling was perceived
> to be the "proper HTTP layer" so there is much room for future
> improvements here.
> 
>> On 27.6.14 10:29 , Lukas Smith wrote:
>> 1) ability to fetch multiple nodes in one HTTP request:
>> https://issues.apache.org/jira/browse/OAK-1923 2) ability to specify
>> a fetch depth: https://issues.apache.org/jira/browse/OAK-1924
> 
> Thanks for reporting these. Patches would be most welcome ;-)

I think it is possible that we can supply patches here. First I wanted to know if there is agreement that these features should be retained in Oak. Second I would be interested in discussing the API. From our review of the changes we noticed a move towards a more RESTful implementation. However the above 2 features go to the limits of what REST covers, meaning there is a lot more room for "bike shedding" than with other aspects of the HTTP API.

For multiple node fetches we would propose to keep the API the same as what we implemented for Jackrabbit 2.x, ie. a POST on the root with a list of nodes. This is inspired by the CouchDB API.

For fetch depth I would propose to use a query parameter as the previous approach of adding the fetch depth to the URI does not fit with the move towards a more RESTful API. I guess some people might however prefer to use a header for this.

At any rate .. I guess I should move the discussion to the 2 above tickets but it would be good to get some feedback to ensure that our patches would match the general philosophy of the Oak HTTP API.

regards,
Lukas Kahwe Smith


Re: HTTP binding

Posted by Michael Dürig <md...@apache.org>.
Hi,

oak-http didn't have much priority so far as Apache Sling was perceived
to be the "proper HTTP layer" so there is much room for future
improvements here.

On 27.6.14 10:29 , Lukas Smith wrote:
> 1) ability to fetch multiple nodes in one HTTP request:
> https://issues.apache.org/jira/browse/OAK-1923 2) ability to specify
> a fetch depth: https://issues.apache.org/jira/browse/OAK-1924

Thanks for reporting these. Patches would be most welcome ;-)

> BTW this wiki entry should likely be removed
> http://wiki.apache.org/jackrabbit/Oak-over-HTTP or linked to
> https://github.com/apache/jackrabbit-oak/blob/trunk/oak-http/README.md
> which is more up to date/complete.

I quickly addressed this by adding a note to the top of that wiki page.

Michael