|
Revision 3656, 0.9 kB
(checked in by ksprotte, 4 months ago)
|
whitespace cleanup
|
- Property svn:eol-style set to
native
- Property svn:keywords set to
author date id revision
|
| Line | |
|---|
| 1 |
(in-package :bos.web) |
|---|
| 2 |
|
|---|
| 3 |
(enable-interpol-syntax) |
|---|
| 4 |
|
|---|
| 5 |
(defmacro with-bos-cms-page ((&key title (response hunchentoot:+http-ok+)) &rest body) |
|---|
| 6 |
`(with-bknr-page (:title ,title :response ,response) |
|---|
| 7 |
,@body)) |
|---|
| 8 |
|
|---|
| 9 |
(defmacro with-xml-error-handler (() &body body) |
|---|
| 10 |
`(handler-case |
|---|
| 11 |
(progn ,@body) |
|---|
| 12 |
(error (e) |
|---|
| 13 |
(with-xml-response (:root-element "response") |
|---|
| 14 |
(with-element "status" |
|---|
| 15 |
(attribute "failure" 1) |
|---|
| 16 |
(text (princ-to-string e))))))) |
|---|
| 17 |
|
|---|
| 18 |
(defmacro handle-every-n-seconds ((n-seconds) &body body) |
|---|
| 19 |
(let ((=time= (gensym "TIME")) |
|---|
| 20 |
(=timestamp= (gensym "TIMESTAMP"))) |
|---|
| 21 |
`(let* ((,=time= (get-universal-time)) |
|---|
| 22 |
(,=timestamp= (- ,=time= (mod ,=time= ,n-seconds)))) |
|---|
| 23 |
(hunchentoot:handle-if-modified-since ,=timestamp=) |
|---|
| 24 |
(setf (hunchentoot:header-out :last-modified) |
|---|
| 25 |
(hunchentoot:rfc-1123-date ,=timestamp=)) |
|---|
| 26 |
,@body))) |
|---|