[Zope] Best approach for a newbie?

Michael R. Bernstein webmaven@lvcm.com
22 Oct 2001 08:07:24 -0700


On Mon, 2001-10-22 at 03:44, Richard Hewison wrote:
> I'm new to Zope and am slowly getting to grips with v2.4.1. However,
I'm unsure what the best approach is going to be for the following:
> 
> I would like to write a form that users can access to upload documents
to a particular folder. I then want Zope to create a table which
contains four columns - one for an icon showing the document type (word
or pdf usually), a link to the document itself (I can do this part
already), the author and finally the date the document was last updated.
> 
> I was hoping that the easiest way of doing this would be to get the
user to type in the required info in the form (doc_type, doc_author,
doc_date), and this would then be applied as properties to the file
object (the document) when it was uploaded. Is this feasible, if so -
how should I do it - or is there a better method?

Some of what you want is already built-in to the various Zope objects.
For example, the last time an object has been changed is available via
the attribute bobo_modification_time (bobo was the ZODB's original
name).

If you're going to require people to be logged in when they upload the
document, you can grab their user name and fill in the form, or you can
check the object itself to see who has an 'owner' role on it after the
fact.

The document type is a little trickier. If all uploads are going to be
from windows machines, then you can probably get away with just checking
the file suffix. Otherwise, you have other options, of varying degrees
of sophistication.

Finally, there is a product that you can either use or modify or just
examine for inspiration, the Kaivo DocumentLibrary:
http://www.zope.org/Members/Kaivo/DocumentLibrary

Hope this helps,

Michael Bernstein.