jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jukka Zitting <jukka.zitt...@gmail.com>
Subject Re: Native HTTP bindings for Oak
Date Wed, 27 Jun 2012 16:27:15 GMT
Hi,

On Mon, Jun 25, 2012 at 2:26 PM, Jukka Zitting <jukka.zitting@gmail.com> wrote:
> As suggested in OAK-104 [1] and discussed briefly before, I think it
> would be useful for Oak to have a native HTTP binding that allows
> remote clients to talk directly with oak-core without having to go
> through the JCR layer.

Here's a quick example of this feature in action. First, let's build
Oak trunk and start the standalone jar:

    $ mvn clean install
    $ java -jar oak-run/target/oak-run-0.3-SNAPSHOT.jar
    Apache Jackrabbit Oak 0.3-SNAPSHOT
    Starting an in-memory repository
    http://localhost:8080/ -> [memory]

Then, in a separate terminal I'm using the HTTPie tool
(http://httpie.org/) to access the server:

    $ http -u -b http://localhost:8080/
    {"jcr:primaryType":"nt:unstructured"}

    $ http -u -b http://localhost:8080/ test:={}
    {"jcr:primaryType":"nt:unstructured","test":{}}

    $ http -u -b http://localhost:8080/test
    {}

    $ http -u -b http://localhost:8080/test a=x b=y c=z
    {"b":"y","c":"z","a":"x"}

    $ http -u -b http://localhost:8080/?d=2
    {"jcr:primaryType":"nt:unstructured","test":{"b":"y","c":"z","a":"x"}}

    $ http -u -b http://localhost:8080/ test:=null
    {"jcr:primaryType":"nt:unstructured"}

A lot of things still don't work as expected, but the above should
give a rough idea of the possibilities.

BR,

Jukka Zitting

Mime
View raw message