[xwiki-users] XMLRPC and getAttachment function
Hi everybody! I tried to use the *getAttachment(String token, String pageId, String fileName, String versionNumber)* function in the XMLRPC API. According to JIRA ticket, it should be implemented. Here is my call: final Map picList = (Map) client.execute("confluence1.getAttachment", new Object[] {token, "Main.WebHome", "imageName.png", "1.1"}); But I got the exception : Exception in thread "main" org.apache.xmlrpc.XmlRpcException: No such handler: confluence1.getAttachment Every other function (login, logout, getPage...) works fine. This one throws the exception, and a bogus function name throws exactly the same. Checking the file xwiki-platform-core/xwiki-core/src/main/java/com/xpn/xwiki/xmlrpc/XWikiXmlRpcHandler.java in the sources shows various functions , but not getAttachment. So here is my question : where is the getAttachment function? I'm aware that the whole API is not implemented yet, but the Jira ticket XWIKI-1663 says this particular function is. Did I do something wrong? -- Sébastien Fieux
On 26 juin 08, at 17:10, Sebastien Fieux wrote:
So here is my question : where is the getAttachment function? I'm aware that the whole API is not implemented yet, but the Jira ticket XWIKI-1663 says this particular function is. Did I do something wrong?
Hi Sebastien, sorry for the late reply. No you did't anything wrong. The getAttachment function is not implemented because it is redundant. Basically when you discover attachments with the getAttachments function you get as the result a list of Attachment structures that contain all the information about available attachments. These structures are basically the same that would be returned by calling getAttachment, so if you discover attachments you already have them all so there is no need to call getAttachment on each single item. You can then use the information contained in those structures for calling the getAttachmentData function and retrieve the actual attachment data. -Fabio
participants (2)
-
Fabio Mancinelli -
Sebastien Fieux