Hi all;

I have been playing with JsonQueryServlet, trying to make a dojo.data
source.  The datasource is used by a dojo.form.FilteringSelect, which
looks up its data by calling
/.query.json?statement=/jcr:root//*[jcr:like(name, "searchTerm%")]
The JsonQueryServlet then returns a JSON object like this:
[{"name":"searchTermMatch","jcr:score":"1000","jcr:primaryType":"nt:unstructured","jcr:path":"/searchTermMatch"}]

Most of the nodes in our repository have a 'name' attribute. The
problem is that it is NOT the 'name' attribute that is returned in the
JSON object, but the value of node.getName(). But the search
jcr:like(name, "searchTerm%") searches the name attribute, not the
node name.

In most cases, I will be interested in the 'name' attribute, not
node.getName(). I know that I can make JsonQueryServlet return the
'name' attribute by appending "property=name" to the URL, but this
gives me a JSON object like this:
[{"name":"searchTermMatch","jcr:score":"1000","jcr:primaryType":"nt:unstructured","jcr:path":"/searchTermMatch","name":"searchTerm
and more"}]

That is, the JSON object has 2 'name' properties, which doesn't work
well in javascript.

I cannot find a way around this. Could we make JsonQueryServlet return
node.getName() as something other than 'name'? For instance,
'jcr:name'?
I'd be happy to create a patch for this, if you agree.


-- 
Vidar S. Ramdal <[EMAIL PROTECTED]> - http://www.idium.no
Akersgata 16, N-0158 Oslo, Norway

Reply via email to