Changeset 3707
- Timestamp:
- 07/31/08 11:02:18 (4 months ago)
- Files:
-
- trunk/projects/bos/web/poi-handlers.lisp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/projects/bos/web/poi-handlers.lisp
r3706 r3707 3 3 (enable-interpol-syntax) 4 4 5 ;;; make-poi-handler 5 6 (defclass make-poi-handler (page-handler) 6 7 ()) … … 20 21 (redirect (edit-object-url (make-poi name))))))) 21 22 23 ;;; edit-poi-handler 22 24 (defclass edit-poi-handler (editor-only-handler edit-object-handler) 23 25 () … … 284 286 "The POI has been deleted"))) 285 287 286 ;; edit-poi-image 287 288 ;;; edit-poi-image-handler 288 289 (defclass edit-poi-image-handler (editor-only-handler edit-object-handler) 289 290 () … … 376 377 "You may " (cmslink (edit-object-url poi) "continue editing the POI")))) 377 378 379 ;;; poi-javascript-handler 378 380 (defclass poi-javascript-handler (page-handler) 379 381 ()) … … 404 406 (:princ (format nil "parent.last_sponsors([~{~A~^,~%~}]);" (mapcar #'contract-js last-paid-contracts))))))))) 405 407 408 ;;; poi-image-handler 406 409 (defclass poi-image-handler (object-handler) 407 410 () … … 423 426 (error "image index ~a out of bounds for poi ~a" image-index poi))))) 424 427 428 ;;; poi-movie-handler 425 429 (defclass poi-movie-handler (admin-only-handler object-handler) 426 430 () … … 440 444 :width "425" :height "344"))))) 441 445 446 ;;; poi-xml-handler 442 447 (defun write-poi-xml (poi language) 443 448 "Writes the poi xml format for one specific language. This is used … … 493 498 (with-element "url" (text (poi-movie-url movie)))))))))) 494 499 500 (defclass poi-xml-handler (object-handler) 501 () 502 (:default-initargs :object-class 'poi :query-function #'find-poi)) 503 504 505 (defmethod handle-object ((handler poi-xml-handler) poi) 506 (let ((timestamp (store-object-last-change poi 1))) 507 (hunchentoot:handle-if-modified-since timestamp) 508 (setf (hunchentoot:header-out :last-modified) 509 (hunchentoot:rfc-1123-date timestamp)) 510 (with-query-params ((lang "en")) 511 (with-xml-response (:xsl-stylesheet-name "/static/poi.xsl") 512 (write-poi-xml poi lang))))) 513 514 ;;; poi-kml-handler 495 515 (defun poi-description-google-earth (poi language &key (image-width 120)) 496 516 (labels ((website-path (path &rest args) … … 591 611 (error (c) (error "while generating poi-description-google-earth for ~s:~%~a" poi c))))) 592 612 593 594 595 613 (defun write-poi-kml (poi language) 596 614 (with-element "Placemark" … … 604 622 (text (format nil "~{~,20F,~}0" (poi-center-lon-lat poi))))))) 605 623 606 (defclass poi-xml-handler (object-handler)607 ()608 (:default-initargs :object-class 'poi :query-function #'find-poi))609 610 611 (defmethod handle-object ((handler poi-xml-handler) poi)612 (let ((timestamp (store-object-last-change poi 1)))613 (hunchentoot:handle-if-modified-since timestamp)614 (setf (hunchentoot:header-out :last-modified)615 (hunchentoot:rfc-1123-date timestamp))616 (with-query-params ((lang "en"))617 (with-xml-response (:xsl-stylesheet-name "/static/poi.xsl")618 (write-poi-xml poi lang)))))619 620 624 (defclass poi-kml-handler (object-handler) 621 625 () … … 630 634 (write-poi-kml poi lang)))))) 631 635 636 ;;; poi-kml-all-handler 632 637 (defclass poi-kml-all-handler (page-handler) 633 638 ())
