Common Lisp Package: UCW-STANDARD

README:

FUNCTION

Public

SERVE-SEQUENCE (SEQUENCE &KEY (REQUEST (CONTEXT.REQUEST *CONTEXT*)) (RESPONSE (CONTEXT.RESPONSE *CONTEXT*)) (LAST-MODIFIED (GET-UNIVERSAL-TIME)) (CONTENT-TYPE application/octet-stream) CONTENT-DISPOSITION (EXPIRES 3600))

Write SEQUENCE into the network stream and clean up the request. SEQUENCE may be a string or a byte vector. When it's a string it will be encoded according to what the (encoding response) protocol answers.

UNIQUE-DOM-ID (&KEY (PREFIX _ucw_))

Generates a unique DOM id

Undocumented

ANSWER (&OPTIONAL VAL)

CALL (THING &REST ARGS)

CALL-AS-WINDOW (COMPONENT-TYPE &REST COMPONENT-INIT-ARGS)

CLOSE-TRANSACTION (&OPTIONAL (SESSION (CONTEXT.SESSION *CONTEXT*)))

JUMP (COMPONENT-TYPE &REST COMPONENT-INIT-ARGS)

OPEN-TRANSACTION (&OPTIONAL (SESSION (CONTEXT.SESSION *CONTEXT*)))

SERVE-FILE (FILE-NAME &REST ARGS &KEY (REQUEST (CONTEXT.REQUEST *CONTEXT*)) (RESPONSE (CONTEXT.RESPONSE *CONTEXT*)) (LAST-MODIFIED NIL LAST-MODIFIED-SUPPLIED-P) (CONTENT-TYPE NIL CONTENT-TYPE-P) (CONTENT-DISPOSITION-FILENAME NIL CONTENT-DISPOSITION-FILENAME-P) CONTENT-DISPOSITION-SIZE (EXPIRES 86400))

SERVE-STREAM (STREAM &KEY (REQUEST (CONTEXT.REQUEST *CONTEXT*)) (RESPONSE (CONTEXT.RESPONSE *CONTEXT*)) (LAST-MODIFIED (GET-UNIVERSAL-TIME)) CONTENT-TYPE CONTENT-LENGTH (CONTENT-DISPOSITION attachment CONTENT-DISPOSITION-P) CONTENT-DISPOSITION-FILENAME CONTENT-DISPOSITION-SIZE (EXPIRES 86400))

SESSION-AUTHENTICATED-P (&OPTIONAL (SESSION (CONTEXT.SESSION *CONTEXT*)))

SESSION-USER (&OPTIONAL (SESSION (CONTEXT.SESSION *CONTEXT*)))

Private

Undocumented

%RENDER-TEMPLATE (CONTEXT GENERATOR TRUENAME ENVIRONMENT)

CHECK-USER-PASSWORD (USER PASSWORD &OPTIONAL (APP (CONTEXT.APPLICATION *CONTEXT*)))

FIND-APPLICATION-USER (USERNAME &OPTIONAL (APP (CONTEXT.APPLICATION *CONTEXT*)))

FIND-CONTAINER-COMPONENT-ENTRY (C KEY)

GEN-ID (STRING)

PARTITION-INTO-PAGES (DATA PAGE-SIZE)

REMOVE-CONTAINER-COMPONENT-ENTRY (C KEY)

MACRO

Public

Undocumented

DEFACTION (&REST ARGS-AND-BODY)

OPTION-DIALOG ((MESSAGE-SPEC &REST MESSAGE-ARGS) &BODY OPTIONS)

Private

%WITH-ACTION-UNIQUE-NAMES (&BODY BODY)

These magic macros.

%WITH-CALLBACK-WRITER (&BODY BODY)

Bind WRITER to either WRITER or ACCESSOR.

Undocumented

INITIALIZE-CONTAINER ((CONTAINER &KEY KEY-TEST CURRENT-COMPONENT) &BODY CONTENTS)

