Changeset 3260

Show
Ignore:
Timestamp:
06/04/08 18:54:14 (6 months ago)
Author:
ksprotte
Message:

set http-query of kml-network-link to nil where appr

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/bos-trunk-sat/projects/bos/web/image-tree.lisp

    r3138 r3260  
    256256  (format nil "~2,'0X~{~2,'0X~}" opacity (reverse color))) 
    257257 
    258 (defmethod kml-link ((href string)
     258(defmethod kml-link ((href string) &key (http-query "lang=[language]")
    259259  (with-element "Link" 
    260260    (with-element "href" (text href)) 
    261261    (with-element "viewRefreshMode" (text "onRegion")) 
    262     (with-element "httpQuery" (text "lang=[language]")))) 
     262    (when http-query 
     263      (with-element "httpQuery" (text http-query))))) 
    263264 
    264265;; (defmethod kml-link ((href puri:uri)) 
     
    267268;;     (kml-link string))) 
    268269 
    269 (defun kml-network-link (href &key rect lod name
     270(defun kml-network-link (href &key rect lod name (http-query "lang=[language]")
    270271  (with-element "NetworkLink" 
    271272    (when name (with-element "name" (text name))) 
    272273    (when rect (kml-region rect lod)) 
    273     (kml-link href))) 
     274    (kml-link href :http-query http-query))) 
    274275 
    275276(defun kml-lat-lon-box (rect &optional (element "LatLonBox")) 
     
    630631                            :rect (make-rectangle2 (list (geo-x child) (geo-y child) 
    631632                                                         (geo-width child) (geo-height child))) 
    632                             :lod `(:min ,(lod-min child) :max ,(lod-max child)))))))) 
     633                            :lod `(:min ,(lod-min child) :max ,(lod-max child)) 
     634                            :http-query nil)))))) 
    633635 
    634636(defclass image-tree-kml-latest-handler (page-handler) 
  • branches/bos-trunk-sat/projects/bos/web/kml-handlers.lisp

    r3258 r3260  
    6464 
    6565(defclass kml-root-handler (object-handler) 
    66   ()) 
     66  ((timestamp :accessor timestamp :initform (get-universal-time)))) 
    6767 
    68 (defun write-root-kml (&optional sponsor) 
     68(defun write-root-kml (handler sponsor) 
    6969  (let ((*print-case* :downcase) 
    7070        (contract (when sponsor (first (sponsor-contracts sponsor))))) 
     71    (hunchentoot:handle-if-modified-since (timestamp handler)) 
    7172    ;; only the first contract of SPONSOR will be shown 
    7273    (with-xml-response (:content-type #+nil "text/xml" "application/vnd.google-earth.kml+xml; charset=utf-8" 
    7374                                      :root-element "kml") 
     75      (setf (hunchentoot:header-out :last-modified) 
     76            (hunchentoot:rfc-1123-date (timestamp handler))) 
    7477      (with-query-params ((lang "en")) 
    7578        (with-element "Document" 
     
    97100                              :rect (make-rectangle2 (geo-location image-tree)) 
    98101                              :lod `(:min ,(lod-min image-tree) :max ,(lod-max image-tree)) 
    99                               :name "old-image-tree")) 
     102                              :name "old-image-tree" 
     103                              :http-query nil)) 
    100104          (dolist (sat-layer (class-instances 'sat-layer)) 
    101105            (kml-network-link (format nil "http://~a/sat-root-kml?name=~A" (website-host) (name sat-layer)) 
    102106                              :rect (geo-box-rectangle *m2-geo-box*) 
    103107                              :lod '(:min 0 :max -1) 
    104                               :name (princ-to-string (name sat-layer)))) 
     108                              :name (princ-to-string (name sat-layer)) 
     109                              :http-query nil)) 
    105110          (let ((href (if (not contract) 
    106111                          (format nil "http://~a/contract-tree-kml" (website-host)) 
     
    112117            (kml-network-link href 
    113118                              :rect (geo-box-rectangle (geo-box *contract-tree*)) 
    114                               :lod `(:min ,(network-link-lod-min *contract-tree*) 
    115                                           :max ,(network-link-lod-max *contract-tree*)) 
     119                              :lod (node-lod *contract-tree*) 
    116120                              :name "contracts")) 
    117121          (kml-network-link (format nil "http://~a/poi-kml-all" (website-host)) 
     
    153157 
    154158(defmethod handle-object ((handler kml-root-handler) (object sponsor)) 
    155   (write-root-kml object)) 
     159  (write-root-kml handler object)) 
    156160 
    157161(defmethod handle-object ((handler kml-root-handler) (object contract)) 
     
    159163 
    160164(defmethod handle-object ((handler kml-root-handler) (object null)) 
    161   (write-root-kml)) 
     165  (write-root-kml handler nil)) 
    162166 
  • branches/bos-trunk-sat/projects/bos/web/sat-tree.lisp

    r3257 r3260  
    224224                                                  (website-host) (name layer) (append path (list i))) 
    225225                                          :rect (geo-box-rectangle (geo-box child)) 
    226                                           :lod (node-lod child)))))))))))))) 
     226                                          :lod (node-lod child) 
     227                                          :http-query nil))))))))))))) 
    227228 
    228229(defclass sat-root-kml-handler (page-handler) 
     
    246247                                        (website-host) (name layer) (node-path node)) 
    247248                                :rect (geo-box-rectangle (geo-box node)) 
    248                                 :lod (node-lod node))))))))) 
    249  
     249                                :lod (node-lod node) 
     250                                :http-query nil)))))))) 
     251