An ASPAjaxWikiBlog Thingy

March 15, 2006

Save Tiddler to TagMe

Filed under: Planned Features, Ideas

OK, saving a single tiddler to TagMe was relatively trivial. Hijacking the TiddlyWiki.prototype.saveTiddler() function and adding the following at the end.

var TiddlerObj = {subject:tiddler.title, body:tiddler.text, wikiword:tiddler.title, id:title, tags:tiddler.tags}
ajax.PostObject("tagme.asp", TiddlerObj, "POST", "action=save")

The action "save" is a new action in tagme.asp which basically inserts or updates depending on the existance of the tiddler. It also obtains the id from the wikiword in the parameter id.

ajax.PostObject is also a new function which simply serializes a simple object as a series of parameters basically resulting in the following post data:
subject=MyTiddler&body=Hello+World&wikiword=MyTiddler&id=MyOldTiddlerTitle&tags=Tag1,Tag+2

Actually in order to get the comma seperated tags we must pass the following as the tags attribute of TiddlerObj:

tags:tiddler.tags.join(’,').replace(/[\[\]]/, "") 

This ensures the TW-style tags (Tag1 [[Tag 2]]) get converted to our CSV Tags.

TiddlyWiki Integration

Filed under: Ideas

I use TiddlyWiki daily because it’s the leanest, meanest, simplest, most intelligent personal data management system I’ve ever seen.

It’s only drawbacks are the lack of scalability and the lack of content/code seperation. This means, if you have 7 wiki files for managing 7 projects you have to update them all when a TW upgrade is available. This is especially difficult if you’ve customized the code yourself and not always using hijacking plugins (naughtyemoticon).

Regarding scalability, there’s only so much you can do with an HTML file where all data is loaded into memory at once. Sometime in the future you will have a performance problem.

I propose to hijack 3 aspects of TiddlyWiki and move all tiddler data to the server’s database.

  1. SaveToDiv() -> Don’t save to HTML, post entry/entries to server
  2. LoadFromDiv() -> Likewise, load all tiddlers (except their main body text) from the server into memory.
  3. Access to the tiddler’s body (not cached in memory)

In this way, memory is saved by only loading a tiddlers body (80-90% of the data size) when it is needed.

Get free blog up and running in minutes with Blogsome
Theme designed by Jay of onefinejay.com