Common Lisp Package: IT.BESE.UCW.CORE

README:

FUNCTION

Public

ABORT-ACTION (&OPTIONAL FAILURE-MESSAGE)

Calling it without arguments means a graceful abort, while providing a failure message means there was an error.
An ajax request will for example show the FAILURE-MESSAGE in one way or another when provided.

Given an action returns an URL (as a string) which will call
the action lambda.
The COMPONENT parameter is passed directly to COMPUTE-URL, FRAME
is passed to REGISTER-ACTION. ACTION may be a lambda
or an action object made with MAKE-ACTION factory methods.

CALL-AS-REQUEST-HANDLER (SERVER REQUEST RESPONSE THUNK)

Sets up a proper request-handling environment around THUNK

CALLBACK-LAMBDA (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

Creates and returns a UCW server according to SERVER-CLASS, HOST and
PORT. Affects *DEFAULT-SERVER*.
BACKEND is a list of (BACKEND-TYPE &rest INITARGS). BACKEND-TYPE
may be :HTTPD, :MOD-LISP, an existing
backend, an existing UCW server backend or :DEFAULT in which case
it attempts to return a sane default from the UCW backends loaded
and available, or any other value for which a valid MAKE-BACKEND
method has been defined. INITARGS will be passed, unmodified, to
MAKE-BACKEND.
APPLICATIONS is a list of defined applications to be loaded into the
server.
Logs are generated in verbosity defined by LOG-LEVEL and directed to
LOG-ROOT-DIRECTORY if defined.

QUERY-PATH-SANS-PREFIX (CONTEXT)

Returns the part of the context's request's query-path after
the context's application's url-prefix. NB: The returned value
shares structure with the query-path. NB: We assume the proper
application has already been placed in CONTEXT.

CALLBACK-PRIORITY (INSTANCE)

Drops all the frames except the current one. Useful for operations that change some non-backtrackable global state that affects the entire application.

CLONE-EFFECTIVE-BACKTRACKS (SESSION FRAME)

We create a new collection of backtracks with the same getter, setter and value but a new copy of value.

INITIALIZE-BACKTRACKING (COMP FRAME)

Prepare the slots of COMP for backtracking.

INITIALIZE-COMPONENT-SLOTS (COMP)

Setup any nested components (create them and their places) in COMP.
For every component-slot in COMP: if the slot doesn't already contain
a component and a type was given for what the component should be,
then make-instance of the type and set the slot-value.
Then check whether the slot is bound and not null and if
so set its place slot. the second check is done seperatly from the
first so that components passed via initargs will have their place
set.

INITIALIZE-PLACE-SLOT (COMP)

Setup the place of COMP's place-slot's component.
NB: This function assumes a component already exists in COMP's place-slot.

INSERT-WITH-NEW-KEY (HASH-TABLE KEY-LENGTH VALUE)

helper method. generates random strings of length key-length until
it finds one that isn't a key in hash-table and sets value to
that. returns the new id.

IP-ADDRESS-FROM-PRIVATE-NETWORK-P (ADDRESS)

http://en.wikipedia.org/wiki/Private_network

MAKE-CALLBACK (LAMBDA &KEY (PRIORITY 0))

Creates a new (unregistered) callback.
When registered and the request arrives LAMBDA will be passed the
value (a string) associated with the input. If NAME is not
provided, or NIL, a random name will be generated.
Returns the freshly created callback-entry struct.

MAP-TO-DYNAMIC-UCW-URL (URL)

Prefixes random UCW internal url's to ensure that it does not clash with some user defined entrypoint.

SHSH-ACCESS-COUNT-UNTIL-PURGE (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

SHSH-LAST-PURGE-TIME (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

SHSH-LOCK (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

SHSH-TABLE (INSTANCE)

@arg[extid]{A @class{extid}}
@return[sytemid]{puri:uri or nil}
Returns the System ID part of this External ID.

SEND-BACKTRACE-TO-EMACS (SERVER CONDITION BACKTRACE)

SEND-REDIRECT (TARGET &OPTIONAL (RESPONSE *RESPONSE*))

SESSION-LOCK-HELD-P (SESSION)

SHARED-HASHTABLE-ENTRY-P (OBJECT)

SETFSHSH-ACCESS-COUNT-UNTIL-PURGE (NEW-VALUE INSTANCE)

SETFSHSH-LAST-PURGE-TIME (NEW-VALUE INSTANCE)

SETFSHSH-LOCK (NEW-VALUE INSTANCE)

SETFSHSH-TABLE (NEW-VALUE INSTANCE)

UNREGISTER-JS-RESOURCE (NAME)

WRITE-URI (URI STREAM &OPTIONAL (ESCAPE T))

MACRO

Public

DEFCOMPONENT (NAME SUPERS SLOTS &REST OPTIONS)

Macro for defining a component class.
This macro is used to create component classes and provides
options for easily creating the methods which often accompany a
component definition.
NAME, SUPERS and SLOTS as treated as per defclass. The following
extra options are allowed:
(:ENTRY-POINT url (&key application class)) - Define an
entry-point on the url URL which simply calls an instance of
this component. Any request parameters passed to the entry-point
are used to initialize the slots in the component. This option
may appear multiple times.
(:DEFAULT-BACKTRACK function-designator) - Unless the slots
already have a :backtrack option FUNCTION-DESIGNATOR is
added. As with the 'regular' :backtrack options if you pass T
here it is assumed to mean #'IDENTITY.
(:RENDER (&optional COMPONENT) &body BODY) - Generate a render
method specialized to COMPONENT. COMPONENT may be a symbol, in
which case the method will be specialized on the componnet
class. If COMPONNET is omited the component is bound to a
variable with the same name as the class.
(:ACTION &optional NAME) - Generate a defmethod/cc form named
NAME (which defaults to the name of the component) which simply
CALL's this component class passing all the arguments passed to
the action as initargs.

Define an entry point bound to the url URL of type CLASS.
URL must be a string which, when appended to APPLICATION's
url-prefix, specifies the complete url for this entry
point. CLASS is a symbol naming the dispatcher class.
APPLICATION (evaluated) specifies the application object this
entry point will be attached to. If NIL *default-application*
will be used, otherwise it must be the name of an existing
application.
REQUEST-LAMBDA-LIST is a request lambda list as per
WITH-REQUEST-PARAMS.
The body of the entry-point is executed whenever the server
recieves a request for the specified url. The body can contain
calls to components but must not contain answer forms.
If the backend supports it then the url is
automatically registered with the backend, otherwise (mod_lisp)
developers must manually configure the backend.

This macro handles a raw request. Will set the http cache control headers
according to the supplied arguments, send the headers, execute the BODY and
close the request. WITH-NETWORK-STREAM will be bound to the network stream
unless it's nil. When WITH-YACLML-STREAM is not nil the body will run inside a
with-yaclml-stream block and after it finished it will be properly encoded
and written into the network stream. Additionally if it is a symbol then
it will be bound with that name.

MAKE-PLACE (FORM &OPTIONAL (COPYER '#'IDENTITY))

Makes a new action and registers it in FRAME. For more details see make-action.

WITH-REQUEST-PARAMS (REQUEST-LAMBDA-LIST REQUEST &BODY BODY)

Bind, according the REQUEST-LAMBDA-LIST the parameters in
REQUEST and execute BODY.
REQUEST-LAMBDA-LIST is a list of the form:
( [ ( symbol string ) | symbol ]
[ default-value [ supplied-symbol-name ]? ]? )
If the request contains a param (no distinction between GET and
POST params is made) named STRING (which defaults to the symbol
name of SYMBOL) the variable SYMBOL is bound to the associated
value (which is always a string) . If no parameter with that name
was passed SYMBOL will be bound to DEFAULT-VALUE and the variable
named SUPPLIED-SYMBOL-NAME will be bound to NIL.
NB: Parameter names are matched case insensitively.

WITH-LOCK-HELD-ON-SERVER (SERVER &BODY BODY)

WITH-THREAD-NAME (NAME &BODY BODY)

GENERIC-FUNCTION

Public

ANSWER-COMPONENT (CALLEE VALUE)

Return control to CALLEE's CALLER, continuing
with the value VALUE.
answer-component can be called by user code though it will
generally be called through the UCW:ANSWER function.

CALL-ACTION (ACTION APPLICATION SESSION FRAME)

This protocol is started when we are ready to call the action.
If the action was found to be valid then the default implementation simply funcalls
the action wrapped in an error handler.

CALL-CALLBACKS (ACTION FRAME REQUEST)

Call all the callbacks in REQUEST for FRAME.
Methods defined on this generic function must be built up from
using map-parameters (part of the backend protocol). Return nil
iff there were no callbacks executed.

CALL-COMPONENT (FROM TO)

Transfer control from the component CALLER, to
the component CALLEE.
CALLEE should replace CALLER in the user interface (by setting
itself in CALLER's place). CALLEE can return control to CALLER by
calling answer-component.
call-component can be called by user code even though it will
generally be called through the UCW:CALL function.

CONTEXT.WINDOW-COMPONENT (CONTEXT)

COOKIES (REQUEST)

DELETE-SESSION (APPLICATION SESSION)

Remove the session SESSION from APPLICATION.
User code may not call this function directly, see MARK-SESSION-INVALID if you want to mark a session invalid.

DISPATCH (DISPATCHER APPLICATION CONTEXT)

Entry point into a dispatcher. Must return T
if the context has been handled or NIL if it hasn't.
No methods defined on this function may rebind *context*, nor
change CONTEXT's application. Only if the method returns T is it
allowed to modify CONTEXT or APPLICATION, even in that case
methods defined on this function must not modify CONTEXT's
application nor rebind *context*.

ENCODING (RESPONSE)

Return a symbol representing the desired encoding
when writing strings into the network stream.

ENSURE-SESSION (APPLICATION CONTEXT &OPTIONAL NEW-SESSION)

Makes sure the context has a valid session,
set it to NEW-SESSION if there's none. Returns the session.

FIND-ACTION-ID (CONTEXT)

Same as find-session-id but looks for the action id.

FIND-SESSION-ID (CONTEXT)

Returns the client supplied session-id in CONTEXT.
Methods should inspect the context's request object and return a
string specifying the session-id. No guarantee on the
validity (well-formedness or existence) of the returned
session-id is made.
If no session-id is supplied NIL must be returned.

GET-HEADER (MESSAGE HEADER-NAME)

Return the value of the header named HEADER-NAME.
HEADER-NAME must be a string and will be compared case sensitvly
agaist the headers in the message.
Callers are not allowed to modify the value returned by
GET-HEADER.

SETFGET-HEADER (VALUE MESSAGE HEADER-NAME)

Change the value of the header named
HEADER-NAME. Like in get-header HEADER-NAME must be a
string.

GET-PARAMETER (REQUEST PARAMETER-NAME)

Returns the query value, a string or a list of
strings, associated with the name PARAMETER-NAME. As with
GET-HEADER callers are not allowed to modify the value retruned
by this function.

HANDLE-ACTION (ACTION APPLICATION SESSION FRAME)

Determines how a UCW action is processed.
This method is called when a valid session was identified or created and
an action needs to be executed in that session (this includes entry points, too).
This method can be a central point for user code to hook into, for app specific purposes like
setting up a db transaction, etc.

HANDLE-REQUEST (SERVER REQUEST RESPONSE)

Perform one iteration of the RERL on REQUEST and RESPONSE.
Methods defined on this generic function must be built from the
methods associated-application and service and should, as much as
possible, handle all conditions signalled by calls to service.

HANDLE-TOPLEVEL-CONDITION (APPLICATION CONDITION ACTION)

Process a condition that reached the UCW toplevel.
If this function returns it means that the callers must try to clean up
and continue.

HANDLER-HANDLE (HANDLER APPLICATION CONTEXT MATCHER-RESULT)

Abstract function for handler classes to
implement the handling of the matched request.
These methods may modify context as they wish since they are
matched, request will be closed after this method is run.

HEADERS-ARE-SENT-P (RESPONSE)

Returns whether the headers are already written
to the network stream or not.

HTML-STREAM (RESPONSE)

Return the stream we can write html output to.
This stream may be cached in order to provide an accurate
Content-Length header.

MAKE-BACKEND (BACKEND-SPEC &ALLOW-OTHER-KEYS)

Returns a UCW server backend as requested by
the functional arguments. BACKEND-SPEC may be :HTTPD, :MOD-LISP,
an existing backend, an existing UCW server backend or :DEFAULT
in which case it attempts to return a sane default from the UCW
backends loaded and available.

MAKE-REQUEST-CONTEXT (APPLICATION REQUEST RESPONSE)

Create a new request-context form REQUEST and RESPONSE.
The returned context will have its application, request and
response slots set to APPLICATION, REQUEST and RESPONSE.
This method need not neccessarily return a new object each time
but may reuse previouly created objects in which case a call to
clear-context must be made before returning the object.

MAP-PARAMETERS (REQUEST LAMBDA)

Apply LAMBDA to all the parameters in REQUEST.
LAMBDA will be passed two arguments: the name of the parameter, a
string, and the value of the parameter, a string or a list of
strings. The values are passed in that order and LAMBDA must not
modify any of the values passed to it.

MATCHER-MATCH (MATCHER APPLICATION CONTEXT)

Abstract method for subclasses to implement a
matcher. This method would return multiple-values according to
matcher internal nature, but the first return value is always
used to indicate if this matcher matched.
No methods defined on this function may rebind *context*, nor
change CONTEXT's application. Only if the method matches the
request, it is allowed to modify CONTEXT or APPLICATION, even in
that case methods defined on this function must not modify
CONTEXT's application nor rebind *context*.

MIME-PART-BODY (MIME-PART)

Returns the body of MIME-PART.

MIME-PART-HEADERS (MIME-PART)

Returns an alist of the headers of MIME-PART.
The alist must be of the form (NAME . VALUE) where both NAME and
VALUE are strings.

NOTIFY-SESSION-EXPIRATION (SESSION)

This is called after the session has been deleted.
While this method is called the application is not locked (so it's ok to grab external resouces) but the session is.

QUERY-PATH (REQUEST)

Return the QUERY-PATH of REQUEST as a string.
The returned string may share structure with objects in the
request and sholud be considered read-only. The returned
query-path must be already escaped.

REFRESH-COMPONENT (COMPONENT)

This generic action is should simply redraw COMPONENT without performing any action.
It can be used as the :action parameter to forms which have
multiple submit buttons and we don't want hitting the enter key
to call one of the actions.

REGISTER-ACTION-IN-FRAME (FRAME ACTION-ENTRY)

Register an action in the frame and return its id.

REGISTER-CALLBACK-IN-FRAME (FRAME CALLBACK &KEY ID)

Registers a callback-entry in this frame and return the callback itself.
When passed in an action generated by FRAME then CALLBACK will be called passing it the value of
the corresponding request param.

REQUEST-CONTEXT-CLASS (APPLICATION)

RESTART-APPLICATION (APPLICATION)

Calls shutdown-application and then startup-application on APPLICATION.

SEND-HEADERS (RESPONSE)

Sends all the headers in RESPONSE to the
client. Unlike the send-response method we don't add a
Content-Length header, though if one is present in RESPONSE it
will be sent.
After calling this method the response data, a sequence of bytes,
should be sent to RESPONSE's network-stream.

SEND-RESPONSE (RESPONSE)

Assuming RESPONSE is complete send it to the
client. When calling this function we assume all headers have
already been set and the body's content has been collected in
the response object.

SERVICE (RELEVANT-OBJECT CONTEXT)

The core request handling generic function.
The service protocol consists of 4 passes: application -> session
-> session-frame -> action. At each phase the appropriate object
is passed to service with the current request object (which is
also bound to *context*). The appropiate object must perform
whatever it needs and then explicitly call service again passing
it the next object in the chain.

SESSION-FRAME-CLASS (SESSION)

SESSION-VALID-P (SESSION)

UCW guarantees to only call this function from inside HANDLE-ACTION (and therefore with the session being locked) to check if the session is valid.
This method is similar to SESSION-EXPIRED-P but users can install more heavyweight customizations on it and assume being wrapped by HANDLE-ACTION and WITH-LOCK-HELD-ON-SESSION.

SHUTDOWN-APPLICATION (APPLICATION)

Terminate the application's life cycle.
Release any and all resources held by APPLICATION. The value
returned by the generic function is unspecified.

SHUTDOWN-SERVER (SERVER)

Make SERVER stop responding to requests and
close/release and resources.

STARTUP-APPLICATION (APPLICATION)

Start the application's request-eval-response loop.

STARTUP-SERVER (SERVER)

Make SERVER start responding to requests.

UPDATE-URL (COMPONENT URL)

Prepare URL for rendering as action urls.
Each component can define a method on UPDATE-URL to add
component-specific parameters. This is generally coupled with a
url-dispatcher to create bookmark-able urls.

Undocumented

BACKTRACK (FRAME PLACE &OPTIONAL VALUE)

BACKTRACK-SLOT (FRAME OBJECT SLOT-NAME &OPTIONAL COPYER)

CALL-RENDER (ACTION APPLICATION SESSION FRAME)

SETFCONTEXT.CURRENT-FRAME (VALUE CONTEXT)

SETFCONTEXT.WINDOW-COMPONENT (COMPONENT CONTEXT)

JUMP-TO-COMPONENT (TARGET)

PLACE (PLACE)

SETFPLACE (VALUE PLACE)

SETFQUERY-PATH (NEW-VALUE CONDITION)

REGISTER-APPLICATION (SERVER APPLICTAION)

RESTART-SERVER (SERVER)

SETFSESSION-OF (NEW-VALUE CONDITION)

UNREGISTER-APPLICATION (SERVER APPLICTAION)

Private

ACTION-REQUEST-P (CONTEXT)

Returns true if the request represents an action (as opposed to entry-point).
IOW, returns true iff the context's request has a frame-id and action-id, and
they represent a valid frame and action in the session.
As a second value it returns the extracted action-id.

ADD-COOKIE-USING-RESPONSE (RESPONSE COOKIE)

Adds COOKIE (an rfc2109::cookie struct) to be sent to the client with this response.

ADD-HEADER (MESSAGE HEADER-NAME VALUE)

Add another header line with
HEADER-NAME=VALUE. Returns VALUE.
Like get-header and (setf get-header) HEADER-NAME must be a
string.

CALL-REQUEST-PATH (COMPONENT)

Return current request path as a list for reporting.

CLEAR-CONTEXT (CONTEXT)

Prepare REQUEST-CONTEXT for re-use.
This method must destructivly modify CONTEXT so that it becomes
indistinguishable from a freshly created object as returned by
make-request-context.

CLEAR-RESPONSE (RESPONSE)

Restore RESPONSE to its clean state.
This generic function is generally used when dealing with an
error which occurs during the rendering of a window.

COOKIE-VALUE-USING-REQUEST (REQUEST NAME &OPTIONAL DEFAULT)

Returns the value of the first cookie with NAME in the
request or DEFAULT if none was found. Cookies are sorted by their cookie
path's, most specific first.

DESCENDANT-P (PARENT CHILD &OPTIONAL RECURSIVE-P)

Predicate to use whether child is a child of parent.

FIND-ACTION (SESSION-FRAME ACTION-ID)

Return the action (a funcallable) associated with ACTION-ID.

FIND-ACTION-INVOCATION-ID (CONTEXT)

Same as find-session-id but looks for the action invocation id.
An invocation is basically a unique id (currently a timestamp) generated on the
client side when the user triggers the action.

FIND-ASSOCIATED-APPLICATION (SERVER REQUEST)

Return the application object which will
handle REQUEST.

FIND-COOKIE-USING-REQUEST (REQUEST NAME)

Returns the first cookie with NAME in the request or NIL
if none was found. Cookies are sorted by their cookie path's, most
specific first.

FIND-FRAME-ID (CONTEXT)

Same as find-session-id but looks for the frame id.

FIND-SESSION (APPLICATION CONTEXT)

Return the session object in CONTEXT or NIL if
there's no session.

HAS-EVENTS-FOR-THE-CLIENT (SESSION)

This method is called from the polling thread to determine whether there are any events that could be sent to the client.

INITIALIZE-BACKEND (BACKEND &REST INIT-ARGS)

Prepare BACKEND but do not actually start serving request.

INSPECTABLE-COMPONENT (COMPONENT)

Returns T when inspector links should be
created for this component.
If methods on this function need a default value (iow the user
hasn't explicitly specified a preference) the return value of the
generic function INSPECT-COMPONENTS (passed the current
application) should be used.

MAKE-NEW-FRAME (ACTION SESSION)

Adds a new session-frame object to SESSION.

MAKE-NEW-SESSION (APPLICATION)

Return a new session object.

MAKE-NEXT-FRAME (SESSION FRAME NEW-FRAME-ID)

Create the "next" frame object with id NEW-FRAME-ID.
The new frame object must build its history (component,
backtracks, etc.) assuming that FRAME is the previous (in
chronological order) frame.

OK (COMPONENT &OPTIONAL VALUE)

This generic action causes component to answer.
The answer macro expects the component to be bound to self in the
lexical environment it's used. It exists to avoid the creation of
spurious actions this action can be used whenever we want to
cause a compoent to answer.
VALUE should default to COMPOENT.

PUBLISH-DIRECTORY (BACKEND DIRECTORY-PATHNAME URL-BASE)

Publish the directory at PATHNAME at the URLs starting from URL-BASE.

REINSTATE-BACKTRACKED (FRAME)

Reset all the values of the backtracked places in FRAME to the values they had the last FRAME was handled.

REMOTE-ADDRESS (REQUEST)

Return the remote ip address of a request.

REMOVE-EXPIRED-SESSIONS (APPLICATION)

Remove all the expired sessions in APPLICATION.
Implementations of this method must use the generic function SESSION-EXPIRED-P to determine if a session is expired or not, and must call DELETE-SESSION on the session objects.

SEND-EVENTS-TO-THE-CLIENT (SESSION)

This method is called by the polling thread to actually send events for the client (which includes dirty component rerendering).

SESSION-EXPIRED-P (SESSION)

UCW may call this function any time to check if the session is expired and without the session being locked.
Only install lightweight customizations here that may not block. See SESSION-VALID-P for possibly blocking (i.e. using a db transaction) customizations.

SESSION.VALUE (KEY SESSION &OPTIONAL DEFAULT)

Fetch the value with key KEY in the session SESSION.
DEFAULT is returned should KEY not be found in SESSION's
session-table.
Keys are compared using EQL.

SETFSESSION.VALUE (VALUE KEY SESSION)

Sets the value of KEY in SESSION to VALUE.
As with session.value keys are compared with EQL.

SHUTDOWN-BACKEND (BACKEND &REST SHUTDOWN-ARGS)

Stop the RERL and release any resources.
In multi-threaded backends, this function MUST block until the socket is closed.

STARTUP-BACKEND (BACKEND &REST STARTUP-ARGS)

Start the RERL. This method may block on
single threaded lisps.

VALIDP (COMPONENT)

Returns whether the component is valid.
A component being invalid means that something has changed on it
that needs rendering. This is only useful when using AJAX
features and ajax-application-mixin.

VISIBLEP (COMPONENT)

Returns wether (context.window-component *context*) is reachable through the parent slots.
When visible, returns the distance from the window as a second value.

WAS-CALLED-P (COMPONENT)

Returns whether COMPONENT has been called (so we can answer)

Undocumented

ANSWER-COMPONENT* (SOURCE TARGET VALUE)

CLONE-PLACE-VALUE (PLACE &OPTIONAL VALUE)

CONTENT-LENGTH-OF (CONDITION)

SETFCONTENT-LENGTH-OF (NEW-VALUE CONDITION)

CONTEXT-OF (CONDITION)

SETFCONTEXT-OF (NEW-VALUE CONDITION)

CONTEXT.LOCALE (CONTEXT)

SETFDIRTYP (VALUE COMPONENT)

SETFFIND-ACTION (ACTION SESSION-FRAME ACTION-ID)

FIND-FRAME-BY-ID (QUEUE FRAME-ID)

RAW-URI-OF (CONDITION)

SETFRAW-URI-OF (NEW-VALUE CONDITION)

REINSTATE-BACKTRACKED-USING-ACTION (FRAME ACTION)

REQUEST-CONTENT-LENGTH-LIMIT-OF (CONDITION)

SETFREQUEST-CONTENT-LENGTH-LIMIT-OF (NEW-VALUE CONDITION)

REQUEST-OF (CONDITION)

SETFREQUEST-OF (NEW-VALUE CONDITION)

SAVE-BACKTRACKED (FRAME)

SAVE-BACKTRACKED-USING-ACTION (FRAME ACTION)

SLOT-ACCESSOR

Public

ACTION-ISOLATED-P (OBJECT)

Isolated actions are invalidated after the first call.

SETFACTION-ISOLATED-P (NEW-VALUE OBJECT)

Isolated actions are invalidated after the first call.

APPLICATION.CHARSET (OBJECT)

Default charset for sent text/html documents.

SETFAPPLICATION.CHARSET (NEW-VALUE OBJECT)

Default charset for sent text/html documents.

APPLICATION.DISPATCHERS (OBJECT)

A list of request
dispatchers. The user supplied list of dispatchers is extended
with other dispatchers that are required for UCW to function
properly (action-dispatcher, a parenscript-dispatcher, etc). If
you want full control over the active dispatchers use the (setf
application.dispatchers) accessor or, if you want control over
the order of the dispathcers, (slot-value instance
'dispatchers).

SETFAPPLICATION.DISPATCHERS (NEW-VALUE OBJECT)

A list of request
dispatchers. The user supplied list of dispatchers is extended
with other dispatchers that are required for UCW to function
properly (action-dispatcher, a parenscript-dispatcher, etc). If
you want full control over the active dispatchers use the (setf
application.dispatchers) accessor or, if you want control over
the order of the dispathcers, (slot-value instance
'dispatchers).

APPLICATION.URL-PREFIX (APPLICATION)

The Returns the url prefix (a string) for APPLICATION.
The URL prefix is that string which, when used as the prefix of
an incoming http query path, identifies an application.

SETFAPPLICATION.URL-PREFIX (NEW-VALUE OBJECT)

Set the Returns the url prefix (a string) for APPLICATION.
The URL prefix is that string which, when used as the prefix of
an incoming http query path, identifies an application.

COMPONENT.CALLING-COMPONENT (OBJECT)

The component which transfered control to this component.
When this component ANSWERs it returns control to the
calling-component and modifes the associated place. Only in the
case of top level components will this slot be NIL.

SETFCOMPONENT.CALLING-COMPONENT (CALLER COMPONENT)

The component which transfered control to this component.
When this component ANSWERs it returns control to the
calling-component and modifes the associated place. Only in the
case of top level components will this slot be NIL.

COMPONENT.PLACE (OBJECT)

The place (a PLACE object) which holds this component.
Only in the case of top level component will this slot be NIL.

SETFCOMPONENT.PLACE (NEW-VALUE OBJECT)

The place (a PLACE object) which holds this component.
Only in the case of top level component will this slot be NIL.

CONTEXT.APPLICATION (CONTEXT)

The Accessor for the application object in CONTEXT.

SETFCONTEXT.APPLICATION (APPLICATION CONTEXT)

Set the Accessor for the application object in CONTEXT.

CONTEXT.REQUEST (CONTEXT)

The Accessor for the request object in CONTEXT.

SETFCONTEXT.REQUEST (REQUEST CONTEXT)

Set the Accessor for the request object in CONTEXT.

CONTEXT.RESPONSE (CONTEXT)

The Accessor for the response object in CONTEXT.

SETFCONTEXT.RESPONSE (RESPONSE CONTEXT)

Set the Accessor for the response object in CONTEXT.

CONTEXT.SESSION (CONTEXT)

The Accessor for the session object in CONTEXT.

SETFCONTEXT.SESSION (SESSION CONTEXT)

Set the Accessor for the session object in CONTEXT.

DEBUG-ON-ERROR (APPLICATION)

The Returns T if APPLICATION should attempt to debug errors (instead of just returning an error page).

SETFDEBUG-ON-ERROR (VALUE APP)

Set the Returns T if APPLICATION should attempt to debug errors (instead of just returning an error page).

FRAME.WINDOW-COMPONENT (SESSION-FRAME)

The Accessor for SESSION-FRAME's window component.

SETFFRAME.WINDOW-COMPONENT (COMPONENT SESSION-FRAME)

Set the Accessor for SESSION-FRAME's window component.

HANDLER (OBJECT)

Function to run when this
entry-point-handler runs. This handler is a
zero-arged.

SETFHANDLER (NEW-VALUE OBJECT)

Function to run when this
entry-point-handler runs. This handler is a
zero-arged.

NETWORK-STREAM (RESPONSE)

The Return the stream attached to the client's browser.
Any bytes written to this stream are sent immediatly to the
client (though buffering issues may arise).

SETFNETWORK-STREAM (NEW-VALUE OBJECT)

Set the Return the stream attached to the client's browser.
Any bytes written to this stream are sent immediatly to the
client (though buffering issues may arise).

PARENT (COMPONENT)

The Returns the parent of COMPONENT.
Only window components and detached components may return NIL
from this function.

SETFPARENT (NEW-VALUE OBJECT)

Set the Returns the parent of COMPONENT.
Only window components and detached components may return NIL
from this function.

RESPONSE-MANAGED-P (OBJECT)

SEND-RESPONSE for unmanaged responses
is a no-op.

SETFRESPONSE-MANAGED-P (NEW-VALUE OBJECT)

SEND-RESPONSE for unmanaged responses
is a no-op.

SERVER.APPLICATIONS (SERVER)

The Return a list of all the application objects
SERVER manages.

SETFSERVER.APPLICATIONS (NEW-VALUE OBJECT)

Set the Return a list of all the application objects
SERVER manages.

SESSION-OF (CONDITION)

The owner session of this component. A component may only be used in one session at a time.

SESSION.ID (SESSION)

The Returns the id of SESSION.
An ID is a unique (within the same application) object
identifying SESSION.

SETFSESSION.ID (NEW-VALUE OBJECT)

Set the Returns the id of SESSION.
An ID is a unique (within the same application) object
identifying SESSION.

WINDOW-COMPONENT.CONTENT-TYPE (OBJECT)

Either use slot value, or compute content-type from current application charset.

SETFWINDOW-COMPONENT.CONTENT-TYPE (NEW-VALUE OBJECT)

The Content-Type header for the
http response (also used in the meta tag)

Undocumented

APPLICATION.SERVER (OBJECT)

SETFAPPLICATION.SERVER (NEW-VALUE OBJECT)

CONTEXT.ACTION (OBJECT)

SETFCONTEXT.ACTION (NEW-VALUE OBJECT)

FRAME.ID (SESSION-FRAME)

SETFFRAME.ID (NEW-VALUE OBJECT)

LOCK-OF (OBJECT)

SETFLOCK-OF (NEW-VALUE OBJECT)

SERVER.BACKEND (OBJECT)

SETFSERVER.BACKEND (NEW-VALUE OBJECT)

SERVER.STARTED (OBJECT)

SETFSERVER.STARTED (NEW-VALUE OBJECT)

URI.HOST (OBJECT)

SETFURI.HOST (NEW-VALUE OBJECT)

URI.PATH (OBJECT)

SETFURI.PATH (NEW-VALUE OBJECT)

URI.QUERY (OBJECT)

SETFURI.QUERY (NEW-VALUE OBJECT)

URL-STRING (OBJECT)

SETFURL-STRING (NEW-VALUE OBJECT)

Private

SETFACTION-LAMBDA-OF (NEW-VALUE OBJECT)

Make sure the FUNCALLABLE-INSTANCE-FUNCTION is in sync with the LAMBDA

ACTION-VALID-P (OBJECT)

Invalid actions are never called anymore.

SETFACTION-VALID-P (NEW-VALUE OBJECT)

Invalid actions are never called anymore.

ALLOCATED-BACKTRACKS-OF (OBJECT)

The places allocated in this frame.

SETFALLOCATED-BACKTRACKS-OF (NEW-VALUE OBJECT)

The places allocated in this frame.

COMPONENT-CLASS.BACKTRACK-SLOTS (OBJECT)

A list of effective-slot-definition's that are backtracked.

SETFCOMPONENT-CLASS.BACKTRACK-SLOTS (NEW-VALUE OBJECT)

A list of effective-slot-definition's that are backtracked.

COMPONENT-CLASS.COMPONENT-SLOTS (OBJECT)

A list of effective-slot-definition's that are component slots.

SETFCOMPONENT-CLASS.COMPONENT-SLOTS (NEW-VALUE OBJECT)

A list of effective-slot-definition's that are component slots.

COMPONENT.CONTINUATION (COMPONENT)

The Accessor for COMPONENT's continuation.
The continuation is implemented as a 1 arg lambda which is called
with the value COMPONENT answers. and continues whatever was
stopped when control was transfered to the component.

SETFCOMPONENT.CONTINUATION (K COMPONENT)

Set the Accessor for COMPONENT's continuation.
The continuation is implemented as a 1 arg lambda which is called
with the value COMPONENT answers. and continues whatever was
stopped when control was transfered to the component.

DIRTYP (OBJECT)

A flag whether the component was invalidated (which means that it needs rendering).

EFFECTIVE-BACKTRACKS-OF (OBJECT)

PLACE -> VALUE mapping of the effective backtracked places.

SETFEFFECTIVE-BACKTRACKS-OF (NEW-VALUE OBJECT)

PLACE -> VALUE mapping of the effective backtracked places.

FRAME.ACTIONS (OBJECT)

A hash table mapping action ids to 0 argument functions.

SETFFRAME.ACTIONS (NEW-VALUE OBJECT)

A hash table mapping action ids to 0 argument functions.

FRAME.CALLBACKS (OBJECT)

A hash table mapping callback ids to 1 argument functions.

SETFFRAME.CALLBACKS (NEW-VALUE OBJECT)

A hash table mapping callback ids to 1 argument functions.

LIVE-BACKTRACKS-OF (OBJECT)

A cumulated hashtable of all the ALLOCATED-BACKTRACKS of each frame.
When a new frame is created, only these backtracks are cloned. When a frame is
dropped, its ALLOCATED-BACKTRACKS are remhash's from here. Because weak pointers
are too expensive for this.

SETFLIVE-BACKTRACKS-OF (NEW-VALUE OBJECT)

A cumulated hashtable of all the ALLOCATED-BACKTRACKS of each frame.
When a new frame is created, only these backtracks are cloned. When a frame is
dropped, its ALLOCATED-BACKTRACKS are remhash's from here. Because weak pointers
are too expensive for this.

PRIORITY (OBJECT)

Dispatchers will be checked from
highest-priority to lowest priority. The default
values for priority on the various classes assume
this is a positive integer less than
most-positive-fixnum.

SETFPRIORITY (NEW-VALUE OBJECT)

Dispatchers will be checked from
highest-priority to lowest priority. The default
values for priority on the various classes assume
this is a positive integer less than
most-positive-fixnum.

REQUEST-CONTEXT-CLASS-OF (OBJECT)

Caches the class of the effective request context.

SETFREQUEST-CONTEXT-CLASS-OF (NEW-VALUE OBJECT)

Caches the class of the effective request context.

SESSION-CLASS-OF (OBJECT)

Caches the class of the effective session.

SETFSESSION-CLASS-OF (NEW-VALUE OBJECT)

Caches the class of the effective session.

SESSION-FRAME-CLASS-OF (OBJECT)

Caches the class of the effective session frame.

SETFSESSION-FRAME-CLASS-OF (NEW-VALUE OBJECT)

Caches the class of the effective session frame.

SESSION.CURRENT-FRAME (SESSION)

The Return the current active frame in the session.

SETFSESSION.CURRENT-FRAME (VALUE SESSION)

Set the Return the current active frame in the session.

SESSION.FRAMES (OBJECT)

The table of session-frame objects
generated in this session.

SETFSESSION.FRAMES (NEW-VALUE OBJECT)

The table of session-frame objects
generated in this session.

Undocumented

ACTION-BACKTRACKS (OBJECT)

SETFACTION-BACKTRACKS (NEW-VALUE OBJECT)

ACTION-CALL-CALLBACKS-P (OBJECT)

SETFACTION-CALL-CALLBACKS-P (NEW-VALUE OBJECT)

ACTION-CALL-RENDER-P (OBJECT)

SETFACTION-CALL-RENDER-P (NEW-VALUE OBJECT)

ACTION-ID (OBJECT)

SETFACTION-ID (NEW-VALUE OBJECT)

ACTION-LAMBDA-OF (OBJECT)

ACTION-MAKE-NEW-FRAME-P (OBJECT)

SETFACTION-MAKE-NEW-FRAME-P (NEW-VALUE OBJECT)

APPLICATION.SESSION-TABLE (OBJECT)

SETFAPPLICATION.SESSION-TABLE (NEW-VALUE OBJECT)

COMPONENT-CLASS.PLACE-SLOT (OBJECT)

SETFCOMPONENT-CLASS.PLACE-SLOT (NEW-VALUE OBJECT)

COMPONENT-SLOT.BACKTRACK (OBJECT)

SETFCOMPONENT-SLOT.BACKTRACK (NEW-VALUE OBJECT)

COMPONENT-SLOT.COMPONENT (OBJECT)

SETFCOMPONENT-SLOT.COMPONENT (NEW-VALUE OBJECT)

DESCRIPTION-OF (OBJECT)

SETFDESCRIPTION-OF (NEW-VALUE OBJECT)

FRAME-ID-HASH (OBJECT)

SETFFRAME-ID-HASH (NEW-VALUE OBJECT)

FRAME-IS-OPTIONAL-P (OBJECT)

SETFFRAME-IS-OPTIONAL-P (NEW-VALUE OBJECT)

LOCAL-VARIABLES-OF (OBJECT)

SETFLOCAL-VARIABLES-OF (NEW-VALUE OBJECT)

PLACE.COPYER (OBJECT)

SETFPLACE.COPYER (NEW-VALUE OBJECT)

PLACE.FORM (OBJECT)

SETFPLACE.FORM (NEW-VALUE OBJECT)

PLACE.GETTER (OBJECT)

SETFPLACE.GETTER (NEW-VALUE OBJECT)

PLACE.SETTER (OBJECT)

SETFPLACE.SETTER (NEW-VALUE OBJECT)

SESSION.LAST-ACCESS (OBJECT)

SETFSESSION.LAST-ACCESS (NEW-VALUE OBJECT)

SESSION.OBJECT-POOL (OBJECT)

SETFSESSION.OBJECT-POOL (NEW-VALUE OBJECT)

SOURCE-LOCATION-OF (OBJECT)

SETFSOURCE-LOCATION-OF (NEW-VALUE OBJECT)

URI.FRAGMENT (OBJECT)

SETFURI.FRAGMENT (NEW-VALUE OBJECT)

URI.PORT (OBJECT)

SETFURI.PORT (NEW-VALUE OBJECT)

URI.SCHEME (OBJECT)

SETFURI.SCHEME (NEW-VALUE OBJECT)

VARIABLE

Public

*DEBUG-ON-ERROR*

The default, system wide, value for debug-on-error. Applications may override this.

*DEFAULT-ACTION-CLASS*

Default action class for MAKE-ACTION

*DEFAULT-APPLICATION*

The application object to use when none is explicitly specified.

*DEFAULT-SERVER*

The server object to use when none is explicitly specified.

*INSPECT-COMPONENTS*

When rendering, should we put links next to components that will bring up the inspector?

*REQUEST-CONTENT-LENGTH-LIMIT*

While uploading a file the size of the request may go higher then this in which case UCW signals an error.
See also the REQUEST-CONTENT-LENGTH-LIMIT slot of BASIC-BACKEND.

Undocumented

+ACTION-PARAMETER-NAME+

+FRAME-PARAMETER-NAME+

+SESSION-PARAMETER-NAME+

Private

*COPY-DOWN-COMPONENT*

Holder variable used for the copy-down link in the inspector
links. not thread safe (but good enough for single user
debugging).

*DEFAULT-SESSION-LONGEVITY*

Seconds of inactivity allowed before a basic-session object is expired.

*DEFAULT-SESSION-PURGE-PERIOD*

Seconds of minimal delay between looking for expired sessions.

*DIRECTORY-FOR-TEMPORARY-FILES*

Used for file uploads, too.

*EXTERNAL-FORMATS*

The external formats used for url-unescaping, slime and http(via swank) intercommunication

*JS-RESOURCE-REGISTRY*

Contains the l10n resource names that should be sent to the client side js.

*JS-RESOURCE-REGISTRY-LAST-MODIFIED-AT*

A universal-time timestamp updated when the registry was last modified.

*MAXIMUM-NUMBER-OF-SESSIONS*

UCW will render a '503 Service Unavailable' when there are this many live sessions in an application and new ones are coming.

*UCW-BACKTRACE-VERBOSE*

When `t' display local variables in error log backtrace

+ACTION-INVOCATION-PARAMETER-NAME+

This parameter identifies an invocation of an action (to be used when the action is invocation-isolated-p)

+SESSION-BACKTRACKING-MAX-DEPTH+

How many frames we keep in backtracking history.

Undocumented

+ACTION-PARAMETER-KEYWORD+

+AJAX-ACTION-DISPATCHER-URL+

+CALLBACK-DISPATCHER-URL+

+FRAME-PARAMETER-KEYWORD+

+I18N-PARENSCRIPT-DISPATCHER-URL+

+IP-V4-LOCALHOST+

+IP-V6-LOCALHOST+

+POLLING-DISPATCHER-URL+

+SESSION-PARAMETER-KEYWORD+

+UCW-DYNAMIC-URL-PREFIX+

CLASS

Public

ACTION-DISPATCHER

This is the core dispatcher for ucw. Due to
how ucw's COMPUTE-URL method works it is important that the
action-dispatcher be checked before any url-dispatchers, so it
should be the first element in an application's dispatcher
list.

APPLICATION

A UCW application.
Application objects are responsible for:
- Managing a collection of sessions and finding the right session for a given request.
- Managing session life time (session creation and expiration).
- Creating request contexts.
- Managing dispatchers and associating them to request objects.
- Creating http query paths which subsequently (when requested)
call action lambdas.
Since application objects are used to create sessions (via
make-new-session) they are also important when customizing the
functionality of the RERL.

BASIC-APPLICATION

The base UCW application class.

COMPONENT

The generic super class of all components.

ENTRY-POINT-HANDLER

This handler is used to handle
entry-points.

HANDLER (OBJECT)

Abstract handler class.

MATCHER

Abstract matcher class.

PLACE (PLACE)

A "pointer" or "locative", an object
encapsulating a settable and readable place

REQUEST

Generic superclass for all HTTP requests.

REQUEST-CONTEXT

The generic super class of all request contexts.
A request-context object contains all the information associated
with one particular request/response loop. The request context is
usually accessed via the special variable *context* and contains
the currently relevant application, session, session-frame,
request and response object.

RESPONSE

Generic superlcass for all HTTP responses.
An HTTP response has, other than the headers, two streams:
1) the html-stream - This is a character based stream which can
be used to send ISO-8859-1 characters to the client.
2) the network-stream - This is the binary (unsigned-byte 8)
stream attached directly to the client' browser.

STANDARD-COMPONENT

Super class of all standard components.

STANDARD-COMPONENT-CLASS

The meta class for standard-components.
Classes defined with this meta-class have extra slot options, see
the class STANDARD-COMPONENT-DIRECT-SLOT for details.

URL-MATCHER

Matcher used to match url-string exactly (using string=).

Undocumented

ACTION

ACTION-WITH-ISOLATION-SUPPORT

BASIC-ACTION

BASIC-SESSION

DISPATCHER

STANDARD-REQUEST-CONTEXT

STANDARD-SERVER

STANDARD-SESSION-FRAME

URI

URL-DISPATCHER

WINDOW-COMPONENT

Private

APPLICATION-WITH-SESSION-HANDLING-MIXIN

This mixin adds session handling capabilities to applications.

BACKEND

Super class for UCW backends.
A backend object is used to represent one active running instance
of an http server which UCW can use to read requests and send
response.
A backend object's life cycle is managed by the three methods
initialize-backend, startup-backend and shutdown-backend.

FRAME-QUEUE

A LRU queue with a hash table wrapped around
it for fast 'contains' checks.

MESSAGE

Generic superclass for all HTTP messages.
All HTTP messages provide the ability to inspect (and maybe
modify) the associated headers and mesage body.

SERVER

A single UCW server.
Within the RERL server objects provide the following
functionality:
* Take request and response objects as provided by the backend
via the handle-request method and run one iteration of the
RERL.
* Call the generic function associated-application to determine
the application object which should handle the request.
* Create a request-context object (via a call to
make-request-context on the application) and initialize it.
* Call the application's service method passing it the
request-context.
* close the request and response when the application's
service method returns.
The server object should also attempt to deal with all conditions
signalled during the service'ing of the request.
Servers are responsible for managing multiple applications within
the same UCW instance and dealing with, possibly, multiple
backends.

SESSION-FRAME

Super class of all session frame.
A session frame represents a single request/response interaction
with a client. Session frames know what actions they've generated
and what the component tree was when the response was sent.

SESSION-FRAME-MATCHER

Matches when a valid session and a valid frame
could be identified from the request.

STANDARD-COMPONENT-SLOT

The superclass for direct/effective slots of standard-components.
Other than the initargs for standard slots the following
options can be passed to component slots:
:backtrack [ T | NIL | FUNCTION-NAME ] - Specify that this slot
should be backtracked (or not if NIL is passed as the value). If
the value is neither T nor NIL then it must be a function which
will be used as the copyer.
:component [ T | NIL | TYPE | ( TYPE &rest INITARGS ) ] - Specify that this
slot is actually a nested component of type TYPE unless NIL. When instances
of the class are created and there's no iniform for this slot, then this it
will be set to an instance of type TYPE and its place will be set to this
slot. If a list is passed to :component then TYPE (which isn't evaluated) will be
passed as the first argument to make-instance. The INITARGS will
be eval'd and apply'd to make-instance. The result of this call
to make-instance will be used as the component object used for initialization.

Undocumented

ARG-SPEC

CALLBACK-ENTRY

DUMMY-REQUEST

DUMMY-REQUEST-CONTEXT

DUMMY-RESPONSE

DUMMY-ROOT-COMPONENT

HTTPD-REQUEST

HTTPD-RESPONSE

MINIMAL-APPLICATION

RENDERABLE-ACTION

SESSION

SHARED-HASHTABLE-ENTRY

STACK-FRAME

STANDARD-COMPONENT-DIRECT-SLOT

STANDARD-COMPONENT-EFFECTIVE-SLOT

CONDITION

Private

ACTION-ERROR

An error has occured during the execution of an action.

BADLY-FORMATTED-REQUEST

Class of errors signaled when a particular
id (application, session, frame or action) is not found in the
request.

CALLBACK-ERROR

An error has occured while handling a callback.

INEXISTENT-REQUEST-PART

Class of errors signaled when a particular
part of the action chain (session, frame, param-action or action)
is specified in the request but the corresponding server side
object can't be found.

NO-HANDLER-FOR-REQUEST

This is signalled for a 404

RENDER-ERROR

An error has occured while rendering a component.

RERL-ERROR

An error signalled during the request processing chain.

TOO-MANY-SESSIONS

This error is signalled when there are more then
*maximum-number-of-sessions* live sessions and a new one should be needed.

Undocumented

ACTION-ID-MISSING

ACTION-NOT-FOUND

FRAME-ID-MISSING

FRAME-NOT-FOUND

REQUEST-CONTENT-LENGTH-LIMIT-REACHED (CONTENT-LENGTH)

SESSION-HAS-EXPIRED

SESSION-ID-MISSING

SESSION-IS-INVALID

CONSTANT

Private

+ACCEPT-LANGUAGE-CACHE-PURGE-SIZE+

The maximum size of the cache of Accept-Language header over which the hashtable is cleared.