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

Thomas Waldmann tw-public at gmx.de
Thu Aug 28 08:01:20 EDT 2008


> - Browsers don't get the correct filename (at least they're missing 
>   the extension ".odt"). Without this extension OpenDocument files 
>   are seen as ZIP-Files (at least on my system)

See AttachFile.py about how to tell the browser the filename (it's not 
perfect, but for some browsers and ascii-filenames it works).

> - Even if there's no new revision of the page, every time when the 
>   action "Render as OpenDocument" is called a new OpenDocument 
>   file is generated (which may take a few seconds)

I think it is best to use the "cache" action of recent moin (e.g. 1.7.1):
  * it is fast and ressource efficient
  * if you use it as proposed, you will never get outdated cache content

> (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.

> Before this there should be a check:
> (0) Check whether there's a OpenDocument file corresponding to 
>      the newest revision of the wiki page. If yes, proceed with (2), 
>      if no, proceed with (1)

See the cache action, the procedures used for it make sure you never get 
outdated content.

> But I need help with this. Which directory should I choose?

You don't have to, the cache action will do that.

> How do I read page revisions?

You can give the rev=X to the Page constructor.

> How do I do a HTTP redirect in MoinMoin?

Just grep for "redirect" :)






More information about the Moin-user mailing list