WITH-ATTRIBUTE-VALUE ((VAR ATTRIBUTE-NAME TAG &KEY IMPLICIT-PROGN-P) &BODY BODY)

WITH-TRANSACTION ((&REST OPTIONS) &BODY BODY)

GENERIC-FUNCTION

Public

APPLICATION-AUTHORIZE-CALL (APPLICATION USER FROM TO)

Check user credentials to call TO by FROM in APPLICATION.

APPLICATION-CHECK-PASSWORD (APPLICATION USER PASSWORD)

Validate PASSWORD against USER for APPLICATION.

APPLICATION-FIND-USER (APPLICATION USERNAME)

Find USER by USERNAME for APPLICATION.

CHILD-COMPONENTS (STANDARD-COMPONENT &KEY PREDICATE KEY (KEY #'IDENTITY) (KEY #'IDENTITY) PREDICATE)

Return the children of a component.

COMPONENT-CACHE-INVALID-P (COMPONENT)

Returns T if COMPONENT's cache is invalid.

NOTE-CACHE-UPDATED (COMPONENT OUTPUT)

Called whenever COMPONENT's cache is updated. It is safe to override the primary method.

RENDER-PAGED-LIST-ITEM (PAGED-LIST ITEM)

Render a single element of a paged-list.

SECURE-APPLICATION-P (APPLICATION)

Does APPLICATION require authorized access.

START (TASK)

action which gets called automatically when task-component is active. Use defmethod/cc to define your specialized "start" methods

TAL-COMPONENT-ENVIRONMENT (COMPONENT)

Create the TAL environment for rendering COMPONENT's template. Methods defined on this generic function must return a TAL environment: a list of TAL binding sets (see the documentation for YACLML:MAKE-STANDARD-TAL-ENVIRONMENT for details on TAL environments.)

Undocumented

ADD-COMPONENT (CONTAINER COMPONENT &OPTIONAL KEY)

CANCEL (SELF)

CLEAR-CONTAINER (C)

COMPONENT-AT (CONTAINER INDEX)

SETFCOMPONENT-AT (COMPONENT CONTAINER INDEX &OPTIONAL KEY)

CONTAINER.CURRENT-COMPONENT (CONTAINER)

SETFCONTAINER.CURRENT-COMPONENT (VALUE CONTAINER)

SETFCONTAINER.CURRENT-COMPONENT-KEY (VALUE CONTAINER)

EXIT-USER (SELF)

FIND-COMPONENT (C KEY)

SETFFIND-COMPONENT (COMPONENT CONTAINER KEY)

LOGIN-USER (SELF)

LOGOUT-USER (SELF)

ON-AUTHORIZATION-REJECT (APP USER FROM TO)

PAGED-LIST.CURRENT-PAGE (RANGE)

PAGED-LIST.HAVE-NEXT-P (VIEW)

PAGED-LIST.HAVE-PREVIOUS-P (VIEW)

PAGED-LIST.PAGE-COUNT (LIST)

REMOVE-COMPONENT (C KEY)

RENDER-PANE-CONTENTS (PANE)

RENDER-PANE-OPTIONS (PANE)

RENDER-TEMPLATE (CONTEXT TEMPLATE-NAME ENVIRONMENT)

RESPOND (SELF VALUE)

SCROLL-BACKWARD (RANGE &OPTIONAL N)

SCROLL-END (RANGE)

SCROLL-FORWARD (VIEW &OPTIONAL N)

SCROLL-START (RANGE)

SCROLL-TO-PAGE (RANGE PAGE-NUMBER)

SUBMIT (SELF)

SWITCH-COMPONENT (CONTAINER KEY)

Private

APPLICATION-AUTHENTICATE-USER (APPLICATION)

Ask user for credentials, authenticate and return valid USER data or NIL.

APPLICATION-UNAUTHORIZE-SESSION (APPLICATION &OPTIONAL SESSION)

Clear session user data.

EFFECTIVE-WINDOW-STYLESHEETS (WINDOW)

This method is used to collect the effective stylesheet list for a window; available for customizations.

Undocumented

%SESSION-USER (SELF)

SETF%SESSION-USER (VALUE SELF)

APPLICATION-AUTHORIZE-SESSION (APPLICATION &OPTIONAL SESSION)

CLOSE-TRANSACTION* (SESSION)

EMPTYP (C)

ENSURE-VALID-COMPONENT-KEY (CONTAINER KEY)

MAP-CONTENTS (FUNC CONTAINER)

OPEN-TRANSACTION* (SESSION)

PAGED-LIST.CURRENT-PAGE-ITEMS (RANGE)

PREPROCESS-TEMPLATE (TEMPLATE-NAME ENVIRONMENT &OPTIONAL (APPLICATION))

RENDER-HTML-HEAD (WINDOW)

RENDER-WINDOW-SCRIPTS (WINDOW)

SLOT-ACCESSOR

Public

APPLICATION.STATIC-ROOTS (OBJECT)

A list of (URL-subdir . pathname) pairs to use when looking for static files. This follows standard CL pathname syntax i.e. you must include a trailing / in both the URL-subdir and pathname.

SETFAPPLICATION.STATIC-ROOTS (NEW-VALUE OBJECT)

A list of (URL-subdir . pathname) pairs to use when looking for static files. This follows standard CL pathname syntax i.e. you must include a trailing / in both the URL-subdir and pathname.

COMPONENT-CACHE (OBJECT)

A string holding the output to use for this component. This string will be written directly to the html stream.

SETFCOMPONENT-CACHE (NEW-VALUE OBJECT)

A string holding the output to use for this component. This string will be written directly to the html stream.

CONTAINER.CONTENTS (OBJECT)

An alist of (key . component) holding the controlled components.

SETFCONTAINER.CONTENTS (NEW-VALUE OBJECT)

An alist of (key . component) holding the controlled components.

CONTAINER.CURRENT-COMPONENT-KEY (OBJECT)

The key of the current component.

CONTAINER.KEY-GENERATOR (OBJECT)

A lambda that generates the keys from a component when they are not specified

SETFCONTAINER.KEY-GENERATOR (NEW-VALUE OBJECT)

A lambda that generates the keys from a component when they are not specified

CONTAINER.KEY-TEST (OBJECT)

Function used to compare two keys.

SETFCONTAINER.KEY-TEST (NEW-VALUE OBJECT)

Function used to compare two keys.

PAGED-LIST.OFFSET (OBJECT)

Which of the pages we're currently looking at.

SETFPAGED-LIST.OFFSET (NEW-VALUE OBJECT)

Which of the pages we're currently looking at.

WINDOW-COMPONENT.CONTENT-PROLOGUE (OBJECT)

Unless nil it's printed <:as-is before any other output. Suitable for <?xml...?> lines.

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

Unless nil it's printed <:as-is before any other output. Suitable for <?xml...?> lines.

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)

WINDOW-COMPONENT.DOCTYPE (OBJECT)

Doctype for this window.

SETFWINDOW-COMPONENT.DOCTYPE (NEW-VALUE OBJECT)

Doctype for this window.

WINDOW-COMPONENT.HTML-TAG-ATTRIBUTES (OBJECT)

A yaclml attribute list that'll be rendered into the <:html tag's attributes.

SETFWINDOW-COMPONENT.HTML-TAG-ATTRIBUTES (NEW-VALUE OBJECT)

A yaclml attribute list that'll be rendered into the <:html tag's attributes.

WINDOW-COMPONENT.ICON (OBJECT)

Optional URL for an icon.

SETFWINDOW-COMPONENT.ICON (NEW-VALUE OBJECT)

Optional URL for an icon.

WINDOW-COMPONENT.JAVASCRIPT (OBJECT)

List of javascript includes. Each element must be a list whose first value is either the symbol :SRC or :JS. (:SRC url) - writes <script src="URL"></script> tag. (:JS form) - equivalent to (:SCRIPT (js:js* form)) (:SCRIPT string) - write <script>STRING</script>. The elements will be rendered in order.

SETFWINDOW-COMPONENT.JAVASCRIPT (NEW-VALUE OBJECT)

List of javascript includes. Each element must be a list whose first value is either the symbol :SRC or :JS. (:SRC url) - writes <script src="URL"></script> tag. (:JS form) - equivalent to (:SCRIPT (js:js* form)) (:SCRIPT string) - write <script>STRING</script>. The elements will be rendered in order.

WINDOW-COMPONENT.STYLESHEET (OBJECT)

The URL of the css file to use as a stylesheet for this window.

SETFWINDOW-COMPONENT.STYLESHEET (NEW-VALUE OBJECT)

The URL of the css file to use as a stylesheet for this window.

Undocumented

APPLICATION.ONLINE-USERS (OBJECT)

SETFAPPLICATION.ONLINE-USERS (NEW-VALUE OBJECT)

HTML-ELEMENT.CSS-CLASS (OBJECT)

SETFHTML-ELEMENT.CSS-CLASS (NEW-VALUE OBJECT)

HTML-ELEMENT.CSS-STYLE (OBJECT)

SETFHTML-ELEMENT.CSS-STYLE (NEW-VALUE OBJECT)

HTML-ELEMENT.DOM-ID (OBJECT)

SETFHTML-ELEMENT.DOM-ID (NEW-VALUE OBJECT)

PAGED-LIST.PAGE-SIZE (OBJECT)

SETFPAGED-LIST.PAGE-SIZE (NEW-VALUE OBJECT)

PAGED-LIST.PAGES (OBJECT)

USER-LOGIN (OBJECT)

SETFUSER-LOGIN (NEW-VALUE OBJECT)

WINDOW-BODY (OBJECT)

SETFWINDOW-BODY (NEW-VALUE OBJECT)

WINDOW-COMPONENT.TITLE (OBJECT)

SETFWINDOW-COMPONENT.TITLE (NEW-VALUE OBJECT)

Private

APPLICATION.TAL-GENERATOR (OBJECT)

A tal-generator object used to lookup and compile tal pages for template-components.

SETFAPPLICATION.TAL-GENERATOR (NEW-VALUE OBJECT)

A tal-generator object used to lookup and compile tal pages for template-components.

EXPIRES-AFTER (OBJECT)

Number of seconds the cache is valid.

SETFEXPIRES-AFTER (NEW-VALUE OBJECT)

Number of seconds the cache is valid.

HITS (OBJECT)

Number of before the cache is invalid.

SETFHITS (NEW-VALUE OBJECT)

Number of before the cache is invalid.

HITS-SINCE-REFRESH (OBJECT)

Number of views since last refresh.

SETFHITS-SINCE-REFRESH (NEW-VALUE OBJECT)

Number of views since last refresh.

INSECURE-COMPONENTS (OBJECT)

Calls to these components are never checked.

SETFINSECURE-COMPONENTS (NEW-VALUE OBJECT)

Calls to these components are never checked.

LAST-REFRESH (OBJECT)

The time, exrpessed as a universal time, when the component was last rendered.

SETFLAST-REFRESH (NEW-VALUE OBJECT)

The time, exrpessed as a universal time, when the component was last rendered.

LOGIN-COMPONENT (OBJECT)

Class of component for user login. It must return authenticated USER data or NIL on answer.

SETFLOGIN-COMPONENT (NEW-VALUE OBJECT)

Class of component for user login. It must return authenticated USER data or NIL on answer.

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.

PASSWORD (OBJECT)

User password.

SETFPASSWORD (NEW-VALUE OBJECT)

User password.

SCANNER (OBJECT)

CL-PPCRE scanner used for pattern matching. Created automagically when url-string is set via accessors or initform.

SETFSCANNER (NEW-VALUE OBJECT)

CL-PPCRE scanner used for pattern matching. Created automagically when url-string is set via accessors or initform.

USERNAME (OBJECT)

User login name.

SETFUSERNAME (NEW-VALUE OBJECT)

User login name.

Undocumented

ACTION-SOURCE-COMPONENT (OBJECT)

SETFACTION-SOURCE-COMPONENT (NEW-VALUE OBJECT)

APPLICATION.ACTION-CLASS (OBJECT)

SETFAPPLICATION.ACTION-CLASS (NEW-VALUE OBJECT)

CONFIRM (OBJECT)

SETFCONFIRM (NEW-VALUE OBJECT)

FRAME.TRANSACTION-STACK (OBJECT)

SETFFRAME.TRANSACTION-STACK (NEW-VALUE OBJECT)

MESSAGE (OBJECT)

SETFMESSAGE (NEW-VALUE OBJECT)

OPTIONS (OBJECT)

SETFOPTIONS (NEW-VALUE OBJECT)

ORIENTATION (OBJECT)

SETFORIENTATION (NEW-VALUE OBJECT)

SESSION.TRANSACTION-STACK (OBJECT)

SETFSESSION.TRANSACTION-STACK (NEW-VALUE OBJECT)

TAL-COMPONENT.TEMPLATE-NAME (OBJECT)

SETFTAL-COMPONENT.TEMPLATE-NAME (NEW-VALUE OBJECT)

TARGET (OBJECT)

SETFTARGET (NEW-VALUE OBJECT)

VARIABLE

Public

*DEFAULT-ACTION-CLASS*

Default action class for MAKE-ACTION

Undocumented

*SOURCE-COMPONENT*

Private

Undocumented

*IN-FORM*

*XML-ID-COUNTER*

CLASS

Public

CACHE-COMPONENT-MIXIN

Component which caches its output. 0 The component caching protocol consists of the generic functions COMPONENT-CACHE-INVALID-P, REFRESH-COMPONENT-OUTPUT, and NOTE-CACHE-UPDATED. Caching is managed in a :wrapping method on RENDER.

CONTAINER

Allow multiple components to share the same place. The container component serves to manage a set of components. It does not provide any render impementation, which is the resposibility of the subclasses (e.g. switching-container or list-container). Each contained component has a "key" associated with it which is used to retrieve a particular component. Keys are compared with container.key-test. The :contents inintarg, if provided, must be either a list of (key . component) or a list of components. In the latter case it will be converted into (component . component) form.

ERROR-MESSAGE-WINDOW

Generic component for showing server side error messages.

HTML-BLOCK-ELEMENT-MIXIN

A component which should be wrapped in a <div>.

HTML-ELEMENT-MIXIN

An HTML element. HTML elements control aspects that are relevant to almost all tags. They provide a place to store the class, id, and style of the component. The specific render methods of the components themselves must pass these values to whatever code is used to render the actual tag.

HTML-INLINE-ELEMENT-MIXIN

A component which should be wrapped in a <span>

LIST-CONTAINER

A simple renderable container component. This component is exactly like the regular CONTAINER but provides an implementation of RENDER which renders its contents in <:ol/<:li tags

MINIMAL-DISPATCHER

A dispatcher which does as little work as possible. The handler function must do basically everything (including shutdowning down request and response).

NUM-HITS-CACHE-COMPONENT-MIXIN

Render the component every HITS views.

OPTION-DIALOG ((MESSAGE-SPEC &REST MESSAGE-ARGS) &BODY OPTIONS)

Component for querying the user. The value of the slot MESSAGE is used as a general heading. The OPTIONS slot must be an alist of (VALUE . LABEL). LABEL (a string) will be used as the text of a link which, when clikced, will answer VALUE. If the CONFIRM slot is T the user will be presented with a second OPTION-DIALOG asking the user if they are sure they want to submit that value.

PAGED-LIST

Component for showing the user a set of data one "page" at a time. The data set is presented one "page" at a time with links to the the first, previous, next and last page. Each page shows at most PAGE-SIZE elements of the data. The data is passed to the paged-list at instance creation time via the :DATA initarg. The generic function RENDER-PAGED-LIST-ITEM is used to render each item of DATA. In order to change the rendering of the single elements of a range view developer's should create a sub class of PAGED-LIST and define their RENDER-PAGED-LIST-ITEM methods on that.

REGEXP-DISPATCHER

Matches URL using a cl-ppcre regular expression. Captured registers are available via `ucw:*dispatcher-registers*'

SECURE-APPLICATION-MIXIN

Mixin class for applications which require authorized access. Concrete application must specialize the following methods: APPLICATION-FIND-USER (APPLICATION USERNAME) APPLICATION-CHECK-PASSWORD (APPLICATION USER PASSWORD) APPLICATION-AUTHORIZE-CALL (APPLICATION USER FROM-COMPONENT TO-COMPONENT).

SIMPLE-DISPATCHER

This class of dispatchers avoids all of UCW's standard call/cc (and therefore frame/backtracking/component) mechanism. Unlike all other UCW dispatchers a simple-dispatcher must not use CALL, and must perform the rendering directly within the handler.

SWITCHING-CONTAINER

A simple renderable container component. This component is like the regular CONTAINER but serves to manage a set of components which share the same place in the UI. Therefore it provides an implementation of RENDER which simply renders its current component. The switching-container component class is generally used as the super class for navigatation components and tabbed-pane like components.

TABBED-PANE

Component for providing the user with a standard "tabbed pane" GUI widget.

TAL-COMPONENT

Component which is rendered via a TAL template.

TASK-COMPONENT

A controller for a single task or operation to be performed by the user. A task component's START action is called as soon as the component is instantiated. Task components do not have their own RENDER method, in fact they have no graphical representation but serve only to order a sequence of other components.

TIMEOUT-CACHE-COMPONENT-MIXIN

Render the component at most every EXPIRES-AFTER seconds.

USER-LOGIN (OBJECT)

User login component.

USER-LOGIN-WINDOW

A container window componenet for the user-login.

USER-TRACK-APPLICATION-MIXIN

module to mix with your application in order to track logged in and out users.

Undocumented

SIMPLE-TAL-COMPONENT

STANDARD-ACTION

STANDARD-APPLICATION

STANDARD-WINDOW-COMPONENT

STARTS-WITH-DISPATCHER

STATIC-ROOTS-APPLICATION-MIXIN

TAL-APPLICATION-MIXIN

TRANSACTIONAL-APPLICATION-MIXIN

WINDOW-COMPONENT

Private

BASIC-WINDOW-COMPONENT

A convenience class for writing window components.

BASIC-WINDOW-FEATURES-MIXIN

A mixin that renders basic html toplevel tags.

FUNCTION-HANDLER

Function handler class funcalls the handler lambda while providing application and context.

REDIRECT-COMPONENT

Send a client redirect. This component, which must be used as a window-component, redirects the client to the url specified in the target slot. A 302 (as opposed to 303) response code is sent to ensure compatability with older browsers. The redirect component never answers.

REGEXP-URL-MATCHER

Regexp matcher class to match url-string via cl-ppcre scanner.

Undocumented

INFO-MESSAGE

REGEXP-BINDING-HANDLER

STARTS-WITH-BINDING-HANDLER

STARTS-WITH-MATCHER

TRANSACTIONAL-SESSION-FRAME-MIXIN

TRANSACTIONAL-SESSION-MIXIN

USER-TRACK-SESSION-MIXIN

CONSTANT

Private

+USER-SESSION-KEY+

Session key for user's authorization data.

Undocumented

+MINIMAL-DISPATCHER-DEFAULT-PRIORITY+

+REGEX-DISPATCHER-DEFAULT-PRIORITY+

+SIMPLE-DISPATCHER-DEFAULT-PRIORITY+

+STARTS-WITH-DISPATCHER-DEFAULT-PRIORITY+