Hi Danielo

It's looking great, well done. I did some experimentation but the server
seems to have stopped responding. I'm now seeing the POST to
"exec/action=listTiddlers" stuck in the (pending) status, with no response
from the server. Apologies if I crashed it.

I did notice a few things (you may have mentioned them in earlier threads,
I'm afraid I'm in the process of catching up on the groups)

When loading a server tiddler the "created" and "modified" fields are
coming through as "NaNNaNNaNNaNNaNNaNNaN". I suspect that you're passing a
string for those fields that is not in the YYYYMMDDhhmmssmmm format
expected by the core (eg "20141208203732926")

An architectural concern is that you're using an HTTP POST request to
retrieve data from the server. Strictly, that is not correct. HTTP verbs
like GET and POST have specific semantics. The idea is that a URL
represents a resource - a thing that you can do things to. POSTing to a
resource is intended to create a new subordinate resource. There's a good
summary in Wikipedia:

http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods

This topic is also referred to as "REST"; you'll find lots of articles
explaining why POSTing to retrieve data is a bad idea. This one seems
reasonable:

http://blog.teamtreehouse.com/the-definitive-guide-to-get-vs-post

All of this might seem very arcane, but I've found that it's worth trying
to get it right. You'll end up with something more reliable and with better
performance.

A more basic concern is that as we've discussed before, what you've got
here is doing the same job as the tiddlyweb adaptor in the TiddlyWiki core.

Try visiting http://tw5test.tiddlyspace.com/tw5 in your browser with the
developer tools open on the "network" tab. As it starts up, you should see
a GET request to "tiddlers.json". The response is a JSON object containing
an array of the tiddlers in the wiki, but excluding the "text" field.
(Dates are encoded in "20131111192330" format).

These are called "skinny tiddlers". Click open a link to, say, "close.svg"
in the "Recent" tab and you should see a brief flicker as another GET
request is fired to retrieve the full tiddler, including the text field.
This process is called lazy loading; wiki.js implements a convention
whereby if the text field of a tiddler is requested and that tiddler lacks
a text field, then via an event the syncer module is given the opportunity
to load the named tiddler.

If you try to create a tiddler you'll get a 403 error because you're not
authenticated, but you should be able to see the HTTP PUT request that is
issued to create the tiddler. "PUT" is used to create a resource if the
name is known by the client, while "POST" is used if the server must
allocate a name to the new resource.

Listing the problems might all sound very discouraging, but it's not
intended to be. You'll have learned a great deal in getting as far as you
have, and possibly now be in a much better position to start to see why the
tiddlyweb is architected as it is. And of course, you have adopted goals
that are more ambitious than the current incarnation of the tiddlyweb
adaptor.

Anyhow, I think it might be worth having a look at the TiddlyWeb adaptor to
see if you can pick up some techniques that will simplify your plugin. If
you're around for the hangout tomorrow perhaps we can devote some time to
looking at the code then?

Best wishes

Jeremy.









On Mon, Dec 8, 2014 at 5:08 PM, Tobias Beer <[email protected]> wrote:

> Hi Danielo,
>
> I may have created more import conflicts right now... as I have edited
> GettingStarted again and also SiteSubtitle.
>
> Also, when I enter my username and then open that tiddler (with a link my
> edits above generate), it doesn't tell me that there is a server version
> outthere of it, even though in the "TD Tools" tab it says there is.
>
> So, I think for any missing tiddler, it would be good if you can check in
> some conditional ViewTemplate
> <http://tb5.tiddlyspot.com/#Conditional%20ViewTemplate%20Section> if it
> exists on the drive and provide that button to load it.
>
> "TD Tools" is a bit cryptic for a tabname. Perhaps call it "Drive",
> "Server", "Content", etc...
>
> Best wishes, Tobias.
>
> --
> You received this message because you are subscribed to the Google Groups
> "TiddlyWiki" 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/tiddlywiki.
> 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 
"TiddlyWiki" 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/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

Reply via email to