The ht-simple-ajax Reference Manual

This is the ht-simple-ajax Reference Manual, version 0.5, generated automatically by Declt version 4.0 beta 2 "William Riker" on Thu Feb 15 06:14:13 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 ht-simple-ajax

simple AJAX for Hunchentoot

Author

Martin Loetzsch

License

BSD-style

Long Description

See http://martin-loetzsch.de/ht-simple-ajax/

Version

0.5

Dependency

hunchentoot (system).

Source

ht-simple-ajax.asd.

Child Component

ht-simple-ajax.lisp (file).


3 Files

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


3.1 Lisp


3.1.1 ht-simple-ajax/ht-simple-ajax.asd

Source

ht-simple-ajax.asd.

Parent Component

ht-simple-ajax (system).

ASDF Systems

ht-simple-ajax.


3.1.2 ht-simple-ajax/ht-simple-ajax.lisp

Source

ht-simple-ajax.asd.

Parent Component

ht-simple-ajax (system).

Packages

ht-simple-ajax.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 ht-simple-ajax

Source

ht-simple-ajax.lisp.

Use List
  • 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 Macros

Macro: 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))

Package

ht-simple-ajax.

Source

ht-simple-ajax.lisp.


5.1.2 Ordinary functions

Function: create-ajax-dispatcher (processor)

Creates a hunchentoot dispatcher for an ajax processor

Package

ht-simple-ajax.

Source

ht-simple-ajax.lisp.

Function: 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

Package

ht-simple-ajax.

Source

ht-simple-ajax.lisp.


5.1.3 Standalone methods

Writer Method: (setf content-type) ((ajax-processor ajax-processor))

The http content type that is sent with each response

Package

hunchentoot.

Source

ht-simple-ajax.lisp.

Target Slot

content-type.

Reader Method: content-type ((ajax-processor ajax-processor))

The http content type that is sent with each response

Package

hunchentoot.

Source

ht-simple-ajax.lisp.

Target Slot

content-type.

Writer Method: (setf reply-external-format) ((ajax-processor ajax-processor))

The format for the character output stream

Package

hunchentoot.

Source

ht-simple-ajax.lisp.

Target Slot

reply-external-format.

Reader Method: reply-external-format ((ajax-processor ajax-processor))

The format for the character output stream

Package

hunchentoot.

Source

ht-simple-ajax.lisp.

Target Slot

reply-external-format.


5.1.4 Classes

Class: ajax-processor

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

Package

ht-simple-ajax.

Source

ht-simple-ajax.lisp.

Direct methods
Direct slots
Slot: lisp-fns

Maps the symbol names of the exported functions to their symbols

Type

hash-table

Initform

(make-hash-table :test (function equal))

Readers

lisp-fns.

Writers

(setf lisp-fns).

Slot: js-fns

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

Type

hash-table

Initform

(make-hash-table :test (function equal))

Readers

js-fns.

Writers

(setf js-fns).

Slot: server-uri

The uri which is used to handle ajax request

Type

string

Initform

"/ajax"

Initargs

:server-uri

Readers

server-uri.

Writers

(setf server-uri).

Slot: content-type

The http content type that is sent with each response

Package

hunchentoot.

Type

string

Initform

"text/xml; charset=\"utf-8\""

Initargs

:content-type

Readers

content-type.

Writers

(setf content-type).

Slot: reply-external-format

The format for the character output stream

Package

hunchentoot.

Type

flexi-streams::external-format

Initform

hunchentoot::+utf-8+

Initargs

:reply-external-format

Readers

reply-external-format.

Writers

(setf reply-external-format).


5.2 Internals


5.2.1 Ordinary functions

Function: 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.

Package

ht-simple-ajax.

Source

ht-simple-ajax.lisp.

Function: make-js-symbol (symbol)

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

Package

ht-simple-ajax.

Source

ht-simple-ajax.lisp.


5.2.2 Generic functions

Generic Reader: js-fns (object)
Generic Writer: (setf js-fns) (object)
Package

ht-simple-ajax.

Methods
Reader Method: js-fns ((ajax-processor ajax-processor))
Writer Method: (setf js-fns) ((ajax-processor ajax-processor))

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

Source

ht-simple-ajax.lisp.

Target Slot

js-fns.

Generic Reader: lisp-fns (object)
Generic Writer: (setf lisp-fns) (object)
Package

ht-simple-ajax.

Methods
Reader Method: lisp-fns ((ajax-processor ajax-processor))
Writer Method: (setf lisp-fns) ((ajax-processor ajax-processor))

Maps the symbol names of the exported functions to their symbols

Source

ht-simple-ajax.lisp.

Target Slot

lisp-fns.

Generic Reader: server-uri (object)
Generic Writer: (setf server-uri) (object)
Package

ht-simple-ajax.

Methods
Reader Method: server-uri ((ajax-processor ajax-processor))
Writer Method: (setf server-uri) ((ajax-processor ajax-processor))

The uri which is used to handle ajax request

Source

ht-simple-ajax.lisp.

Target Slot

server-uri.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
C   D   F   G   J   L   M   R   S  
Index Entry  Section

(
(setf content-type): Public standalone methods
(setf js-fns): Private generic functions
(setf js-fns): Private generic functions
(setf lisp-fns): Private generic functions
(setf lisp-fns): Private generic functions
(setf reply-external-format): Public standalone methods
(setf server-uri): Private generic functions
(setf server-uri): Private generic functions

C
call-lisp-function: Private ordinary functions
content-type: Public standalone methods
create-ajax-dispatcher: Public ordinary functions

D
defun-ajax: Public macros

F
Function, call-lisp-function: Private ordinary functions
Function, create-ajax-dispatcher: Public ordinary functions
Function, generate-prologue: Public ordinary functions
Function, make-js-symbol: Private ordinary functions

G
generate-prologue: Public ordinary functions
Generic Function, (setf js-fns): Private generic functions
Generic Function, (setf lisp-fns): Private generic functions
Generic Function, (setf server-uri): Private generic functions
Generic Function, js-fns: Private generic functions
Generic Function, lisp-fns: Private generic functions
Generic Function, server-uri: Private generic functions

J
js-fns: Private generic functions
js-fns: Private generic functions

L
lisp-fns: Private generic functions
lisp-fns: Private generic functions

M
Macro, defun-ajax: Public macros
make-js-symbol: Private ordinary functions
Method, (setf content-type): Public standalone methods
Method, (setf js-fns): Private generic functions
Method, (setf lisp-fns): Private generic functions
Method, (setf reply-external-format): Public standalone methods
Method, (setf server-uri): Private generic functions
Method, content-type: Public standalone methods
Method, js-fns: Private generic functions
Method, lisp-fns: Private generic functions
Method, reply-external-format: Public standalone methods
Method, server-uri: Private generic functions

R
reply-external-format: Public standalone methods

S
server-uri: Private generic functions
server-uri: Private generic functions