[Zope] Re: Bulk uploads

Alexis Roda alexis.roda at urv.es
Wed Sep 1 07:39:07 EDT 2004


cp.hennessy at openapp.biz wrote:
> Maik Jablonski wrote:
> 
> This is really the problem to be solved :
> is it possible to control the type of content created when an object is
> added to Zope using either FTP or WebDAV ? 
> Preferably we would like to be able for this type to be created
> automatically i.e. when 20 files of mixed types are ftp'd/webdav'd then the
> appropriate content types should be used for each file.

Not sure, but I think CMF content_type_registry can do that for CMF 
content objects.

class ContentTypeRegistry( SimpleItem ):
     """
         Registry for rules which map PUT args to a CMF Type Object.
     """

For "pure" zope content it may be more dificult, since each object 
constructor requires a different set of parameters, but its possible to 
hack ContentTypeRegistry to acomplish that.

I have not followed the thread, so excuse if that has been mentioned before.

You can look at the problem in a different way, using FileSystemSite you 
can plug a file system directory into zope. The user can FTP/local 
network/whatever to the directory (filesystem, not zope) and the files 
will be seen within zope as objects with the appropiate meta-type, the 
only requirement is that files have known/fixed extensions (.py scripts, 
.pt page templates and so on) in order to determine its meta-type. The 
problem here is that objects are read only IIRC (you can't edit them 
from zope, only from the filesystem) and FileSystemSite only provides 
support form some basic object types (scripts, dtml, page templates, 
zsql ...). Other products may include its own FSxxxx version (btw 
formulator includes a FSForm object).

Finally, FileSystemSite defines a method _createZODBClone(). I think it 
can be used to create a zope clone for a given FSxxxx object (I think 
this is how customize works for skins). The clone is a "real" zope 
object and you can edit it through the ZMI.



HTH
-- 
                                    ////
                                   (@ @)
----------------------------oOO----(_)----OOo--------------------------
<>               Ojo por ojo y el mundo acabara ciego
/\ Alexis Roda - Universitat Rovira i Virgili - Reus, Tarragona (Spain)
-----------------------------------------------------------------------



More information about the Zope mailing list