[Bese-devel] generated content with ucw

henrik hjelte henrik at evahjelte.com
Wed Feb 15 21:03:06 UTC 2006


On ons, 2006-02-15 at 20:41 +0100, Attila Lendvai wrote:
> hi!
> 
> i'm looking into serving generated content with ucw (generated png's),
> but i seem to be stuck.
> 
> i only have a blurred picture how it should work:
> - generate a temporary random url and register it as an entry point
Do you need an entry point?
I use action-href to generate a url:

Somewhere in a render method ((p my-component))
...
An url is generated...
 (action-href  (lambda () (my-method p)

> - render this link somewhere in a page
> - from the handler lambda of the entry point extract the actual socket
> stream and write the content, set correct mime-type

(defmethod my-method ((p my-component))
..do things.
..At the end..
      (setf (context.window-component *context*)
            (make-instance 'ajax-answer :text msg)))))

(defcomponent ajax-answer (window-component)
  ((text :initarg :text :accessor ajax-answer.text))
  (:default-initargs
   :content-type "text/plain"))

(defmethod render((a ajax-answer))
  (<:as-is (ajax-answer.text a)))

I hope the general idea comes through. Just change the name from ajax to
png and the content type. Maybe there are smarter solutions than this,
but this works for me..

/ Henrik Hjelte

> 
> did anybody do this before? what part of the infrastructure is ready
> for this? how will the generated entry point be unregistered? am i way
> off? :)
> 
> thanks all in advance, and now back to digging
> 
> - attila
> 
> (alias 101 on irc &no 'its not lisp code :)
> _______________________________________________
> bese-devel mailing list
> bese-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/bese-devel
> 
> 




More information about the bese-devel mailing list