[Zope] WebDAV Metadata

Dieter Maurer dieter@handshake.de
Wed, 11 Jun 2003 21:10:18 +0200


Holger Schmidt wrote at 2003-6-11 17:36 +0200:
 > ...
 > Using WebDAV you are able to attach Metadata to a document by calling
 > PROPPATCH and you can get this Metadata by calling PROPFIND ...
 > 
 > Zope saves these Properties in the ZODB.
 > 
 > Properties are handled by OFS.PropertyManager.PropertyManager and for
 > the Presentation OFS.PropertySheets.PropertySheet is used ...
 > ---
 > 
 > I think it should be possible to "redirect" this Metadata, so a
 > PROPPATCH would save the Metadata to 'MY' MySQL-DB and a PROPFIND
 > would get it from 'MY' MySQL-DB ...
 > 
 > Has anybody ever done something like this before?

I did something like this but for general attributes
(not WebDAV properties).

A word of warning:

   You get lots of nasty problems when you distribute attribute
   storage between ZODB and something external.
   
   Moving and copying must be treated carefully.
   Export/Import is likely to break.
   Undo and Versions will bring your system in an inconsistent state.

Apart from that, it is not too difficult:

   Attribute access can be handled by letting "__getattr__"
   fetch the attributes from the database on demand.

   For modification, the "PropertyManager" methods can
   be overridden to update the values in the database
   (be careful, if you delay update until transaction
   commit (for efficiency). It may be too late then to
   register the DA.).


Dieter