[Zope] ZClasses and FTP/WebDAV

Edward Pollard pollej@uleth.ca
Mon, 16 Dec 2002 16:02:06 -0700


My ZClass is based off Page Template and CatalogAware (vis a vis a CatalogAware
wrapper for Page Templates! Is there any reason the developers are not making
older types CatalogAware to save us this trouble and make the ZCatalog that much
more usefull? I digress.)

I had hoped the inheritance from Page Templates would have handled the required
functions, but it does not. I can see where I might begin to move towards a
solution in a Python Product, but not at all with a ZClass. It's a pity, as I'm
so very close to being where I want with this. If anyone has any further
thoughts on manipularing the inner workings of a ZClass, I'd find that
tremendously helpful. In lieu of that, a primer on how to make a Python Product
would be nice as it looks like I'll be working overtime...

But, for the time being, I'll work with the ancient patch mentioned previously
to see if I can incorporate the features I desire into Zope 2.6

Ed

sean.upton@uniontrib.com wrote:

> 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 )