jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Darren Hartford" <dhartf...@ghsinc.com>
Subject AW: Webdav SearchMethod and xpath query
Date Thu, 28 Dec 2006 16:48:54 GMT
All I needed was for someone to say "do not wrap the queries with
searchrequest or xpath tags".

> String jackrabbitquery=
> "<d:searchrequest xmlns:d=\"DAV\" 
> dcr:=\"http://www.day.com/jcr/webdav/1.0\">" + 
> "<dcr:xpath>//sv:node[@sv:name='jcr:root']</dcr:xpath>" + 
> "</d:searchrequest>"; ....

Should have been just:
String jackrabbitquery="//sv:node[@sv:name='jcr:root']";


This also goes for the SQL queries as well when using the Jackrabbit
webdav lib.

Couple months down the drain - hopefully no one else will make the same
mistake!

-D


> -----Original Message-----
> From: Darren Hartford 
> Sent: Thursday, November 30, 2006 11:51 AM
> To: 'users@jackrabbit.apache.org'
> Subject: Webdav SearchMethod and xpath query
> 
> I'm trying to use the xpath query mechanism through webdav.
> 
> ========
> String jackrabbitquery=
> "<d:searchrequest xmlns:d=\"DAV\" 
> dcr:=\"http://www.day.com/jcr/webdav/1.0\">" + 
> "<dcr:xpath>//sv:node[@sv:name='jcr:root']</dcr:xpath>" + 
> "</d:searchrequest>"; ....
> String mypath = "/jackrabbit-server-1.1/server/default/";
> HttpURL url = new HttpURL("http://localhost:8080" + mypath); ...
> SearchMethod smethod = new 
> SearchMethod(mypath,jackrabbitquery,"xpath");
> ...
> =======
> 
> And I'm always getting 400 responses and various errors like:
> 
> ==========
> <D:error xmlns:D="DAV:"><dcr:exception 
> xmlns:dcr="http://www.day.com/jcr/webdav/1.0"><dcr:class>javax
> .jcr.query.InvalidQueryException</dcr:class><dcr:message>Encou
> ntered "&lt;EOF&gt;" at line 1, column 163.&#xd; Was 
> expecting one of:&#xd; ....
> 
> And
> <D:error xmlns:D="DAV:"><dcr:exception 
> xmlns:dcr="http://www.day.com/jcr/webdav/1.0"><dcr:class>javax
> .jcr.query.InvalidQueryException</dcr:class><dcr:message>Lexic
> al error at line 1, column 45.  Encountered: ":" (58), after 
> : "": Lexical error at line 1, column 45.  Encountered: ":" 
> (58), after : ""</dcr:message></dcr:exception></D:error>
> ========
> 
> Could someone point me to some example or test code or some 
> similar sample that would be a reference working example?  
> Using the 
> org.apache.jackrabbit.webdav.client.methods.SearchMethod from 
> jackrabbit 1.1.
> 
> Thanks,
> -D
> 

Mime
View raw message