You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Phil Rice <ph...@googlemail.com> on 2011/07/20 13:47:44 UTC

Querying Sling

My current goal is produce two web pages. The first is the query
template. "I want to find all data items that look like <this>". The
second is a listing of the things that I have found.

There is a nice section in the Sling documentation describing how to
query: http://sling.apache.org/site/resources.html#Resources-QueryingResources.
This however all seems to be "how to do it from Java". From this I can
probably write my own JSP/Servlet to pass the query through to the
ResourceResolver.

However before I dive into this, I thought it best to ask: "what is
the usual way that you would find resources over the RESTful
interface". I have explored the Wiki, looked at the tutorials, and
spent a little while with google, and not found many hits (although I
did find quite a lot about the traditional Apache Sling...)

Re: Querying Sling

Posted by Phil Rice <ph...@googlemail.com>.
Thank you that's very helpful

On Wed, Jul 20, 2011 at 12:57 PM, Bertrand Delacretaz
<bd...@apache.org> wrote:
> Hi,
>
> On Wed, Jul 20, 2011 at 1:47 PM, Phil Rice
> <ph...@googlemail.com> wrote:
>> ...before I dive into this, I thought it best to ask: "what is
>> the usual way that you would find resources over the RESTful
>> interface"...
>
> The JsonQueryServlet is your friend, there's a nice tutorial here:
>
> http://in-the-sling.blogspot.com/2008/09/how-to-use-json-query-servlet.html
>
> and the test cases at [1] should help as well.
>
> -Bertrand
>
> [1] http://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/JsonQueryServletTest.java
>

Re: Querying Sling

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Wed, Jul 20, 2011 at 1:47 PM, Phil Rice
<ph...@googlemail.com> wrote:
> ...before I dive into this, I thought it best to ask: "what is
> the usual way that you would find resources over the RESTful
> interface"...

The JsonQueryServlet is your friend, there's a nice tutorial here:

http://in-the-sling.blogspot.com/2008/09/how-to-use-json-query-servlet.html

and the test cases at [1] should help as well.

-Bertrand

[1] http://svn.apache.org/repos/asf/sling/trunk/launchpad/integration-tests/src/main/java/org/apache/sling/launchpad/webapp/integrationtest/JsonQueryServletTest.java