> it's currently not possible to use TiddlyWiki's import function

That's correct.

There are two separate issues here:
* browser security / access restrictions (same origin policy)
* tiddler origin / sync target

Working around that first item should be fairly straightforward using a 
proxy, as described by yourself and Chris. (It probably makes sense to 
have a whitelist of permitted domains in the instance config.)

The second issue, however, is somewhat more complicated.
When you import from an external source (say, a plugin repository), do 
you want to sync against the original source or to your TiddlyWeb server?
You can't really have both - although one could imageine a macro that 
switches destinations on demand (e.g. an Update Plugins button that 
restores systemConfig tiddlers' server.* fields to point to the 
respective origin, pulls down the latest version via sync and eventually 
sets the fields back to TiddlyWeb)...

> this came up yesterday for someone else as well. You
> can do some hackery if you take the wiki that TiddlyWeb produces
> offline (using wget, curl or adding download=<filename> to the
> parameter string of the URL), but you then run into issues with some
> of the server.* fields

Here's what we did:
* download the TiddlyWeb-generated TiddlyWiki document
* import from the desired source into our now-local document
* run a little script to set those new tiddlers' server.* fields to
  point to our TiddlyWeb server (so we can sync) and make sure the
  changecount is higher than zero (so sync picks up the local changes)

Alternatively, uou could import the respective document - either via the 
shell (twanager imwiki), or using the adaptor's putTiddlerStore method:
---------------
// get document contents
var localPath = getLocalPath(document.location.toString());
var doc = loadOriginal(localPath);      

// send contents to TiddlyWeb
var context = {
      host: "http://example.org";,
      workspace: "bags/myBag"
};
var callback = function(context, userParams) {
      if(context.status) {
           displayMessage("import succeeded");
      } else {
           displayMessage("import failed");
      }
};
var adaptor = new config.adaptors.tiddlyweb();
adaptor.putTiddlerStore(doc, context, null, callback);
---------------

HTH.


-- F.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to