[Zope-CMF] Anonymous submissions -- Some advice?

Tres Seaver tseaver@palladion.com
Tue, 05 Jun 2001 08:21:32 -0400


Ricardo Newbery wrote:

> 
> I'm still feeling my way around CMF and learning new tricks every day.  
> There's nothing like a real project and a deadline to give you some 
> motivation.
> 
> Anyway, I would like to create a special skin to facilitate a 
> semi-anonymous submission of certain file objects and I could use some 
> advice.
> 
> 
> The proposed workflow...
> 
> 1) A special 'user' is predefined and given the Member role.  Let name 
> the user, 'public'.
> 
> 2) An anonymous user visits a page similar to the 'folder_factories' 
> skin but with only two inputs: a dropdown select list of county names 
> and a text input field for the user's email address.
> 
> 3) After submitting this form, the email address is validated and the 
> object 'id' would be generated from the county name and a timestamp, 
> then an upload form is presented similar to the 'file_edit_form' skin.
> 
> 4) Uploaded files would be deposited within the 'public' member folder 
> and owned by 'public' and automatically submitted for review.
> 
> 5) After successfully uploading a file, a confirmation message is sent 
> to the submitted email address and a list of contact addresses 
> maintained in a TinyTable file.
> 
> 
> Okay, now for the questions...
> 
> 1) Before I go any deeper, are there any obvious problems with this 
> proposed workflow?  Is there an easier way I'm missing?


You may have to juke about with an ExternalMethod, to deal with the
fact that the anonymous user wouldn't normally be able to create content
in a member folder.  Other than that, your mechanism sounds fine.


> 2) It is unclear to me exactly where to insert the 'id' generating 
> code.  I'm guessing that I might need to have the first form submit its 
> data to a 'generate_id' skin which would then call the 'invokeFactory' 
> method.  I believe this method then returns the skin defined for that 
> object type (I'll define a special file type for this purpose).  Does 
> this sound right?  And how exactly should I call the 'invokeFactory' 
> method from the skin?


The ID generation may need to add a random factor to the timestamp, to
mitigate the (probably remote) chance of clashes from near-simultaneous
submissions.  I would probably try to hold off on calling 'invokeFactory'
until the user had actually uploaded the file, since you aren't collecting
the metadata anyway.


> 2) How do I tell the skin to use the 'public' folder when uploading the 
> file and assign the correct ownership?


The method to which you perform the upload would probably have the
folder path hard-coded;  alternately, you could store it in a property on
the portal object.  The ownership wouldn't need to be explicitly set;  it
should just derive from the owner of the containing folder.


> 3) I would like to save the submitted email address as metadata for this 
> file.  How do I define additional metadata fields for this object?  
> Remember, I'm a Zope/CMF newbie.  ;-)


The "Contributors" element of the Dublin Core might be just what you need.


> 4) The confirmation emails will have a special return address for 
> responses.  I would like to create a log of return emails for each 
> file.  I'm currently looking at POP Mail Zope Product for ideas here. 
> Any suggestions are appreciated.


I'm not up on the various mail products at the moment.


Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org