On Sat, Jul 19, 2008 at 7:31 PM, Gilles Scokart <[EMAIL PROTECTED]> wrote:
> ...But what If I want to list all employees in a page or as a result of > an AJAX call? Did I have to use the url of the parent node of all the > employee and map that to a rendering script that I have to write ? Is > there any default rendering for list ?... The json rendering is recursive, so if you have a node /content/employees that contains many employee nodes, you can list them all at once by requesting /content/employees.infinity.json, or /content/employees.2.json if you want only 2 levels, etc. > > ...And what if I only want a sublist (as a result of a query for instance) > ?... Then yes you'll need a query - the simplest way is to use the JsonQueryServlet which you'd call for example like /content/employees.query.json?statement=...&queryType=...&offset=10&rows=10 See JsonQueryServletTest [1] for (a few) examples. The offset/rows parameters are used for paging through results. -Bertrand [1] http://svn.eu.apache.org/repos/asf/incubator/sling/trunk/launchpad/webapp/src/test/java/org/apache/sling/launchpad/webapp/integrationtest/JsonQueryServletTest.java
