[bknr-cvs] r2525 - in branches/trunk-reorg/bknr: datastore/src/data modules/mail web/src/rss

hhubner at common-lisp.net hhubner at common-lisp.net
Sun Feb 17 21:39:29 UTC 2008


Author: hhubner
Date: Sun Feb 17 16:39:28 2008
New Revision: 2525

Modified:
   branches/trunk-reorg/bknr/datastore/src/data/object.lisp
   branches/trunk-reorg/bknr/datastore/src/data/txn.lisp
   branches/trunk-reorg/bknr/modules/mail/mail.lisp
   branches/trunk-reorg/bknr/web/src/rss/rss.lisp
Log:
Docstring fixes, add another missing defgeneric.


Modified: branches/trunk-reorg/bknr/datastore/src/data/object.lisp
==============================================================================
--- branches/trunk-reorg/bknr/datastore/src/data/object.lisp	(original)
+++ branches/trunk-reorg/bknr/datastore/src/data/object.lisp	Sun Feb 17 16:39:28 2008
@@ -647,7 +647,7 @@
   
 
 (defun find-store-object (id-or-name &key (class 'store-object) query-function key-slot-name)
-  "mock up implementation of find-store-object api as in the old datastore"
+  "Mock up implementation of find-store-object API as in the old datastore"
   (unless id-or-name
     (error "can't search a store object with null key"))
   (when (stringp id-or-name)

Modified: branches/trunk-reorg/bknr/datastore/src/data/txn.lisp
==============================================================================
--- branches/trunk-reorg/bknr/datastore/src/data/txn.lisp	(original)
+++ branches/trunk-reorg/bknr/datastore/src/data/txn.lisp	Sun Feb 17 16:39:28 2008
@@ -223,12 +223,11 @@
 ;;; itself or, in the case of a nested transaction, the parent
 ;;; transaction.  Named transactions do not explicitly log the nested
 ;;; transactions as the nesting is implicit, meaning that any repeated
-;;; execution of the transactions triggered by rolling forward the
-;;; transaction log will automatically repeat the sequence of
-;;; executing nested transactions by the program code executed.
-;;; Contrasted to that, an anonymous transaction has no implicit
-;;; nesting, so any nested transactions which are called are
-;;; explicitly logged.
+;;; execution of the transactions while rolling forward the
+;;; transaction log will automatically repeat the sequence of nested
+;;; transaction executions by the program code executed.  Contrasted
+;;; to that, an anonymous transaction has no implicit nesting, so any
+;;; nested transactions which are called are explicitly logged.
 
 (defgeneric execute-transaction (executor transaction)
   (:documentation "Execute TRANSACTION on EXECUTOR (which may be a store or a transaction scope)."))
@@ -299,9 +298,10 @@
 (defmacro deftransaction (name (&rest args) &rest body)
   "Define a transaction function tx-NAME and a function NAME executing
 tx-NAME in the context of the current store. The arguments to NAME
-will be serialized to the transaction-log, and should must be
-supported by the binary encoder. tx-NAME will be called during a
-roll-forward."
+will be serialized to the transaction-log, and must be supported by
+the binary encoder. tx-NAME will be called during a roll-forward to
+repeat any effects that the transaction function had on the persistent
+store."
   (let ((name name)
         (args args)
         (body body))

Modified: branches/trunk-reorg/bknr/modules/mail/mail.lisp
==============================================================================
--- branches/trunk-reorg/bknr/modules/mail/mail.lisp	(original)
+++ branches/trunk-reorg/bknr/modules/mail/mail.lisp	Sun Feb 17 16:39:28 2008
@@ -92,12 +92,14 @@
 		     :subject (header :subject)
 		     :id (regex-replace-all
 			  *message-id-re*
-			  (header :message-id) #?/\1/)
-#|		     :in-reply (regex-replace-all
+			  (header :message-id)
+                          #?/\1/)
+		     :in-reply (regex-replace-all
 				*message-id-re*
 				(first (if (header :in-reply-to)
 					   (split #?/\s+/ (header :in-reply-to))
-					   (last (split #?/\s+/ (header :references)))))) |#
+					   (last (split #?/\s+/ (header :references)))))
+                                 #?/\1/)
 		     :headers headers
 		     :body body)))))
 

Modified: branches/trunk-reorg/bknr/web/src/rss/rss.lisp
==============================================================================
--- branches/trunk-reorg/bknr/web/src/rss/rss.lisp	(original)
+++ branches/trunk-reorg/bknr/web/src/rss/rss.lisp	Sun Feb 17 16:39:28 2008
@@ -64,6 +64,9 @@
 class RSS-CHANNEL for an overview."))
 
 (defun make-rss-channel (name title description link &rest args)
+  "Create an RSS channel with the given NAME, TITLE, DESCRIPTION and
+LINK (all strings) which are the mandatory fields in an RSS channel.
+Returns the persistent RSS-CHANNEL object that has been created."
   (apply #'make-object 'rss-channel :name name :title title :description description :link link args))
   
 (defun render-mandatory-element (channel element)
@@ -73,20 +76,23 @@
 	       it
 	       (format nil "(channel ~(~A~) not defined)" element)))))
 
-(defmethod rss-channel-xml ((channel rss-channel) stream)
-  (with-xml-output (make-character-stream-sink stream)
-    (with-element "rss"
-      (attribute "version" "2.0")
-      (attribute* "xmlns" "content" "http://purl.org/rss/1.0/modules/content/")
-      (with-element "channel"
-	(dolist (slot '(title link description))
-	  (render-mandatory-element channel slot))
+(defgeneric rss-channel-xml (channel stream)
+  (:documentation "Generate XML for the current state of RSS channel
+CHANNEL to STREAM.")
+  (:method ((channel rss-channel) stream)
+    (with-xml-output (make-character-stream-sink stream)
+      (with-element "rss"
+        (attribute "version" "2.0")
+        (attribute* "xmlns" "content" "http://purl.org/rss/1.0/modules/content/")
+        (with-element "channel"
+          (dolist (slot '(title link description))
+            (render-mandatory-element channel slot))
 	
-	(dolist (item (remove-if-not #'(lambda (item)
-                                         (and (not (object-destroyed-p item))
-                                              (rss-item-published item)))
-                                     (rss-channel-items channel)))
-	  (rss-item-xml item))))))
+          (dolist (item (remove-if-not #'(lambda (item)
+                                           (and (not (object-destroyed-p item))
+                                                (rss-item-published item)))
+                                       (rss-channel-items channel)))
+            (rss-item-xml item)))))))
 
 (defgeneric rss-channel-items (channel)
   (:documentation "Return all non-expired items in channel.")



More information about the Bknr-cvs mailing list