[Zope-CMF] Uploading news items with FTP

John Fitzgerald jack@digicool.com
Mon, 23 Apr 2001 16:17:30 -0400


Hello Jon,
	You might want to check out the end of the __init__.py in CMFDefault.
There is where the 'types' for the PUT_factory are registered. You could do
something similar in your __init__.py if you like. This would cause 'your'
object to be created on the 'PUT' from FTP. I hope this helps.

-Jack

> -----Original Message-----
> From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org]On Behalf
> Of Jonathan Corbet
> Sent: Monday, April 23, 2001 4:08 PM
> To: zope-cmf@zope.org
> Subject: Re: [Zope-CMF] Uploading news items with FTP
>
>
> I'm still working on how to upload news items with FTP.  As far as I can
> tell from my digging so far, it can't be done.  I'd be overjoyed if
> somebody told me otherwise...
>
> If you look at
> http://cmf.zope.org/doc/user/BasicContent.txt/view, it says,
> among other things:
>
>       the CMF checks the incoming data to see if it has a piece
> of metadata
>       called Type. The value of this metadata property would instruct the
>       CMF to create, for instance, a NewsItem.
>
> But, as far as I can tell, that simply is not true.  A couple of content
> types (Document, NewsItem) use parseHeadersBody to grab metadata and set
> things like the title, but that is done *after* the object has been
> created.  There is nothing, currently, which looks at headers before the
> object is created.
>
> So, even though NewsItem defines a PUT_factory method, nothing ever calls
> it.
>
> I could perhaps bash out a hacky solution in PortalFolder.PUT_factory that
> would make things work.  I get a sense, though, from the code that the
> whole portal_types mechanism is intended to be used in this sort of role,
> and I haven't done anywhere near enough time staring at the code to figure
> out how I might make that happen...
>
> Thoughts?
>
> jon
>
> Jonathan Corbet
> Executive editor, LWN.net
> corbet@lwn.net
>
>
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and
> feature requests
>