07 May 2009 20:32
TAGS: api dev wikidot xmlrpc
The Wikidot API page.save method is one of the things we've been holding over for weeks, just because there were so many other important things to do.
But the API is also important, because it can enable developers (which are big fraction of our users) to create applications that use Wikidot.com as a service. This can be useful in many ways, the best example I can think of is creating an application, that get some photos from your disk, uploads them to Wikidot, creates a page for each of them and saves some metadata from them into it.
Today, I finally managed to start working on one of the most important API method which is page.save. This method obviously is for saving a page. The page saving mechanism in Wikidot is quite complex, because of advanced site permissions, various performance optimizations, caches and many scenarios of updating a page.
Also, we wanted to make page.save to be one method to update and create pages, which involves other permission checking, because in some cases you have permission to create a page, but not to edit. This is especially true if you have a site category with everybody-can-create-but-only-author-can-edit policy.
I started from dealing with updating already existing pages, so for now page.save can't yet create pages. We have more or less working page.save for the following activities:
code in Python syntax | |
---|---|
set title | page.save({ 'site': 'quake', 'page': 'dev:api-save', 'title': 'Other title' }) |
update page source | page.save({ 'site': 'quake', 'page': 'dev:api-save', 'source': '+ Come back later' }) |
set tags | page.save({ 'site': 'quake', 'page': 'dev:api-save', 'tags': ['wikidot', 'api'] }) |
all at once | page.save({ 'site': 'quake', 'page': 'dev:api-save', 'title': 'Other title', 'source': '+ Come back later', 'tags': ['wikidot', 'api'] }) |
Notes:
- the API service is XML-RPC based, so the syntax of calls is syntax of the programming language you use (Python used as an example syntax)
- site: quake and page: dev:api-save means http://quake.wikidot.com/dev:api-save page
- setting tags as a single string (comma- or space-separated) is also supported
- setting of parent page is also supported in similar way to setting the title
Now we're going to review the code, ensure there is no more caching mechanism I forgot about and make final polishing. This includes generating notifications to be send to page-watchers and saving revision comments.
This method is crucial for the API. Once it gets fully working (including creating pages), applications will be able to:
- create pages
- read pages
- modify pages
and this the core functionality we want to provide with the Wikidot API.
Check out the API methods to see if page.save is already out.
If you want to test the (beta) API, drop a comment at the Wikidot API page.
Which I got some time before?
Or do I need a new one ?
And: a great Step forward !
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
The page.save method is being worked on, we haven't made it public yet (even for API-testers).
Piotr Gabryjeluk
visit my blog
Thanks Piotr, that makes it clear. :)
Confusing is the fact that there are 2 info-platforms about his theme - your blog with informations about your projects and loved work and the "official" ( means public) documentation about the API.
I think I forget this from time to time..
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
There are two sources, but this is perfectly OK. Documentation (even not final yet) is official and informs about the current state of API. My blog informs about progress (and through older posts about history of it). I think this is good to have it done this way.
Cheers!
Piotr Gabryjeluk
visit my blog
For the Wikidot API page.save method I mean.
Thanks for all!
Post preview:
Close preview