Common Lisp Package: HT-SIMPLE-AJAX

README:

ht-simple-ajax

Another Ajax library for Hunchentoot, a web server written in Common Lisp.

See <http://martin-loetzsch.de/ht-simple-ajax/> for details.

Revisions

Version 0.1 2010-01-21

Initial release

Version 0.2 2010-02-02

Added demo

Version 0.3 2010-02-22

Renamed ajax_call_uri to ajax_call

Version 0.4 2012-01-25

Demo uses hunchentoot:easy-acceptor instead of hunchentoot:acceptor

Version 0.5 2013-04-17

Bug fix for a problem when the *print-case* is set to :downcase (provided by Ben Hyde).

FUNCTION

Public

CREATE-AJAX-DISPATCHER (PROCESSOR)

Creates a hunchentoot dispatcher for an ajax processor

GENERATE-PROLOGUE (PROCESSOR)

Creates a <script> ... </script> html element that contains all the client-side javascript code for the ajax communication. Include this script in the <head> </head> of each html page

Private

CALL-LISP-FUNCTION (PROCESSOR)

This is called from hunchentoot on each ajax request. It parses the parameters from the http request, calls the lisp function and returns the response.

MAKE-JS-SYMBOL (SYMBOL)

helper function for making 'foo_bar_' out of 'foo-bar?'

MACRO

Public

DEFUN-AJAX (NAME PARAMS (PROCESSOR) &BODY BODY)

Declares a defun that can be called from a client page. Example: (defun-ajax func1 (arg1 arg2) (*ajax-processor*) (do-stuff))

SLOT-ACCESSOR

Private

JS-FNS (OBJECT)

Maps the symbol names of the exported functions to a javascript code that can call the function from within the client page

SETFJS-FNS (NEW-VALUE OBJECT)

Maps the symbol names of the exported functions to a javascript code that can call the function from within the client page

LISP-FNS (OBJECT)

Maps the symbol names of the exported functions to their symbols

SETFLISP-FNS (NEW-VALUE OBJECT)

Maps the symbol names of the exported functions to their symbols

SERVER-URI (OBJECT)

The uri which is used to handle ajax request

SETFSERVER-URI (NEW-VALUE OBJECT)

The uri which is used to handle ajax request

CLASS

Public

AJAX-PROCESSOR

Maintains a list of lisp function that can be called from a client page.