API for package KPAX

The KPAX Web Application Framework

*before-last-debug-request*   variable

The request part of the before last request-response handled by the server
Initial value: NIL

*before-last-request-response*   variable

The complete, original before last request-response handled by the server
Initial value: NIL

*default-data-set-render-options*   variable

The default options for rendering a data set view
Initial value: #<KPAX::OPTIONS 10CA4763>

*default-web-form-render-options*   variable

The default options for rendering a web form
Initial value: #<KPAX::OPTIONS 10DBB6C3>

*html-prologue*   variable

The contents of this string is inserted before any HTML page (used at macro-expansion/compile time)
Initial value: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

*last-debug-request*   variable

The request part of the last request-response handled by the server
Initial value: NIL

*last-request-response*   variable

The complete, original last request-response handled by the server
Initial value: NIL

*locale*   variable

Special variable to be bound to a locale specification object
Initial value: NIL

*localization-source*   variable

Special variable to be bound to an object to be used as localization source
Initial value: NIL

*pprint-html*   variable

Controls pretty printing of generated HTML (used at macro-expansion/compile time)
Initial value: NIL

*simple-localization-source*   variable

A builtin, simple localization source
Initial value: #<KPAX::SIMPLE-LOCALIZATION-SOURCE 10D7CA93>

*web-app-server*   variable

A handle to the current web application server object
Initial value: NIL

(add-appender logger appender)   generic-function

Add an appender to a logger

(byte-vector->hex-string bytes)   function

Convert a byte vector to a hex string, as in #(1 15 255) becomes '010FFF'

(byte-vector->string bytes)   function

Convert a byte vector to an 8-bit ASCII string

(clear-attributes object)   generic-function

Clear all named attributes in object

(commit-headers request-response &optional content-length)   generic-function

Partially commmit the request-response: response header line and response headers

(copy-slots-form->object form object slots)   function

Copy the named slots from a form to an object

(copy-slots-object->form object form slots)   function

Copy the named slots from an object to a form

(data-set-elt data-set position)   generic-function

Return the element at position in data-set (zero-based offset)

(data-set-length data-set)   generic-function

Return the number of elements in the data-set

(debug-request uri-string-or-request-response &key parameters session-id headers)   function

Execute a request (uri-string or debug-request-response instance) directly on KPAX

debug-stream-appender   class

A stream appender for debugging including an 'enabled' property
Class precedence list: debug-stream-appender stream-appender appender standard-object t
Class init args: :stream

(defwebapp name &rest options)   function

Define a web application by name with the options listed

(defwebform name field-specs &rest options)   function

Define a web form with name, field-specs and options

(destroy-kpax &rest options)   function

Stop and remove the the KPAX web application server

(dynamic-url request-response relative-url &rest args)   generic-function

Generate a dynamic URL in the context of request-response based on relative-url and args

(ensure-web-form-definition name field-specs options)   function

Ensure (create or update) a web form with name, field-specs and options

(extract-multipart-parts stream-or-body-string &key use-tmp-files-for-data)   function

Extract all parts of a multipart/form-data encoded stream-or-body-string into ((part1-headers part1-data) ..)

(field-value web-form name)   generic-function

Return the value of a field with name in web-form

(find-menu-item menu id)   function

Find the menu item with id in menu

(find-multipart-header-attribute attribute-name multipart-header)   function

Find the value of a named attribute in a multipart/form-data decoded header

(find-multipart-header-named header-name multipart-headers)   function

Find a named header in a list of multipart/form-data decoded headers

(find-multipart-named part-name parts)   function

Find a named part in a list of multipart/form-data decoded parts

(find-session session-manager id)   generic-function

Find the session with id in session-manager

(forward-request-response dispatcher request-response &key webapp function)   generic-function

Forward a request-repsonse to a different webapp and/or function but keeping the session

(forward-to request-response &key webapp function)   function

Convenience wrapper to forward a request-repsonse to a different webapp and/or function

(generate-checkbox request-response name value &key (true-value t) (checked-value checked) label)   function

Generate a checkbox type form input tag with optional extra label

(generate-hidden-field request-response name value)   function

Generate a hidden type form input tag

(generate-password-field request-response name value &key size maxlength readonly)   function

Generate a password type form input tag

(generate-radiobutton request-response name value &key (true-value t) (checked-value checked) label)   function

Generate a radio type form input tag with optional label

(generate-select request-response name values-list current-value &key (selected-value selected) multiple (multiple-value multiple) size labels (test (function eql)))   function

Generate a select tag with nested option tags, indicating the current selection

(generate-text-area request-response name value &key cols rows readonly)   function

Generate a textarea form tag

(generate-text-field request-response name value &key size maxlength readonly)   function

Generate a text type form input tag

(get-action data-set-view)   generic-function

Get the action to perform for item

(get-actual-label item &optional render-options)   generic-function

Get the actual (translated using render-options) label to use for item

(get-all-sessions session-manager)   generic-function

Return a list of all known sessions

(get-application request-response)   generic-function

Get the web application to which this request-response was directed

(get-attribute object key)   generic-function

Get the attribute value for name in object

(setf (get-attribute attributes-mixin key) value)   generic-function

Set the value of the attribute for key in object

(get-attributes object)   generic-function

Return the list of all attribute keys known by object

(get-content-stream request-response)   generic-function

Access the buffered stream to write content to for this request-response's reply

(get-cookie request-response name)   generic-function

Return the most specific string value of the cookie with name in request-response

(get-created-timestamp session)   generic-function

Return the universal time when this session was created

(get-data-set data-set-view)   generic-function

Access the underlying data-set in data-set-view

(get-debug-mode object)   generic-function

Return whether object is in debug mode or not

(get-debug-stream web-app-server)   generic-function

Get the debug stream of this web application server

(setf (get-debug-stream web-app-server) stream)   generic-function

Set the debug stream of this web application server

(get-dispatcher server)   generic-function

Access this server's dispatcher

(get-dynamic-prefix web-app)   generic-function

Get this server's dynamic prefix

(get-home-url web-app web-app-server)   generic-function

Return the home URL for web-app in web-app-server

(get-hostname server)   generic-function

Get this server's hostname

(get-id web-form)   generic-function

Get the id that uniquely identifies object

(get-index web-app)   generic-function

Return the start function for this web application

(get-items object)   generic-function

Return the items in object

(get-last-modified-timestamp session)   generic-function

Return the universal time when this session was last modified ('touched')

(get-logstream web-app-server)   generic-function

Get the log stream of this web application server

(setf (get-logstream web-app-server) stream)   generic-function

Set the log stream of this web application server

(get-menu-item-path menu id)   function

Return the path list in menu to the menu item with id

(get-name web-form-group-definition)   generic-function

Return the name of this object

(get-option object option-name)   generic-function

Returns the value of a named option in object

(get-request-body request-response)   generic-function

Get the request data, 'body', from request-response as a (possibly empty) string

(get-request-header-value request-response header-name)   generic-function

Get the request header value for header-name in request-response

(get-request-headers request-response)   generic-function

Get the list of all header names in request-response

(get-request-ip-address request-response)   generic-function

Get the ip address of the client of request-response as a dotted string

(get-request-method request-response)   generic-function

Get the request HTTP method, a keyword symbol most likely :get or :post (but extendible)

(get-request-parameter-value request-response parameter-name)   generic-function

Get the first request parameter value for parameter-name in request-response

(get-request-parameter-values request-response parameter-name)   generic-function

Get the list of request parameter values for parameter-name in request-response

(get-request-parameters request-response)   generic-function

Get the list of all request parameter names in request-response

(get-request-state request-response)   generic-function

One of - in order - nil, :request-line-read, :headers-read or :body-read

(get-request-stream request-response)   generic-function

Get the raw request stream from request-response (fails if get-request-body was done first)

(get-request-sub-path request-response)   generic-function

Get the sub path list for this request (the uri components minus the server and web app prefixes)

(get-response-header-value request-response header-name)   generic-function

Get the (first) response header value for header-name in request-response

(setf (get-response-header-value request-response header-name) value)   generic-function

Set the response header value for header-name in request-response to value

(get-response-mime-type request-response)   generic-function

Get the mime-type for this request-response's reply

(get-response-state request-response)   generic-function

One of - in order - nil, :response-line-written, :headers-written, :response-written or :response-flushed

(get-response-status request-response)   generic-function

Get the statuc for this request-response's reply (:ok, :created, :not-found, :error or :moved)

(get-response-stream request-response)   generic-function

Access the raw stream to write content to for this request-response (will commit headers if necessary)

(get-s-http-server server)   generic-function

Access the S-HTTP-SERVER object inside server

(get-server request-response)   generic-function

Get the web application server handling this request-response

(get-session request-response)   generic-function

Get the session bound to this request-response

(get-session-count session-manager)   generic-function

Return the number of known sessions

(get-session-id session)   generic-function

Return the id that uniquely identifies this session

(get-session-lifetime session-manager)   generic-function

Return after how many seconds of idle time a session is destroyed

(get-state web-app)   generic-function

Get the current state of object

(get-static-prefix web-app)   generic-function

Get this server's static prefix

(get-static-root web-app)   generic-function

Return the static root (filesystem directory) for this web application

(get-submit-text form)   generic-function

Access the submit button text of form

(get-title object)   generic-function

Get the title of object

(get-uri request-response)   generic-function

Get the URI underlying this request-response

(get-uri-string debug-request-response)   generic-function

Get the URI string underlying this request-response

(get-value-field web-form name)   generic-function

Return the value field with name in web-form

(get-web-app name)   function

Get the web application known by name (return nil when not found)

(get-web-form-definition name)   function

Get the web form definition with name

(hex-string->byte-vector hex-string)   function

Convert a hex string to a byte vector, as '010FFF' becomes #(1 15 255)

(hmac data key &key (hash-start-function (function hash-start-place-holder)) (hash-update-function (function hash-update-place-holder)) (hash-finish-function (function hash-finish-place-holder)) (hash-block-length 64))   function

Compute an RFC 2104 HMAC from the data and key sequences using hash-[start|update|finish]-function

(hmac-md5 data key)   function

Do an RFC 2104 HMAC-MD5 on data and key

(hmac-sha1 data key)   function

Do an RFC 2104 HMAC-SHA1 on data and key

(html-message request-response title message &rest args)   function

Render a simple page with a message using title and formatting message using args

(html-page (var request-response &key (pprint-html *pprint-html*) (html-prologue *html-prologue*)) &body body)   function

Generate contents for a whole page

(html-part (var request-response &key (pprint-html *pprint-html*)) &body body)   function

Generate contents for a part

(init web-app-server &optional options)   generic-function

Initialize web-app-server using options

(init-kpax server-class &rest options)   function

Initialize the KPAX web application framework

(init-localized-strings &optional (location *default-strings-location*) (locales (quote (:nl :fr :en))))   function

Initialize the builtin, simple localization source using location and locales

(instanciate-web-form name)   function

Create a new web form instance from the web form definition named by name

(invalidate-all-sessions session-manager)   generic-function

Remove all sessions from session-manager

(localized-format stream key &rest args)   function

Translate key to stream in the context of *locale* and *localization-source*, using args to format

(localized-string key &rest args)   function

Translate key to a string in the context of *locale* and *localization-source*, using args to format

(log-debug object format-string &rest args)   function

Log a message at the debug level using format-string and args

(log-error object format-string &rest args)   function

Log a message at the error level using format-string and args

(log-fatal object format-string &rest args)   function

Log a message at the fatal level using format-string and args

(log-info object format-string &rest args)   function

Log a message at the info level using format-string and args

(log-warn object format-string &rest args)   function

Log a message at the warn level using format-string and args

logger   class

A logger accepts log messages
Class precedence list: logger standard-object t
Class init args: :cutoff

(logm object level format-string &rest args)   generic-function

Log a message at level defined by format-string and args to object

(logout request-response)   function

Generic logout hook

(make-byte-vector size &optional (initial-element 0))   function

Make a byte vector of size bytes filled with initial-element

(make-data-set-view data-set action columns &key (page-size 20) sortable sort-order sort-column renderer localizer)   function

Create a new data set view

(make-menu spec)   function

Make a new menu based on spec

(make-menubar-render-options key-value-list)   function

Make new menubar render options by combining key-value-list with *default-menubar-render-options*

(make-options key-value-list &optional parent)   function

Combine the options in key-value-list with those in parent

(make-translator &rest args)   function

Make a new translator

(make-web-form-render-options key-value-list)   function

Make new web form render options by combining key-value-list with *default-web-form-render-options*

(map-web-apps function)   function

Apply function on each defined web application and return the result

(maptree function tree)   function

Apply function to all elements in tree (a cons), returning a new isomorphic tree with the results

menu   class

A representation for a menu
Class precedence list: menu menu-item standard-object t
Class init args: :description :action :parent :label :id :items

menu-item   class

A representation for a menu item
Class precedence list: menu-item standard-object t
Class init args: :description :action :parent :label :id

mod-lisp-server   class

mod-lisp implementation of the KPAX web application server protocol
Class precedence list: mod-lisp-server web-app-server session-manager attributes-mixin logger standard-object t
Class init args: :dynamic-prefix :static-prefix :hostname :debug-mode :cutoff :keep-alive

(not-yet-implemented request-response)   function

Web function that outputs a not yet implemented message

(note-inconsistent-request reqeust-response)   function

Standard inconsistent request recording (setting request attribute :inconsistent-request to t)

(parse-boolean string)   function

