[bknr-cvs] ksprotte changed trunk/projects/bos/web/

BKNR Commits bknr at bknr.net
Mon Sep 8 13:45:11 UTC 2008


Revision: 3844
Author: ksprotte
URL: http://bknr.net/trac/changeset/3844

fixed: Infosystem: POI Picture Gallery is broken

poi-image-handler should not have been removed in #3760

U   trunk/projects/bos/web/poi-handlers.lisp
U   trunk/projects/bos/web/webserver.lisp

Modified: trunk/projects/bos/web/poi-handlers.lisp
===================================================================
--- trunk/projects/bos/web/poi-handlers.lisp	2008-09-08 13:12:50 UTC (rev 3843)
+++ trunk/projects/bos/web/poi-handlers.lisp	2008-09-08 13:45:11 UTC (rev 3844)
@@ -634,3 +634,23 @@
                   (with-element "Icon"
                     (with-element "href" (text (format nil "http://~a/static/Orang_weiss.png" (website-host)))))))
               (mapc #'(lambda (poi) (write-poi-kml poi lang)) relevant-pois))))))))
+
+;;; poi-image-handler
+(defclass poi-image-handler (object-handler)
+  ()
+  (:default-initargs :object-class 'poi :query-function #'find-poi))
+
+(defmethod handle-object ((handler poi-image-handler) (poi (eql nil)))
+  (error "poi not found"))
+
+(defmethod handle-object ((handler poi-image-handler) poi)
+  (destructuring-bind (poi-name image-index-string &rest imageproc-arguments)
+      (multiple-value-list (parse-handler-url handler))
+    (declare (ignore poi-name))
+    (let ((image-index (1- (parse-integer image-index-string))))
+      (if (and (not (minusp image-index))
+               (< image-index (length (poi-sat-images poi))))
+          (redirect (format nil "/image/~D~@[~{/~a~}~]"
+                            (store-object-id (nth image-index (poi-sat-images poi)))
+                            imageproc-arguments))
+          (error "image index ~a out of bounds for poi ~a" image-index poi)))))

Modified: trunk/projects/bos/web/webserver.lisp
===================================================================
--- trunk/projects/bos/web/webserver.lisp	2008-09-08 13:12:50 UTC (rev 3843)
+++ trunk/projects/bos/web/webserver.lisp	2008-09-08 13:45:11 UTC (rev 3844)
@@ -174,6 +174,7 @@
                                         ("/complete-transfer" complete-transfer-handler)
                                         ("/edit-news" edit-news-handler)
                                         ("/make-poi" make-poi-handler)
+                                        ("/poi-image" poi-image-handler)
                                         ("/poi-xml" poi-xml-handler)
                                         ("/poi-kml-all" poi-kml-all-handler)
                                         ("/poi-kml" poi-kml-handler)




More information about the Bknr-cvs mailing list