[dokuwiki] Re: [Gsoc] REST ful API alongwith XML/JSON RPC

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Thu, 24 Mar 2011 11:58:07 +0100

> I wanted to suggest the very same idea of a RESTful API but using a
> different approach and meant for a different application. My main goal
> was to utilize it to AJAXify the GUI, for example the search field.
> Another important subject which I was considering was to implement a
> structure to limit API requests (save bandwidth, security reasons) and
> to authenticate queries either by using a key-pair approach (as used
> by Amazon Web Services) or to authenticate using an API-Key assigned
> to each host.
>
> Another matter would be to introduce different response queries, for
> example, most AJAX applications use JSON to parse responses but some
> may prefer XML, so the idea is to provide different response
> structures.

These are all very nice ideas but quite a step ahead. Here is what I
see as the most urgent steps:

- Analyze the current XML-RPC interface
- move everything that implements any logic inside the XML-RPC server
out of it and back into the rest of DokuWiki core
- also check where code inside XML-RPC actually duplicates code in the
rest of DokuWiki core, merge this code with the core code (adjusting
anything currently relying on the core code)
- create an abstract API class/interface that defines
   a) functions that should be available via API (interfacing the
above core functions)
   b) the permissions these functions need to be called
   c) provides error handling/reporting to inheriting classes
   d) provides a plugin hook where plugins can register their own API
function in the same abstract manner
- create a new XML-RPC interface that implements/inherits from the
above abstract interface
- provide an plugin hook to register new API implementations (eg. for
your suggested REST API, JSON or XML output)

After the above is implemented and working reliable and if there's
still time it's fine to implement another API like JSON.

Andi

-- 
splitbrain.org
-- 
DokuWiki mailing list - more info at
http://www.dokuwiki.org/mailinglist

Other related posts: