The formlets Reference Manual

This is the formlets Reference Manual, version 0.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:08:19 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 formlets

Validating formlets for Hunchentoot

Maintainer

<>

Author

<>

License

MIT-style

Version

0.3

Dependencies
  • cl-who (system).
  • drakma (system).
  • hunchentoot (system).
  • cl-ppcre (system).
Source

formlets.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 formlets/formlets.asd

Source

formlets.asd.

Parent Component

formlets (system).

ASDF Systems

formlets.

Packages

formlets-system.


3.1.2 formlets/package.lisp

Source

formlets.asd.

Parent Component

formlets (system).

Packages

formlets.


3.1.3 formlets/utility.lisp

Dependency

package.lisp (file).

Source

formlets.asd.

Parent Component

formlets (system).

Internals

3.1.4 formlets/formlets.lisp

Dependencies
Source

formlets.asd.

Parent Component

formlets (system).

Public Interface
Internals

3.1.5 formlets/recaptcha.lisp

Dependencies
Source

formlets.asd.

Parent Component

formlets (system).

Public Interface
Internals

recaptcha-passed? (function).


3.1.6 formlets/macros.lisp

Dependencies
Source

formlets.asd.

Parent Component

formlets (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 formlets-system

Source

formlets.asd.

Use List
  • asdf/interface.
  • common-lisp.

4.2 formlets

A package implementing auto-validating formlets for Hunchentoot

Source

package.lisp.

Use List
  • cl-who.
  • common-lisp.
  • hunchentoot.
Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Special variables

Special Variable: *private-key*
Package

formlets.

Source

recaptcha.lisp.

Special Variable: *public-key*
Package

formlets.

Source

recaptcha.lisp.


5.1.2 Macros

Macro: define-formlet ((name &key general-validation submit) (&rest fields) &rest on-success)

Converts a terse declaration form into the corresponding object and validation handler.

Package

formlets.

Source

macros.lisp.

Macro: show-formlet (formlet-name &key default-values)

Shortcut for displaying a formlet.
It outputs the formlet HTML to standard-out (with indenting).
If this is the last submitted formlet in session, display field values and errors, then clear out the formlet-related session information.

Package

formlets.

Source

macros.lisp.


5.1.3 Ordinary functions

Function: file-smaller-than? (byte-size)
Package

formlets.

Source

formlets.lisp.

Function: file-type? (&rest accepted-types)
Package

formlets.

Source

formlets.lisp.

Function: longer-than? (num)
Package

formlets.

Source

formlets.lisp.

Function: matches? (regex)
Package

formlets.

Source

formlets.lisp.

Function: mismatches? (regex)
Package

formlets.

Source

formlets.lisp.

Function: not-blank? ()
Package

formlets.

Source

formlets.lisp.

Function: picked-exactly? (num)
Package

formlets.

Source

formlets.lisp.

Function: picked-fewer-than? (num)
Package

formlets.

Source

formlets.lisp.

Function: picked-more-than? (num)
Package

formlets.

Source

formlets.lisp.

Function: same-as? (field-name-string)
Package

formlets.

Source

formlets.lisp.

Function: shorter-than? (num)
Package

formlets.

Source

formlets.lisp.


5.1.4 Generic functions

Generic Function: post-value (formlet post-alist)
Package

formlets.

Methods
Method: post-value ((field formlet-field-return-set) post-alist)
Source

formlets.lisp.

Method: post-value ((field formlet-field) post-alist)
Source

formlets.lisp.

Method: post-value ((formlet formlet) post-alist)
Source

formlets.lisp.

Generic Function: show (formlet &optional values errors)
Package

formlets.

Methods
Method: show ((field recaptcha) &optional v error)
Source

recaptcha.lisp.

Method: show ((field checkbox-set) &optional value error)
Source

formlets.lisp.

Method: show ((field multi-select) &optional value error)
Source

formlets.lisp.

Method: show ((field radio-set) &optional value error)
Source

formlets.lisp.

Method: show ((field checkbox) &optional value error)
Source

formlets.lisp.

Method: show ((field select) &optional value error)
Source

formlets.lisp.

Method: show ((field file) &optional value error)
Source

formlets.lisp.

Method: show ((field password) &optional value error)
Source

formlets.lisp.

Method: show ((field textarea) &optional value error)
Source

formlets.lisp.

Method: show ((field formlet-field) &optional value error)
Source

formlets.lisp.

Method: show ((field hidden) &optional value error)
Source

formlets.lisp.

Method: show ((formlet formlet) &optional values errors)
Source

formlets.lisp.

Generic Function: validate (formlet form-values)
Package

formlets.

Methods
Method: validate ((field recaptcha) values)

A reCaptcha, being a foreign API call, is validated in a completely different way

Source

recaptcha.lisp.

Method: validate ((field formlet-field) value)

Returns (values T NIL) if there are no errors, and (values NIL list-of-errors). By default, a formlet-field passes only its own value to its validation functions.

Source

formlets.lisp.

Method: validate ((formlet formlet) form-values)
Source

formlets.lisp.


5.1.5 Classes

Class: checkbox
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field.

Direct methods

show.

Class: checkbox-set
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field-return-set.

Direct methods

show.

Class: file
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field.

Direct methods

show.

Class: formlet
Package

formlets.

Source

formlets.lisp.

Direct methods
Direct slots
Slot: name
Initargs

:name

Readers

name.

Writers

This slot is read-only.

Slot: fields
Initargs

:fields

Readers

fields.

Writers

This slot is read-only.

Slot: validation-functions
Initargs

:validation-functions

Readers

validation-functions.

Writers

(setf validation-functions).

Slot: error-messages
Initargs

:error-messages

Readers

error-messages.

Writers

This slot is read-only.

Slot: submit-caption
Initform

"submit"

Initargs

:submit

Readers

submit.

Writers

This slot is read-only.

Slot: enctype
Initform

"application/x-www-form-urlencoded"

Initargs

:enctype

Readers

enctype.

Writers

(setf enctype).

Slot: on-success
Initargs

:on-success

Readers

on-success.

Writers

This slot is read-only.

Class: formlet-field
Package

formlets.

Source

formlets.lisp.

Direct subclasses
Direct methods
Direct slots
Slot: name
Initargs

:name

Readers

name.

Writers

This slot is read-only.

Slot: validation-functions
Initargs

:validation-functions

Readers

validation-functions.

Writers

(setf validation-functions).

Slot: default-value
Initargs

:default-value

Readers

default-value.

Writers

This slot is read-only.

Slot: error-messages
Initargs

:error-messages

Readers

error-messages.

Writers

(setf error-messages).

Class: hidden
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field.

Direct methods

show.

Class: multi-select
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field-return-set.

Direct methods

show.

Class: password
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field.

Direct methods

show.

Class: radio-set
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field-set.

Direct methods

show.

Class: recaptcha
Package

formlets.

Source

recaptcha.lisp.

Direct superclasses

formlet-field.

Direct methods
Class: select
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field-set.

Direct methods

show.

Class: text
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field.

Class: textarea
Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field.

Direct methods

show.


5.2 Internals


5.2.1 Macros

Macro: define-predicate (name (&rest args) &body body)
Package

formlets.

Source

formlets.lisp.

Macro: define-show (field-type &body body)
Package

formlets.

Source

formlets.lisp.

Macro: html-to-stout (&body body)
Package

formlets.

Source

utility.lisp.

Macro: html-to-str (&body body)

Returns HTML as a string, as well as printing to standard-out

Package

formlets.

Source

utility.lisp.


5.2.2 Ordinary functions

Function: define-field (field-name field-type &key size value-set default-value validation)

Takes a terse declaration and expands it into a make-instance for macro purposes

Package

formlets.

Source

macros.lisp.

Function: ensure-list-length (list desired-length)
Package

formlets.

Source

macros.lisp.

Function: file-size (f-name)
Package

formlets.

Source

utility.lisp.

Function: recaptcha-passed? (challenge response ip &optional private-key)
Package

formlets.

Source

recaptcha.lisp.

Function: split-validation-list (validation-list)
Package

formlets.

Source

utility.lisp.


5.2.3 Generic functions

Generic Reader: default-value (object)
Package

formlets.

Methods
Reader Method: default-value ((formlet-field formlet-field))

automatically generated reader method

Source

formlets.lisp.

Target Slot

default-value.

Generic Reader: enctype (object)
Package

formlets.

Methods
Reader Method: enctype ((formlet formlet))

automatically generated reader method

Source

formlets.lisp.

Target Slot

enctype.

Generic Writer: (setf enctype) (object)
Package

formlets.

Methods
Writer Method: (setf enctype) ((formlet formlet))

automatically generated writer method

Source

formlets.lisp.

Target Slot

enctype.

Generic Reader: error-messages (object)
Package

formlets.

Methods
Reader Method: error-messages ((formlet-field formlet-field))

automatically generated reader method

Source

formlets.lisp.

Target Slot

error-messages.

Reader Method: error-messages ((formlet formlet))

automatically generated reader method

Source

formlets.lisp.

Target Slot

error-messages.

Generic Writer: (setf error-messages) (object)
Package

formlets.

Methods
Writer Method: (setf error-messages) ((formlet-field formlet-field))

automatically generated writer method

Source

formlets.lisp.

Target Slot

error-messages.

Generic Reader: fields (object)
Package

formlets.

Methods
Reader Method: fields ((formlet formlet))

automatically generated reader method

Source

formlets.lisp.

Target Slot

fields.

Generic Reader: name (object)
Package

formlets.

Methods
Reader Method: name ((formlet-field formlet-field))

automatically generated reader method

Source

formlets.lisp.

Target Slot

name.

Reader Method: name ((formlet formlet))

automatically generated reader method

Source

formlets.lisp.

Target Slot

name.

Generic Reader: on-success (object)
Package

formlets.

Methods
Reader Method: on-success ((formlet formlet))

automatically generated reader method

Source

formlets.lisp.

Target Slot

on-success.

Generic Reader: submit (object)
Package

formlets.

Methods
Reader Method: submit ((formlet formlet))

automatically generated reader method

Source

formlets.lisp.

Target Slot

submit-caption.

Generic Reader: validation-functions (object)
Package

formlets.

Methods
Reader Method: validation-functions ((formlet-field formlet-field))

automatically generated reader method

Source

formlets.lisp.

Target Slot

validation-functions.

Reader Method: validation-functions ((formlet formlet))

automatically generated reader method

Source

formlets.lisp.

Target Slot

validation-functions.

Generic Writer: (setf validation-functions) (object)
Package

formlets.

Methods
Writer Method: (setf validation-functions) ((formlet-field formlet-field))

automatically generated writer method

Source

formlets.lisp.

Target Slot

validation-functions.

Writer Method: (setf validation-functions) ((formlet formlet))

automatically generated writer method

Source

formlets.lisp.

Target Slot

validation-functions.

Generic Reader: value-set (object)
Package

formlets.

Methods
Reader Method: value-set ((formlet-field-set formlet-field-set))

automatically generated reader method

Source

formlets.lisp.

Target Slot

value-set.

Generic Writer: (setf value-set) (object)
Package

formlets.

Methods
Writer Method: (setf value-set) ((formlet-field-set formlet-field-set))

automatically generated writer method

Source

formlets.lisp.

Target Slot

value-set.


5.2.4 Classes

Class: formlet-field-return-set

This class is specifically for fields that return multiple values from the user

Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field-set.

Direct subclasses
Direct methods

post-value.

Class: formlet-field-set

This class is for fields that show the user a list of options

Package

formlets.

Source

formlets.lisp.

Direct superclasses

formlet-field.

Direct subclasses
Direct methods
Direct slots
Slot: value-set
Initargs

:value-set

Readers

value-set.

Writers

(setf value-set).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
D   E   F   G   H   L   M   N   O   P   R   S   V  
Index Entry  Section

(
(setf enctype): Private generic functions
(setf enctype): Private generic functions
(setf error-messages): Private generic functions
(setf error-messages): Private generic functions
(setf validation-functions): Private generic functions
(setf validation-functions): Private generic functions
(setf validation-functions): Private generic functions
(setf value-set): Private generic functions
(setf value-set): Private generic functions

D
default-value: Private generic functions
default-value: Private generic functions
define-field: Private ordinary functions
define-formlet: Public macros
define-predicate: Private macros
define-show: Private macros

E
enctype: Private generic functions
enctype: Private generic functions
ensure-list-length: Private ordinary functions
error-messages: Private generic functions
error-messages: Private generic functions
error-messages: Private generic functions

F
fields: Private generic functions
fields: Private generic functions
file-size: Private ordinary functions
file-smaller-than?: Public ordinary functions
file-type?: Public ordinary functions
Function, define-field: Private ordinary functions
Function, ensure-list-length: Private ordinary functions
Function, file-size: Private ordinary functions
Function, file-smaller-than?: Public ordinary functions
Function, file-type?: Public ordinary functions
Function, longer-than?: Public ordinary functions
Function, matches?: Public ordinary functions
Function, mismatches?: Public ordinary functions
Function, not-blank?: Public ordinary functions
Function, picked-exactly?: Public ordinary functions
Function, picked-fewer-than?: Public ordinary functions
Function, picked-more-than?: Public ordinary functions
Function, recaptcha-passed?: Private ordinary functions
Function, same-as?: Public ordinary functions
Function, shorter-than?: Public ordinary functions
Function, split-validation-list: Private ordinary functions

G
Generic Function, (setf enctype): Private generic functions
Generic Function, (setf error-messages): Private generic functions
Generic Function, (setf validation-functions): Private generic functions
Generic Function, (setf value-set): Private generic functions
Generic Function, default-value: Private generic functions
Generic Function, enctype: Private generic functions
Generic Function, error-messages: Private generic functions
Generic Function, fields: Private generic functions
Generic Function, name: Private generic functions
Generic Function, on-success: Private generic functions
Generic Function, post-value: Public generic functions
Generic Function, show: Public generic functions
Generic Function, submit: Private generic functions
Generic Function, validate: Public generic functions
Generic Function, validation-functions: Private generic functions
Generic Function, value-set: Private generic functions

H
html-to-stout: Private macros
html-to-str: Private macros

L
longer-than?: Public ordinary functions

M
Macro, define-formlet: Public macros
Macro, define-predicate: Private macros
Macro, define-show: Private macros
Macro, html-to-stout: Private macros
Macro, html-to-str: Private macros
Macro, show-formlet: Public macros
matches?: Public ordinary functions
Method, (setf enctype): Private generic functions
Method, (setf error-messages): Private generic functions
Method, (setf validation-functions): Private generic functions
Method, (setf validation-functions): Private generic functions
Method, (setf value-set): Private generic functions
Method, default-value: Private generic functions
Method, enctype: Private generic functions
Method, error-messages: Private generic functions
Method, error-messages: Private generic functions
Method, fields: Private generic functions
Method, name: Private generic functions
Method, name: Private generic functions
Method, on-success: Private generic functions
Method, post-value: Public generic functions
Method, post-value: Public generic functions
Method, post-value: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, show: Public generic functions
Method, submit: Private generic functions
Method, validate: Public generic functions
Method, validate: Public generic functions
Method, validate: Public generic functions
Method, validation-functions: Private generic functions
Method, validation-functions: Private generic functions
Method, value-set: Private generic functions
mismatches?: Public ordinary functions

N
name: Private generic functions
name: Private generic functions
name: Private generic functions
not-blank?: Public ordinary functions

O
on-success: Private generic functions
on-success: Private generic functions

P
picked-exactly?: Public ordinary functions
picked-fewer-than?: Public ordinary functions
picked-more-than?: Public ordinary functions
post-value: Public generic functions
post-value: Public generic functions
post-value: Public generic functions
post-value: Public generic functions

R
recaptcha-passed?: Private ordinary functions

S
same-as?: Public ordinary functions
shorter-than?: Public ordinary functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show: Public generic functions
show-formlet: Public macros
split-validation-list: Private ordinary functions
submit: Private generic functions
submit: Private generic functions

V
validate: Public generic functions
validate: Public generic functions
validate: Public generic functions
validate: Public generic functions
validation-functions: Private generic functions
validation-functions: Private generic functions
validation-functions: Private generic functions
value-set: Private generic functions
value-set: Private generic functions


A.4 Data types

Jump to:   C   F   H   M   P   R   S   T   U  
Index Entry  Section

C
checkbox: Public classes
checkbox-set: Public classes
Class, checkbox: Public classes
Class, checkbox-set: Public classes
Class, file: Public classes
Class, formlet: Public classes
Class, formlet-field: Public classes
Class, formlet-field-return-set: Private classes
Class, formlet-field-set: Private classes
Class, hidden: Public classes
Class, multi-select: Public classes
Class, password: Public classes
Class, radio-set: Public classes
Class, recaptcha: Public classes
Class, select: Public classes
Class, text: Public classes
Class, textarea: Public classes

F
file: Public classes
File, formlets.asd: The formlets/formlets․asd file
File, formlets.lisp: The formlets/formlets․lisp file
File, macros.lisp: The formlets/macros․lisp file
File, package.lisp: The formlets/package․lisp file
File, recaptcha.lisp: The formlets/recaptcha․lisp file
File, utility.lisp: The formlets/utility․lisp file
formlet: Public classes
formlet-field: Public classes
formlet-field-return-set: Private classes
formlet-field-set: Private classes
formlets: The formlets system
formlets: The formlets package
formlets-system: The formlets-system package
formlets.asd: The formlets/formlets․asd file
formlets.lisp: The formlets/formlets․lisp file

H
hidden: Public classes

M
macros.lisp: The formlets/macros․lisp file
multi-select: Public classes

P
Package, formlets: The formlets package
Package, formlets-system: The formlets-system package
package.lisp: The formlets/package․lisp file
password: Public classes

R
radio-set: Public classes
recaptcha: Public classes
recaptcha.lisp: The formlets/recaptcha․lisp file

S
select: Public classes
System, formlets: The formlets system

T
text: Public classes
textarea: Public classes

U
utility.lisp: The formlets/utility․lisp file