2011-04-16 15:45:37 -04:00
|
|
|
(in-package :coleslaw)
|
|
|
|
|
|
|
|
(defclass post ()
|
2011-04-16 15:46:12 -04:00
|
|
|
((id :initform nil :initarg :id
|
2011-04-16 15:45:37 -04:00
|
|
|
:accessor post-id)
|
2011-04-16 15:46:12 -04:00
|
|
|
(title :initform nil :initarg :title
|
2011-04-16 15:45:37 -04:00
|
|
|
:accessor post-title)
|
2011-04-16 15:46:12 -04:00
|
|
|
(tags :initform nil :initarg :tags
|
2011-04-16 15:45:37 -04:00
|
|
|
:accessor post-tags)
|
2011-04-16 15:46:12 -04:00
|
|
|
(date :initform nil :initarg :date
|
2011-04-16 15:45:37 -04:00
|
|
|
:accessor post-date)
|
2011-04-16 15:46:12 -04:00
|
|
|
(content :initform nil :initarg :content
|
2011-04-17 22:22:14 -04:00
|
|
|
:accessor post-content)
|
|
|
|
(aliases :initform nil :initarg :aliases
|
|
|
|
:accessor post-aliases)))
|
2011-04-16 15:45:37 -04:00
|
|
|
|
2011-04-16 15:46:12 -04:00
|
|
|
(defgeneric make-post (title tags date content &key id &allow-other-keys)
|
2011-04-16 15:45:37 -04:00
|
|
|
(:documentation "Create a POST with the given data."))
|
|
|
|
|
|
|
|
(defgeneric add-post (post id)
|
|
|
|
(:documentation "Insert a post into *storage* with the given ID."))
|
|
|
|
|
|
|
|
(defgeneric remove-post (id)
|
|
|
|
(:documentation "Remove a post from *storage* matching ID."))
|
|
|
|
|
|
|
|
(defgeneric render-post (id)
|
|
|
|
(:documentation "Generate the final HTML for post."))
|
|
|
|
|
|
|
|
(defgeneric find-post (id)
|
|
|
|
(:documentation "Retrieve a post from *storage* matching ID."))
|
|
|
|
|
|
|
|
(defgeneric find-by-tag (tag)
|
|
|
|
(:documentation "Retrieve all posts from *storage* tagged with TAG."))
|
|
|
|
|
|
|
|
(defgeneric find-by-date (date)
|
|
|
|
(:documentation "Retrieve all posts from *storage* matching DATE."))
|
|
|
|
|
|
|
|
(defgeneric find-by-range (start end)
|
|
|
|
(:documentation "Retrieve all posts from *storage* with ids between
|
|
|
|
START and END."))
|
2011-04-17 22:22:14 -04:00
|
|
|
|
|
|
|
(defgeneric post-url (id)
|
|
|
|
(:documentation "Return the URL for the post with the given ID."))
|