tiddlyweb change bag

17 views
Skip to first unread message

EduardWagner

unread,
Apr 27, 2009, 5:20:51 PM4/27/09
to TiddlyWiki, cd...@gmail.com
Hi,
is there a way to change the bag/source of a tiddler?

We would like to have the following solutions
- trash: move/copy tiddler to trash bag, that is cleared maybe once a
week
- share: move/copy tiddler to a shared bag, that is used by many
recipes
- archiv: move/copy tiddler to an archiv, where you could search for
good ideas

By the way, is it possible to have more than one workspace?

Thanks a lot
Edi

chris...@gmail.com

unread,
Apr 27, 2009, 8:38:17 PM4/27/09
to TiddlyWiki

On Apr 27, 10:20 pm, EduardWagner <ugligats...@googlemail.com> wrote:
> Hi,
> is there a way to change the bag/source of a tiddler?

At a fundamental level, yes: the HTTP API in TiddlyWeb supports this.

However to do it from within a TidldyWiki it would require some plugin
writing, or some adaptations of the Rename code in the
TiddlyWebAdaptor.

> We would like to have the following solutions
> - trash: move/copy tiddler to trash bag, that is cleared maybe once a
> week
> - share: move/copy tiddler to a shared bag, that is used by many
> recipes
> - archiv: move/copy tiddler to an archiv, where you could search for
> good ideas

For each of these you would:

* duplicate the tiddler data
* change the server.bag field to the {trash,shared,achive} bag
* save the tiddler to the server
* if a move, you would then delete the previous one

How you choose to do the save to the server is up to you. You could
use the methods provides by TiddlyWebAdaptor and
ServerSideSavingPlugin, or make your own http requests.

> By the way, is it possible to have more than one workspace?

It depends on what you mean by workspace?

In TidldyWeb parlance a workspace usually refers to the collection of
tiddlers created by a recipe, especially the TiddlyWiki representation
of those tiddlers. You can have as many recipes as you like.

I'm guessing you probably mean something else by workspace, but I'm
not sure what it is.

EduardWagner

unread,
Apr 29, 2009, 6:18:31 PM4/29/09
to TiddlyWiki, Chris Dent
Hi chris,
On 28 Apr., 02:38, "cd...@peermore.com" <chris.d...@gmail.com> wrote:
> At a fundamental level, yes: the HTTP API in TiddlyWeb supports this.
> However to do it from within a TidldyWiki it would require some plugin
> writing, or some adaptations of the Rename code in the
> TiddlyWebAdaptor
Ok, after start thinking about it the solution was ritght in front of
me
Copy and paste, now we have buttpns to do thus. ;)
> It depends on what you mean by workspace?
A recipe that can create and write to multiple bags?
Thanks a lot edi

FND

unread,
Apr 30, 2009, 2:44:53 AM4/30/09
to Tiddl...@googlegroups.com
> is there a way to change the bag/source of a tiddler?

This might be of interest:
http://trac.tiddlywiki.org/changeset/9597


-- F.

chris...@gmail.com

unread,
Apr 30, 2009, 8:14:59 AM4/30/09
to TiddlyWiki


On Apr 29, 11:18 pm, EduardWagner <ugligats...@googlemail.com> wrote:
>> It depends on what you mean by workspace?
>
> A recipe that can create and write to multiple bags?

Two things control where a tiddler is saved:

* If it is an existing tiddler it is saved back to where it came from.
* If it is a new tiddler it is saved to the server.workspace field
that it inherits, either from config, or the tiddler from which it was
linked.

Therefore, in order to get a recipe to save somewhere "different" you
need to set

config.defaultCustomFields["server.workspace"]

This is usually done in TiddlyWebConfig but can be overridden in other
plugins, as required.

FND

unread,
Apr 30, 2009, 2:07:05 PM4/30/09
to Tiddl...@googlegroups.com
> Two things control where a tiddler is saved:
> * If it is an existing tiddler it is saved back to where it came from.
> * If it is a new tiddler it is saved to the server.workspace field
> that it inherits

There's a third option; the NewTiddler macro might set the respective
custom field(s).


-- F.

Eric Shulman

unread,
Apr 30, 2009, 2:27:45 PM4/30/09
to TiddlyWiki
> There's a third option; the NewTiddler macro might set the respective
> custom field(s).

But that only works if you are creating new tiddlers...

Here's a little inline 'onclick' script that might be useful:

<script label="bag" title="change this tiddler's TiddlyWeb workspace">
var bag=prompt("enter a bag name");
if (!bag) return; /* cancelled by user */
tiddler.fields['server.workspace']=bag;
</script>

-e

EduardWagner

unread,
Apr 30, 2009, 6:19:48 PM4/30/09
to TiddlyWiki
On 30 Apr., 20:27, Eric Shulman <elsdes...@gmail.com> wrote:

Wow, thanks for that bunch of tips
Now we can share, archive and trash our tiddlers
next step forward to single sourcing of important documents
bye edi
by the way best wishes to labour day (1. Mai)

bengillies

unread,
May 1, 2009, 5:22:37 AM5/1/09
to TiddlyWiki
Hi Eduard

The link FND posted is probably the one you want as you can hit a few
conflict problems while copying from one bag to another. Specifically,
if a tiddler with that name already exists in the bag you are copying
to, then you will get a conflict if both tiddlers are on a different
revision and your tiddler will not be copied.

The link FND posted handles this conflict by altering the revision id
to match the revision in the destination bag, saving that, and
changing it back to the source bag. It currently does this
automatically and without prompting so will overwrite anything already
there by default. Depending upon your implementation this may or may
not need a slight alteration.

http://trac.tiddlywiki.org/changeset/9597

Ben

EduardWagner

unread,
May 3, 2009, 6:41:44 AM5/3/09
to TiddlyWiki
Hi Ben,
the plugin does quite the right job i wanted to have!
Tanks for the infos.
Bye Edi

EduardWagner

unread,
Jun 15, 2009, 6:35:20 AM6/15/09
to TiddlyWiki
On 1 Mai, 11:22, bengillies <bengill...@gmail.com> wrote:
> Hi Eduard
>
Depending upon your implementation this may or may
> not need a slight alteration.
>
> http://trac.tiddlywiki.org/changeset/9597
>
> Ben

Hi Ben,

Thanks a lot for the tips,
can anyone help us to adopt the plugins usage like that:
- integrate the plugin as a toolbar command,
- if you press the "copy to bag" button in the toolbar you get
a slider opend where you can
-- choose a listbox of allowed bags filled from a definition tiddler
(the definition tiddler can be changed for each recipes workbag)
-- check to copy or move (copy+delete source) the tiddler to the
wanted bag (default is move)

Our goal is to use the plugin to manage the deployment of tiddlers to
centralized bags we use
like (trash, knowhow, faqs, intern, ...)

Thanks Edi


That would be great.
Thanks Edi

bengillies

unread,
Jun 15, 2009, 10:20:27 AM6/15/09
to TiddlyWiki
Hi Edi

I have implemented moving tiddlers from one bag to another myself and
have just written up a post on how to do it at http://bengillies.net/#[[Publishing%20Tiddlers]]

As far as adding in listboxes to choose a bag, etc, I have not
personally done this, but my publishing plugin simply defines a couple
of new fields, so any plugin that can modify these should be fine.

let me know if this makes sense, or if something doesn't work.

Thanks

Ben

EduardWagner

unread,
Jun 15, 2009, 12:09:13 PM6/15/09
to TiddlyWiki


On 15 Jun., 16:20, bengillies <bengill...@gmail.com> wrote:
> Hi Edi
>
> I have implemented moving tiddlers from one bag to another myself and
> have just written up a post on how to do it athttp://bengillies.net/#[[Publishing%20Tiddlers]]
>
> As far as adding in listboxes to choose a bag, etc, I have not
> personally done this, but my publishing plugin simply defines a couple
> of new fields, so any plugin that can modify these should be fine.
>
> let me know if this makes sense, or if something doesn't work.
>
Hi Ben,
great, thanks for the plugin, it works fine.
It should be easy for us to set up some listbox editing,
i usally take erics listbox plugin, because it can use tag based
definitions, that i prefer,
but we will have a look at Jon Robson's AdvancedEditTemplate
seem to be quite flexible, the cascading inputs are impressive!
again it's fun to ask the community
Bye Edi

bengillies

unread,
Jun 15, 2009, 12:13:09 PM6/15/09
to TiddlyWiki
Great, glad I could help.


Ben

EduardWagner

unread,
Jun 16, 2009, 11:18:29 AM6/16/09
to TiddlyWiki


On 15 Jun., 18:13, bengillies <bengill...@gmail.com> wrote:
> Great, glad I could help.

Hi Ben,
thanks for the plugin,
i changed it a little bit, so we can use tiddlywiki config.options
cookies to set publishLevel and publishToBag.
Both cookie values are set via erics listboxpugin and each recipe has
different definition lists in his workspace to get the right bags.
Then i adjusted the Confirmation Message, so now the user gets to know
the current publishlevel and targetbag before publishing.
Now we can move or copy our tiddlers to trash, knowhow, faqs or other
projectbags, thats fun.

Thanks for help
Bye Edi

bengillies

unread,
Jun 17, 2009, 6:23:49 AM6/17/09
to TiddlyWiki
That sounds quite cool. Sort of like a file system browser/manager,
but for tiddlyweb.
Reply all
Reply to author
Forward
0 new messages