Anyone Expieriences with cl-webdav?

Discussion of Common Lisp
Post Reply
schoppenhauer
Posts: 99
Joined: Sat Jul 26, 2008 2:30 pm
Location: Germany
Contact:

Anyone Expieriences with cl-webdav?

Post by schoppenhauer » Sat Aug 09, 2008 3:12 pm

I hope it is Ok to post this here, because it is nothing "general" about Common Lisp, but something special, but I dont want to get on the developer's nerves, so if it is Ok, I will post it here (if not just delete my topic).

I was just playing around a little bit with cl-webdav, but I am not really understanding its API and what I am doing wrong. I wrote the following code (it is just a quick hack to test cl-webdav):

Code: Select all

(in-package :cl-webdav)

(defclass my-resource (cl-webdav:resource) (script-name :initform "Quarkbaellchen"
                                                        :accessor hunchentoot:script-name)))

(defvar *number1* (make-instance 'my-resource))
(defvar *number2* (make-instance 'my-resource))

(defmethod resource-exists ((obj my-resource))
  (declare (ignore obj)) t)

(defmethod resource-children ((obj my-resource))
  (if (eql obj *number2*) nil (list *number2*)))

(defmethod resource-parent ((obj my-resource))
  (if (eql obj *number2*) *number1* nil))

(defmethod resource-collection-p ((obj my-resource))
  (not (eql obj *number2*)))

(defmethod resource-write-date ((obj my-resource))
  (declare (ignore obj)) 1337)

(defmethod resource-length ((obj my-resource))
  (if (eql obj *number2*) 11))

(defmethod resource-display-name ((obj my-resource))
  (declare (ignore obj)) "Quarkbaellchen")

(defmethod send-content ((obj my-resource) stream)
  (if (eql obj *number2*)
      (progn (write-sequence '(72 97 108 108 111 32 87 101 108 116 33 10) stream)
             (close stream))
      (close stream)))

(defmethod get-content ((obj my-resource) stream length)
  (declare (ignore obj))
  (dotimes (i length) (read-byte stream))
  (close stream))

(defmethod remove-resource ((obj my-resource))
  (declare (ignore obj)) "Quarkbaellchen")

(defmethod move-resource (source dest)
  (declare (ignore source dest)) "Quarkbaellchen")

(defmethod copy-resource (source dest)
  (declare (ignore source dest)) "Quarkbaellchen")

(defmethod create-collection ((obj my-resource))
  (declare (ignore obj)) "Quarkbaellchen")

(defmethod accept-request-p (class request)
  (declare (ignore class request)) "Quarkbaellchen")
I hoped to get a Directory which contents a file called "Quarkbaellchen". But somehow this doesnt work. I think I am doing nothing else than file-resource.lisp does, but i only see an empty directory with no contents when opening it with a webdav-client. I didnt write proper methods for creating collections, etc., because i didnt do these things with the clients anyway, so this shouldnt be a problem. Can anybody help me?
Sorry for my bad english.
Visit my blog http://blog.uxul.de/

findinglisp
Posts: 447
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX
Contact:

Re: Anyone Expieriences with cl-webdav?

Post by findinglisp » Sat Aug 09, 2008 4:39 pm

schoppenhauer wrote:I hope it is Ok to post this here, because it is nothing "general" about Common Lisp, but something special, but I dont want to get on the developer's nerves, so if it is Ok, I will post it here (if not just delete my topic).
You're good. This forum is for anything that concerns Common Lisp, including questions about various CL libraries, implementations, etc., etc. :)
Can anybody help me?
Unfortunately, I'm the wrong guy for this particular question. :?
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/

Post Reply