[Zope-CMF] Metadata Implementation Change in CMF 1.3b?

Carl Rendell cer@sol43.com
Fri, 26 Apr 2002 10:03:26 -0700


On Friday, April 26, 2002, at 08:33  AM, Tres Seaver wrote:

> Subject: Re: [Zope-CMF] Metadata Implementation Change in CMF 1.3b?
>
> On Thu, 2002-04-25 at 19:58, Carl Rendell wrote:
>> Not sure if this is a bug, or a change in implementation for the
>> CMF meta data since 1.1?
>>
>> I have a product - PortalCatalogFolder - which simply creates
>> folders that are automatically cataloged. Generally this has been
>> used as a base class for the creation of ZClasses.
>>
>> The product resides at:
>>
>> http://www.zope.org/Members/crendell/PortalCatalogFolder
>>
>> The symptom I'm seeing with the product now is an error is raised
>> when trying to edit metadata, but the condition is passed as
>> failIfLocked as part of the portal_status_message.
>>
>> I appears that the implementation of metadata_edit.py is different
>> after CMF 1.1. I'm not sure what the locking problem might be.
>>
>> If anyone could point me in the right direction, or if you have
>> time review the product for possible changes that might address
>> this issue.. I'd greatly appreciate it.
>
> PortalContent has a method, 'failIfLocked', which handles the
> possibility that a WebDAV client may have placed a lock on a content
> object.  If this isn't meaningful for you (likely not, for a folder),
> then you can just add a NOOP implementation to your PortalCatalogFolder
> class::
>
>     def failIfLocked( self ):  return 0  # WebDAV locking not possible
>
> Tres.

You're solution is right on for two aspects. One, more than likely 
not ever going to control this type of folder with WebDAV, and 
two... It works perfectly.

A question comes up though. If I were to want WebDAV locking on a 
folderish object that is being cataloged. Would I need to implement 
the webdav.Lockable, webdave.WriteLockInterface and other classes 
as written in portal content?

failIfLocked as an additional two lines in it to test if the object 
is locked.

     def failIfLocked(self):
         """
         Check if isLocked via webDav
         """
         if self.wl_isLocked():
             raise ResourceLockedError, 'This resource is locked via 
webDAV'
         return 0

Leaving these don't have any effect on the product as implemented.

Thanks again,

~C

Carl E. Rendell
Solution43
Information Distribution Consulting        |   "Ahhhh the power of
cer@sol43.com                              |    acquisition"  - Chef Z