[Zope-CMF] folder_factories length

Chris Withers chrisw@nipltd.com
Wed, 6 Jun 2001 13:24:57 +0100


> Yes, but you don't need to differentiate Files Which You Upload, since
they
> can be worked out automatically, and can all present the same
> interface.  (i.e. a 'view as HTML' version and their own
> 'SearchableText').

So, have a File base type and use Scriptable or Factory Type Information
objects to specialise the base type for each of your instances. Would that
work? I guess it depends where you put your converters...

> > mapping a PUT_factory performs. The 'generic upload form' could do
exactly
> > the same thing...
>
> Yes!

...and users wouldn't even need to make the association the first time :-)

> I meant, users never understand the whats and whys of "save as...".
> They just want to "Save".  They hardly even know 'Save as' exists.

Oh, you mean 'Save as...' on the file menu? I use that a lot for converting
document formats: Printing presses like CMYK .tiffs, I prefer to work in
multi-layer rgb .psds ;-)
I don't know if that kind of thing is relevent here so we can probably
ignore it for now.

> Well, they wouldn't be confused if they tried to upload a File which
> happened to be a word document, and got a WordDoc.  And they wouldn't
> be confused if they tried to upload a word document, and got a File.

Ah, so you're saying they _expect_ to get a 'File' and would be pleasantly
suprised if they got a 'Word Document'?

> So, what do you think?  A single 'upload file' field that replaces
> File, and a PUT_factory-like call to deduce which type to create, with
> File being the default?

Well, I see the 'upload file' thing being part of the skin. You product
should provide a DirectoryView with, say, a coupla methods:

folder_factories -- customised to filter out file-like objects from the
bullet listed ones, and with a <dtml-var upload_file> at the bottom.

upload_file - a mini-form (no standard_header or footer) to be included any
pages you end site designer wants to let people upload files from. This
would do the PUT_factory majick described above.

...and of course, you product would also supply all the file-like objects,
one for each file type, probably all subclasses from File, which would
handle the default functionality.

Sounds cool, does it make sense to you?

cheers,

Chris