XWiki XmlRpc help requested

3 messages Options
Embed this post
Permalink
Dilipkumar Jadhav

XWiki XmlRpc help requested

Reply Threaded More More options
Print post
Permalink
Hello friends,

I need a little help here with the XWiki XmlRpc API. I am able to connect to
my xwiki instance using the Swizzle Confluence.

However, I am currently able to only view contents of a particular page
which I supply to the getPage() method.

I would like to build a client which could fetch a list of pages based on
hql queries (which XWiki supports internally).

Could someone please guide me to a search method that could be used here
(eg. search(query, maxinterval) ).

I've tried pushing queries such as search("where doc.creator='XWiki.Admin",
10) but this results into an empty result list.

 

It was mentioned on the
http://platform.xwiki.org/xwiki/bin/view/Features/XMLRPC that XWiki
implements the most important part of the Confluence
<http://confluence.atlassian.com/display/DOC/Remote+API+Specification>
XML-RPC API including Pages: retrieval, rendering, creation, history,
update, search and removal. Could someone please please guide me as to what
I might be doing wrong here. As always, any help would be much appreciated.

 

 

 

import org.codehaus.swizzle.confluence.SpaceSummary;

import org.codehaus.swizzle.confluence.Confluence;

import java.util.HashMap;

import java.util.List;

import java.util.Vector;

 

public class ConfluenceExample {

    public static void main(String[] args) throws Exception {

        String username = "Admin";

        String password = "admin";

        String endpoint = "http://127.0.0.1:8080/xwiki/xmlrpc/confluence";

 

        Confluence confluence = new Confluence(endpoint);

        confluence.login(username, password);

        String sql = "where doc.creator='XWiki.Admin'";

        List searches = confluence.search(sql, 10);

        System.out.println(searches.size());

    }

}

 

 

 

 

 

 

 

Regards,

Dilipkumar Jadhav

 

_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Fabio Mancinelli-4

Re: XWiki XmlRpc help requested

Reply Threaded More More options
Print post
Permalink

On Oct 29, 2009, at 4:16 AM, Dilipkumar Jadhav wrote:

> Hello friends,
>
> I need a little help here with the XWiki XmlRpc API. I am able to  
> connect to
> my xwiki instance using the Swizzle Confluence.
>
> However, I am currently able to only view contents of a particular  
> page
> which I supply to the getPage() method.
>
> I would like to build a client which could fetch a list of pages  
> based on
> hql queries (which XWiki supports internally).
>
> Could someone please guide me to a search method that could be used  
> here
> (eg. search(query, maxinterval) ).
>
> I've tried pushing queries such as search("where  
> doc.creator='XWiki.Admin",
> 10) but this results into an empty result list.
>
>
The semantics of the "query" parameter of the search method is just a  
free text that is matched agains document names or content.

You cannot execute arbitrary HQL queries using the search method, nor  
there exist a method for doing so in the current XMLRPC api.

-Fabio
_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users
Dilipkumar Jadhav

Re: XWiki XmlRpc help requested

Reply Threaded More More options
Print post
Permalink
In reply to this post by Dilipkumar Jadhav
Hi Fabio,



>The semantics of the "query" parameter of the search method is just a  
>free text that is matched agains document names or content.
>
>You cannot execute arbitrary HQL queries using the search method, nor  
>there exist a method for doing so in the current XMLRPC api.
>
>-Fabio


You were absolutely right. This method only takes "free text" and searches
it through document names & content.
The results varied greatly if I changed the order of the words being passed
into the "query" parameter.
Also, I wasn't able to retrieve the URL from the search results. Only the
title could be accessed. As a result, I had to pass the top 10 results
iteratively to the getPage method to obtain the URL. The objective here was
to display search results from the XWiki into another application. The
application would pass certain query parameters to XWiki & XWiki would then
return document URLs which might be of help in the other application.

I also began fiddling with the REST api a little bit. I see that a lot of
methods in the examples at
http://platform.xwiki.org/xwiki/bin/view/Features/XWikiRESTfulAPI were based
on HttpClient 3.x api & the latest one is 4.0. Also, the JAXB I happen to
use is 2.1 (available in Netbeans as a default plugin). Since, I am new to
this, it will take a lot of time, effort & of course help from friends at
XWiki community to get up to date with the latest api :)

Just a question though - will the REST getMethod call for the
/wikis/{wikiName}/spaces/{spaceName}/search?q={keywords}[[&scope={name,conte
nt,title,objects}...]&number=n] resource result in the same search result as
does the internal wiki default/lucene search. My belief is it will return
the same result since we are fetching the same page.

Thanks for your help & timely response Fabio.


_______________________________________________
users mailing list
[hidden email]
http://lists.xwiki.org/mailman/listinfo/users