[bknr-cvs] r2393 - in branches/bos/projects/bos: m2 web

hhubner at common-lisp.net hhubner at common-lisp.net
Wed Jan 23 14:33:59 UTC 2008


Author: hhubner
Date: Wed Jan 23 09:33:58 2008
New Revision: 2393

Modified:
   branches/bos/projects/bos/m2/config.lisp
   branches/bos/projects/bos/web/boi-handlers.lisp
   branches/bos/projects/bos/web/reports-xml-handler.lisp
Log:
Accept :content-type keyword argument in WITH-XML-RESPONSE.  Should this
macro be moved to another file?


Modified: branches/bos/projects/bos/m2/config.lisp
==============================================================================
--- branches/bos/projects/bos/m2/config.lisp	(original)
+++ branches/bos/projects/bos/m2/config.lisp	Wed Jan 23 09:33:58 2008
@@ -5,7 +5,7 @@
 ;; Die Gesamtbreite des Gebiets in Quadratmetern.
 (defconstant +width+ 10800)
 
-;; Die UTM-Koordinaten der Nord-West-Ecke des Gebiets.
+;; Die UTM-Koordinaten der Nord-West-Ecke des Gebiets (Zone 50)
 (defconstant +nw-utm-x+ 491698.366d0)
 (defconstant +nw-utm-y+ 9890100.289d0)
 

Modified: branches/bos/projects/bos/web/boi-handlers.lisp
==============================================================================
--- branches/bos/projects/bos/web/boi-handlers.lisp	(original)
+++ branches/bos/projects/bos/web/boi-handlers.lisp	Wed Jan 23 09:33:58 2008
@@ -5,13 +5,13 @@
 
 (defvar *xml-sink*)
 
-(defmacro with-xml-response (req &body body)
-  `(with-http-response (,req *ent* :content-type "text/xml")
-     (with-query-params (,req download)
+(defmacro with-xml-response ((&key (content-type "text/xml")) &body body)
+  `(with-http-response (*req* *ent* :content-type ,content-type)
+     (with-query-params (*req* download)
        (when download
-	 (setf (reply-header-slot-value ,req :content-disposition)
+	 (setf (reply-header-slot-value *req* :content-disposition)
 	       (format nil "attachment; filename=~A" download))))
-     (with-http-body (,req *ent*)
+     (with-http-body (*req* *ent*)
        (let ((*xml-sink* (make-character-stream-sink net.html.generator:*html-stream* :canonical nil)))
 	 (with-xml-output *xml-sink*
 	   (with-element "response"

Modified: branches/bos/projects/bos/web/reports-xml-handler.lisp
==============================================================================
--- branches/bos/projects/bos/web/reports-xml-handler.lisp	(original)
+++ branches/bos/projects/bos/web/reports-xml-handler.lisp	Wed Jan 23 09:33:58 2008
@@ -20,7 +20,7 @@
     year))
 
 (defmethod handle ((handler reports-xml-handler) req)
-  (with-xml-response req
+  (with-xml-response ()
     (destructuring-bind (name &optional *year* &rest arguments) (decoded-handler-path handler req)
       (setf *year* (and *year* (parse-integer *year*)))
       (let ((*contracts-to-process* (sort (remove-if (lambda (contract)



More information about the Bknr-cvs mailing list