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

BKNR Commits bknr at bknr.net
Wed Sep 3 12:56:00 UTC 2008


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

:published-web und :published-earth f?\195?\188r POIs
U   trunk/projects/bos/m2/packages.lisp
U   trunk/projects/bos/m2/poi.lisp
U   trunk/projects/bos/web/poi-handlers.lisp

Modified: trunk/projects/bos/m2/packages.lisp
===================================================================
--- trunk/projects/bos/m2/packages.lisp	2008-09-03 11:43:11 UTC (rev 3778)
+++ trunk/projects/bos/m2/packages.lisp	2008-09-03 12:56:00 UTC (rev 3779)
@@ -221,7 +221,8 @@
            #:poi-name
            #:find-poi
            #:all-pois
-           #:poi-published
+           #:poi-published-web
+           #:poi-published-earth
            #:poi-area
            #:poi-icon
            #:poi-media

Modified: trunk/projects/bos/m2/poi.lisp
===================================================================
--- trunk/projects/bos/m2/poi.lisp	2008-09-03 11:43:11 UTC (rev 3778)
+++ trunk/projects/bos/m2/poi.lisp	2008-09-03 12:56:00 UTC (rev 3779)
@@ -93,9 +93,12 @@
     :index-type string-unique-index
     :index-reader find-poi :index-values all-pois
     :documentation "symbolischer name")
-   (published
-    :accessor poi-published :initarg :published :initform nil
-    :documentation "wenn dieses flag nil ist, wird der poi in den uis nicht angezeigt")
+   (published-web
+    :accessor poi-published-web :initarg :published-web :initform nil
+    :documentation "wenn dieses flag nil ist, wird der poi auf der Website nicht angezeigt")
+   (published-earth
+    :accessor poi-published-earth :initarg :published-earth :initform nil
+    :documentation "wenn dieses flag nil ist, wird der poi in Google Earth nicht angezeigt")
    (area
     :accessor poi-area :initarg :area :initform nil
     :documentation "polygon mit den poi-koordinaten")
@@ -106,6 +109,10 @@
     :accessor poi-media :initarg :media :initform nil
     :documentation "liste aller poi-medien, wie poi-image, poi-airal ...")))
 
+
+(defmethod convert-slot-value-while-restoring ((object poi) (slot-name (eql 'published)) published)
+  (setf (slot-value object 'published-web) published))
+
 (deftransaction make-poi (name &rest rest &key area language title subtitle description)
   (declare (ignore area))
   (assert (if (or title subtitle description) language t) nil
@@ -116,10 +123,12 @@
 (defmethod destroy-object :before ((poi poi))
   (mapc #'delete-object (poi-media poi)))
 
-(deftransaction update-poi (poi &key published icon area)
-  (check-type published boolean)
+(deftransaction update-poi (poi &key published-web published-earth icon area)
+  (check-type published-web boolean)
+  (check-type published-earth boolean)
   (check-type area list)
-  (setf (poi-published poi) published)
+  (setf (poi-published-web poi) published-web
+        (poi-published-earth poi) published-earth)
   (when icon
     (setf (poi-icon poi) icon))
   (when area
@@ -191,7 +200,7 @@
     (format t "var anzahlVerkauft = ~D;~%" (number-of-sold-sqm))
     (format t "var pois = new Array;~%")
     (dolist (poi (sort (remove-if #'(lambda (poi) (or (not (poi-complete poi language))
-                                                      (not (poi-published poi))))
+                                                      (not (poi-published-web poi))))
                                   (store-objects-with-class 'poi))
                        #'(lambda (poi-1 poi-2) (string-lessp (slot-string poi-1 'title language) (slot-string poi-2 'title language)))))
       (format t "

Modified: trunk/projects/bos/web/poi-handlers.lisp
===================================================================
--- trunk/projects/bos/web/poi-handlers.lisp	2008-09-03 11:43:11 UTC (rev 3778)
+++ trunk/projects/bos/web/poi-handlers.lisp	2008-09-03 12:56:00 UTC (rev 3779)
@@ -73,7 +73,8 @@
         (:tr (:td "name")
              (:td (:princ-safe (poi-name poi))))
         (:tr (:td "published")
-             (:td (checkbox-field "published" "published" :checked (poi-published poi))))
+             (:td (checkbox-field "published-web" "published-web" :checked (poi-published-web poi)) " "
+                  (checkbox-field "published-earth" "published-earth" :checked (poi-published-earth poi))))
         (:tr (:td "title")
              (:td (text-field "title"
                               :value (slot-string poi 'title language))))
@@ -88,10 +89,11 @@
         (:tr (:td "location")
              (:td (flet ((format-chosen-url ()
                            (encode-urlencoded
-                            (format nil "~A?action=save&language=~A&~:[~;published=on~]"
+                            (format nil "~A?action=save&language=~A&~:[~;published-web=on~]&~:[~;published-earth=on~]"
                                     (hunchentoot:script-name*)
                                     language
-                                    (poi-published poi)))))
+                                    (poi-published-web poi)
+                                    (poi-published-earth poi)))))
                     (cond
                       ((poi-area poi)
                        (html (:princ-safe (format nil "~D/~D " (first (poi-area poi)) (second (poi-area poi)))))
@@ -170,7 +172,8 @@
 
 (defmethod handle-object-form ((handler edit-poi-handler)
                                (action (eql :save)) (poi poi))
-  (with-query-params ((published nil boolean)
+  (with-query-params ((published-web nil boolean)
+                      (published-earth nil boolean)
                       title subtitle description language
                       (x nil integer)
                       (y nil integer)
@@ -181,7 +184,8 @@
                                 :subtitle subtitle
                                 :description description)
     (update-poi poi
-                :published published
+                :published-web published-web
+                :published-earth published-earth
                 :area (when (and x y) (list x y))
                 :icon icon)
     (with-bos-cms-page (:title "POI has been updated")
@@ -592,7 +596,7 @@
   ())
 
 (defmethod handle ((handler poi-kml-all-handler))
-  (let* ((relevant-pois (remove-if-not #'(lambda (poi) (and (poi-area poi) (poi-published poi)))
+  (let* ((relevant-pois (remove-if-not #'(lambda (poi) (and (poi-area poi) (poi-published-earth poi)))
                                        (class-instances 'poi)))
          (pois-last-change (reduce #'max relevant-pois :key (lambda (poi) (store-object-last-change poi 1)))))
     (hunchentoot:handle-if-modified-since pois-last-change)




More information about the Bknr-cvs mailing list