This is the smackjack Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:43:57 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
smackjack
A small Ajax framework for hunchentoot using parenscript
Andy Peterson <andy.arvid@gmail.com>
MIT
0.1
alexandria
(system).
hunchentoot
(system).
cl-json
(system).
parenscript
(system).
cl-containers
(system).
sb-introspect
(system).
package.lisp
(file).
smackjack.lisp
(file).
pusher.lisp
(file).
impl-dependent
(module).
Modules are listed depth-first from the system components tree.
smackjack/impl-dependent
package.lisp
(file).
pusher.lisp
(file).
smackjack
(system).
sbcl.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
smackjack/smackjack.asd
smackjack/package.lisp
smackjack/smackjack.lisp
smackjack/pusher.lisp
smackjack/impl-dependent/sbcl.lisp
smackjack/smackjack.lisp
package.lisp
(file).
smackjack
(system).
ajax-function-prefix
(reader method).
(setf ajax-function-prefix)
(writer method).
ajax-functions-namespace-p
(reader method).
(setf ajax-functions-namespace-p)
(writer method).
ajax-namespace
(reader method).
(setf ajax-namespace)
(writer method).
ajax-processor
(class).
(setf content-type)
(writer method).
content-type
(reader method).
create-ajax-dispatcher
(generic function).
default-content-type
(reader method).
(setf default-content-type)
(writer method).
defun-ajax
(macro).
generate-prologue
(generic function).
ht-simple-ajax-processor
(class).
ht-simple-ajax-symbols-p
(reader method).
(setf ht-simple-ajax-symbols-p)
(writer method).
json-args-p
(reader method).
(setf json-args-p)
(writer method).
(setf reply-external-format)
(writer method).
reply-external-format
(reader method).
server-uri
(reader method).
(setf server-uri)
(writer method).
ajax-function
(class).
ajax-function-name
(generic function).
ajax-functions
(reader method).
(setf ajax-functions)
(writer method).
ajax-ps-function
(generic function).
ajax-ps-parameters
(generic function).
ajax-response-process
(generic function).
call-lisp-function
(generic function).
callback-data
(reader method).
(setf callback-data)
(writer method).
escape-string
(function).
generate-prologue-javascript
(generic function).
get-content-type
(generic function).
html-script-cdata
(function).
http-method
(reader method).
(setf http-method)
(writer method).
make-simple-js-symbol
(function).
name
(reader method).
process-ajax-request
(generic function).
ps-ajax-call
(generic function).
ps-ajax-response-processes
(generic function).
ps-encode-args
(generic function).
ps-fetch-uri
(generic function).
ps-http-request
(function).
remote-function
(class).
remote-name
(reader method).
(setf remote-name)
(writer method).
remotify-function
(generic function).
un-remotify-function
(generic function).
xml-wrapper
(function).
smackjack/pusher.lisp
smackjack.lisp
(file).
smackjack
(system).
ajax-pusher
(class).
defun-push
(macro).
initialize-instance
(method).
pusher-poll-function-name
(reader method).
(setf pusher-poll-function-name)
(writer method).
(setf pusher-poll-function-name)
(method).
(setf pusher-poll-function-name)
(method).
pusher-poll-interval
(reader method).
(setf pusher-poll-interval)
(writer method).
pusher-poll-namespace
(reader method).
(setf pusher-poll-namespace)
(writer method).
pusher-pushes-per-poll
(reader method).
(setf pusher-pushes-per-poll)
(writer method).
ajax-ps-parameters
(method).
call-lisp-function
(method).
generate-prologue-javascript
(method).
process-push-poll
(function).
ps-push-functions
(generic function).
push-default-sessions
(reader method).
(setf push-default-sessions)
(writer method).
push-function
(generic function).
push-function
(class).
push-function-sessions
(generic function).
push-ps-code
(reader method).
(setf push-ps-code)
(writer method).
push-ps-function
(generic function).
pusher-push-functions
(reader method).
(setf pusher-push-functions)
(writer method).
pusher-session-queue-name
(reader method).
(setf pusher-session-queue-name)
(writer method).
pushify-function
(generic function).
smackjack/impl-dependent/sbcl.lisp
impl-dependent
(module).
arglist
(function).
Packages are listed by definition order.
smackjack
the one and only smackjack package. Contains all code to run the ajax framework.
alexandria
.
common-lisp
.
hunchentoot
.
parenscript
.
ajax-function-prefix
(generic reader).
(setf ajax-function-prefix)
(generic writer).
ajax-functions-namespace-p
(generic reader).
(setf ajax-functions-namespace-p)
(generic writer).
ajax-namespace
(generic reader).
(setf ajax-namespace)
(generic writer).
ajax-processor
(class).
ajax-pusher
(class).
create-ajax-dispatcher
(generic function).
default-content-type
(generic reader).
(setf default-content-type)
(generic writer).
defun-ajax
(macro).
defun-push
(macro).
generate-prologue
(generic function).
ht-simple-ajax-processor
(class).
ht-simple-ajax-symbols-p
(generic reader).
(setf ht-simple-ajax-symbols-p)
(generic writer).
json-args-p
(generic reader).
(setf json-args-p)
(generic writer).
pusher-poll-function-name
(generic reader).
(setf pusher-poll-function-name)
(generic function).
pusher-poll-interval
(generic reader).
(setf pusher-poll-interval)
(generic writer).
pusher-poll-namespace
(generic reader).
(setf pusher-poll-namespace)
(generic writer).
pusher-pushes-per-poll
(generic reader).
(setf pusher-pushes-per-poll)
(generic writer).
server-uri
(generic reader).
(setf server-uri)
(generic writer).
ajax-function
(class).
ajax-function-name
(generic function).
ajax-functions
(generic reader).
(setf ajax-functions)
(generic writer).
ajax-ps-function
(generic function).
ajax-ps-parameters
(generic function).
ajax-response-process
(generic function).
arglist
(function).
call-lisp-function
(generic function).
callback-data
(generic reader).
(setf callback-data)
(generic writer).
escape-string
(function).
generate-prologue-javascript
(generic function).
get-content-type
(generic function).
html-script-cdata
(function).
http-method
(generic reader).
(setf http-method)
(generic writer).
make-simple-js-symbol
(function).
name
(generic reader).
process-ajax-request
(generic function).
process-push-poll
(function).
ps-ajax-call
(generic function).
ps-ajax-response-processes
(generic function).
ps-encode-args
(generic function).
ps-fetch-uri
(generic function).
ps-http-request
(function).
ps-push-functions
(generic function).
push-default-sessions
(generic reader).
(setf push-default-sessions)
(generic writer).
push-function
(generic function).
push-function
(class).
push-function-sessions
(generic function).
push-ps-code
(generic reader).
(setf push-ps-code)
(generic writer).
push-ps-function
(generic function).
pusher-push-functions
(generic reader).
(setf pusher-push-functions)
(generic writer).
pusher-session-queue-name
(generic reader).
(setf pusher-session-queue-name)
(generic writer).
pushify-function
(generic function).
remote-function
(class).
remote-name
(generic reader).
(setf remote-name)
(generic writer).
remotify-function
(generic function).
un-remotify-function
(generic function).
xml-wrapper
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Macro to defun a server-side function that can be called from a client page.
Example: (defun-ajax func1 (arg1 arg2) (*ajax-processor*)
(do-stuff))
declares and defines a ’push’ function that when called in lisp causes the correponding javascript function to be called in the client page. the body should be parenscript code to be compiled into javascript
ajax-processor
)) ¶ajax-processor
)) ¶Symbol. Prefix for javascript functions corresponding
to lisp functions. Default is nil for no prefix.
ajax-processor
)) ¶ajax-processor
)) ¶Boolean. Place javascript functions corresponding
to lisp functions in the ajax-namespace. Default t.
ajax-processor
)) ¶ajax-processor
)) ¶Symbol or nil. Name for a namespace object for generated
javascript code. Nil means no namespace; code will be
global
Creates a hunchentoot dispatcher for an ajax processor.
One possible usage:
(push (create-ajax-dispatcher your-ajax-processor)
hunchentoot:*dispatch-table*)
ajax-processor
)) ¶ajax-processor
)) ¶ajax-processor
)) ¶String. The http content type that is sent with each response
Creates a string that contains all the client-side
javascript code for the ajax communication. Optionally include
<script> ... </script> html element wrapper. If including the wrapper,
include this script in the <head> </head> of each html page.
Without the wrapper, a virtual file can be done like:
(define-easy-handler (js-ajax-code :uri "/ajax-code.js") ()
(when (boundp ’hunchentoot:*request*)
(setf (content-type*) "text/javascript"))
(generate-prologue *ajax-processor* :wrapper nil))
ajax-processor
) &key wrapper) ¶ajax-processor
)) ¶ajax-processor
)) ¶Boolean. use ht-simple-ajax symbol processor to generate compatible ht-simple-ajax compatible code
ajax-processor
)) ¶ajax-processor
)) ¶Boolean. Ajax function arguments are passed using json
ajax-pusher
)) ¶Name of the smackjack function called
on the client side when polling for pushes. Note: this name is a tag. The
function does not actually exist on the server.
ajax-pusher
)) ¶ajax-pusher
)) ¶ajax-pusher
)) ¶Name of the smackjack function called
on the client side when polling for pushes. Note: this name is a tag. The
function does not actually exist on the server.
ajax-pusher
)) ¶ajax-pusher
)) ¶The number of milliseconds between polls of the server for push calls.
ajax-pusher
)) ¶ajax-pusher
)) ¶javascript namespace (i.e. object) to hold the polling code and the defined push functions
ajax-pusher
)) ¶ajax-pusher
)) ¶Maximum number of pushes per poll.
ajax-processor
)) ¶ajax-processor
)) ¶String. The uri which is used to handle ajax request
ajax-function
)) ¶The http content type that is sent with each response
hunchentoot
.
ajax-function
)) ¶The http content type that is sent with each response
hunchentoot
.
ajax-pusher
) &key) ¶add remote polling function name after creating pusher class.
ajax-processor
)) ¶The format for the character output stream
hunchentoot
.
ajax-processor
)) ¶The format for the character output stream
hunchentoot
.
The principal and controlling class of this
library. The programmer will instantiate this class, define the ajax
functions of the class and link the dispatcher to hunchentoot’s
dispatcher. This processor will also generate javascript code that can
be loaded to the browser.
ajax-function-name
.
(setf ajax-function-prefix)
.
ajax-function-prefix
.
(setf ajax-functions)
.
ajax-functions
.
(setf ajax-functions-namespace-p)
.
ajax-functions-namespace-p
.
(setf ajax-namespace)
.
ajax-namespace
.
ajax-ps-function
.
ajax-ps-parameters
.
call-lisp-function
.
create-ajax-dispatcher
.
(setf default-content-type)
.
default-content-type
.
generate-prologue
.
generate-prologue-javascript
.
get-content-type
.
(setf ht-simple-ajax-symbols-p)
.
ht-simple-ajax-symbols-p
.
(setf json-args-p)
.
json-args-p
.
process-ajax-request
.
ps-ajax-call
.
ps-ajax-response-processes
.
ps-encode-args
.
ps-fetch-uri
.
remotify-function
.
(setf reply-external-format)
.
reply-external-format
.
(setf server-uri)
.
server-uri
.
un-remotify-function
.
Hashtable maps the symbol names of the remoted functions to their ajax-function object
hash-table
(make-hash-table :test (function equal))
Symbol or nil. Name for a namespace object for generated
javascript code. Nil means no namespace; code will be
global
symbol
(quote smackjack::smackjack)
:ajax-namespace
Boolean. Place javascript functions corresponding
to lisp functions in the ajax-namespace. Default t.
boolean
t
:ajax-functions-namespace-p
Symbol. Prefix for javascript functions corresponding
to lisp functions. Default is nil for no prefix.
symbol
:ajax-function-prefix
Boolean. use ht-simple-ajax symbol processor to generate compatible ht-simple-ajax compatible code
boolean
:ht-simple-ajax-symbols-p
Boolean. Ajax function arguments are passed using json
boolean
t
:json-args-p
String. The uri which is used to handle ajax request
string
"/ajax"
:server-uri
String. The http content type that is sent with each response
string
"text/xml; charset=\"utf-8\""
:default-content-type
The format for the character output stream
hunchentoot
.
flexi-streams::external-format
hunchentoot::+utf-8+
:reply-external-format
The class adds pushing capabilities to ajax-processor.
The server can push function calls to the client. That is the lisp server
code calls a function with arguments that will cause a corresponding
function call on the client side.
ajax-ps-parameters
.
call-lisp-function
.
generate-prologue-javascript
.
initialize-instance
.
ps-push-functions
.
push-function
.
push-ps-function
.
(setf pusher-poll-function-name)
.
(setf pusher-poll-function-name)
.
(setf pusher-poll-function-name)
.
pusher-poll-function-name
.
(setf pusher-poll-interval)
.
pusher-poll-interval
.
(setf pusher-poll-namespace)
.
pusher-poll-namespace
.
(setf pusher-push-functions)
.
pusher-push-functions
.
(setf pusher-pushes-per-poll)
.
pusher-pushes-per-poll
.
(setf pusher-session-queue-name)
.
pusher-session-queue-name
.
pushify-function
.
javascript namespace (i.e. object) to hold the polling code and the defined push functions
symbol
(quote smackjack::smackpusher)
:poll-namespace
Name of the smackjack function called
on the client side when polling for pushes. Note: this name is a tag. The
function does not actually exist on the server.
symbol
(quote smackjack::push-poll-request)
:poll-function-name
pretty sure this is not used.
symbol
:smackpush-queue
:session-queue-name
The number of milliseconds between polls of the server for push calls.
(integer 1)
5000
:poll-interval
Maps the symbol names of the remoted functions to their ajax-function object
hash-table
(make-hash-table :test (function equal))
Maximum number of pushes per poll.
(integer 1)
1
:pushes-per-poll
A sub-class designed to be compatible with ht-simple-ajax
Escape all characters in STRING which pass TEST. This function is not guaranteed to return a fresh string. Note that you can pass NIL for STRING which’ll just be returned.
html script/cdata wrapper for javascript
wraps javascript in a <script> ... </script> html element
this functions generates converts lisps symbols to format used
by ht-simple-ajax and will be transformed by parenscript so that.
they are compatibile with ht-simple-ajax.
helper function for making ’foo_bar_ out of ’foo-bar?
this is the default processor of the polling from the client.
returns parenscript (client) code to set up ajax request.
wrapper for xml ajax response
returns a string for the remote function name before parenscript processing
ajax-processor
) (ajax-fn remote-function
)) ¶ajax-processor
)) ¶ajax-processor
)) ¶Hashtable maps the symbol names of the remoted functions to their ajax-function object
returns parenscript code to define a function on the
client that will call the corresponding server-side lisp function via ajax.
ajax-processor
) (ajax-fn ajax-function
)) ¶returns a list of the arguments of the ajax-function ready for parenscript processing.
ajax-pusher
) (ajax-fn ajax-function
)) ¶Overriding the default method for ajax-processor because that method
would fail on the pusher-poll-function. First checks if the
lisp function is the name given for the ajax-pusher’s poll processing
function. If so, returns nil to indicate no parameters. If not,
then call the ajax-processor method.
ajax-processor
) (ajax-fn ajax-function
)) ¶returns the symbol of the parenscript function that will handle the ajax response of the ajax-function
ajax-function
)) ¶This calls does the actual call of the ajax-lisp function.
Note: this is separate because it is overridden in the class ajax-pusher.
ajax-pusher
) (func ajax-function
) arguments) ¶Overriding the default method for ajax-processor. First checks if the lisp function is the name given for the ajax-pusher’s poll processing function. If so, process push polls. If not, then call the ajax-processor method.
ajax-processor
) (func ajax-function
) arguments) ¶ajax-function
)) ¶ajax-function
)) ¶argument passed to callback function from ajax response. Content-type should correspond.
generates a string of raw javascript code that needs to be
loaded on the client side for the ajax-processor to function correctly.
This code can be embedded in a file, a virtual file, or generated html.
ajax-pusher
)) ¶returns javascript code for the entire pusher/ajax processor.
Calls the inherited method from ajax-processor and adds in code for the
pusher.
ajax-processor
)) ¶return the content type string for ajax-function response.
ajax-processor
) (ajax-fn ajax-function
)) ¶ajax-function
)) ¶ajax-function
)) ¶http method of the lisp ajax function
remote-function
)) ¶symbol name of the lisp function
name
.
This should called on each ajax request. That is the
ajax uri is identified and dispatched by hunchentoot. See
CREATE-AJAX-DISPATCHER. It parses the parameters from the http request, calls
the lisp function and returns the response.
ajax-processor
)) ¶returns parenscript code to define a client-side function
for the ajax-processor that initiates an ajax call of a server-side lisp
function
ajax-processor
)) ¶returns client parenscript code to define functions to handle the various types of ajax responses
ajax-processor
)) ¶returns parenscript code to define a client-side function that encodes the arguments to be passed along with an ajax/http request.
ajax-processor
)) ¶Return parenscript code to define client-side fetch-uri
which initiates ajax request and sets up callback/error treatment.
ajax-processor
)) ¶returns parenscript code to define all the push-functions on the client
ajax-pusher
)) ¶push-function
)) ¶push-function
)) ¶If a push function is called and the hunchentoot
sessions are not specified, this will determine which in sessions the push call
happens on the client side.
This function is called when you want to push a function
call to the client(s) as specified in the parameter sessions. Note: the
programmer should not call this directly.
ajax-pusher
) function-name arguments &optional sessions) ¶Returns a list of Hunchentoot sessions for a push-function based on the slot default-sessions
push-function
)) ¶push-function
)) ¶push-function
)) ¶parenscript code to be compiled and sent to the browser on page load
returns parenscript code for the push-function to be defined on the client
ajax-pusher
) (push-function push-function
)) ¶ajax-pusher
)) ¶ajax-pusher
)) ¶Maps the symbol names of the remoted functions to their ajax-function object
ajax-pusher
)) ¶ajax-pusher
)) ¶pretty sure this is not used.
Function to create a push-function and store it in the pusher object.
ajax-pusher
) function-name ps-code &key remote-name default-sessions) ¶remote-function
)) ¶remote-function
)) ¶remote name of the function
Creates a remote ajax-function identified by its symbol and symbol-name and attaches it to the ajax-processor
ajax-processor
) function-name &key method remote-name content-type callback-data) ¶remove a remote function identified by its symbol or name from the ajax-processor
ajax-processor
) symbol-or-name) ¶Class for browser functions that call a server-side lisp function using ajax
http method of the lisp ajax function
common-lisp
.
(quote (member :post :get))
:get
:method
argument passed to callback function from ajax response. Content-type should correspond.
(quote (member :request-object :response-xml :response-text :response-xml-text :json))
:response-xml
:callback-data
The http content type that is sent with each response
hunchentoot
.
(or null string)
"text/xml;"
:content-type
This class represents functions that are pushed to the client.
parenscript code to be compiled and sent to the browser on page load
list
:ps-code
If a push function is called and the hunchentoot
sessions are not specified, this will determine which in sessions the push call
happens on the client side.
(quote (member :current-session :acceptor-sessions :acceptor-sessions-except-current))
:acceptor-sessions
:default-sessions
Base class for remote functions between server and browser
Jump to: | (
A C D E F G H I J M N P R S U X |
---|
Jump to: | (
A C D E F G H I J M N P R S U X |
---|
Jump to: | A C D H J M N P R S |
---|
Jump to: | A C D H J M N P R S |
---|
Jump to: | A C F H I M P R S |
---|
Jump to: | A C F H I M P R S |
---|