2 ; note: for parenscript, may need to use #'escape-string
3 ; http://www.groupsrv.com/computers/about410678.html
4 (defpackage :lineal.webui
5 (:use
:cl
:cl-who
:hunchentoot
:parenscript
6 :lineal.devvars
:lineal
:lineal.overload
)
7 (:export
:start-server
:with-html
))
9 (in-package :lineal.webui
)
12 ;V Apparently Huncehntoot's handle-static-file and V
13 ;V create-static-file-dispatcher-and-handler don't V
14 ;V handle content-type correctly... so here, V
15 ;V just embed the COPYING file in a web page. V
16 (defun show-license ()
17 (with-html-output-to-string
18 (ostrm nil
:prologue t
)
20 (:head
(:title
"COPYING"))
25 (make-pathname :name
"COPYING")
27 (loop :for line
= (read-line istrm nil nil
)
29 (write-line line ostrm
))))))))
34 ,(create-regex-dispatcher "^/$" 'front-page
)
35 ,(create-prefix-dispatcher
36 "/recall_vrbl" 'web-recall-vrbl
)
38 ,(create-prefix-dispatcher
39 "/post_matrix_input" 'get-matrix-input
)
40 ,(create-prefix-dispatcher
41 "/matrix_request" 'matrix-request
)
42 ,(create-prefix-dispatcher
43 "/input_matrix" 'matrix-input-code
)
44 ,(create-prefix-dispatcher
45 "/matrix_select_contents" 'matrix-select-contents
)
47 ,(create-prefix-dispatcher
48 "/calcupage" 'calcupage
)
49 ,(create-prefix-dispatcher
50 "/process" 'receive-and-process
)
52 ,@(unless (boundp 'lineal.devvars
::no-save-restore
)
53 (format t
"Save/restore enabled!~%")
55 (create-prefix-dispatcher
56 "/save_restore" 'save-restore-page
)
57 (create-prefix-dispatcher
58 "/capture_session" 'capture-session
)
59 (create-prefix-dispatcher
60 "/restore_from_upload" 'restore-from-upload
)))
62 ,@(when (boundp 'lineal.devvars
::reload-page
)
63 (format t
"Reload page enabled!~%")
64 (list (create-prefix-dispatcher "/reload" 'reload
)))
65 ;V defined in this file V
66 ,(create-prefix-dispatcher "/COPYING" 'show-license
)
68 ,(create-folder-dispatcher-and-handler
70 :directory
'(:relative
"http_root")))))