URL for import in local TWC?

59 views
Skip to first unread message

Reto Stauss

unread,
May 16, 2014, 8:52:02 AM5/16/14
to tidd...@googlegroups.com
On my quest to find a robust way to provide updates for a TWC application I tried out tank. Unfortuntaly I was not able to figure out
  1. how I can upload tiddlers I want to publish
  2. how the URL to my tank/bag/comp/.. is in a way that in a local TWC the import function may be used to get certain tiddlers from may tank

My own findings:

  1. It is not possible to upload tiddlers I need to create and edit them directly
  2. No luck with a syntax similar to WebSpace like http://extendedbrain.tiddlyspace.com/?select=tag:ExtendedBrain or something like https://tank.peermore.com/bags/ExtendedBrain/tiddlers

Anyone?

chris...@gmail.com

unread,
May 18, 2014, 8:48:46 AM5/18/14
to tidd...@googlegroups.com

On Fri, 16 May 2014, Reto Stauss wrote:

> 1. how I can upload tiddlers I want to publish
> 2. how the URL to my tank/bag/comp/.. is in a way that in a local TWC
> the import function may be used to get certain tiddlers from may tank

At the moment, bulk import is possible via code you would make
yourself that uses the API[1].

I do have plans to make bulk import easier for various use cases and
for TWC in particular I've created a ticket[2].

[1] https://tank.peermore.com/tanks/docs/API
[2] https://github.com/cdent/tank/issues/126

> 2. No luck with a syntax similar to WebSpace like
Assuming you have a bag named "extendedbrain" which contains some
tiddlers that are tagged "ExtendedBrain" you can get all the tiddlers
in that bag as:

https://tank.peermore.com/bags/extendedbrain/tiddlers

and just the ones that are tagged "ExtendedBrain" with:

https://tank.peermore.com/bags/extendedbrain/tiddlers?select=tag:ExtendedBrain

For a real example:

https://tank.peermore.com/bags/cdent/tiddlers?select=tag:tiddlyweb

I hope this helps, let me know if you need more info.

--
Chris Dent http://burningchrome.com/
[...]

Reto Stauss

unread,
May 22, 2014, 8:16:02 AM5/22/14
to tidd...@googlegroups.com

At the moment, bulk import is possible via code you would make
yourself that uses the API[1].

I do have plans to make bulk import easier for various use cases and
for TWC in particular I've created a ticket[2].

[1] https://tank.peermore.com/tanks/docs/API
[2] https://github.com/cdent/tank/issues/126

Thanks for letting me know!
 
Assuming you have a bag named "extendedbrain" which contains some
tiddlers that are tagged "ExtendedBrain" you can get all the tiddlers
in that bag as:

     https://tank.peermore.com/bags/extendedbrain/tiddlers

and just the ones that are tagged "ExtendedBrain" with:

     https://tank.peermore.com/bags/extendedbrain/tiddlers?select=tag:ExtendedBrain

I going to try your suggestions.

Reto Stauss

unread,
Jun 18, 2014, 11:26:14 AM6/18/14
to tidd...@googlegroups.com

Assuming you have a bag named "extendedbrain" which contains some ...

Sorry for my late response ... I just tried to figure out how to create a bag. Or at least what the concept of a bag is. Unfortunately I was not able to find documentation about this topic on https://tank.peermore.com ...

Any hints?

chris...@gmail.com

unread,
Jun 18, 2014, 4:12:27 PM6/18/14
to tidd...@googlegroups.com
On Wed, 18 Jun 2014, Reto Stauss wrote:

> Sorry for my late response ... I just tried to figure out how to create a
> bag. Or at least what the concept of a bag is. Unfortunately I was not able
> to find documentation about this topic on https://tank.peermore.com ...

Try:

https://tank.peermore.com/tanks/docs/tank

and:

http://tiddlyweb.tiddlyspace.com/bag

Reto Stauss

