On Wed, May 25, 2016 at 3:00 PM, Mark Sack <mark.sack(a)secti.al.gov.br>
wrote:
You're right - I was missing the wiki name. But,
for some reason, I still
can't get the queries to work. Here is what I've found so far.
There is only one wiki - confirmed by the following REST call:
http://10.1.16.192/wiki/rest/wikis/ which returns
<wikis><link href="http://10.1.16.192:8080/wiki/rest/wikis/query"
rel="http://www.xwiki.org/rel/query"/><wiki><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/spaces"
rel="http://www.xwiki.org/rel/spaces"/><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/classes"
rel="http://www.xwiki.org/rel/classes"/><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/modifications"
rel="http://www.xwiki.org/rel/modifications"/><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/search"
rel="http://www.xwiki.org/rel/search"/><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/query"
rel="http://www.xwiki.org/rel/query
"/><id>xwiki</id><name>xwiki</name></wiki></wikis>
I can get some information about the wiki using
http://10.1.16.192/wiki/rest/wikis/xwiki/ which returns
<wiki><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/spaces"
rel="http://www.xwiki.org/rel/spaces"/><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/classes"
rel="http://www.xwiki.org/rel/classes"/><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/modifications"
rel="http://www.xwiki.org/rel/modifications"/><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/search"
rel="http://www.xwiki.org/rel/search"/><link
href="http://10.1.16.192:8080/wiki/rest/wikis/xwiki/query"
rel="http://www.xwiki.org/rel/query
"/><id>xwiki</id><name>xwiki</name></wiki>
I can get a list of spaces in the wiki using
http://10.1.16.192/wiki/rest/wikis/xwiki/spaces/
I won't reproduce the results as it is quite long but it looks correct and
includes those that I've added.
But if I try to do a simple query such as
.../rest/wikis/xwiki/query?q=select+obj.first_name+from+Document+doc%2C+doc.object%28XWiki.XWikiUsers%29+as+obj&type=xwql
the result is
<searchResults
template="
http://10.1.16.192:8080/wiki/rest/wikis/xwiki/query?q={query}(&type={ty…
"/>
whereas the same query executed in velocity (without the URL encoding)
returns the correct result.
I checked the code and it seems you are not allowed to use full statements
(i.e. that start with 'select'). You have to use instead:
, <additional FROM clause> where ...
or
where ...
Unfortunately using a short query is not enough for XWQL. It seems the code
doesn't do anything special for XWQL query type and it treats it as HQL. So
for now you'll have to rely on HQL. See
http://extensions.xwiki.org/xwiki/bin/view/Extension/Query+Module .
You should probably report a bug regarding the fact that XWQL cannot be
used.
Hope this helps,
Marius
This is again probably some simple item I've overlooked. I appreciate your
help in resolving this problem.
Regards
Mark Sack
--
View this message in context:
http://xwiki.475771.n2.nabble.com/REST-API-ignores-type-parameter-tp7599586…
Sent from the XWiki- Users mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users