X-Git-Url: http://git.hcoop.net/clinton/website/site/unknownlamer.org.git/blobdiff_plain/cb44b69be59b2387df40b925ed6ff287afa6b4c0..aebf22ad2b817e34c64802d98c0896f7aba772aa:/UCWNotes.html diff --git a/UCWNotes.html b/UCWNotes.html index 7dc59ed..b751c91 100644 --- a/UCWNotes.html +++ b/UCWNotes.html @@ -7,7 +7,10 @@ - + + +

Roadmap to UCW Codebase

@@ -157,19 +160,19 @@ application mixins you find useful.

src/rerl/standard-classes.lisp

-(defclass standard-application (application)
-  ((url-prefix :initarg :url-prefix
-               :documentation "A string specifying the
+(defclass standard-application (application)
+  ((url-prefix :initarg :url-prefix
+               :documentation "A string specifying the
 start (prefix) of all the urls this app should handle.
 
 This value is used by the standard-server to decide what app a
 particular request is aimed at and for generating links to
 actions within the app. ")
-   (www-roots :initarg :www-roots
-              :documentation "A list of directories (pathname
+   (www-roots :initarg :www-roots
+              :documentation "A list of directories (pathname
 specifiers) or cons-cell (URL-subdir . pathname) to use when looking for static files.")
-   (dispatchers :initarg :dispatchers
-                :documentation "A list of request
+   (dispatchers :initarg :dispatchers
+                :documentation "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
@@ -177,17 +180,17 @@ 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)."))
-  (:documentation "The default UCW application class."))
+  (:documentation "The default UCW application class."))
 

src/rerl/modular-application/modular-application.lisp

-(defclass modular-application-mixin ()
+(defclass modular-application-mixin ()
   ()
-  (:documentation "Superclass for all application mixins."))
+  (:documentation "Superclass for all application mixins."))
 
-(defclass modular-application (standard-application modular-application-mixin)
+(defclass modular-application (standard-application modular-application-mixin)
   ...)
 
@@ -197,8 +200,8 @@ Cookie

src/rerl/modular-application/cookie-module.lisp

-(defclass cookie-session-application-module (modular-application-mixin)
-  (:documentation "Class for applications which use cookies for sesion tracking.
+(defclass cookie-session-application-module (modular-application-mixin)
+  (:documentation "Class for applications which use cookies for sesion tracking.
 
 Cookie session applications work exactly like
 standard-applications except that when the session is not found
@@ -216,8 +219,8 @@ L10n
 

src/rerl/modular-application/l10n-module.lisp

-(defclass l10n-application-module (modular-application-mixin)
-  (:documentation "Application class which can handle l10n requests."))
+(defclass l10n-application-module (modular-application-mixin)
+  (:documentation "Application class which can handle l10n requests."))
 
@@ -227,9 +230,9 @@ Secure

src/rerl/modular-application/security-module.lisp

-(defclass secure-application-module (modular-application-mixin)
-  (:documentation
-    "Mixin class for applications which require authorized access.
+(defclass secure-application-module (modular-application-mixin)
+  (:documentation
+    "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)
@@ -250,8 +253,8 @@ metaclass is set.

src/rerl/standard-component/standard-component.lisp

-(defmacro defcomponent (name supers slots &rest options)
-  "Macro for defining a component class.
+(defmacro 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
@@ -282,8 +285,8 @@ extra options are allowed:
  CALL's this component class passing all the arguments passed to
  the action as initargs.")
 
-;;; Extra Slot Options
-"Other than the initargs for standard slots the following
+;;; Extra Slot Options
+"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
@@ -310,13 +313,13 @@ Windows
 

src/components/window.lisp

-(defclass window-component ()
+(defclass window-component ()
   ((content-type)))
 
-(defclass simple-window-component (window-component)
+(defclass simple-window-component (window-component)
   ((title)
    (stylesheet)
-   (javascript :documentation "List of javascript includes.
+   (javascript :documentation "List of javascript includes.
 
 Each element must be a list whose first value is either the
 symbol :SRC or :JS.
@@ -350,29 +353,29 @@ to insert messages into the browser status bar.

 (defcomponent status-bar ()
-  ((messages :documentation "An ALIST of the messages to
+  ((messages :documentation "An ALIST of the messages to
 show. Each element is a cons of the form (SEVERITY .
 MESSAGE). SEVERITY is one of :ERROR, :WARN, :INFO and MESSAGE is
 a string which will be html-escaped.")
    ...)
-  (:documentation "Stateless status bar to display messages."))
+  (:documentation "Stateless status bar to display messages."))
 
-(defgeneric add-message (status-bar msg &key severity &allow-other-keys)
-  (:documentation "Add the message text MSG to STATUS-BAR with
+(defgeneric add-message (status-bar msg &key severity &allow-other-keys)
+  (:documentation "Add the message text MSG to STATUS-BAR with
 severity SEVERITY."))
 
 (defcomponent status-bar-mixin ()
-  ((status-bar :accessor status-bar
-               :initarg status-bar
-               :component (status-bar))))
+  ((status-bar :accessor status-bar
+               :initarg status-bar
+               :component (status-bar))))
 
-(defmethod show-status-bar ((win status-bar-mixin))
+(defmethod show-status-bar ((win status-bar-mixin))
   (render (status-bar win)))
 
-(defgeneric show-message (msg &key severity &allow-other-keys)
-  (:documentation "Show a message in the status bar. Only works if
+(defgeneric show-message (msg &key severity &allow-other-keys)
+  (:documentation "Show a message in the status bar. Only works if
   current window is a status-bar-mixin"))
 
@@ -382,10 +385,10 @@ severity SEVERITY."
))

src/components/redirect.lisp

-(defclass redirect-component ()
-  ((target :accessor target :initarg :target))
-  (:metaclass standard-component-class)
-  (:documentation "Send a client redirect.
+(defclass redirect-component ()
+  ((target :accessor target :initarg :target))
+  (:metaclass standard-component-class)
+  (:documentation "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
@@ -399,7 +402,7 @@ The redirect component never answers."))
 
 
 (defun/cc meta-refresh ()
-  "Cause a meta-refresh (a freshly got (GET) url) at this point.
+  "Cause a meta-refresh (a freshly got (GET) url) at this point.
 This is useful in order to have a GET url after a form POST's
 actions have completed running. The user can then refresh to his
 heart's content.")
@@ -413,10 +416,10 @@ Containers
 

src/components/container.lisp

-(defclass container ()
+(defclass container ()
   (...)
-  (:metaclass standard-component-class)
-  (:documentation "Allow multiple components to share the same place.
+  (:metaclass standard-component-class)
+  (:documentation "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
@@ -448,8 +451,8 @@ be converted into (component . component) form."))
 

src/components/container.lisp

-(defclass switching-container ...
-  (:documentation "A simple renderable container component.
+(defclass switching-container ...
+  (:documentation "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
@@ -478,7 +481,7 @@ components."))
 
 
 (defcomponent tabbed-pane (switching-container)
-  (:documentation "Component for providing the user with a standard \"tabbed pane\" GUI widget."))
+  (:documentation "Component for providing the user with a standard \"tabbed pane\" GUI widget."))
 

Provides a generic tabbed pane that renders a nested div split into a @@ -498,9 +501,9 @@ user.

src/components/login.lisp

-(defclass login ()
+(defclass login ()
   ((username) (password) (message))
-  (:documentation "Generic login (input username and password) component.
+  (:documentation "Generic login (input username and password) component.
 
 This component, which must be embedded in another component,
 presents the user with a simple two fielded login form.
@@ -516,12 +519,12 @@ The default implementaion of login-successful simply answers t,
 no default implementation of check-credentials is
 provided. Developers should use sub-classes of login for which
 all the required methods have been definined.")
-  (:metaclass standard-component-class))
+  (:metaclass standard-component-class))
 
-(defgeneric check-credentials (login)
-  (:documentation "Returns T if LOGIN is valid."))
+(defgeneric check-credentials (login)
+  (:documentation "Returns T if LOGIN is valid."))
 
 (defaction login-successful ((l login))
   (answer t))
@@ -538,15 +541,15 @@ all the required methods have been definined.")
 protocol details follow.

-(defmethod check-credentials ((self user-login))
-  (let* ((username (value (username self)))
+(defmethod check-credentials ((self user-login))
+  (let* ((username (value (username self)))
          (password (value (password self)))
          (user (find-application-user username)))
-    (when (and user (check-user-password user password))
+    (when (and user (check-user-password user password))
       user)))
 
-(defgeneric application-find-user (application username)
-  (:documentation "Find USER by USERNAME for APPLICATION."))
+(defgeneric application-find-user (application username)
+  (:documentation "Find USER by USERNAME for APPLICATION."))
 
@@ -555,19 +558,19 @@ protocol details follow.

src/components/error.lisp

-(defclass error-message (simple-window-component)
-  ((message :accessor message :initarg :message :initform "ERROR [no message specified]"))
-  (:documentation "Generic component for showing server side
+(defclass error-message (simple-window-component)
+  ((message :accessor message :initarg :message :initform "ERROR [no message specified]"))
+  (:documentation "Generic component for showing server side
  error messages.")
-  (:metaclass standard-component-class))
+  (:metaclass standard-component-class))
 
-(defclass error-component (error-message)
-  ((condition :accessor error.condition :initarg :condition :initform nil)
-   (backtrace :accessor error.backtrace :initarg :backtrace))
-  (:documentation "Generic component for showing server side
+(defclass error-component (error-message)
+  ((condition :accessor error.condition :initarg :condition :initform nil)
+   (backtrace :accessor error.backtrace :initarg :backtrace))
+  (:documentation "Generic component for showing server side
  error conditions. Unlike ERROR-MESSAGE this component also
  attempts to display a backtrace.")
-  (:metaclass standard-component-class))
+  (:metaclass standard-component-class))
 
@@ -576,16 +579,16 @@ protocol details follow.

src/components/message.lisp

-(defclass info-message ()
-  ((message :initarg :message :accessor message)
-   (ok-text :initarg :ok-text :accessor ok-text :initform "Ok."))
-  (:documentation "Component for showing a message to the user.
+(defclass info-message ()
+  ((message :initarg :message :accessor message)
+   (ok-text :initarg :ok-text :accessor ok-text :initform "Ok."))
+  (:documentation "Component for showing a message to the user.
 
 If the OK-TEXT slot is non-NIL component will use that as the
 text for a link which, when clicked, causes the component to
 answer. It follows that if OK-TEXT is NIL this component will
 never answer.")
-  (:metaclass standard-component-class))
+  (:metaclass standard-component-class))
 
@@ -594,10 +597,10 @@ never answer.")

src/components/option-dialog.lisp

-(defclass option-dialog (template-component)
+(defclass option-dialog (template-component)
   ((message) (options) (confirm))
-  (:default-initargs :template-name "ucw/option-dialog.tal")
-  (:documentation "Component for querying the user.
+  (:default-initargs :template-name "ucw/option-dialog.tal")
+  (:documentation "Component for querying the user.
 
 The value of the slot MESSAGE is used as a general heading.
 
@@ -608,13 +611,13 @@ 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.")
-  (:metaclass standard-component-class))
+  (:metaclass standard-component-class))
 

A macro to present an option dialog is provided.

-(defmacro option-dialog ((message-spec &rest message-args) &body options)
+(defmacro option-dialog ((message-spec &rest message-args) &body options)
   ...)
 
@@ -632,28 +635,28 @@ Forms

src/components/form.lisp

-(defclass form-field ()
-  ((validators :documentation "List of validators which will be
+(defclass form-field ()
+  ((validators :documentation "List of validators which will be
                applied to this field.")
-   (initially-validate :documentation "When non-NIL the
+   (initially-validate :documentation "When non-NIL the
                        validators will be run as soon as the page
                        is rendered.")))
 
-(defgeneric value (form-field)
-  (:documentation "The lispish translated value that represents the form-field."))
-
-(defgeneric (setf value) (new-value form-field)
-  (:documentation "Set the value of a form-field with translation to client."))
-
-(defclass generic-html-input (form-field html-element)
-  ((client-value :accessor client-value :initarg :client-value
-                 :initform ""
-                 :documentation "The string the client submitted along with this field.")
-   (name :accessor name :initarg :name :initform nil)
-   (accesskey :accessor accesskey :initarg :accesskey :initform nil)
-   (tooltip :accessor tooltip :initarg :tooltip :initform nil)
-   (tabindex :accessor tabindex :initarg :tabindex :initform nil))
-  (:default-initargs :dom-id (js:gen-js-name-string :prefix "_ucw_")))
+(defgeneric value (form-field)
+  (:documentation "The lispish translated value that represents the form-field."))
+
+(defgeneric (setf value) (new-value form-field)
+  (:documentation "Set the value of a form-field with translation to client."))
+
+(defclass generic-html-input (form-field html-element)
+  ((client-value :accessor client-value :initarg :client-value
+                 :initform ""
+                 :documentation "The string the client submitted along with this field.")
+   (name :accessor name :initarg :name :initform nil)
+   (accesskey :accessor accesskey :initarg :accesskey :initform nil)
+   (tooltip :accessor tooltip :initarg :tooltip :initform nil)
+   (tabindex :accessor tabindex :initarg :tabindex :initform nil))
+  (:default-initargs :dom-id (js:gen-js-name-string :prefix "_ucw_")))
 

Fields are rendered into the extended <ucw:input yaclml tag which @@ -662,9 +665,9 @@ set to (client-value FIELD), and you should use value Lisp value associated with it.

-(deftag-macro <ucw:input (&attribute accessor action reader writer name id (default nil)
-                          &allow-other-attributes others)
-  "Generic INPUT tag replacement.
+(deftag-macro <ucw:input (&attribute accessor action reader writer name id (default nil)
+                          &allow-other-attributes others)
+  "Generic INPUT tag replacement.
 
 If the ACCESSOR attribute is specified then it must be a PLACE
 and it's value will be used to fill the input, when the form is
@@ -682,39 +685,39 @@ the latest wins.")
 list.

-(defclass validator ()
-  ((message :accessor message :initarg :message :initform nil)))
+(defclass validator ()
+  ((message :accessor message :initarg :message :initform nil)))
 
-(defgeneric validate (field validator)
-  (:documentation "Validate a form-field with a validator."))
+(defgeneric validate (field validator)
+  (:documentation "Validate a form-field with a validator."))
 
-(defgeneric javascript-check (field validator)
-  (:documentation "Generate javascript code for checking FIELD against VALIDATOR.
+(defgeneric javascript-check (field validator)
+  (:documentation "Generate javascript code for checking FIELD against VALIDATOR.
 
 This is the convenience entry point to generate-javascript-check,
 methods defined on this generic funcition should return a list of
 javascript code (as per parenscript) which tests against the
 javascript variable value."))
 
-(defgeneric javascript-invalid-handler (field validator)
-  (:documentation "The javascript code body for when a field is invalid."))
+(defgeneric javascript-invalid-handler (field validator)
+  (:documentation "The javascript code body for when a field is invalid."))
 
-(defgeneric javascript-valid-handler (field validator)
-  (:documentation "Generate the javascript body for when a field is valid."))
+(defgeneric javascript-valid-handler (field validator)
+  (:documentation "Generate the javascript body for when a field is valid."))
 
Standard Form Fields
-(defclass string-field (generic-html-input)
+(defclass string-field (generic-html-input)
   ((input-size) (maxlength)))
 
-(defclass password-field (string-field))
-(defclass number-field (string-field))
-(defclass integer-field (number-field))
+(defclass password-field (string-field))
+(defclass number-field (string-field))
+(defclass integer-field (number-field))
 
-(defclass in-field-string-field (string-field)
-  ((in-field-label :documentation "This slot, if non-NIL, will be
+(defclass in-field-string-field (string-field)
+  ((in-field-label :documentation "This slot, if non-NIL, will be
                    used as an initial field label. An initial
                    field label is a block of text which is placed
                    inside the input element and removed as soon
@@ -722,53 +725,53 @@ javascript variable value."))
                    field is overidden by an initial :client-value
                    argument.")))
 
-(defclass textarea-field (generic-html-input)
+(defclass textarea-field (generic-html-input)
   ((rows) (cols)))
 
-(defclass date-field (form-field widget-component)
+(defclass date-field (form-field widget-component)
   ((year) (month) (day)))
 
-(defclass dmy-date-field (date-field)
-  (:documentation "Date fields which orders the inputs day/month/year"))
-(defclass mdy-date-field (date-field))
+(defclass dmy-date-field (date-field)
+  (:documentation "Date fields which orders the inputs day/month/year"))
+(defclass mdy-date-field (date-field))
 
-(defclass select-field (generic-html-input)
-  ((data-set :documentation "The values this select chooses
+(defclass select-field (generic-html-input)
+  ((data-set :documentation "The values this select chooses
              from."))
-  (:documentation "Form field used for selecting one value from a
+  (:documentation "Form field used for selecting one value from a
   list of available options."))
 
-(defgeneric render-value (select-field value)
-  (:documentation "This function will be passed each value in the field's
+(defgeneric render-value (select-field value)
+  (:documentation "This function will be passed each value in the field's
    data-set and must produce the body of the corresponding
    <ucw:option tag."))
 
-(defclass mapping-select-field (select-field)
-  (:documentation "Class used when we want to chose the values of
+(defclass mapping-select-field (select-field)
+  (:documentation "Class used when we want to chose the values of
   a certain mapping based on the keys. We render the keys in the
   select and return the corresponding value from the VALUE
   method."))
 
-(defclass hash-table-select-field (mapping-select-field))
-(defclass alist-select-field (mapping-select-field))
-(defclass plist-select-field (mapping-select-field))
+(defclass hash-table-select-field (mapping-select-field))
+(defclass alist-select-field (mapping-select-field))
+(defclass plist-select-field (mapping-select-field))
 
-(defclass radio-group (generic-html-input)
+(defclass radio-group (generic-html-input)
   ((value-widgets)))
 
-(defclass radio-button (generic-html-input)
+(defclass radio-button (generic-html-input)
   ((value)
-   (group :documentation "The RADIO-GROUP this button is a part
+   (group :documentation "The RADIO-GROUP this button is a part
           of."))
-  (:documentation "A widget representing a single radio
+  (:documentation "A widget representing a single radio
   button. Should be used in conjunction with a RADIO-GROUP."))
 
-(defmethod add-value ((group radio-group) value)
-  "Adds radio-button with value to group")
+(defmethod add-value ((group radio-group) value)
+  "Adds radio-button with value to group")
 
-(defclass checkbox-field (generic-html-input))
-(defclass file-upload-field (generic-html-input))
-(defclass submit-button (generic-html-input)
+(defclass checkbox-field (generic-html-input))
+(defclass file-upload-field (generic-html-input))
+(defclass submit-button (generic-html-input)
   ((label)))
 
@@ -780,14 +783,14 @@ attached to the contents of the file. The Content-Type header shoul be set to the MIME type of the file being uploaded.

-(defgeneric mime-part-headers (mime-part)
-  (:documentation "Returns an alist of the headers of MIME-PART.
+(defgeneric mime-part-headers (mime-part)
+  (:documentation "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."))
 
-(defgeneric mime-part-body (mime-part)
-  (:documentation "Returns the body of MIME-PART."))
+(defgeneric mime-part-body (mime-part)
+  (:documentation "Returns the body of MIME-PART."))
 
@@ -795,35 +798,35 @@ VALUE are strings."
))
Standard Validators
-(defclass not-empty-validator (validator))
+(defclass not-empty-validator (validator))
 
-(defclass value-validator (validator)
-  (:documentation "Validators that should only be applied if there is a value.
+(defclass value-validator (validator)
+  (:documentation "Validators that should only be applied if there is a value.
 That is, they always succeed on nil."))
 
-(defclass length-validator (value-validator)
-  ((min-length :accessor min-length :initarg :min-length
-               :initform nil)
-   (max-length :accessor max-length :initarg :max-length
-               :initform nil)))
+(defclass length-validator (value-validator)
+  ((min-length :accessor min-length :initarg :min-length
+               :initform nil)
+   (max-length :accessor max-length :initarg :max-length
+               :initform nil)))
 
-(defclass string=-validator (validator)
-  ((other-field :accessor other-field :initarg :other-field))
-  (:documentation "Ensures that a field is string= to another one."))
+(defclass string=-validator (validator)
+  ((other-field :accessor other-field :initarg :other-field))
+  (:documentation "Ensures that a field is string= to another one."))
 
-(defclass regex-validator (value-validator)
-  ((regex :accessor regex :initarg :regex :initform nil)))
+(defclass regex-validator (value-validator)
+  ((regex :accessor regex :initarg :regex :initform nil)))
 
-(defclass e-mail-address-validator (regex-validator))
+(defclass e-mail-address-validator (regex-validator))
 
-(defclass phone-number-validator (regex-validator))
+(defclass phone-number-validator (regex-validator))
 
-(defclass is-a-number-validator (value-validator))
-(defclass is-an-integer-validator (is-a-number-validator))
+(defclass is-a-number-validator (value-validator))
+(defclass is-an-integer-validator (is-a-number-validator))
 
-(defclass number-range-validator (is-a-number-validator)
-  ((min-value :accessor min-value :initarg :min-value :initform nil)
-   (max-value :accessor max-value :initarg :max-value :initform nil)))
+(defclass number-range-validator (is-a-number-validator)
+  ((min-value :accessor min-value :initarg :min-value :initform nil)
+   (max-value :accessor max-value :initarg :max-value :initform nil)))
 
@@ -835,13 +838,13 @@ the form boilerplate and then calls your render.

 (defcomponent simple-form (html-element)
-  ((submit-method :accessor submit-method
-                  :initform "post"
-                  :initarg :submit-method)
-   (dom-id :accessor dom-id
-           :initform (js:gen-js-name-string :prefix "_ucw_simple_form_")
-           :initarg :dom-id))
-  (:default-initargs :dom-id "ucw-simple-form"))
+  ((submit-method :accessor submit-method
+                  :initform "post"
+                  :initarg :submit-method)
+   (dom-id :accessor dom-id
+           :initform (js:gen-js-name-string :prefix "_ucw_simple_form_")
+           :initarg :dom-id))
+  (:default-initargs :dom-id "ucw-simple-form"))
 
@@ -854,21 +857,21 @@ Templates

Infrastructure for loading TAL templates as a view of a component.

-(defclass template-component (component))
+(defclass template-component (component))
 (defcomponent simple-template-component (template-component)
-  ((environment :initarg :environment :initform nil)))
+  ((environment :initarg :environment :initform nil)))
 
-(defgeneric template-component-environment (component)
-  (:documentation "Create the TAL environment for rendering COMPONENT's template.
+(defgeneric template-component-environment (component)
+  (:documentation "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-ENVIRONMENT for details on TAL
 environments.)")
-  (:method-combination nconc))
+  (:method-combination nconc))
 
-(defmethod template-component-environment nconc ((component template-component))
-  "Create the basic TAL environment.
+(defmethod template-component-environment nconc ((component template-component))
+  "Create the basic TAL environment.
 
 Binds the symbol ucw:component to the component object itself,
 also puts the object COMPONENT on the environment (after the
@@ -876,8 +879,8 @@ binding of ucw:component) so that slots are, by default,
 visable."
   (make-standard-environment `((component . ,component)) component))
 
-(defmethod render ((component template-component))
-  "Render a template based component.
+(defmethod render ((component template-component))
+  "Render a template based component.
 
 Calls the component's template. The name of the template is the
 value returned by the generic function
@@ -903,9 +906,9 @@ Utility Mixin Components
 

src/components/range-view.lisp

-(defclass range-view (template-component)
-  (:default-initargs :template-name "ucw/range-view.tal")
-  (:documentation "Component for showing the user a set of data one \"window\" at a time.
+(defclass range-view (template-component)
+  (:default-initargs :template-name "ucw/range-view.tal")
+  (:documentation "Component for showing the user a set of data one \"window\" at a time.
 
 The data set is presented one \"window\" at a time with links to
 the the first, previous, next and last window. Each window shows
@@ -918,16 +921,16 @@ 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 RANGE-VIEW
 and define their RENDER-RANGE-VIEW-ITEM methods on that.")
-  (:metaclass standard-component-class))
+  (:metaclass standard-component-class))
 
-(defgeneric render-range-view-item (range-view item)
-  (:documentation "Render a single element of a range-view.")
-  (:method ((range-view range-view) (item t))
-    "Standard implementation of RENDER-RANGE-VIEW-ITEM. Simply
+(defgeneric render-range-view-item (range-view item)
+  (:documentation "Render a single element of a range-view.")
+  (:method ((range-view range-view) (item t))
+    "Standard implementation of RENDER-RANGE-VIEW-ITEM. Simply
 applies ITEM to princ (via <:as-html)."
-    (declare (ignore range-view))
+    (declare (ignore range-view))
     (<:as-html item)))
 
@@ -940,13 +943,13 @@ for defining lightweight widgets embedded within other components.

src/components/html-element.lisp

-(defclass html-element (component)
+(defclass html-element (component)
   ((css-class)
    (dom-id)
    (css-style)
    (extra-tags)
    (events))
-  (:documentation "An HTML element.
+  (:documentation "An HTML element.
 
 HTML elements control aspects that are relevant to almost all tags.
 
@@ -968,16 +971,16 @@ added."))
 

src/components/widget.lisp

-(defclass widget-component (html-element)
+(defclass widget-component (html-element)
   ()
-  (:documentation "A widget which should be wrapped in a <div>."))
+  (:documentation "A widget which should be wrapped in a <div>."))
 
-(defclass inline-widget-component (html-element)
+(defclass inline-widget-component (html-element)
   ()
-  (:documentation "A widget which should be wrapped in <span> and not <div>"))
+  (:documentation "A widget which should be wrapped in <span> and not <div>"))
 
-(defmethod render :wrap-around ((widget widget-component)))
-(defmethod render :wrap-around ((widget inline-widget-component)))
+(defmethod render :wrap-around ((widget widget-component)))
+(defmethod render :wrap-around ((widget inline-widget-component)))
 
@@ -1010,9 +1013,9 @@ into a task.

src/components/task.lisp

-(defclass task-component (standard-component)
+(defclass task-component (standard-component)
   (...)
-  (:documentation "A controller for a single task or operation to
+  (:documentation "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
@@ -1021,7 +1024,7 @@ RENDER method, in fact they have no graphical representation but
 serve only to order a sequence of other components."))
 
 (defgeneric/cc start (task)
-  (:documentation "action which gets called automatically when
+  (:documentation "action which gets called automatically when
 task-component is active. Use defaction to define your own
 \"start\" action"))
 
@@ -1033,18 +1036,18 @@ task-component is active. Use defaction to define your own
 (defcomponent cached-component ()
-  ((cached-output :accessor cached-output :initform nil
-                  :documentation "A string holding the output to
+  ((cached-output :accessor cached-output :initform nil
+                  :documentation "A string holding the output to
                   use for this component. This string will be
                   written directly to the html stream and is
                   changed by the REFRESH-COMPONENT-OUTPUT
                   method." )
-   (timeout :accessor timeout :initarg :timeout
-            :documentation "An value specifying how often this
+   (timeout :accessor timeout :initarg :timeout
+            :documentation "An value specifying how often this
             component needs to be refreshed. The exact
             interpretation of the value depends on the type of
             caching used class."))
-  (:documentation "Component which caches its output.
+  (:documentation "Component which caches its output.
 
 The component caching API is built around the generic functions
 COMPONENT-DIRTY-P and REFRESH-COMPONENT-OUTPUT and a method on
@@ -1052,26 +1055,26 @@ RENDER, see the respective docstrings for more details.
 
 Do not use CACHED-COMPONENT directly, use one its subclasses."))
 
-(defgeneric component-dirty-p (component)
-  (:documentation "Returns T is COMPONENT's cache is invalid."))
+(defgeneric component-dirty-p (component)
+  (:documentation "Returns T is COMPONENT's cache is invalid."))
 
-(defgeneric update-cache (component)
-  (:documentation "Update COMPONENT's cache variables after a refresh."))
+(defgeneric update-cache (component)
+  (:documentation "Update COMPONENT's cache variables after a refresh."))
 
 (defcomponent timeout-cache-component (cached-component)
-  ((last-refresh :accessor last-refresh :initform nil
-                 :documentation "The time, exrpessed as a
+  ((last-refresh :accessor last-refresh :initform nil
+                 :documentation "The time, exrpessed as a
                  universal time, when the component was last rendered."))
-  (:default-initargs
-   :timeout (* 30 60 60))
-  (:documentation "Render the component at most every TIMEOUT seconds."))
+  (:default-initargs
+   :timeout (* 30 60 60))
+  (:documentation "Render the component at most every TIMEOUT seconds."))
 
 (defcomponent num-hits-cache-component (cached-component)
-  ((hits-since-refresh :accessor hits-since-refresh
-                       :initform nil
-                       :documentation "Number of views since last refresh."))
-  (:default-initargs :timeout 10)
-  (:documentation "Render the component every TIMEOUT views."))
+  ((hits-since-refresh :accessor hits-since-refresh
+                       :initform nil
+                       :documentation "Number of views since last refresh."))
+  (:default-initargs :timeout 10)
+  (:documentation "Render the component every TIMEOUT views."))
 

Subclass and override component-dirty-p to do something useful @@ -1096,8 +1099,8 @@ you want to render a component in place as part of another component just call render on it instead.

-(defmacro call (component-type &rest component-init-args)
-  "Stop the execution of the current action and pass control to
+(defmacro call (component-type &rest component-init-args)
+  "Stop the execution of the current action and pass control to
 a freshly created component of type COMPONENT-TYPE.
 
 COMPONENT-INIT-ARGS are passed directly to the underlying
@@ -1110,15 +1113,15 @@ Notes:
 This macro assumes that the lexcial variable UCW:SELF is bound to
 the calling component.")
 
-(answer VAL) ; answer parent component ONLY IN ACTIONS
+(answer VAL) ; answer parent component ONLY IN ACTIONS
 
-(ok SELF VAL) ; Used to answer a component anywhere and what answer
-              ; expands into
+(ok SELF VAL) ; Used to answer a component anywhere and what answer
+              ; expands into
 
-(jump COMPONENT-NAME &REST ARGS) ; is similar to call, but replaces
-                                 ; the current component with the new
-                                 ; one and drops any backtracks (back
-                                 ; button will no longer work)
+(jump COMPONENT-NAME &REST ARGS) ; is similar to call, but replaces
+                                 ; the current component with the new
+                                 ; one and drops any backtracks (back
+                                 ; button will no longer work)
 

(call COMPONENT-NAME &ARGS INIT-ARGS) calls COMPONENT-NAME and returns @@ -1134,9 +1137,9 @@ component for most of UCW to work.

 (defaction NAME (first ...) ...)
- ;  (roughly) expands into
+ ;  (roughly) expands into
 (defmethod/cc NAME (first ...)
-  (let ((self first))
+  (let ((self first))
     ...))
 
@@ -1151,9 +1154,9 @@ macroexpansion!").

Entry Points
-(defentry-point url (:application APPLICATION
-                     :class DISPATCHER-CLASS)
-   (PARAM1 ... PARAMN) ; GET / POST vars, bound in body
+(defentry-point url (:application APPLICATION
+                     :class DISPATCHER-CLASS)
+   (PARAM1 ... PARAMN) ; GET / POST vars, bound in body
   body)
 
@@ -1164,15 +1167,15 @@ follows. The entry point allows files to be streamed to user when the url audio.ucw?file=FOO is used.

-(defentry-point "^(audio.ucw|)$" (:application *golf-test-app*
-                                  :class regexp-dispatcher)
+(defentry-point "^(audio.ucw|)$" (:application *golf-test-app*
+                                  :class regexp-dispatcher)
     (file)
   (call 'audio-file-window
-   :audio-file (make-instance 'audio-file
-                :type :vorbis
-                :data (file->bytes (open
+   :audio-file (make-instance 'audio-file
+                :type :vorbis
+                :data (file->bytes (open
                                     file
-                                    :element-type 'unsigned-byte)))))
+                                    :element-type 'unsigned-byte)))))
 
@@ -1183,8 +1186,8 @@ Dispatching

src/rerl/standard-dispatcher.lisp

-(defgeneric matcher-match (matcher application context)
-  (:documentation "Abstract method for subclasses to implement a
+(defgeneric matcher-match (matcher application context)
+  (:documentation "Abstract method for subclasses to implement a
 matcher.  This method would return multiple-values according to
 matcher internal nature.
 
@@ -1194,16 +1197,16 @@ 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*."))
 
-(defgeneric handler-handle (handler application context matcher-result)
-  (:documentation "Abstract function for handler classes to
+(defgeneric handler-handle (handler application context matcher-result)
+  (:documentation "Abstract function for handler classes to
 implement in order to handle a request matched by relevant
 matcher.
 
 These methods may modify context as they wish since they'r
 matched, request will be closed after this method is run."))
 
-(defgeneric dispatch (dispatcher application context)
-  (:documentation "Entry point into a dispatcher. Must return T
+(defgeneric dispatch (dispatcher application context)
+  (:documentation "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
@@ -1214,9 +1217,9 @@ application nor rebind *context*."))
 
-(defclass my-matcher    (abstract-matcher)    ...)
-(defclass my-handler    (abstract-handler)    ...)
-(defclass my-dispatcher (abstract-dispatcher my-matcher my-handler)
+(defclass my-matcher    (abstract-matcher)    ...)
+(defclass my-handler    (abstract-handler)    ...)
+(defclass my-dispatcher (abstract-dispatcher my-matcher my-handler)
   ...)
 
@@ -1224,7 +1227,7 @@ application nor rebind *context*."
)) Simple Dispatcher
-(:documentation "This class of dispatchers avoids all of UCW's
+(:documentation "This class of dispatchers avoids all of UCW's
   standard call/cc (and therefore frame/backtracking/component)
   mechanism.
 
@@ -1240,15 +1243,15 @@ Server
 

src/control.lisp

-(defun create-server (&key
-                      (backend `(,*ucw-backend-type* :host ,*ucw-backend-host*
-                                 :port ,*ucw-backend-port*))
+(defun create-server (&key
+                      (backend `(,*ucw-backend-type* :host ,*ucw-backend-host*
+                                 :port ,*ucw-backend-port*))
                       (applications *ucw-applications*)
                       (start-p t)
                       (server-class *ucw-server-class*)
                       (log-root-directory (truename *ucw-log-root-directory*))
                       (log-level *ucw-log-level*))
-  "Creates and returns a UCW server according to SERVER-CLASS, HOST and
+  "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
@@ -1265,7 +1268,7 @@ server.
 Logs are generated in verbosity defined by LOG-LEVEL and directed to
 LOG-ROOT-DIRECTORY if defined."
   ...
-  server) ; return server, naturally
+  server) ; return server, naturally
 
@@ -1279,8 +1282,8 @@ Inspector
 (defaction call-inspector ((component component) datum)
-  "Call an inspector for DATUM on the component COMPONENT."
-  (call 'ucw-inspector :datum datum))
+  "Call an inspector for DATUM on the component COMPONENT."
+  (call 'ucw-inspector :datum datum))
 
@@ -1300,8 +1303,8 @@ must also have the / (which is counterintuitive given the behavior most unix things that don't want the / at the end of the name).

-:www-roots (list '("dojo/" .
-                   #P"/home/clinton/src/ucw/darcs/ucw_dev/wwwroot/dojo/"))
+:www-roots (list '("dojo/" .
+                   #P"/home/clinton/src/ucw/darcs/ucw_dev/wwwroot/dojo/"))
 
@@ -1349,11 +1352,10 @@ you wish to have content interspersed with yaclml tags.

-

Last Modified: March 13, 2008