unread,
Jun 19, 2014, 5:43:00 AM6/19/14
to tidd...@googlegroups.com
So a bag in TS corresponds to a tank? According to your previous post: no. Bags seem to exist also on tank@peermore (Ex. https://tank.peermore.com/bags/cdent/tiddlers?select=tag:tiddlyweb)

I read the documentation found at the two links you mentioned. Was not able to figure out how to create a bag on tank@peermore ... how would I use the HTTP API to create one? And no access to the server for using twanager ...

It starts to frustrate me a bit because I do not want a sophisticated TW hosting but only a place on the web where I can put my SPA (TWC including plugins and certain tiddlers) and people are able to download/update tiddlers in their local TWC.

chris...@gmail.com

unread,
Jun 19, 2014, 6:16:32 AM6/19/14
to tidd...@googlegroups.com
On Thu, 19 Jun 2014, Reto Stauss wrote:

> So a bag in TS corresponds to a tank? According to your previous post: no.

A tank is made from a bag, but not all bags are tanks. Compare the
output of:

https://tank.peermore.com/bags
https://tank.peermore.com/tanks

/bags is the HTTP API view on the available bags. You can also see
them as JSON:

https://tank.peermore.com/bags.json

This

https://tank.peermore.com/bags/cdent/tiddlers

lists all the tiddlers in the bag called cdent. This

https://tank.peermore.com/tanks/cdent

provides an entry point on the tank view of the same bag.


> I read the documentation found at the two links you mentioned. Was not able
> to figure out how to create a bag on tank@peermore ... how would I use the
> HTTP API to create one? And no access to the server for using twanager ...

You'll need to read more than just those two pages, also pages
linked from them, for example:

http://tiddlyweb.tiddlyspace.com/How%20do%20I%20create%20or%20update%20a%20bag%20over%20HTTP%3F

http://tiddlyweb.tiddlyspace.com/How%20can%20I%20use%20curl%20to%20create%20stuff%20in%20TiddlyWeb%3F

> It starts to frustrate me a bit because I do not want a sophisticated TW
> hosting but only a place on the web where I can put my SPA (TWC including
> plugins and certain tiddlers) and people are able to download/update
> tiddlers in their local TWC.

If you're goal is only to allow something people can import, then
you ought to be able to put the wiki HTML file on a web server as a
static file and have people import that URL from within their twc.

The reason for using a server side would be if you want to allow
easy access to updating the content on the server (that will later
be downloaded by other people).

Reto Stauss

unread,
Jun 19, 2014, 6:54:44 AM6/19/14
to tidd...@googlegroups.com
You'll need to read more than just those two pages, also pages
linked from them, for example [...]

Ok, thanks for your patience!
 
If you're goal is only to allow something people can import, then
you ought to be able to put the wiki HTML file on a web server as a
static file and have people import that URL from within their twc.

As far as I understood the point is to have this web server CORS enabled. Otherwise it is not possible to download tiddlers from a TW on it. I guess I give it a try ...
 
The reason for using a server side would be if you want to allow
easy access to updating the content on the server (that will later
be downloaded by other people).

Actually this is an issue: I need to maintain the public TWC. SoO after development locally, I have to update the public version.

Reto Stauss

unread,
Jun 19, 2014, 7:18:36 AM6/19/14
to tidd...@googlegroups.com

If you're goal is only to allow something people can import, then
you ought to be able to put the wiki HTML file on a web server as a
static file and have people import that URL from within their twc.

Just tried that out: the server needs to be CORS enabled. At least that is what the import functionality is telling me if try to open my TWC on this server.Darn.

chris...@gmail.com

unread,
Jun 19, 2014, 7:39:16 AM6/19/14
to tidd...@googlegroups.com
On Thu, 19 Jun 2014, Reto Stauss wrote:

> Just tried that out: the server needs to be CORS enabled. At least that is
> what the import functionality is telling me if try to open my TWC on this
> server.Darn.

So there's kind of hacky way to do what you want with tank (which
does support CORS):

* create a tank (from /dash) which is protected[1]
* add some text to the index page just for completeness
* drag your twc onto the box that says "Drop binaries into your tank
here."
* that will create a binary tiddler containing the tiddlywiki which
can't be edited locally but _can_ be imported into other
tiddlywiki's elsewhere
* link that tiddler into your index page

I did this in a tank called wikicors test:

https://tank.peermore.com/tanks/wikicorstest/index

If you try to import

https://tank.peermore.com/tanks/wikicorstest/foo

into a local empty.html you should get a tiddler called "Hi".

So the idea would be that every time you make an update your
distribution, just drop it on that box in your tank and it will be
accessible. There are other ways to accomplish the same thing that
could allow granular editing of the tiddler on tank itself, but they
have other complications. This one is pretty simple: drag, drop, go.

[1] this means you can write in it and everyone else can read,
there's more info about permissions here:

https://tank.peermore.com/tanks/docs/tank#creating-a-new-tank
http://tiddlyweb.tiddlyspace.com/policy

Reto Stauss

unread,
Jun 19, 2014, 7:49:55 AM6/19/14
to tidd...@googlegroups.com

Just tried that out: the server needs to be CORS enabled. At least that is what the import functionality is telling me if try to open my TWC on this server.Darn.

Enable an Apache for CORS ist actually pretty easy [1]:

Header set Access-Control-Allow-Origin "*"

Although if TWC is static on the server it is not possible to filter via URL like ?select=tag:ExtendedBrain.

[1] http://enable-cors.org/server_apache.html
 

Reto Stauss

unread,
Jun 19, 2014, 8:09:47 AM6/19/14
to tidd...@googlegroups.com
Thanks for your support and detailed instructions. Yes, it works as you described!

Filtering with this syntax "../tiddlers?select=tag:ExtendedBrain" does not work. Any chance to get this working?

chris...@gmail.com

unread,
Jun 19, 2014, 10:16:47 AM6/19/14
to tidd...@googlegroups.com
On Thu, 19 Jun 2014, Reto Stauss wrote:

> Thanks for your support and detailed instructions. Yes, it works as you
> described!
>
> Filtering with this syntax "../tiddlers?select=tag:ExtendedBrain" does not
> work. Any chance to get this working?

That's not going to work for the describe hack because you're at the
wrong layer. The select filter works on a collection of tiddlers
that are being presented in various representations. All those
tiddlers together might make up a tiddlywiki (that's how it works on
tiddlyspace for examples when you load
/tiddlers.wiki?select=tag:systemConfig).

In this hack you've placed the entire HTML file which makes up the
tiddlywiki into one single tiddler. There's nothing for the filter
mechanism to grab onto. It only works when there is a server side
collection of _multiple_ tiddlers. The the wiki-in-a-tiddler trick,
the tiddlers only become separate tiddlers in the browser, not on
the server.

Reto Stauss

unread,
Jun 19, 2014, 10:34:19 AM6/19/14
to tidd...@googlegroups.com
That's not going to work for the describe hack because you're at the
wrong layer. [...]

That's what I suspected.

But nevertheless I think I have a working solution for now. Thanks again!
Reply all
Reply to author
Forward
0 new messages