> I am trying to get a server adaptor work on a custom backend. Is > there somewhere documentation available for this?
There's some stuff on the wiki, but it hasn't gotten a lot of love in recent years: http://tiddlywiki.org/wiki/Dev:Server_Adaptor_Mechanism http://tiddlywiki.org/wiki/Dev:Server_Adaptor_Mechanism/Adaptor_Structure > I find it quite difficult to understand the code. Indeed, the existing adaptors are pretty crufty. Late last year (before I left Osmosoft), I had started to rewrite the TiddlyWebAdaptor, aiming to make it easier to understand and maintain (as much as the current framework allowed): https://github.com/FND/tiddlywebwiki/blob/adaptor/src/TiddlyWebAdaptor.js This work - along with the core's sync rewrite - is still very much incomplete (and currently on hold, as I understand it), but it might provide some insights, as I made an effort to document the generic requirements. > From the code the upload plugin seems a lot easier to understand. Are > there drwabacks with it compared to using the server adaptor stuff? The UploadPlugin is (intentionally) very simplistic - there's a big difference between one- and two-way sync. > Another question on the server adaptors is: > adaptor.mimeType = "application/json"; > is defined. I can also set it to text/html i assume. But what > happens when I want to send the tiddlers in json to the server and > receive them in html? That mimeType property is not a part of the adaptor framework, just a convenience of the TiddlyWebAdaptor. You can do whatever you like when you set up the HTTP request. It's unfortunate that the adaptor framework is so opaque that it seems like there's a lot of magic going on. While there is some of that (particularly regarding `context` and tiddler fields), an adaptor is basically just meant to mediate between TiddlyWiki and whatever data structure the backend provides - i.e. turn it into tiddlers. How that's done is almost entirely up to the adaptor's author. > Another thing is that the sample adaptor makes use of xhr.status > calls. Is there a reason that no jquery ajax calls used? I don't parse the first part of the question, but I assume you're referring to TiddlyWiki's ajaxReq function. Using jQuery.ajax was part of the adaptor rewrite - though there's a minor caveat: http://trac.tiddlywiki.org/ticket/1268 -- F. -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/tiddlywikidev?hl=en.
