[Zope-CMF] CMF FS objects and possible Zope WebDAV bugs (Was: GoLive whinging...)

Martijn Pieters mj@digicool.com
Mon, 9 Apr 2001 13:29:54 +0200


On Sat, Apr 07, 2001 at 11:22:10PM +0100, Chris Withers wrote:
> Getting lots of this when browsing on the WebDAV sourceport, even more when I go
> in through the HTTP port:
> 
> Server Error: The date and time string (last modified) sent by the server for
> resource '<anything in skins>' is not ISO8601- or RFC0822-format.

There are several things wrong here:

- Both FSImage and FSPropertiesObject inherit (indirectly) from
  webdav.Resource, but not from Persistent. This causes them to have an
  empty getlastmodified DAV property, which is against the spec.

- The WebDAV spec dictates that the contents of that property should be
  the same as the Last-Modified header returned on a GET request for that
  object. The FSImage object does return this header, but the
  FSPropertiesObject doesn't (and doesn't need to).

To fix this, two things have to change:

- The getlastmodified property should not be an empty value. It should be
  ommitted if empty. This is a bug in the way Zope handles this property.
  I'll file a Collector entry.

- FSImage does keep track of the last-modified date of the
  filesystem-based image it represents. This modified date should be used
  to create the getlastmodified property. The same goes for FSDTMLMethod,
  FSPythonScript, and FSPageTemplate.

  Possible solutions:
  
  - A very hackish way of accomplishing this is by redefining _p_mtime on
    these objects, as this is what normally is used to create the
    getlastmodified property, but this may have unwanted side-effects.

  - We could also try and extend where OFS.PropertySheets.DAVProperties
    gets the getlastmodified date from. It could look, for example, at a
    'getLastModified' method if present.

  - We could subclass DAVProperties and define a 'propertysheets'
    attribute on the FS* objects that returns our (wrapped) subclass.

  I personally prefer the latter solution; it allows us to work around the
  'empty getlastmodified property' bug as well.

Opinions?

-- 
Martijn Pieters
| Software Engineer  mailto:mj@digicool.com
| Digital Creations  http://www.digicool.com/
| Creators of Zope   http://www.zope.org/
---------------------------------------------