MeatballWiki

Edit History Raw

WebInterfaces

Web applications use the web browser as the user interface. The core of the application itself, however, resides on the server. A wiki is one such web application. The WikiEngine and the PageDatabase both reside on some server (not necessarily the same one).

The database as well as the engine are interesting resources for people other than the wiki visitors, thus the usual web browser interface might not be rich enough.

Public Specifications

The simplest alternative is to publish how the browser communicates with the engine. Usually one of the following is used:

Parameters

   Example: http://www.emacswiki.org/cgi-bin/oddmuse.pl?action=edit&id=Errors

Keywords

   Example: http://www.emacswiki.org/cgi-bin/oddmuse.pl?Errors

Path Info

   Example: http://www.emacswiki.org/cgi-bin/oddmuse.pl/Errors

Cookies

   Cookies are sent and modified via specific HTTP headers

A good interface is documented somewhere on the site and lists the various ways to get at information.

For a wiki, it can be as simple as the [OddMuse Action List].

User Agents

This kind of communication can be emulated by other programs which act like browsers -- as HTTP clients. Here is such an example from a Perl script:

    my $uri = "http://ping.blo.gs/?name=foo&url=bar&direct=1";
    require LWP::UserAgent;
    my $ua = LWP::UserAgent->new;
    my $request = HTTP::Request->new('GET', $uri);
    return $ua->request($request);

Use Plain Text

The kind of interface mentioned above -- where the client acts as a web browser -- is often difficult to use because the format used is often HTML. And HTML often changes. So extracting the useful data becomes a pain.

One way to deal with this is to reduce the "fluff" in the format. Plain text is a very simple alternative.

As an example, OddMuse offers not only a [list of all pages] but also a [plain text list of all pages]. Similarly, it not only offers recent changes as [HTML], but also as [XML] and [plain text].

See also RawMode.

XML Remote Procedure Calls (RPC)

Moving away from HTML does not necessarily have to involve plain text. Many people enjoy using XML for data exchange. One way to do this is to use XML-RPC. Here, the communication between the local application and the remote engine uses XML documents. The function call and its parameters are translated into an XML representation, sent over the network, and on the remote site, the function is called with the appropriate parameters, and an XML representation of the result is sent back. The JSP Wiki has specifications for such an API http://www.jspwiki.org/Wiki.jsp?page=WikiRPCInterface2.


CategoryWikiTechnology