[Special variable]
*cont-gc-lifetime*
The lifetime of continuations in number of seconds.
The default is 1440 (24 minutes).
[Special variable]
*cont-gc-probability*
The probability to start a gc process for expired continuations.
The default is 100.
[Special variable]
*cookie-jar*
An instance of the 'drakma:cookie-jar class used when we make an http
request inside http-* functions or macros.
[Special variable]
*debug-log-file*
A pathname of a debug log file. The default is #P"/tmp/web4r/debug.log".
[Special variable]
*delete-page-uri*
A procedure which returns a uri of a delete page
[Special variable]
*edit-page-uri*
A procedure which returns a uri of a edit page
[Special variable]
*example-bdb*
A pathname of a BDB database directory for example applications.
[Special variable]
*host-uri*
A host uri used when we make an http request inside http-* functions
or macros.
[Special variable]
*image-public-dirs*
An alist of image public directories which must be key/pathname pairs.
[Special variable]
*items-per-page*
The default number to display items per page. The default is 10.
[Special variable]
*links-per-page*
The default number to display page links per page. The default is 10.
[Special variable]
*loggedin-page-uri*
A procedure which returns a uri of a logged-in checking page
[Special variable]
*login-msgs*
An alist of log in/out messages: key/message pairs.
[Special variable]
*login-page-uri*
A procedure which returns a uri of a login page
[Special variable]
*logout-page-uri*
A procedure which returns a uri of a logout page
[Special variable]
*max-items-per-page*
The maximum number to display items per page. This value is only used when a
user changes a value of the get parameter named items_per_page and the value
exceeeds this maximum number. The default is 50.
[Special variable]
*max-links-per-page*
The maximum number to display page links per page. This value is only used when
a user changes a value of the get parameter named links_per_page and the value
exceeeds this maximum number. The default is 30.
[Special variable]
*page-param*
A get parameter name denotate the current page number.
The default is 'page'.
[Special variable]
*public-dir*
A pathname of the public directory.
[Special variable]
*regist-page-uri*
A procedure which returns a uri of a user registration page
[Special variable]
*show-page-uri*
A procedure which returns a uri of a show page
[Special variable]
*sml-dir*
A pathname of the sml directory.
[Special variable]
*thumbnail-height*
The default thumbnail height. The default is 100.
[Special variable]
*thumbnail-width*
The default thumbnail width. The default is 100.
[Special variable]
*tmp-files-gc-lifetime*
The lifetime of temporary saved files in number of seconds.
The default is 1440 (24 minutes).
[Special variable]
*tmp-files-gc-probability*
The probability to start a gc process for expired temporary saved files.
The default is 100.
[Special variable]
*tmp-save-dir*
A pathname of a directory to save temporary uploaded files.
The default is #P"/tmp/web4r/tmp/".
[Special variable]
*upload-save-dir*
A pathname of a directory to save uploaded files.
The default is #P"/tmp/web4r/upload/".
[Special variable]
*user*
An instance of the user* class used for the authentication.
[Special variable]
*valid-email-format*
A string regular expression used to validate a email address.
[Special variable]
*validation-error-messages*
An alist of validation error messages: key/message pairs.
[Special variable]
*web4r-dir*
A pathname of the web4r directory.
[Special variable]
*with-slots*
If this is :all, all slots in a persistent class are displayed. If this is a
list of a persistent class slots' symbol, the slots won't be hided.
[Special variable]
*without-slots*
If this is a list of persistent class slots' symbol, the slots are hided.
[Macro]
a/cont continuation &rest body => result
Generates and displays an html link with embedding CONTINUATION and BODY.
[Function]
add-parameter link key value => result
Returns the LINK with a get parameter named KEY with the VALUE.
Examples:
(add-parameter "http://host/" "k1" "v1") ;=> "http://host/?k1=v1"
[Function]
add-parameters link &rest parameters => result
Returns the LINK with get PARAMETERS.
Examples:
(add-parameters "http://host/" "k1" "v1" "k2" "v2")
;=> "http://host/?k1=v1&k2=v2"
[Function]
class-validation-errors class &optional instance => result
Validates posted parameters to make/update an instance of the persistent
CLASS and returns a list of error messages if any. INSTANCE is an instance
of the persistent CLASS only needed to update an existing instance.
[Accessor]
cont-session key &optional cid => result
(setf (cont-session key &optional cid) value)
Returns the entry for the KEY in cont-session (continuation
based session) associated with the cid (continuation id)
if any.
[Generic accessor]
created-at object => result
(setf (created-at object) new-value)
[Specialized accessor]
created-at (object user) => result
(setf (created-at (object user)) new-value)
automatically generated reader method
[Function]
debug-log &rest contents => result
Writes CONTENTS to the file, *debug-log-file*.
[Function]
debug-mode-off => result
Turns off debug-mode.
[Function]
debug-mode-on => result
Turns on debug-mode.
[Macro]
defpage page (&rest args) &rest body => result
Defines a web page for PATHS. Users can visit a defined web page by accessing
an uri like 'http://yourhost/PATHS'.
Syntax:
defpage paths ([parg ...] [:get garg ...] [:post poarg ...]
:auth :default :redirect redirect) body
Arguments and Values:
paths---a base path of a web page
parg---a relative uri path from the base PATHS
garg---a symbol name of a get parameter
poarg---a symbol name of a post parameter
:auth---if :auth is supplied and the current user hasn't logged in,
redirects the user to a login page
:default---if :default is supplied, the page procedure is set to *default-handler*
redirect---an uri to redirect users after logging in
body---a form
Examples:
(defpage test (path1 path2 :get get1 get2)
[p path1 " " path2 " " get1 " " get2])
; wget http://localhost:8080/test/1/2/ => '<p>1 2 </p>'
; wget http://localhost:8080/test/1/2/?get1=3&get2=4 => '<p>1 2 3 4</p>'
[Macro]
defpclass name parent slot-defs &rest class-opts => result
Defines a persistent object. You can use the extended slot options
defined by the slot-options class. See the slot-options class for the detail.
[Function]
delete-page class oid &optional redirect-uri => result
Redirects the current user to the REDIRECT-URI after deleting an
instance specified by the OID in the CLASS.
[Function]
drop-instance instance => result
Drops the INSTANCE of a persistent class.
[Function]
drop-instance-by-oid class oid => result
Drops an instance of the persistent CLASS by the OID if any.
[Function]
drop-instances-by-class class => result
Drops instances by the CLASS.
[Macro]
edit-page class oid &key slot-values redirect-uri sml => result
Displays an edit form for an instance specified by the OID in the CLASS.
You can specify slot values by the SLOT-VALUES argument which must be an alist
of a slot symbol/value paris. Users will be redirected to the REDIRECT-URI
after successfully editing the instance. SML is a pathname of a sml template
file.
[Function]
edit-upload-file class &optional instance => result
Saves, changes or deletes files for the persistent CLASS from posted
parameters. INSTANCE is an instance of the CLASS only needed to edit or
delete uploaded files for the existing instance.
[Function]
edit/cont class instance page &key with-slots without-slots slot-values => result
Validates posted parameters to edit the CLASS instance. If the INSTANCE is an
instance of a persistent class, the instance is updated, otherwise a new instance
is created. Users will be redirected to the PAGE after successfully editing the
instance. The WITH-SLOTS and WITHOUT-SLOTS are lists of slot symbols used to
specify included/excluded slots for the validations and editing. You can specify
slot values by the SLOT-VALUES argument which must be an alist of slot
symbol/value pairs.
[Function]
example-path file => result
Returns a pathname of the FILE under the examples directory.
[Generic function]
form-comment slot => result
Displays a comment of the SLOT if any.
[Method]
form-comment (slot slot-options) => result
[Macro]
form-for/cont continuation &key class instance submit => result
Generates and displays a form for the persistent CLASS with embedding the
CONTINUATION within the form. INSTANCE is an instance of the CLASS only needed
to update an existing instance. SUBMIT is a value of a submit button.
[Generic function]
form-input class slot &optional instance => result
Displays an input form for the SLOT in the persistent
CLASS. INSTANCE is an instance of the CLASS only needed to update an
existing instance.
[Method]
form-input class (slot slot-options) &optional instance => result
[Generic function]
form-label slot => result
Displays a label of the SLOT.
[Method]
form-label (slot slot-options) => result
[Generic function]
form-valid-attr class slot &optional instance => result
Returns a list of attributes for input tags used for
javascript validations. http://docs.jquery.com/Plugins/Validation
[Method]
form-valid-attr class (slot slot-options) &optional instance => result
[Macro]
form/cont continuation &rest body => result
Generates and displays a form with embedding CONTINUATION and BODY.
[Macro]
genpages class &key index-slot index-sml show-sml edit-sml items-per-page links-per-page => result
Generates seven pages for the persistent CLASS. The pages are index, show,
edit, delete, uniquness validation, list and delete* pages. The last three
pages are used via ajax. You can change the sml template files by the INDEX-SML,
SHOW-SML or EDIT-SML argument. INDEX-SLOT is a symbol of a index slot
used in the index page to sort instances. You can set a number to display
items per page by the ITEMS-PER-PAGE and a number to display links per
page by the LINKS-PER-PAGE argument.
[Function]
get-current-page => result
Returns the current page number.
[Function]
get-excluded-file-slots class => result
Returns a list of excluded slot-options instances for the persistent CLASS
where the input type is :file.
[Function]
get-excluded-slots class &optional uri => result
Returns a list of excluded slot-options instances of the CLASS for the URI.
You can set the excluded slots by the hide-for slot option or *without-slots*.
The values of *with-slots* affects this.
[Function]
get-excluded-slots-if test class => result
Returns a list of excluded slot-options instances for the persistent CLASS
that satisfy the TEST. TEST is a designator for a function of one argument
that returns a generalized boolean.
[Function]
get-file-slots class => result
Returns a list of slot-options instances for the persistent CLASS where
the input type is :file.
[Function]
get-instance-by-oid class oid => result
Returns an instance of the persistent CLASS by the OID if any.
[Function]
get-msgs => result
Returns a list of messages to display if any.
[Function]
get-slot class slot-symbol => result
Returns an instance of the slot-options class by the persistent CLASS
and SLOT-SYMBOL if any.
[Function]
get-slots class => result
Returns a list of slot-options instances for the persistent CLASS.
[Function]
get-slots-if test class => result
Returns a list of slot-options instances for the persistent CLASS that satisfy
the TEST. TEST is a designator for a function of one argument that returns a
generalized boolean.
[Function]
get-user user-id &optional user-pass => result
Returns an instance of the user persistent class by the USER-ID and
USER-PASS if any.
[Function]
get-user-oid user-id => result
Returns an integer oid (object id) of the user specified by the USER-ID if any.
The oid is for an instance of the user persistent class.
[Function]
hide-slot-p slot uri => result
Returns true if the SLOT should be hided for the URI and nil otherwise.
[Function]
host-uri => result
Returns the 'X-FORWARDED-HOST' or 'Host' incoming http header value.
[Function]
http-test-drop-instance-by-oid class oid => result
Executes (http-drop-instance-by-oid CLASS OID) and check if the instance
was successfully deleted. This raises an error if the test failed and returns
true otherwise.
[Function]
http-test-get-instance-by-oid class oid => result
Executes (http-get-instance-by-oid CLASS OID) and check if the values
are correct ones. This raises an error if the tests failed and returns true
otherwise.
[Function]
http-test-login &key id pass => result
Executes (http-login :id ID :pass PASS) and check if the user was
successfully logged in. This raises an error if the test failed
and returns true otherwise.
[Function]
http-test-logout => result
Executes (http-logout) and check if the current user was successfully
logged out. This raises and error if the test failed and returns true
otherwise.
[Macro]
http-test-make-instance class &rest initargs => result
Executes `(http-make-instance ,CLASS ,@INITARGS) and check if
an instance was successfully created. This raises an error if the test
failed and returns an oid of the created instance otherwise.
[Function]
http-test-regist args => result
Executes (http-regist ARGS) and checks if the user was successfully
registered. This raises an error if the registration failed and returns
true otherwise.
[Function]
http-test-update-instance class oid values => result
Executes (http-update-instance CLASS OID VALUES) and check if
the instance was successfully updated. This raises an error if the
tests failed and returns true otherwise.
[Generic accessor]
id object => result
(setf (id object) new-value)
[Specialized accessor]
id (object user) => result
(setf (id (object user)) new-value)
A user login ID.
[Function]
image-file-p file => result
Returns true if the FILE is a image file and nil otherwise.
[Function]
image-path file type => result
Returns a pathname of the image FILE. TYPE must be a key of
*image-public-dirs* such as 'upload' or 'tmp'.
[Macro]
index-page class &key index-slot maxlength items-per-page links-per-page plural sml => result
Displays a list of the CLASS instances for the current page as (x)html order
by the INDEX-SLOT. You can set a number to display items per page by the
ITEMS-PER-PAGE and a number to display links per page by the LINKS-PER-PAGE
argument. SML is a pathname of a sml template file. The default title format
of the page is like 'Listing pluralized-classname' where the 'pluralized-classname'
part is created by (pluralize (->string-down class)), and you can change the
part by the PLURAL argument. The MAXLENGTH is a max length of a slot value to
display in a table cell, and exceeded characters will be replaced by '...'.
[Function]
indexed-slot-p class slot => result
Returns true if the SLOT in the CLASS is indexed and nil otherwise.
[Macro]
item-list class &key index-slot sml => result
Displays a list of the CLASS instances as a part of (x)html table order
by the INDEX-SLOT. You can change the sml template file by the SML argument
which must be a pathname of a valid file.
[Function]
items-per-page class &optional index &key items-per-page links-per-page => result
Returns multiple values, a list of the persistent CLASS instances
for the current page sorted by the INDEX slot, an instances of the
pager class and excluded slots for the current page. You can set a
number to display items per page by the ITEMS-PER-PAGE and a number
to display links per page by the LINKS-PER-PAGE argument.
[Macro]
load-sml-path path &rest args => result
Loads a sml file placed in the PATH under the sml directory.
[Function]
login user-oid user-id => result
Sets the session data, USER-OID and USER-ID, so that the current user
is treated as a login user.
[Function]
login-msg key => result
Returns a string log in/out message.
[Function]
login-page &optional redirect-uri => result
Generates and displays a login page. After logging in, redirects the
user to the REDIRECT-URI.
[Function]
login-user => result
Returns an instance of the user persistent class for the current user
if the user is a login user.
[Function]
login-user-id => result
Returns a string id of the current user if the user is a login user.
[Function]
login-user-oid => result
Returns an integer oid of the current user if the user is a login user.
The oid is for an instance of the user persistent class.
[Function]
logout => result
Logs out the current user.
[Function]
logout-page &optional redirect-uri => result
Logs out the current user and redirects the user to the REDIRECT-URI.
[Function]
make-pinstance class &optional slot-values => result
Makes an instance of the persistent CLASS from posted parameters.
You can specify values of the slots by the SLOT-VALUES argument which
must be an alist of the slot symbol/value pairs.
[Function]
mime-type file => result
Returns a string mime type of the FILE.
[Standard class]
msgs
[Function]
msgs => result
Displays messages if any.
[Macro]
multipart-form/cont continuation &rest body => result
Generates and displays a multi part form with embedding CONTINUATION and BODY.
[Generic accessor]
next-link object => result
(setf (next-link object) new-value)
[Specialized accessor]
next-link (object pager) => result
(setf (next-link (object pager)) new-value)
A link to next page links.
[Macro]
next-link* pager &optional parameters => result
Displays a link to next page links by the PAGER, must be an
instance of the pager class, if needed. The default link is '>>'.
PARAMETERS is a string get parameters which will be added to the link.
[Function]
oid instance => result
Returns an oid (object id) of the INSTANCE if any.
[Function]
omit obj maxlength &optional omark => result
If the length of OBJ exceeds the MAXLENGTH, replaces the exceeded
characters with the OMARK. Returns the OBJ. Note that if the OBJ is
an instance of the sml::safe class, this returns the OBJ without
making any change.
Examples:
(omit "12345" 3) ;=> "123..."
[Function]
owner-p class slot oid => result
Returns true if the value of the SLOT in the CLASS specified
by the OID is eq to the login user oid.
[Function]
page page &rest args => result
Calls the procedure of the PAGE with ARGS.
[Macro]
page-lambda (&rest args) declaration* statement* => result
Creates a page procedure.
Syntax:
page-lambda ([path ...] [:get garg ...] [:post poarg ...] :auth
:redirect redirect) body
Arguments and Values:
path---an uri path
garg---a symbol name of a get parameter
poarg---a symbol name of a post parameter
:auth---if :auth is supplied and the current user hasn't logged in,
redirects the user to the login page
redirect---an uri to redirect users after logging in
body---a form
Examples:
(defpage said ()
(form/cont (page-lambda (:post foo)
(a/cont [p "You said: " foo] "click here"))
(input-text "foo")))
[Function]
page-links pager &optional parameters => result
Generates and displays page links by the PAGER, must be an instance
of the pager class, if needed. PARAMETERS is a string get parameters
which will be added to the links.
[Function]
page-summary pager => result
Generates and displays a summary result of a pagination by the
PAGER, must be an instance of the pager class, if needed. The default
format is 'Results 1 - 10 of 100'.
[Function]
page-uri &rest paths => result
Generates and returns a page uri that contains all the PATHS
in the order that they are supplied.
Examples:
(page-uri 'page' 'path1' 'path1')
;=> 'http://localhost:8080/page/path1/path1/'
[Function]
page/error-msgs page messages &rest args => result
Calls the procedure of the PAGE with error MESSAGES and ARGS.
[Function]
page/msgs page messages &rest args => result
Calls the procedure of the PAGE with success MESSAGES and ARGS.
[Standard class]
pager
A pagination class.
[Generic accessor]
pass object => result
(setf (pass object) new-value)
[Specialized accessor]
pass (object user) => result
(setf (pass (object user)) new-value)
A user login password.
[Function]
per-page instances &key index order items-per-page links-per-page => result
Returns two values, a list of instances and a pager instance. The
returning instances is a copy of the INSTANCES retrieved by the pager
instance. INDEX is a symbol of a index slot used to sort the instances.
ORDER is a predicate function to determine the order. You can set
a number to display items per page by the ITEMS-PER-PAGE, and a number
to display links per page by the LINKS-PER-PAGE argument.
[Function]
pluralize word => result
[Generic accessor]
prev-link object => result
(setf (prev-link object) new-value)
[Specialized accessor]
prev-link (object pager) => result
(setf (prev-link (object pager)) new-value)
A link to previous page links.
[Macro]
prev-link* pager &optional parameters => result
Displays a link to previous page links by the PAGER, must be
an instance of the pager class, if needed. The default link is '<<'.
PARAMETERS is a string get parameters which will be added to the link.
[Function]
ps instance => result
Prints slot's names and values of the INSTANCE.
[Function]
public-path file => result
Returns a pathname of the FILE under the public directory.
[Function]
redirect/error-msgs uri messages => result
Redirects to the URI with the error MESSAGES.
[Function]
redirect/msgs uri messages => result
Redirects to the URI with the success MESSAGES.
[Function]
regist-page &optional redirect-uri => result
Generates and displays a registration page. After registering,
redirects the user to the REDIRECT-URI.
[Function]
rem-cont-session key &optional cid => result
Removes the entry for the KEY in cont-session (continuation
based session) associated with the cid (continuation id)
if any.
[Function]
rem-parameter link key => result
Returns the LINK after removing a get parameter named KEY
Examples:
(rem-parameter "http://host/?k1=v1" "k1") ;=> "http://host/"
[Function]
renew-cont-lifetime cid => result
Renews a lifetime of a continuation associated with the
CID (continuation id).
[Generic function]
required-mark slot => result
Displays a required mark if the SLOT is required.
[Method]
required-mark (slot slot-options) => result
[Function]
select-date name &key y m d y-start y-end => result
Generates and displays date select boxes named NAME. Y is the selected year,
M is the selected month and D is the selected date. The Y-START is the oldest
year and the Y-END is the newest year in the year select box.
[Function]
set-get-parameters parameters => result
Sets the get PARAMETERS which must be an alist of key/value pairs.
[Function]
set-post-parameters parameters => result
Sets the post PARAMETERS which must be an alist of key/value pairs.
[Macro]
show-page class oid &key sml => result
Displays values of slots in the CLASS as (x)html for an instance
specified by the OID. SML is a pathname of a sml template file.
[Function]
sid &optional session => result
Returns an integer id of the SESSION.
[Generic accessor]
slot-cols object => result
(setf (slot-cols object) new-value)
[Specialized accessor]
slot-cols (object slot-options) => result
(setf (slot-cols (object slot-options)) new-value)
A column size of a textarea input field.
[Generic accessor]
slot-comment object => result
(setf (slot-comment object) new-value)
[Specialized accessor]
slot-comment (object slot-options) => result
(setf (slot-comment (object slot-options)) new-value)
A comment of a slot.
[Generic function]
slot-display-value instance slot &key nl->br nl->br => result
Returns a display value of the SLOT for the INSTANCE.
If NL->BR is non nil, replace #newline with br html tags like <br />.
[Method]
slot-display-value instance (slot slot-options) &key nl->br nl->br => result
[Generic accessor]
slot-format object => result
(setf (slot-format object) new-value)
[Specialized accessor]
slot-format (object slot-options) => result
(setf (slot-format (object slot-options)) new-value)
A validation type which must be :alpha, :alnum,
:integer, :email :date, :image, regexp as a string, a function or nil.
[Generic accessor]
slot-hide-for object => result
(setf (slot-hide-for object) new-value)
[Specialized accessor]
slot-hide-for (object slot-options) => result
(setf (slot-hide-for (object slot-options)) new-value)
This specifies where to hide a slot for.
:all for all or a string regexp to hide it only on pages where the request
uri matches to the regexp.
[Generic accessor]
slot-id object => result
(setf (slot-id object) new-value)
[Specialized accessor]
slot-id (object slot-options) => result
(setf (slot-id (object slot-options)) new-value)
A string id of a slot.
[Generic accessor]
slot-input object => result
(setf (slot-input object) new-value)
[Specialized accessor]
slot-input (object slot-options) => result
(setf (slot-input (object slot-options)) new-value)
A type of a input form which must be :text,
:textarea, :radio, :checkbox, :select, :password or :file.
[Generic accessor]
slot-label object => result
(setf (slot-label object) new-value)
[Specialized accessor]
slot-label (object slot-options) => result
(setf (slot-label (object slot-options)) new-value)
A label of a slot.
[Generic accessor]
slot-length object => result
(setf (slot-length object) new-value)
[Specialized accessor]
slot-length (object slot-options) => result
(setf (slot-length (object slot-options)) new-value)
If this is non nil, validates a length of a value.
An integer for a max length or a list of two elements for '(min max) length.
[Standard class]
slot-options
Extended slot options of a persistent class.
[Generic accessor]
slot-options object => result
(setf (slot-options object) new-value)
[Specialized accessor]
slot-options (object slot-options) => result
(setf (slot-options (object slot-options)) new-value)
Options for a select, radio or checkbox input forms.
[Generic accessor]
slot-required object => result
(setf (slot-required object) new-value)
[Specialized accessor]
slot-required (object slot-options) => result
(setf (slot-required (object slot-options)) new-value)
A value of a slot is required if this is non nil.
[Generic accessor]
slot-rows object => result
(setf (slot-rows object) new-value)
[Specialized accessor]
slot-rows (object slot-options) => result
(setf (slot-rows (object slot-options)) new-value)
A row size of a textarea input field.
[Generic function]
slot-save-value slot &optional value => result
Converts and returns the VALUE of the SLOT into the
saving format if needed.
[Method]
slot-save-value (slot slot-options) &optional value => result
[Generic accessor]
slot-size object => result
(setf (slot-size object) new-value)
[Specialized accessor]
slot-size (object slot-options) => result
(setf (slot-size (object slot-options)) new-value)
A size of a text input field.
[Generic accessor]
slot-symbol object => result
(setf (slot-symbol object) new-value)
[Specialized accessor]
slot-symbol (object slot-options) => result
(setf (slot-symbol (object slot-options)) new-value)
A symbol of a slot.
[Generic accessor]
slot-type object => result
(setf (slot-type object) new-value)
[Specialized accessor]
slot-type (object slot-options) => result
(setf (slot-type (object slot-options)) new-value)
A type specifier of a slot.
[Generic accessor]
slot-unique object => result
(setf (slot-unique object) new-value)
[Specialized accessor]
slot-unique (object slot-options) => result
(setf (slot-unique (object slot-options)) new-value)
A value of a slot must be unique if this is non nil.
[Function]
slot-validation-errors class slot &optional instance => result
Validates posted parameters to edit the SLOT value in the persistent
CLASS and returns a list of error messages if any. INSTANCE is an instance
of the persistent CLASS only needed to update an existing instance.
[Function]
sml-path file => result
Returns a pathname of the FILE under the sml directory.
[Function]
start-server &optional acceptor => result
Starts ACCEPTOR so that it begins accepting connections.
Returns the ACCEPTOR.
[Function]
stop-server acceptor => result
Stops ACCEPTOR so that it no longer accepts requests.
[Function]
thumbnail file &key type width height => result
Displays a thumbnail of the image FILE with the size of WIDTH and HEIGHT.
The default width and height are *thumbnail-width* and *thumbnail-height*.
TYPE must be a key of *image-public-dirs* such as 'upload' or 'tmp'.
[Function]
thumbnail-uri file &key type width height => result
Returns a thumbnail uri of the image FILE with the size of WIDTH and HEIGHT.
TYPE must be a key of *image-public-dirs* such as 'upload' or 'tmp'.
[Function]
time-format format &optional time => result
Returns formatted string TIME according to the FORMAT.
+--------+-----------------+
| format | description |
+--------+-----------------+
| ~y | year (~4,'0d) |
| ~m | month (~2,'0d) |
| ~d | date (~2,'0d) |
| ~h | hour (~2,'0d) |
| ~i | minute (~2,'0d) |
| ~s | second (~2,'0d) |
+--------+-----------------+
Examples:
(time-format "~y-~m-~d ~h:~i:~s" 3443621047) ;=> "2009-02-15 02:24:07"
[Generic accessor]
total-pages object => result
(setf (total-pages object) new-value)
[Specialized accessor]
total-pages (object pager) => result
(setf (total-pages (object pager)) new-value)
A number of total pages.
[Function]
unique-p class slot value &optional ins => result
Returns nil if the same VALUE has been registered in the CLASS SLOT
and true otherwise.
[Function]
update-pinstance class instance &optional slot-values => result
Updates the INSTANCE of the persistent CLASS from posted parameters.
You can specify values of the slots by the SLOT-VALUES argument which
must be an alist of the slot symbol/value pairs.
[Generic accessor]
updated-at object => result
(setf (updated-at object) new-value)
[Specialized accessor]
updated-at (object user) => result
(setf (updated-at (object user)) new-value)
automatically generated reader method
[Function]
uri-path nth &optional request => result
Returns the nth element of the uri path from the current page uri.
Examples:
(defpage one () (sml:p (uri-path 1)))
; wget http://localhost:8080/one/path1 => 'path1'
(defpage one/two/three () (sml:p (uri-path 1)))
; wget http://localhost:8080/one/two/three/path1 => 'path1'
[Standard class]
user
This is the default user persistent class used for
the authentication. You can change it by overriding this class or
defining a new persistent class with extending this class.
[Standard class]
user*
An instance of this class, set to *user*, is used
to manage authentication. The default user persistent class is 'user,
and you can change it by defining a new user persistent class with
extending the 'user class.
[Function]
user-class => result
Returns a symbol name of the user persistent class.
[Generic function]
user-id user => result
Returns a string id of the USER.
[Method]
user-id (user user) => result
[Function]
user-id-label => result
Returns a string label of the id slot.
[Function]
user-id-slot => result
Returns a symbol name of the id slot.
[Function]
user-login-page => result
Returns a name of the login page.
[Generic function]
user-pass user => result
Returns a string password of the USER.
[Method]
user-pass (user user) => result
[Function]
user-pass-label => result
Returns a string label of the password slot.
[Function]
user-pass-slot => result
Returns a symbol name of the password slot.
[Function]
validation-errors label value validators => result
Validates VALUE with VALIDATORS and returns error messages if any.
LABEL is used as a subject of error messages.
Examples:
(validation-errors "label" nil '(:required t :length 3))
;=> ("label can't be empty")
(validation-errors "label" "12345" '(:required t :length 3))
;=> ("label is too long (maximum is 3 characters)")
[Function]
w/p link => result
Returns the LINK after adding a get parameter denotate the current
page number.
[Function]
web4r-path file => result
Returns a pathname of the FILE under the web4r directory.
[Macro]
with-get-parameters parameters &rest body => result
Executes BODY with get PARAMETERS which must be an alist
of key/value pairs.
[Macro]
with-new-cookie &rest body => result
[Macro]
with-post-parameters parameters &rest body => result
Executes BODY with post PARAMETERS which must be an alist
of key/value pairs.
[Macro]
with-validations validations error-handler body => result
Executes VALIDATIONS. Then executes ERROR-HANDLER if there is
any error and BODY otherwise. The ERROR-HANDLER takes one argument
which is a list of validation error messages.
Examples:
(with-validations (("1" "v" '(:required t))
("2" nil '(:required t)))
(lambda (e) e)
"ok") ;=> ("2 can't be empty")
(with-validations (("1" "v" '(:required t))
("2" "v" '(:required t)))
(lambda (e) e)
"ok") ;=> "ok"