[Zope] Adding a document using a form

Mike Pelletier mike@digicool.com
Tue, 16 Nov 1999 10:52:51 -0500


Lalo Martins <lalo@webcom.com> asks:

> I have a form where the user can add a DTML Document to a
> folder with very special tweaked permissions. Works like a
> charm. Zope is amazing. :-)
>
> However, I'd prefer to be able to give users my homepage after
> they submit the document, instead of Incoming/manage_main. Is
> that possible?

    Umm, here's something to try.  Remove the special permissions from the
form page, and set the form's action to a DTML Method that you create.  Give
_that_ new method proxy roles to create pages.  Do your request validation
there, too.  From within the new page, use a DTML tag like...

 <dtml-call "manage_addProduct['OFSP'].addDTMLDocument(id, title)">

    I _think_ manage_addProduct is a mapping type and needs to be used in
that manner, but you might have to experiment.  At any rate, this will
create the document, and since there is no REQUEST being passed to
addDTMLDocument it won't redirect the browser.  Then you can redirect them
yourself, or display whatever message or form you might like from this page
itself.

Mike.