UploadOptions + multiple TWs

4 views
Skip to first unread message

pixelwax

unread,
Sep 3, 2008, 11:46:31 AM9/3/08
to TiddlyWiki
Hello,

I'm having troubles with multiple TWs when trying to upload from local
to remote. Each TiddlyWiki is defaulting to the same set of
UploadOptions across all TWs regardless of the TW in use. It appears
that the cookie name is the culprit but before I go about hacking all
the Upload plugin Tiddlers to use unique cookie names (based upon the
my tiddly's filename, e.g. txtUploadStoreUrlMyTiddly,
txtUploadUserNameMyTiddly, txtUploadFilenameMyTiddly, and whatever
other cookies are involved...), I'd like to know if there is something
simpler for me to try. Is there?

Might as well mention this issue too in case it is related. When
working with the remote file, when I click "save to web" the backup
will not save to the specified remote backup directory, it saves to
the same directory holding the TW. I was able to get this to work with
a single TW but when I went to multiple TWs, this got hosed.

FWIW, I'm using MPTW 2.4.1 on Firefox 2.0.0.16 and WindowsXP.

Eric Shulman

unread,
Sep 3, 2008, 1:01:16 PM9/3/08
to TiddlyWiki


On Sep 3, 8:46 am, pixelwax <pixel...@gmail.com> wrote:
> Hello,
>
> I'm having troubles with multiple TWs when trying to upload from local
> to remote. Each TiddlyWiki is defaulting to the same set of
> UploadOptions across all TWs regardless of the TW in use. It appears
> that the cookie name is the culprit but before I go about hacking all
> the Upload plugin Tiddlers to use unique cookie names (based upon the
> my tiddly's filename, e.g. txtUploadStoreUrlMyTiddly,
> txtUploadUserNameMyTiddly, txtUploadFilenameMyTiddly, and whatever
> other cookies are involved...), I'd like to know if there is something
> simpler for me to try. Is there?

Try this:

Create a [[CookieJar]] tiddler, tagged with systemConfig, containing
the following lines of javascript code:

config.options.txtUploadStoreUrl="http://www.example.com/path/to/
store.php";
config.options.txtUploadDir="path/to/document/"
config.options.txtUploadFilename=null;
config.options.txtUploadBackupDir="backup";

These statements assign hard-coded settings (a.k.a 'baked cookies')
for various options used by the <<upload>> macro. If you add this
tiddler into each of your documents, you can then easily reconfigure
each document to have different settings to suit your particular
purposes.

Also, by using a CookieJar to associate hard-coded values with the
document itself rather than being stored as browser cookies, when you
view your document from another browser or system, the upload settings
for the document will still be correctly applied, even though the
browser you are using at the time almost certainly doesn't have any of
the proper cookie values defined.

Some points of note:

* The store URL is an absolute reference. Only one copy of the
store.php script is needed for any given domain, regardless of the
folder locations into which individual TW documents are uploaded.

* the upload directory is the *path* in which the specific TW document
will be placed. If you set it to null, it will default to the same
folder as the store.php script.

* the upload filename is generally set to null so that the *filename*
used online will default to the same as the document currently loaded
in the browser.

* the backup directory is specified without a leading "/", so that
backup folders will be created in each individual directory for which
you have uploaded a TW document. It is also possible to define an
*absolute* path (i.e., with a leading "/") to use a single, shared
backup directory so that all your TW documents can write their backup
files to the same location on your server. This ability can be very
useful, but may also create confusion if you have documents in several
different folders that all have the same name (e.g., multiple
instances of "index.html")

see also:
http://www.TiddlyTools.com/#CookieManagerPlugin
http://www.TiddlyTools.com/#FAQ_OverrideOptions

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

pixelwax

unread,
Sep 5, 2008, 3:08:37 PM9/5/08
to TiddlyWiki
Mmm, baked cookies. Those are delicious. Thanks a ton for the
comprehensive answer, Eric!

-pw

pixelwax

unread,
Sep 9, 2008, 7:07:33 PM9/9/08
to TiddlyWiki
Help! Is there an issue betwixt CookieJar and MonkeyGTD 3.0 alpha
r823143 using Firefox 2.0.0.16 with all add-ons disabled on
WindowsXPsp3?

The default InterfaceOptions are persistent regardless of CookieJar
settings. At least AutoSave always reappears checked (which I
absolutely and unequivocally detest, if I had an eternity I could not
state properly how much I hate having AutoSave set to true).

My failed troubleshooting procedure:
* Installed a fresh copy of MonkeyGTD
* Created the CookieManagerPlugin
* Did a save and refresh
* Baked a batch of cookies
* Stored them in CookieJar
* Did a save and refresh
* Baked a batch of options
* Stored them in CookieJar
* Did a save and refresh
* Closed Firefox and rebooted
* Repeated above
* Deleted Firefox cache and ALL its cookies
* Repeated above

Any suggestions?

Thanks.
-pw

wolfgang

unread,
Sep 10, 2008, 1:20:09 AM9/10/08
to TiddlyWiki
Hi pixelwax,

Settings in CookieJar get overwritten by MptwConfigPluign (since this
comes later in the Alphabet). Don't know if in this case CookieManager
can help.

To have the behated AutoSafe off, find MptwUserConfigPlugin
'systemConfig' tagged tiddler, and add the following line of code:

config.options.chkAutoSave = false;

- save, reload and AutoSave is gone.

Regards,

W.

Daniel Baird

unread,
Sep 10, 2008, 6:52:12 AM9/10/08
to Tiddl...@googlegroups.com
On Wed, Sep 10, 2008 at 3:20 PM, wolfgang <wolfga...@gmail.com> wrote:
>
> Hi pixelwax,
>
> Settings in CookieJar get overwritten by MptwConfigPluign (since this
> comes later in the Alphabet). Don't know if in this case CookieManager
> can help.

Renaming the plugin tiddler to "zzCookieManager" should do the trick.

;D

--
Daniel Baird
/to be or not to be/ => /(2b|[^2]b)/ => /(2|[^2])b/ => /.b/
...optimise your regexes, people!

Eric Shulman

unread,
Sep 10, 2008, 10:04:07 AM9/10/08
to TiddlyWiki
> > Settings in CookieJar get overwritten by MptwConfigPluign (since this
> > comes later in the Alphabet). Don't know if in this case CookieManager
> > can help.
>
> Renaming the plugin tiddler to "zzCookieManager" should do the trick.

[[CookieManagerPlugin]] helps you to generate the [[CookieJar]] by
using the "bake cookies" button in the <<cookieManager>> control
panel. However, it is the [[CookieJar]] that actually contains the
hard-coded setttings. Thus, you would need to rename "CookieJar" to
"zCookieJar" for your settings to be applied last.
Reply all
Reply to author
Forward
0 new messages