4358148e |
1 | (in-package :lisp-on-lines-ucw) |
2 | |
6de8d300 |
3 | (defclass described-component-class (standard-component-class described-class) |
4 | ()) |
5 | |
4358148e |
6 | (defmacro defaction (&rest args-and-body) |
7 | `(arnesi:defmethod/cc ,@args-and-body)) |
8 | |
9 | (defun make-action (lambda &rest args) |
10 | (let ((ucw::*default-action-class* 'basic-action)) |
11 | (apply #'ucw::make-action lambda args))) |
12 | |
13 | (defclass standard-application (ucw:basic-application) |
14 | ()) |
15 | |
16 | (defclass standard-request-context (ucw::standard-request-context) |
17 | ()) |
18 | |
19 | (defmethod ucw:request-context-class list ((application standard-application)) |
20 | 'standard-request-context) |
21 | |
22 | (defvar +action-compound-name-delimiter+ #\|) |
23 | |
24 | (defmethod ucw::find-action-id :around ((context standard-request-context)) |
25 | (or |
6fe664d1 |
26 | (loop |
27 | |
28 | :for (k . v) in (ucw::parameters |
29 | (context.request context)) |
30 | :do(destructuring-bind (param-name &optional action-id) |
31 | (split-sequence:split-sequence |
32 | +action-compound-name-delimiter+ k) |
33 | (when (and action-id |
34 | (string= |
35 | ucw::+action-parameter-name+ param-name)) |
36 | (return action-id)))) |
4358148e |
37 | (call-next-method))) |
38 | |
39 | (defcomponent standard-window-component |
40 | (ucw:basic-window-component) |
41 | ((body |
42 | :initform nil |
43 | :accessor window-body |
44 | :component t |
45 | :initarg :body))) |
46 | |
6de8d300 |
47 | (defmethod render-html-body ((window standard-window-component)) |
4358148e |
48 | (ucw:render (window-body window))) |