Parse string as a Common Lisp boolean

(parse-keyword string)   function

Parse string as a Common Lisp keyword in package

(parse-multipart-header string)   function

Parse a line of the form header-name: header-value; att1-name='att1-value'; att2-name='att2-value' into (header-name header-value ((att1-name . att1-value) (att2-name . att2-value)))

(parse-symbol string &optional (package *package*))   function

Parse string as a Common Lisp symbol in package

(pause web-app-server &optional options)   generic-function

Temporarily and gracefully take KPAX off-line, toggle

(pause-kpax &rest options)   function

Take all KPAX web applications temporarily off-line, showing a 'mainteance in progress' page

(reap-old-sessions session-manager)   generic-function

Remove all sessions from session-manager that are expired

(reconstruct-web-form request-response web-form-name)   function

Reconstruct a web form named web-form-name from request-response

(redirect-to request-response relative-url &rest args)   function

Redirect to another url, built from relative-url and args

(render object request-response &optional render-options)   generic-function

Render object as HTML on request-response using render-options

(render-menubar menu request-response selected-page-id &optional (render-options *default-menubar-render-options*))   function

Render menu as menubar with selected-page-id in HTML to request-response using render-options

(render-menubar-ie-js-code request-response)   function

Render the necessary IE-specific JavaScript code for menubars

(render-tabs menu request-response selected-page-id &optional (render-options *default-menubar-render-options*))   function

Render menu as tabs with selected-page-id in HTML to request-response using render-options

(report-inconsistent-request request-response)   function

Standard inconsistent request reporter

request-response   class

I represent a request-response from a server
Class precedence list: request-response attributes-mixin standard-object t
Class init args: :server

(restart-kpax &rest options)   function

Restart the KPAX web application server

(restart-web-app name &rest options)   function

Stop and start the web application known by name

(run-kpax &rest options)   function

Run the KPAX web application server

s-http-server   class

S-HTTP-SERVER implementation of the KPAX web application server protocol
Class precedence list: s-http-server web-app-server session-manager attributes-mixin logger standard-object t
Class init args: :dynamic-prefix :static-prefix :hostname :debug-mode :cutoff :s-http-server

(secure-random limit)   function

Like cl:random, return a random number (<= 0 x limit) [same type as limit], using our secure MT random generator

(secure-random-bytes n)   function

Return a byte-vector of size n filled with secure random bytes

(set-cookie request-response name value path &optional expires)   generic-function

Set the code with name and value for path in request-response (expires is :session or :never)

(shutdown web-app-server &optional options)   generic-function

Shut down web-app-server using options

(standard-web-form-element-renderer request-response componentweb-form-field render-options)   generic-function

Standard, builtin renderer for a component in a form using options

(standard-web-form-renderer request-response web-form render-options)   function

Standard, builtin renderer for form using options

(start-kpax &key (server-class (quote mod-lisp-server)) (port 2001) (logstream *standard-output*))   function

Do init-kpax & run-kpax in debug mode with extra logging

(start-web-app name &rest options)   function

Start the web application known by name, installing and publishing it

(startup web-app-server &optional options)   generic-function

Start up web-app-server using options

(static-url request-response scope relative-url &rest args)   generic-function

Generate a static URL in the scope (:server :webapp) of request-response using relative-url and args

(stop-kpax &rest options)   function

Stop the KPAX web application server

(stop-web-app name &rest options)   function

Stop the web application known by name, making it no longer accessible

stream-appender   class

A stream appender writes log messages to a stream
Class precedence list: stream-appender appender standard-object t
Class init args: :stream

(string->byte-vector string)   function

Convert an 8-bit ASCII string to a byte vector

(touch object)   generic-function

Update the last modified timestamp of object

(translate translator request-response parameter)   generic-function

Translate parameter from request-response using translator

(translate-integer value)   function

Translate value to an integer

(translate-keyword value)   function

Translate value to a keyword

(uri-decode-for-query string)   function

URI decode string from a query parameter value

(uri-encode-for-query string)   function

URI encode string for use as a query parameter value

(validate component)   generic-function

Validate component by running all validators

web-app   class

The representation of a KPAX web application
Class precedence list: web-app web-app-in-server attributes-mixin standard-object t
Class init args: :static-root :option-list :dynamic-prefix :static-prefix :name

web-app-server   class

I represent a server delivering requests-response objects
Class precedence list: web-app-server session-manager attributes-mixin logger standard-object t
Class init args: :cutoff :debug-mode :hostname :static-prefix :dynamic-prefix

Documentation generated by lispdoc running on LispWorks