You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2008/03/13 08:31:46 UTC
[jira] Resolved: (SLING-307) JsonQueryServlet
[ https://issues.apache.org/jira/browse/SLING-307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Felix Meschberger resolved SLING-307.
-------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.0
After adapting the JsonQueryServlet to the Resource paradigm in Rev. 636656 I think this issue can be resolved.
And of course the integration tests still succeed ;-)
Please close if it works ok for you. Thanks.
> JsonQueryServlet
> ----------------
>
> Key: SLING-307
> URL: https://issues.apache.org/jira/browse/SLING-307
> Project: Sling
> Issue Type: New Feature
> Components: Default Servlets
> Reporter: Philipp Koch
> Assignee: Bertrand Delacretaz
> Fix For: 2.0.0
>
> Attachments: queryservlet.patch
>
>
> it would be nice to have a way to specify a jcr query in the url in order to query the underlying jcr repository.
> the attached patch works as follows:
> The new query servlet is called if the extension is ".json" and the selector is set to "query". you can pass following parameters in the url:
> statement: jcr query statement (XPATH or SQL)
> queryType: xpath or sql (of none is specified xpath is taken)
> property: specifies which property (relative path) has to be "put" into the result set (this parameter can be added multiple times)
> excerptPath: specifies the relative node path from where the excerpt has to be built.
> the result is returned as json string. e.g.:
> [
> {"name":"ee0","rep:excerpt()":"<excerpt><fragment>geometrixx/components/contentpage ... ee<\/fragment><\/excerpt>","jcr:path":"/content/ee0","jcr:score":"528","cq:content/jcr:title":"ee"},
> {"name":"news","rep:excerpt()":"<excerpt><fragment> ... geometrixx/components/contentpage ... ... ... ... news about geometrix<\/fragment><\/excerpt>","jcr:path":"/content/geometrixx/en/about/news","jcr:score":"521","cq:content/jcr:title":"News"}
> ]
> example query call:
> http://localhost:8080/sling/myhome.query.json?statement=//element(*,cq:Page)[jcr:contains(.,'sling')]/(rep:excerpt(.))&property=cq:content/jcr:title&excerptPath=cq:content
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.