[Zope-CMF] Proposal to modify File

seb bacon seb@jamkit.com
Mon, 4 Jun 2001 15:05:04 +0100


* Tres Seaver <tseaver@palladion.com> [010604 14:14]:
> On Mon, 4 Jun 2001, seb bacon wrote:
> 
> > At the moment, my MSWord conversion stuff manifests itself in a
> > WordDoc Type.  However, it occured to me that it would probably be
> > nicer to sniff File types at upload time and create the correct type
> > accordingly, rather than having a whole slew of different types to
> > chose from for a new file when you create it.  This would require File
> > being implemented in a similar way to NullResource, I guess, creating
> > the correct object by looking it up in the brand new, very cool
> > content types registry.   
> 
> Hmm, I guess I don't quite get what you mean.  Do you want to
> *change* the 'portal_type' when the user uploads a new Content-type
> into an existing File?  The PUT_factory can already decide which
> kind of thing to make on the initial upload;  I doubt that many
> folks will change the type, if for no other reason than that the
> tools they use mangle the type into the ID.

It's a usability issue.  To make it clearer why, I'll explain my
particular case again: 

I'm munging HTML out of Word and Excel documents.  The only way I can
support this file type specific behaviour is by creating a Word Type
and and Excel Type (both based on File).  If I get round to adding
support for PDF, Photoshop, etc, my users will have to select the file
type they're adding from an increasingly lengthy folder factory list.
This is Bad and Redundant, since all the information for the file type
is already there in the file itself.  Most users will use WebDAV, so
this won't be a problem; but they might be confused by the fact that
they have to treat what is to them a 'file' as one of several Types
listed.  Similarly, webDAV isn't always an option.

So, yes, the functionality does already exit in the PUT_factory.
However,  I'd like the same as a PUT_factory, but for TTW uploads -
a POST_factory, I suppose.  As for changing the type after uploads, I
agree this is a very unlikely scenario, but the CMF design would
require this anyway, since you 'edit' a file *after* creating it.

hmm, not sure I explained that any better ;-)  oh well.

seb