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.

Reply via email to