Hi Abilio, when runninng a tiddlywiki with node.js, a complete tiddlywiki html file is built and then served, it includes all the tiddlers. It is a two stage process, first tiddlywiki(nodejs) builds itself from the directories that contains the tiddlers as files. Then depending upon which 'edition' is specified different plugins are included. see the editions directory for tw5.com-server/tiddlers/ which is where the 'user' tiddlers are loaded from with the server edition. The nodejs instance of tw will then will build the html file using a set of templates. There is a template that is used for the store, look for the line <$list filter=<<saveTiddlerFilter>> template="$:/core/templates/html-div-tiddler"/> in the source files - this is creating the text of tiddlers for the 'store' area of the html file.
If you are only interested in having 'user' tiddlers in the database you could replace this with a new widget to extract the tiddlers from your database. Cheers BJ On Sunday, January 25, 2015 at 3:54:09 PM UTC-6, Abilio Marques wrote: > > Hi, > > As a long time user of tiddlywiki, I adapted the classic version into a > server version using sqlite and nodejs a couple of years ago. I never > published the code as I think it was more of a hack than real software. > After tiddlywiki5 was published, I found that it already has a server > running in nodejs. Now I want to add the sqlite storage as an alternative > to plain text files. > > Been trying to create a syncadaptor plugin for sqlite. Read these before I > started: > > http://tiddlywiki.com/dev/#Syncadaptor > http://tiddlywiki.com/dev/#SyncAdaptorModules > > It made me believe that it was possible. > > Then, as a quick test, I went into the directory called, > tiddlywiki/plugins and copied the filesystem directory into a new one > called sqlite. Refactored the entire code to replace "filesystem" by > "sqlite". > > Created a test wiki with the --init server parameter, then modified the > plugins list inside tiddlywiki.info accordingly (replaced filesystem with > sqlite). > > Tested it and still ran... Then tried a few console logs, and it printed > text when saving or deleting a tiddler, but... loadTiddler didn't run. I > was suspicious from the start, as it runs a dummy callback and the comments > read: > > We don't need to implement loading for the file system adaptor, because >> all the tiddler files will have been loaded during the boot process >> > > > Tried to find where, and I must say I got lost in the code... Would anyone > please point me in the right direction on how to make the plugin be the > responsible for loading all the tiddlers? (in other words, allow > loadTiddler to run) > > This time, I want to release my code, so I don't want to solve it in a > "replace this code in the core" fashion. > > > Thanks in advance, > Abilio > -- You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/tiddlywikidev. For more options, visit https://groups.google.com/d/optout.
