[Zope] ZClasses and FTP/WebDAV

sean.upton@uniontrib.com sean.upton@uniontrib.com
Mon, 16 Dec 2002 11:22:05 -0800


There are a few methods that you can create and/or override to make your
objects behave in FTP/DAV friendly ways, which will likely need to be
customized to work correctly with your class.

A good first question is what your ZClass is subclassing?  If it is
folderish, there are a few things that you can do to make it act more like a
leaf-level object (i.e. SimpleItem-like). I've never done this in a ZClass,
only in a python product, but you might need to define custom methods, like
manage_FTPlist (override), manage_FTPstat, manage_FTPget, and PUT.

The biggest thing is that you need to make manage_FTPlist return a tuple
with one element containing the stat info for one object, which tricks the
FTP machinery into thinking this should be represented as a file/leaf
object, and not as a directory to the FTP client.
	
This might work (likely as an external method?):

import marshal
def manage_FTPlist(self,REQUEST):
	stat = marshal.loads(self.manage_FTPstat(REQUEST))
	return marshal.dumps((self.id, stat))

Once you get this working, it is likely you will need to figure out creating
a custom PUT()...

Good luck,
Sean

-----Original Message-----
From: Edward Pollard [mailto:pollej@uleth.ca]
Sent: Monday, December 16, 2002 10:45 AM
To: zope@zope.org
Subject: [Zope] ZClasses and FTP/WebDAV


Can anyone bring me up to speed on why my ZClasses cannot be manipulated
via FTP/WebDAV, and what I need to do to make them so they can?

I was pleased to note that built in Zope objects perform admirably
during FTP/WebDAV manipulation : I'd feared that changed files would
revert to 'File' objects. (Irrational, I know). However, my lovely
ZClass, that I've put so much time and energy into, does not work.

In FTP - I just get an error when I try to replace it. (Downloading is
fine)
In WebDAV - it sees my ZClass as a Folder. Downloads it as a Folder.
Wierd.

I'll be happy as can be to get one of theses methods working. This is
imperative as we use Dreamweaver as our site manager/editor.

Now, I've found this: http://www.zope.org/Members/akendall/zclassftp
Seems relevant, but old as can be. I'm going to compare the files it
alters with the ones that come with Zope 2.6, and hopefully I can
distill some wisdom as to what needs changing. But if anyone can shed
some light to help guide my way, I'd appreciate it.

Ed


_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )