Revision r1.28 - 19 Nov 2002 - 05:40 GMT - LesOrchard

[This idea is still under development, but comments are welcome on XmlRpcToWikiDiscussion.]


Exposes an API via XmlRpc on a wiki to allow programatic inspection, retrieval, and modification of its contents. Possibly supports a WikiInterchangeFormat for a common treatment of WikiMarkup? between wikis. See: JSPWiki:WikiRPCInterface (where it all started)


The XML-RPC interface currently supports the following methods:

  • struct wiki.filterData(base64 data, string contentType, struct params):
    • See XmlRpcFilteringPipe
    • Note: Only the TWiki implementation supports this method at present
    • Accepts:
      • data (base64): Data stream to be filtered
      • contentType (string): MIME type of data being passed
      • params (struct): Arbitrary parameters to the filter
    • Returns:
      • (struct):
        • data (base64): Filtered data stream
        • contentType (string): MIME type of filtered data
  • int wiki.getRPCVersionSupported(): Returns 1 with this version of the Wiki API.
  • array wiki.getAllPages(): Returns a list of all pages. The result is an array of strings, again UTF-8 in URL encoding.
  • array wiki.getRecentChanges( Date timestamp ): Get list of changed pages since timestamp, which should be in UTC. The result is an array, where each element is a struct:
    • name (string) : Name of the page. The name is UTF-8 with URL encoding to make it ASCII.
    • lastModified (date) : Date of last modification, in UTC.
    • author (string) : Name of the author (if available). Again, name is UTF-8 with URL encoding.
    • version (int) : Current version.
  • struct wiki.getPageInfo( string pagename ) : returns a struct with elements
    • name (string): the canonical page name, URL-encoded UTF-8.
    • lastModified (date): Last modification date, UTC.
    • author (string): author name, URL-encoded UTF-8.
    • version (int): current version
  • struct wiki.getPageInfoVersion( string pagename, int version ) : returns a struct just like plain getPageInfo(), but this time for a specific version.
  • base64 wiki.getPage( String pagename ): Get the raw Wiki text of page, latest version. Page name must be UTF-8, with URL encoding. Returned value is a binary object, with UTF-8 encoded page data.
  • base64 wiki.getPageVersion( String pagename, int version ): Get the raw Wiki text of page. Returns UTF-8, expects UTF-8 with URL encoding.
  • base64 wiki.getPageHTML( String pagename ): Return page in rendered HTML. Returns UTF-8, expects UTF-8 with URL encoding.
  • base64 wiki.getPageHTMLVersion( String pagename, int version ): Return page in rendered HTML, UTF-8.
  • boolean wiki.putPage( String pagename, base64 text ): Set the raw Wiki text of page, returning boolean true on success.
  • array wiki.listLinks( string pagename ): Lists all links for a given page.
    • Returned array contains structs, with the following elements:
    • name (string): The page name or URL the link is to.
    • type (int): The link type. Zero (0) for internal Wiki link, one (1) for external link (URL - image link, whatever).


I guess I'm just not smart enough yet on TWiki. Hos does the wiki.putPage method handle access restrictions? Does the TWiki access restrictions even affect the get* methods? -- doug@lathi.net

I'll have to look through the code again, but I believe the TWiki interface works under the TWikiGuest access restrictions. -- LesOrchard - 19 Aug 2002

I added an issue into the ZWiki issue-tracking system here requesting implementation of the API. Hopefully, Simon will implement the API in ZWiki. -- Michael Bernstein - 5 Sep 2002

Latest News

All three implementations are now up to synch with the API as detailed here, which is roughly in synch with the API at JSPWiki:WikiRPCInterface. The one exception is that the TWiki implementation does not yet support listLinks, since I couldn't find a quick bit of code to use in TWiki for now. Other than that, I may add a method or two of my own to the API next, but the main thing is that something useful needs to be done with this stuff now.

-- LesOrchard - 05 Mar 2002

Partial implementations for TWiki, UseMod?, and MoinMoin. Still need to do some work to get them all in line with the latest rev of the spec on JSPWiki:WikiRPCInterface

-- LesOrchard - 28 Feb 2002


I plan on packaging this stuff up nicely when it's ready for general consumption. But for now, here's the naked code as I'm working with it:

  • twiki_xmlrpc_cgi.txt: TWiki XML-RPC
    • Requires SOAP::Lite perl module to be installed
    • To install, drop it into the bin/ directory of your TWiki installation.

  • usemod_xmlrpc_cgi.txt: UseModWiki XML-RPC
    • Requires SOAP::Lite perl module to be installed
    • To install
      • Drop it into your cgi-bin along with your wiki.pl
      • Edit it, and make sure the var $wiki_script points at your wiki.pl


  • The original idea of Wiki:InterWiki as a network of interlinked distributed WikiServers?
  • Conversion / synch between wikis, perhaps one personal and one public
  • Provide an abstract interface for a WikiBrowser? or lightweight PDA-based WikiClient?
  • Content harvesting by robot, for preparation in book form, summarization, etc.
  • I wanted this ... so I could use WikiAsPim?, concretely by writing some command-line tools to interact with the data in my personal wiki's pages and other software ... --JohnAbbe
  • A generic(!) Wiki GUI using http://www.xwt.org/


  • Explicit API beats messing with forms and textareas (See: Emacs:WikiRemote)
  • XmlRpc is language-neutral, a WikiClient? could access any WikiServer? regardless of implementation
  • Can serve the purpose of a WikiWikiTransportProtocol?
  • XmlRpc can be used pretty much anywhere a CGI script can be used

Why not?

  • Implicit API of forms and textareas might be just fine. (See: Emacs:WikiRemote)
  • WebDav already covers much of this functionality
  • TextFormattingRules? vary between implementations, between installations
  • There is no agreed upon WikiInterchangeFormat to render any wiki's raw content intelligible outside the originating wiki
  • WikiNames? vary between wikis

Attachment sort Action Size Date Who Comment
twiki_xmlrpc_cgi.txt manage 10.2 K 28 Aug 2002 - 20:05 TWikiGuest TWiki XML-RPC API
usemod_xmlrpc_cgi.txt manage 11.6 K 05 Mar 2002 - 06:48 LesOrchard UseModWiki? XML-RPC API
moinmoin_xmlrpc_cgi.txt manage 6.8 K 05 Mar 2002 - 06:47 LesOrchard MoinMoin XML-RPC API

Main.XmlRpcToWiki moved from Main.WikiWikiApi on 28 Feb 2002 - 03:16 by LesOrchard - put it back

When I grow up, I want to be a computer scientist
Rotating header picture Rotating header picture

Advanced Search

Related Entries

(Disabled, for now.)


View items on my Amazon wishlist

Made on a Macintosh Powered by Movable Type <$MTVersion$> Made for Safari Get Firefox You can do better than Microsoft Internet Explorer

Creative Commons License
This work is licensed under a Creative Commons License.