[Moin-user] forms for moin

Matthew Nuzum newz at bearfruit.org
Tue Sep 19 09:47:08 EDT 2006

On 9/19/06, Craig Johnson <CPJohnson at edcon.co.za> wrote:
> Why not make the form processor a user written Moin Action, rather than some
> arbitrary CGI script?

Thanks for the positive feedback. Here's my thinking...

There are two parts to a form:
a: The form
b: The code that processes the form submission

Right now I'm doing only (a). I started out making it an action, but
then I couldn't get that action to show up on the page by default...
you had to go to PageName?action=form. Also, it was difficult to
intermingle wiki content and the form.

TheSheep (Radomir?) on IRC suggested I use a filter, and I'm thankful
for that advice because it looks like it solves all of my problems.

I will absolutely release this code back to moin as GPL. My employer
(Canonical) is a huge supporter of open source software and believes
firmly in this method of development.

I will also be writing an action later to handle the form request, but
it will likely be very specific to my needs. If I can make the action
generic enough to be useful to many I will release it too. Here is
what I plan to do:

Wiki page ThankYou has a generic helpful message that thanks people
for submitting the form. The form will submit to
ThankYou?action=process_form which will handle the form and then
redirect to just ThankYou (implied action=show). This allows me to
craft a thank you page using wiki markup. This isn't without problems,
but I can't think of a better way. Any suggestions are welcome.

In some cases my forms will need to database work too, so in those
cases I will probably submit to another CGI entirely as the code will
be more complex. We'll see.

The beauty of making the individual parts (a and b listed above)
separate is that  it gives you ultimate flexibility.

Matthew Nuzum
newz2000 on freenode

More information about the Moin-user mailing list