Hi Chris > Two is that, despite the above, it makes semantic sense that a > tiddler which has as content JSON but is expected to be manipulated > as a tiddler (that is the text attribute of a tiddler is JSON) should > have a content type that is distinct from straight > "application/json".
This is the bit that I still struggle with. There's still entirely special behaviour for application/json tiddlers. From the point of view of TiddlyWiki these tiddlers really are application/json, and not some special TW variant implied by the special content type. When the user drags in a .json file from the desktop they get an application/json tiddler automatically. End users are going to be confused if dragging text/html content gives them text/html tiddlers, but dragging application/json content gives them some different type. > TiddlyWeb is not merely a data store for tiddlers, it is also a content delivery system Yes I was thinking the same thing in relation to the work that Jon Udell has been doing making tiddlywebadaptor.js talk to PouchDB: the representation transformation aspects of TiddlyWeb can be seen as a layer on top of the data store layer. The trouble is that I wouldn't expect the existence of a representation transformation layer to break the basic data store layer protocol of "thou shall GET what thou PUT". The real issue for TW5 is that I have been trying to keep the serverside compatible with TiddlyWeb, but I can't really come up with a rationale for duplicating TiddlyWeb's handling of JSON tiddlers. Best wishes Jeremy On Wed, Apr 9, 2014 at 2:05 PM, <[email protected]> wrote: > On Tue, 8 Apr 2014, [email protected] wrote: > > All I need is a reliable way to read the text and fields of a tiddler, >>> regardless of its content type. >>> >> >> I think the best thing is going to be to set the 'type' field to >> something different. There's already the "unholy freaking of content >> types" in tiddlywebadaptor.js so there's some precedent. >> >> It's not ideal but is probably workable and keeps the (I think >> important) distinction between the content-type of the representation >> being PUT and the media type of the content. >> >> Is that workable? >> > > I spent quite a while going through several scenarios related to > this topic with FND. The result of that were two goals that though > related are not mutually dependent. > > One is that, long term, Jeremy is correct: There needs to be a > "reliable way to read the text and fields of a tiddler" even if the > "content" of the tiddler is application/json. At the moment the way > to do that for every single type, except for application/json, is to > get the tiddler as application/json. > > Two is that, despite the above, it makes semantic sense that a > tiddler which has as content JSON but is expected to be manipulated > as a tiddler (that is the text attribute of a tiddler is JSON) should > have a content type that is distinct from straight > "application/json". > > Doing both of these things preserves the some unique aspects of both > TiddlyWeb and TW5: TiddlyWeb is not merely a data store for > tiddlers, it is also a content delivery system. TW5, in one of its > forms, is a container and manipulator of tiddlers, including some which > contain content that is not wikitext. > > These things suggest the following actions: > > * TW5 institutes a media-type for tiddlers which contain JSON in the > text field. Because of that text field use I wonder if something > like "text/vnd.tiddler+json" is in the vicinity of right? Or maybe > application. Not sure and not sure it really matters other than > that it is custom in some form. > > When a tiddler is being PUT it is PUT with either the "old" > content-type application/json or the below new type and a type > attribute of the above. > > * TiddlyWeb extends itself to treat "application/x-tiddler+json" in > much the same way it treats "application/json" now, deprecating > but continuing to support the latter. > > The caveat here is that if some bright bulb chooses to PUT a tiddler > with content-type 'application/x-tiddler+json' and type attribute > of the same they are not going to get the results they expect. > > I think these changes will help maintain the important distinction > between the content type being transported and the content type > being stored or contained while still allowing "easy" binary and > pseudo-binary tiddlers. > > Thoughts? > > -- > Chris Dent http://burningchrome.com/ > [...] > > -- > 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. > -- Jeremy Ruston mailto:[email protected] -- 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.
