summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2009-10-30 21:51:04 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2009-10-30 21:51:04 +0100
commit5d0b3520f01f55d09ed05927f1f4aa43df9e5bc6 (patch)
treeed8842efebfb87fdf755053957a41bdd45e9a893
parent3199fd448e0e15c23096460647b21f361561a2c7 (diff)
Implement metaWeblog.getCategories and metaWeblog.getRecentPosts.
Ignore-this: 38094bb5aff14dc701398aa871e22116 darcs-hash:607981d7d7dff2945b8a1824c152a365ea28ceea
-rw-r--r--journal-content.lisp13
-rw-r--r--xml-rpc-functions.lisp11
2 files changed, 19 insertions, 5 deletions
diff --git a/journal-content.lisp b/journal-content.lisp
index 3d286b3..29f01e4 100644
--- a/journal-content.lisp
+++ b/journal-content.lisp
@@ -279,16 +279,19 @@
(setf (%trackbacks-about journal-entry) new-value))
-(defun make-journal-entry-id ()
+(defun find-largest-post-id ()
#.(locally-enable-sql-reader-syntax)
(prog1
- (1+ (or (single-object (select [max [slot-value 'journal-entry 'id]]
- :from [journal-entry]
- :flatp t))
- -1))
+ (single-object (select [max [slot-value 'journal-entry 'id]]
+ :from [journal-entry]
+ :flatp t))
#.(restore-sql-reader-syntax-state)))
+(defun make-journal-entry-id ()
+ (1+ (or (find-largest-post-id) -1)))
+
+
(defun make-journal-comment-id ()
#.(locally-enable-sql-reader-syntax)
(prog1
diff --git a/xml-rpc-functions.lisp b/xml-rpc-functions.lisp
index 41ee2a3..7c914b9 100644
--- a/xml-rpc-functions.lisp
+++ b/xml-rpc-functions.lisp
@@ -55,6 +55,17 @@
:title title)))
+(defun mulk.journal.xml-rpc::|metaWeblog.getCategories| (blogid username password)
+ (declare (ignore blogid username password))
+ (list))
+
+
+(defun mulk.journal.xml-rpc::|metaWeblog.getRecentPosts| (blogid username password number-of-posts)
+ (declare (ignore blogid))
+ (loop for post-id from (or (find-largest-post-id) 0) above (max 0 (- (or (find-largest-post-id) 0) number-of-posts))
+ collect (mulk.journal.xml-rpc::|metaWeblog.getPost| post-id username password)))
+
+
(defun create-or-edit-post (body title &key entry-type post-id)
(with-transaction ()
(let* ((entry (if post-id