|
Cookbook /
XMLRPCSummary: How to communicate with PmWiki via the XML-RPC protocol
Version: 0.2
Prerequisites: Last tested on PmWiki version: pmwiki-2.0.beta26
Status:
Maintainer: James McDuffie
GoalTo create the framework and implementations necessary for communicating with PmWiki via the XML-RPC protocol. FilesProvides:
DescriptionXML-RPC is a remote procedure calling mechanism that uses HTTP as the transport layer and XML as the encoding. Its purposes is to allow software that runs on different types of machines to communicate easily. This PmWiki extension utilizes XML-RPC code from usefulinc.com to implement communicate. Currently the following XML-RPC interfaces have been implemented: All interfaces can utilize UserAuth for authentification if it is installed. Blogger InterfaceUse clients such as ecto (Mac OS X & Windows) or w.bloggar (Windows) to connect through this interface. You can also use Zoundary, another free blogging software. Instruct the client you choose to connect to your PmWiki installation's URL with "?action=xmlrpc" appended to it. For instance, if the PmWiki website utilized this plugin (it currently does not) you would connect to the URL: "http://www.pmwiki.org/wiki/pmwiki.php?action=xmlrpc". The username configured in the client is simply the Author name you usually use when editing. If you have password protected pages then use it when configuring the password in the client. Or, if you use UserAuth, use the password associated with your UserAuth username. However, if you do not use passwords or authentification then the password configured in the client can be any string. Most clients will complain if you leave the password field blank, so just put something like "nopass" in case you do not have protected pages. When the Blogger client connects to PmWiki it will download a list of existing group names on the wiki. The group names will appear to the client as blog names. Existing pages in a group will show up as recent posts. Editing a page as a post and then publishing it should not require any special actions. However, when creating a new page using a Blogger client, the desired pagename needs to be specified in the title field of the client. The client w.blogger does not show the title field unless you configure the title tags <title> and </title> in the account setup. If your client does not have a separate title field then you will need to explicitly write something like this at the beginning of the page contents: "<title>Main.NewPageName</title>". If the Group.PageName semantic is not used and instead only a page name is specified in the title field then the page will be put into the group currently selected in the client. VoodooPad InterfaceConnect to the VoodooPad interface using the same URL as described in the Blogger section above. Username and password setup also works the same way as the Blogger interface. The VoodooPad interface uses the vpwiki api. The vpstash example was used to develop the PmWiki interface. The interface is read only for now because of problems with how VoodooPad sends the name of the page being posted. The program seems to use a lowercased version of pagenames as a key even though the PmWiki interface sends the pagename properly capitalized to the client. Additionally, there does not appear to be a way to determine the group of the page referencing a new page resulting in problems with the wrong page being retrieved when a group name is not explicit in a wiki link. Therefore, the VoodooPad interface might not always work as expected. To navigate the wiki using VoodooPad you will most likely need to manually select links within the link bracket notation with your mouse and then press the link button at the top of the window. Any help in figuring out how to get around VoodooPad's limitations is greatly appreciated. InstallationAdd the following line to your config.php file: include_once('cookbook/xmlrpc.php');
ConfigurationBy default all interfaces are enabled. They can be turned off by setting the corresponding variable named below to 0 in your config.php before xmlrpc.php is included. Interface usage varibles:
For instance adding: $UseBloggerInterface = 0; will disable usage of the Blogger interface. ScreenshotsClick on image for bigger version. w.bloggarectoVoodooPadHistory
NotesThe way the code has been engineered will hopefully make it easy for further XML-RPC interfaces to be added. Please use the existing code as examples for writing new modules. Ideas for the Future:
When using Blogger clients, make sure to turn off any preprocessing or else the client might effect some of the markup on the page. CommentsXES - This is terrific. I'm using Ecto as a software package on the Mac platform. What I'm wondering is why it only shows 20 journal/wiki entries. I see that Ecto thinks that Blogger imposes a 20 post limit. I've asked Ecto to give me the last 333 entries, but it still only shows 20. Is this a limit from Ecto, or from the XML-RPC implementation in the cookbook entries?
I tried many other blogging packages, and Ecto was the only one that saw past entries, and allows me to edit them. I'd also recommend DashBlog. It won't list past entries, or allow you to edit items already on the website. However, it's so easy to use to start a new page, has a slender profile, and of course the benefit of being on the dashboard, that I can't resist recommending it. 2005-12-28: It seems I can't get this working with UTF-8. ecto fails to read (or post) characters such as å, ä and ö. 2006-10-12: Has anybody tried this with the Performancing firefox plugin (see http://performancing.com/firefox)? I can login fine, it downloads the groups (i.e. Blogs), but publishing a page does not work (invalid server answer or something like that...) sts 2006-11-07: I was unable to properly use the XML-RPC library with non-ISO-8859-1 characters. However, after migrating my wiki to utf-8 encoding, everything seems to work fine. Moreover, you may want to upgrade the xml-rpc library for php to the most current version, which is available from http://phpxmlrpc.sourceforge.net/ (alef0) 2007-01-19: I was unable to use this in conjunction with either UserAuth - or AuthUser, tried as an alternative. Would someone care to upload a working config of either ? Chris Stiles Fixed: When using some blogger clients it may be necessary to use the crypted form of the password, rather than the password itself.
Smc: 2008-04-04: Clarification on usage with Ecto (perhaps a question for James or XES)
AuthorCopyright 2005 by James McDuffie, under the GNU GPL License Isolating the problem with this recipe -- it must be php5 incompatible. I don't have a php4 server to try it on. I downloaded pmwiki-2.0.beta26 from subversion and tried it on my server. Same error. So it must be that it isn't php5 compatible right now. I don't have time to try to fix it right now. XES January 11, 2009, at 11:49 PM
User notes?: If you use, used or reviewed this recipe, you can add your name. The following format is recognized:
* (+) Optional positive comment. Name, date * (-) Optional negative comment. Name, date These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki. |