[Zope-CMF] PUT_factory/content_type_registry new feature Proposal

Florent Guillaume fg@nuxeo.com
Sat, 3 Aug 2002 18:25:49 +0000 (UTC)


Sidnei wanted feedback on this, so here's what I said on IRC:

[19:58:46]<efge> I don't see a clean way to fix that that doesn't involve
                 putting all the Document header parsing stuff into the
                 c_t_r...
[20:07:04]<dreamcatcher> the cleaner way would be registering another kind of
                         predicate to parse document headers, i think.
[20:09:14]<efge> maybe. the problem with this Document header parsing business
                 is that it looks like a hack to me.
[20:15:04]<efge> the problem is more general, how do I attach metadata to a
                 document and upload the bunch in a single go. FTP is not
                 designed for this, that's why I call it a hack.
[20:15:43]<efge> that's not bad mind you, but I see it as such.
[20:16:21]<efge> In code for my clients I had to disable it: I wanted to
                 upload documents that started with "Date: today" and it
                 barfed.
[20:16:32]<dreamcatcher> im just thinking about this because when you ftp a
                         file _out_ of cmf, it sets the metadata on the
                         headers acordingly, but the reverse is not true.
[20:17:04]<efge> well the download part adding stuff to the content is even
                 worse IMHO :)


Florent


Sidnei da Silva  <sidnei@x3ng.com.br> wrote:
> Howdy CMF crew,
> 
> I was playing with FTP and CMF today and found an interesting issue:
> 
>   * When downloading a CMF type based on Document, the manage_FTPget method 
> appends some headers to the files, mostly metadata properties. 
>   
>   * If the file contents is HTML, the headers are set using the <meta> tag. 
> 
>   * If the file contents are plain text or structured text, the headers are 
> set using standard rfc822 style headers.
> 
> The problem i ran into is:
> 
>   * When uploading the same file back into a CMF site, when the object
> doesnt exist yet, PUT_factory relies on content_type_registry to
> discover the kind of object to create. However, the
> content_type_registry doesnt check for those headers when analyzing
> the uploaded file.
> 
> Suggestions:
> 
>   * Fix PUT_factory to parse the uploaded file for rfc822
> headers/metatags (I did this for testing, but its a ugly hack) OR,
> 
>   * Provide another kind of predicate to parse the headers on the 
> content_type_registry (better)
> 
> I hope this is not too much feature to get into 1.3 final. I really
> think this is needed, as it looks like a missing feature more than a
> new feature.
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com