While I've obviously been following the numerous discussions around the
issue of including data from external sources, I don't feel confident
that my knowledge of this is actually up to date.
Since I intend to reorganize my entire TiddlyWiki collection (see below)
and later write an article on the community wiki, I'd like to make sure
I get it right from the start.
As far as I can tell, we need to differentiate between three types of
tiddlers (due to differences in processing during startup):
* regular tiddlers
* shadow tiddlers (e.g. StyleSheet, PageTemplate, MarkupPostHead)
* plugins (i.e. "systemConfig" tiddlers)
Plugin candidates for these tasks include:
* IncludePlugin[1]
* LoadTiddlersPlugin[2]
* ExternalTiddlersPlugin[3]
* loadExternal (v2.0)[4]
But I'm not sure that's all I need - and whether there are any issues I
need to be aware of.
Additional background information:
My intention is to externalize the basic setup so all of my TWs can use
a centralized, consistent layout and configuration.
The first step is to use TinyTiddly[5]'s externalized TW core, which
should make upgrading very easy (simply by replacing twcore.js).
The next step, then, is to load the basic settings from a central TW so
I won't have to update each TW document individually.
Any further insights would be greatly appreciated. (I've got a feeling I
know who's gonna have all the answers for me here... )
-- F.
[1] http://tiddlywiki.abego-software.de/#IncludePlugin
[2] http://www.tiddlytools.com/#LoadTiddlersPlugin
[3] http://www.tiddlytools.com/#ExternalTiddlersPlugin
[4] http://tinyurl.com/2on5u9
(http://groups.google.com/group/TiddlyWikiDev/attach/24b01004700c20a6/ExternalTiddlers.zip?part=4)
[5] http://tinytiddly.tiddlywiki.org
> loadExternal (v2.0) would have the most potential for having
> everything every time automatically updated
I tend to agree, and will run some tests in the next few days.
I'll also take look at loadExternal's code; maybe I can do something
about that bug you've mentioned.
Thanks again, this is very much appreciated!
-- F.
The problem with using sync for this purpose is that plugins wouldn't
work right away; the TW document would need to be reloaded after the update.
However, that's not really a huge problem (as long as it's fully
automated), because the master TW document would usually not be updated
very often.
I'll investigate this further and report back when I have a workable
solution.
Thanks everyone!
-- F.
Will report back here as soon as there's something to show.
-- F.
* loadExternal proved to be the simplest solution for this particular
purpose of reading from a master document - in a different context (e.g.
including regular content tiddlers from various sources), the
alternatives mentioned before might be the better choice
That's one of the issues yet to sort out.
File access via HTTP is different from local file access; we'll need
XHR[1] to handle the loading of external file(s) there.
By the way, due to XSS[2]-related security issues, this will be limited
to files on the same host.[3]
> there isn't yet a more user friendly way
> to select tiddlers to include, other than writing each path and file
> name in the 'ExternalTiddlers' tiddler.
Actually, I will probably remove the functionality to include individual
files as tiddlers in favor of including just a single master document.
That's because including multiple external files has significant impact
on the startup speed (due to file I/O operations). Also, this inclusion
should be as simple and lightweight as reasonably possible, so I'll try
to avoid bloat through "just because I can" features.
However, there'd be an optional module or separate plugin for including
individual files as tiddlers (just because that makes developing TW
plugins so much easier).
> choose all tiddler with particular tags, all changed.. etc.
For that we'll use the [filter[syntax]] introduced in TW v2.2.6 (which
will probably become more powerful in future versions).
You can track the progress on my SVN repo:
http://fnd.lewcid.org/svn/TiddlyWiki/plugins/loadExternal/
But remember, this is still heavily work in progress, so it might be
sloppy code, features might change (see above) etc. - plus I might not
have the time to continuously work on it.
(In fact, I'm not entirely sure why I'm exposing myself like this - all
for the sake of FOSS, I guess... )
-- F.
[1] XMLHttpRequest (http://en.wikipedia.org/wiki/XMLHttpRequest)
[2] cross-site scripting (http://en.wikipedia.org/wiki/XSS)
[3] more info here: http://tiddlywiki.bidix.info/#ProxyService
also: http://tinyurl.com/ysh267
(http://announce.tiddlyspot.com/#%5B%5BProxy%20service%20available%20for%20Tiddlyspot%20sites%5D%5D)
As far as I could tell (and I admit that I, too, am confused by the
large number of options here), there is no truly satisfying solution
that does everything I want it to (and/or the way I want it to ;) ).
That's why I'm now developing TiddlyMaster (which is largely based upon,
and will thus supersede, loadExternal).
Wolfgang's original response to my inquiry gives a pretty good overview
of the options (and different approaches).
For example, other than loadExternal, LoadTiddlersPlugin stores all
updated ("master") tiddlers in the loading ("slave" or "client") TW.
There's also IncludePlugin, which doesn't work for including plugins
though - however, it has (or will have) some pretty advanced features
for including regular content.
So each of those options has a distinct raison d'être (even though the
differences are hard to grasp at first).
Bottom line: LoadTiddlersPlugin is probably what you want right now.
> I can't seem to access my SVN repo from this machine though, so I'll
> apply the fix tonight.
Done; Wolfgang, the backstage button should now use the value from the
"Title" slice in [[TiddlyMasterConfig]].
-- F.
So your original question was geared towards downloading the file
separately (e.g. via ImportTiddlers), in contrast to actually opening it
as a TW document in the browser?
In that regard, the download size would indeed be reduced - but you
would not have access to the tiddlers from the master document, as TMP
(pretty much any plugin, really) only takes effect when the respective
TW document is actually rendered.
However, one could imagine a separate plugin (code) repository as master
"back-end", and a front-end TW with additional documentation. But when
importing, users would have to point the ImportTiddlers wizard to the
master file, not to the file they navigate in their browsers - which
might be difficult to communicate.
I hope this answers your question.
-- F.
Well, no, but the master document would have to be loaded in full to
extract the respective tiddlers for inclusion.
> the master with all the older systemConfigs and the core would still
> be there in my browser cache
Not necessarily; this depends on a number of factors (both server and
client configuration), so you can't be sure that caching will work that way.
> Would today's new slave override just those 5 updated tiddler from
> the cache - or isn't it more likely that I actually indeed would
> have to purge the whole cache
If the master document has not been edited (i.e. the last-modified
timestamp is the same as the cached version's), the user agent (browser)
might recognize this and use the cached version instead (if there is
one), thus only downloading the (modified) slave file.
-- F.
Oh, now I see what you mean (I hope).
Local tiddlers take precedence over external tiddlers. So if a tiddler
of the same name exists both in the master and in the slave, that
tiddler is skipped during import.
-- F.
Yep.
Of course the factors required for this to work your way - server and
client configuration, user visiting patterns - are not very likely to
coincide for regular users. But if it's for a particular target
audience, it might be okay.
-- F.
I think you could make this work between tiddlyspot sites by using
tiddlyspot's proxying workaround..
Using the odd looking url of:
http://devoroumov.tiddlyspot.com/proxy/http://devoroumov2.tiddlyspot.com
You can get to the second site from the first. I'm not sure how the
authentication would work though. Maybe tiddlyspot should take away
the auth from the proxy script.
;Daniel
--
Daniel Baird
They say a million monkeys typing will eventually produce Shakespeare.
Thanks to commenters on YouTube, we now know this is not true.
Yeah I think it's gonna need some changes on the tiddlyspot end.
Can you try it with authentication at one end only, then the other, and see what happens then?
Anyway.. so if you have a local TiddlyWiki, can you use Eric's new
version of LoadTiddlers to get tiddlers from a restricted online TW?
If we can get that going, I reckon we can get the rest working.
;D
On 1/9/08, Nicolas Syssoieff <nicolas....@gmail.com> wrote:
> If by one end or the other you mean the source TW or the destination TW,
> then I already have the answer for you :)
>
> - With source TW *non-restricted* and destination TW *non-restricted : OK
> *- With source TW *restricted* and destination TW *non-restricted : OK *(but
> prompt for authentication when exiting source TW - I guess it's because
> we're using the source TW proxy)*
> *- With source TW *non-restricted* and destination TW *restricted :
> NOK *(immediate
> failure with the now famous error **)*
> *- With source TW *restricted* and destination TW *restricted : NOK *(prompt
> for authentication by source tw then immediate failure with the same error
> **)
> *
> *** "Opening
> http://devoroumov.tiddlyspot.com/proxy/http://devoroumov2.tiddlyspot.comFound
It bothers me that a "case-insensitive" sort is the one that has to
understand the meaning of letter case. So I can understand it's not
easy to make stuff obvious :)
So basically you can't import tiddlers from a password-protected TW.
Can you import from a protected TW if you are importing into a TW on
your local drive? As in, is this just an online problem?
That's the new functionality that Eric added, so we should eliminate
the possibility of a bug in it before we go too much further. I know
it's Eric, but better to check anyway :)
;D