Folks, We've had a number of requests from customers to allow bulk upload of images and various content types (Open Office documents, etc.) into a Zope/Plone Content Management System. There doesn't seem to be any standard way of doing this built into Zope. The question I have is "Why?" Has the Zope Corporation ever considered building this functionality into their FTP or WebDAV server? I'd like to see something like the following: 1. User has a folder on his Linux/Windows file system with one or more content types (images, OO docs,Word docs, etc.) 2. User does a drag and drop to a WebDAV folder which appears to the client to be just another folder on the disk. 3. The webDav server automatically determines the content type and creates it in the selected target folder using the appropriate factory when it receives the file, and uses the "file" factory if it can't automatically determine the file type... Is there something I'm missing on this? Thanks, Braun Brelin
Braun Brelin wrote:
1. User has a folder on his Linux/Windows file system with one or more content types (images, OO docs,Word docs, etc.)
2. User does a drag and drop to a WebDAV folder which appears to the client to be just another folder on the disk.
3. The webDav server automatically determines the content type and creates it in the selected target folder using the appropriate factory when it receives the file, and uses the "file" factory if it can't automatically determine the file type...
Use Webdrive (http://www.webdrive.com/) to connect your Zope to the Desktop of the users via Webdav and you'll be happy... -mj
Maik Jablonski wrote:
Braun Brelin wrote:
1. User has a folder on his Linux/Windows file system with one or more content types (images, OO docs,Word docs, etc.)
2. User does a drag and drop to a WebDAV folder which appears to the client to be just another folder on the disk.
3. The webDav server automatically determines the content type and creates it in the selected target folder using the appropriate factory when it receives the file, and uses the "file" factory if it can't automatically determine the file type...
Use Webdrive (http://www.webdrive.com/) to connect your Zope to the Desktop of the users via Webdav and you'll be happy...
There are two problems with this : 1) it only works on Windows; and more importantly 2) when you drop a file into webdav how can you control the content type created from that object e.g if we drop a HTML file into webdav it will normally be of type File, whereas Document may be more interesting, or for an image we may want Image or a custom type defined. 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. I imagine that there much be an automatic way (or a product for this) but it is not obvious to me. Thanks CPH
cp.hennessy@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) -----------------------------------------------------------------------
Alexis Roda wrote:
cp.hennessy@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.
The content_type_registry is exactly what I was looking for! Thanks all, CPH
in article ch50ag$80e$1@sea.gmane.org, cp.hennessy@openapp.biz at cp.hennessy@openapp.biz wrote on 9/1/04 7:16 PM:
Alexis Roda wrote:
cp.hennessy@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.
The content_type_registry is exactly what I was looking for! Thanks all,
You might be interested to hear that Sidnei da Silva is going to be giving a tutorial on WebDAV at the PloneConference entitled "Leveraging the Standards: Improving the WebDAV experience... NOW!" (http://plone.org/events/conferences/2/program). Here's the relevant excerpt: "Over the last couple months, while working for Enfold Systems, I've developed a couple of tools to improve and provide better control over the process of creating and modifying content over WebDAV. In this tutorial I will explain about the goals of each of these tools and how they can be used together to build a better WebDAV experience by using existing standard technologies and libraries, instead of reinventing the wheel." Here's the whole blurb that appears on the conference program page. " Leveraging the Standards: Improving the WebDAV experience... NOW! Sidnei da Silva Day after day, new tools are created to enable new features and faster development of the most different kinds of applications. Obviously, the main target is the browser interaction. Plone has shown to be specially targeted at this niche, being widely recognized as one of the best Open Source Content Management Systems out there. However, Content Management is not only about being able to control your content. The Web Browser, though a universal tool that is available on the most different platforms, enabling people to reach and control their content from anywere, is not rich enough to match existing tools with years of acceptance and tight desktop integration. This is the domain of Document Management, which increasingly is converging with Content Management. The WebDAV protocol was created for the purpose of integrating web content into desktop authoring environments. WebDAV has been present on Zope since the early days as a supported way of interacting with content, along with FTP and XML-RPC, but has been mostly ignored due to the aforementioned reasons. Providing a reasonable WebDAV experience is not an Herculean task. However it requires some preparation an thinking. Care must be taken as to not break backwards compatibility. All the contracts must be clear and predictable, and more than that, the scope must be clear so that we don't get stranded by overengineering and endless discussions. Over the last couple months, while working for Enfold Systems, I've developed a couple of tools to improve and provide better control over the process of creating and modifying content over WebDAV. In this tutorial I will explain about the goals of each of these tools and how they can be used together to build a better WebDAV experience by using existing standard technologies and libraries, instead of reinventing the wheel." -- Nate Aune - natea@jazkarta.com Plone4Artists - http://plone4artists.org "Build your own artist community website!"
cp.hennessy@openapp.biz 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.
I imagine that there much be an automatic way (or a product for this) but it is not obvious to me.
A few notes that might help: http://zope.org/Members/stonor/ftp /Anton
cp.hennessy@openapp.biz wrote:
Maik Jablonski wrote:
I imagine that there much be an automatic way (or a product for this) but it is not obvious to me.
If your implement your own folder you can override the methods for WebDAV support (see below). With CMFs TypeTool You would probably configure the mapping per site, I'm not sure. Check the CMF source for PUT_factory or MKCOL_handler. One problem remains, which is partly a file system clash. WebDAV client usually doesn't handle collections of different type, because the only sensible is to map it to a Folder. Zope can have collections that are not just Folders but will look like Folders through the client (for instance WebDrive which I use by the way). I'm not sure if this limitation is built in to WebDAV as well, but it's possible (someone from South River Technologies ones told me otherwice). Regards, Johan Carlsson An example of Colliberty Easy Publishers WebDAV support: def MKCOL_handler(self,id,REQUEST=None,RESPONSE=None): """Handle WebDAV MKCOL.""" #This adds a new Collection self.addNewDocument(id, REQUEST=REQUEST,RESPONSE=RESPONSE) def PUT_factory( self, name, typ, body ): """\ Dispatcher for PUT requests to non-existent IDs. Returns an object of the appropriate type (or None, if we don't know what to do). """ try: if name and name.endswith('.pt'): ob = ZopePageTemplate(name, body, content_type=typ) elif typ in ('text/html', 'text/xml', 'text/plain'): ob = DTMLMethod( '', __name__=name ) elif typ=='text/x-python' or (body and body[0]=='#') \ or name.endswith('.pys'): ob = PythonScript( name ) elif typ=='text/easydocument' or name.endswith('.edoc'): from Products.EasyEditor.EasyDocument import EasyDocument ob = EasyDocument( name ) elif typ=='text/easynewsitem' or name.endswith('.enews'): from Products.EasyEditor.EasyNewsItem import EasyNewsItem ob = EasyNewsItem( name ) elif typ=='text/easycontactform' or name.endswith('.eform'): from Products.EasyContactForm.EasyContactForm import EasyContactForm ob = EasyContactForm( name ) elif typ[:6]=='image/' or name[-3:].upper() in TYPEINFOMAP.keys(): ob = EasyImage(name, body, '', content_type=typ) else: ob = EasyFile(name, body, '', content_type=typ) except: return None return ob
cp.hennessy@openapp.biz wrote:
1. User has a folder on his Linux/Windows file system with one or more content types (images, OO docs,Word docs, etc.)
2. User does a drag and drop to a WebDAV folder which appears to the client to be just another folder on the disk.
3. The webDav server automatically determines the content type and creates it in the selected target folder using the appropriate factory when it receives the file, and uses the "file" factory if it can't automatically determine the file type...
Use Webdrive (http://www.webdrive.com/) to connect your Zope to the Desktop of the users via Webdav and you'll be happy...
There are two problems with this : 1) it only works on Windows;
For Linux exists many solutions... KDE delivers this out of the box, other projects can use WebDavFS (or something called similar) to mount a Webdav-Folder to the filesystem. -mj
cp.hennessy@openapp.biz 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 ?
Have a read of this: http://zope.org/Members/glpb/dwhowto ...particularly the bit about PUT_factory. cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (8)
-
Alexis Roda -
Anton Stonor -
Braun Brelin -
Chris Withers -
cp.hennessy@openapp.biz -
Johan Carlsson -
Maik Jablonski -
Nate Aune