[Moin-user] MoinMoin API: Writing files and HTTP redirect
Hape News
hp.news at gmx.de
Thu Aug 28 10:33:34 EDT 2008
Hi Thomas,
thanks a lot for your hints!
> [...]
> 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...
> [...]
> > (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.
> [...]
> > How do I read page revisions?
>
> You can give the rev=X to the Page constructor.
not what I had in mind (I don't want to explicitly set rev numbers, I want to read the rev number of the current page). But thanks to your hint, I discovered Page.get_rev_dir which returns the rev number even if Page is called without explicit rev number.
> > How do I do a HTTP redirect in MoinMoin?
>
> Just grep for "redirect" :)
> [...]
well - ok, you're right :)
As for the cache action, I'll try it when developing for MoinMoin 1.7.
Did I understand you correctly here: With this cache action, all is handled automatically, so I don't have to read page revision numbers. 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?
Thanks again,
Hape
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
More information about the Moin-user
mailing list