[Moin-user] MoinMoin API: Writing files and HTTP redirect

Thomas Waldmann tw-public at gmx.de
Thu Aug 28 11:36:02 EDT 2008


>> See AttachFile.py about how to tell the browser the filename (it's not 
>> perfect, but for some browsers and ascii-filenames it works).
> 
> ok, I see it in AttachFile.get_file (MoinMoin 1.5 here)
> 
> Do you remember which browsers worked and which not? If not I'll try it myself of course...

There is a bug report on the wiki about problems with non ascii attachments.

>>> (2) Do a HTTP redirect to this file (so all browsers get the correct 
>>>      filename)
>> I am not sure about how a http redirect should help.
> 
> I've never done this, but my idea was:
> - Create a file <some path exported by web server>/<PageTitle>-<revNumber>.odt
>   if it doesn't already exist for the current page revision
> - Do a http-Redirect to "<URL of the above Path>/<PageTitle>-<revNumber>.odt"
> 
> I'd thought this would help as the browser is redirected directly to a file.

I wouldn't do it like that. It needs additional webserver configuration 
(for that direct access), has security issues (your page could be acl 
protected, but the webserver will happily serve those files to everyone) 
and noone cleans up in that dir anyway. :)

> As for the cache action, I'll try it when developing for MoinMoin 1.7.

Well, you should. :)

Moin 1.5 is out of support. There won't be any 1.5 updates / changes any 
more, not even for security.

1.6 is also rather closed and only important security fixes will get 
into 1.6 for a while (if needed).

1.7.x is the current release with full support. If you are developing 
extensions that should be in production very soon, you should target 1.7.

1.8 is already at the horizon as a rather easy update with many GUI 
editor fixes, modernized theme and some other stuff. If you are 
developing stuff that will still take some time (~ 1..3 months) until it 
can be used, you should target this version.

Aside from that, you can save yourself a lot of work by using newer and 
better moin code instead of struggling with old crap. :)

> Did I understand you correctly here: With this cache action, all is handled automatically, so I don't have to read page revision numbers.

Look there:

http://hg.moinmo.in/moin/1.7/file/tip/MoinMoin/action/cache.py

For some practical code, you can look at Reimar's arnica stuff.

> But for MoinMoin 1.5/1.6 there is no possibility to permanently write a file, so I can't use my idea with revision comparison of OpenDocument file and wiki page?

Well, in the past, some people used attachment storage for such stuff, 
but that's rather messy and as I said, AttachFile will die anyway.

I guess if someone insists on using 1.6, he could backport cache action 
and the caching module changes to 1.6, but it would be a bit pointless, 
as just upgrading to 1.7.latest is much easier and 1.7 has some bug 
fixes not present in 1.6.






More information about the Moin-user mailing list