[hunchentoot-devel] [CL-WEBDAV] Property behaviour

Edi Weitz edi at agharta.de
Thu May 24 07:23:52 UTC 2007


On Wed, 23 May 2007 18:35:49 +0200, Ralf Mattes <rm at seid-online.de> wrote:

> A PROPGET for all properties of a resource

I assume you mean PROPFIND.

> will result in a call to 'collect-all-properties' that will call
> 'all-property-designators' which will result (at the end of a long
> call chain) in a call to 'get-dead-properties'. After that the same
> 'get-dead-properties' is called for each property again.

No.  GET-DEAD-PROPERTIES is called once for each /resource/ (not
property) if the "Depth" header is not 0 - see transcript below.  This
has to be done because each resource can have a different set of dead
properties.  At least that's how I'm reading the spec.

> Now, according to the documentation 'get-dead-properties' is
> supposed to return _all_ dead properties so it looks as if we do
> some extra work here ;-)

I don't think so.

Cheers,
Edi.




  CL-USER 1 > (defmethod print-object ((resource dav:file-resource) stream)
                ;; for the TRACE output
                (print-unreadable-object (resource stream :type t)
                  (format stream " ~S" (dav::resource-name resource))))
  #<STANDARD-METHOD PRINT-OBJECT NIL (CL-WEBDAV:FILE-RESOURCE T) 200BDDEF>

  CL-USER 2 > (merge-pathnames "test/*.*" dav:*file-resource-base-path-namestring*)
  #P"c:/tmp/test/*.*"

  CL-USER 3 > (directory *)
  (#P"c:/tmp/test/foo" #P"c:/tmp/test/bar")

  CL-USER 4 > (push (dav:create-dav-dispatcher 'dav:file-resource) tbnl:*dispatch-table*)
  (#<Closure ((METHOD CL-WEBDAV:CREATE-DAV-DISPATCHER (SYMBOL)) . 1) 200F6252> HUNCHENTOOT:DEFAULT-DISPATCHER)

  CL-USER 5 > (trace dav::get-dead-properties)
  (CL-WEBDAV:GET-DEAD-PROPERTIES)

  CL-USER 6 > (tbnl:start-server :port 4242)
  #<HUNCHENTOOT::SERVER 20090CFB>

  CL-USER 7 > (nth-value 1 (drakma:http-request "http://localhost:4242/test/"
                                                :method :propfind
                                                :additional-headers '(("Depth" . "1"))))
  207

  CL-USER 8 > (nth-value 1 (drakma:http-request "http://localhost:4242/test/"
                                                :method :propfind
                                                :additional-headers '(("Depth" . "0"))))
  207


For the first request, the TRACE window looks like this:

  0 CL-WEBDAV:GET-DEAD-PROPERTIES > ...
    >> CL-WEBDAV:RESOURCE : #<CL-WEBDAV:FILE-RESOURCE  "test">
  0 CL-WEBDAV:GET-DEAD-PROPERTIES < ...
    << VALUE-0 : NIL
    << VALUE-1 : NIL
  0 CL-WEBDAV:GET-DEAD-PROPERTIES > ...
    >> CL-WEBDAV:RESOURCE : #<CL-WEBDAV:FILE-RESOURCE  "foo">
  0 CL-WEBDAV:GET-DEAD-PROPERTIES < ...
    << VALUE-0 : NIL
    << VALUE-1 : NIL
  0 CL-WEBDAV:GET-DEAD-PROPERTIES > ...
    >> CL-WEBDAV:RESOURCE : #<CL-WEBDAV:FILE-RESOURCE  "bar">
  0 CL-WEBDAV:GET-DEAD-PROPERTIES < ...
    << VALUE-0 : NIL
    << VALUE-1 : NIL

For the second request, the TRACE window looks like this:

  0 CL-WEBDAV:GET-DEAD-PROPERTIES > ...
    >> CL-WEBDAV:RESOURCE : #<CL-WEBDAV:FILE-RESOURCE  "test">
  0 CL-WEBDAV:GET-DEAD-PROPERTIES < ...
    << VALUE-0 : NIL
    << VALUE-1 : NIL



More information about the Tbnl-devel mailing list