On 7/19/07, Vincent Massol <vincent@massol.net> wrote:
On Jul 18, 2007, at 8:50 PM, Asiri Rathnayake wrote:
[snip]
---------- Forwarded message ----------
From: Asiri Rathnayake <asiri.rathnayake@gmail.com>
Date: Jul 18, 2007 9:37 AM
Subject: About XWiki XMLRPC
To: xwiki-dev@objectweb.org
Hi all,
After going through xwiki sources, I finally managed to fix the issues with XMLRPC. But before opening up any JIRA issues or submitting patches, i thought it would be better to get some feedback. Following are my observations on XMLRPCs,
1. XWiki's XMLRPC implementation does not map one-to-one with the given
documentation
Ex.
- in XWiki, there is no method as removePage(), instead we have deletePage()
- in XWiki, there is no method as removeSpace() but it's achieved by deleting all the child pages.
We need to align it. You can create JIRA issues and submit patches for that, thanks.
2. Some XMLRPCs are not implemented. But these are not used used in Xeclipse (yet), so i didn't pay much attention to them.
3. One XMLRPC call threw an exception when it's return type was 'void'. I changed this one to 'boolean' and everything works fine. I don't know why this happens though.
Which is that?
com.xpn.xwiki.xmlrpc.ConfluenceRpcHandler.deletePage() RPC.
(sorry, i should have mention this before)
4. storePage() RPC had a problem which makes it override other pages when trying to save a newly created page. I think this is a typo, anyway, it's fixed.
Cool. I think I've also fixed that today (but not committed yet as it's part of a bigger commit). It was using "newdoc" instead of "document". Is that the one? Please feel free to create a jira issue for this too.
in com.xpn.xwiki.xmlrpc.ConfluenceRpcHandler.storePage(),
The line,
XWikiDocument document = xwiki.getDocument(page.getId(), context);
tries to grab the old (existing) page. But the thing is, when we create a new page, we don't supply an id (according to the API).
therefor, the method call effectively becomes,
xwiki.getDocument(null, context);
well, after that, I don't know how things go. But the end result is 'document' refers to Main.WebHome and end up over writing that document.
my initial idea to fix this was to use
XWikiDocument document = xwiki.getDocument(page.getTitle(), context);
(this worked and i was able to add new pages)
but now I'm having second thoughts whether it would break page (existing) saving. Anyway, checking whether
page.getid() == null and appropriately invoking getDocument() will fix the issue.
please let me know if you think otherwise.
5. I also noted that there is a XWiki specific XMLRPC API too (which is very limited).
Ah, didn't know about this...
Does someone know if we want to keep it? I think we should dump it. Does it do anything that the confluence xmlrpc doesn't do?
It has two methods, getPage(String name) and getAllPages(). In Confluence API, there is no method for retrieving all the pages. But we can always get all spaces and iteratively get all child pages.
I'll create the JIRA issues tomorrow (i'm falling asleep).
Thanks
- Asiri
Thanks
-Vincent
So, if any of you have any concerns, thoughts, opinions, please throw them in. I'll create the JIRA issues little later.
Thanks.
- Asiri
--
You receive this message as a subscriber of the
xwiki-dev@objectweb.org mailing list.
To unsubscribe: mailto:xwiki-dev-unsubscribe@objectweb.org
For general help: mailto:
sympa@objectweb.org?subject=help
ObjectWeb mailing lists service home page:
http://www.objectweb.org/wws