UCW

Standard RERL Implementation 

STANDARD-SERVER 

(defgeneric dump-applications (server output-file-name))

STANDARD-APPLICATION 

(defgeneric entry-point-match (entry-point effective-query-path)
  (:documentation "Returns T if ENTRY-POINT should handle
  EFFECTIVE-QUERY-PATH. EFFECTIVE-QUERY-PATH. is a string
  representing the request's query-path but with application's
  url-prefix removed. The name could be improved.")
  (:method ((entry-point standard-entry-point) (query-path string))
    (string= (entry-point.url entry-point) query-path))
  (:method ((entry-point regexp-entry-point) (query-path string))
    (cl-ppcre:scan (entry-point.url entry-point) query-path)))

STANDARD-SESSION 

Cookie session 

STANDARD-SESSION-FRAME 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Servicing session frame

Call, Answer, Defaction and Defentry-Point 

Call/Answer vodoo

Binding request params to variables

(defstruct arg-spec
  symbol
  name-string
  default-value
  supplied-symbol-name)

Defining actions and entry points

Backtracking  

Places

Backtracking

Error handling 

Our simple wrapper around slime's backtrace lists. 

(defstruct backtrace-frame
  index
  description
  locals
  source-location)

Handling internal UCW errors 

(defgeneric handle-request-error (error backtrace))

Handling user errors 

(defgeneric handle-action-error (error backtrace)
  (:documentation "Method called when a user defined action
  signals an error."))
(defgeneric handle-action-error-using-application
    (application error backtrace)
  (:documentation
   "Hook for application specific error handilng code.

Please rename me. Please, God please!"))

Generating bug reports in emacs 

RERL Conditions 

(define-condition rerl-error (error)
  ((context :initarg :context :accessor rerl-error.context :initform *context*))
  (:documentation "An error signalled during the request processing chain."))

Conditions relating to badly formed requests. Generally this means that some essential piece of information was either missing or unrecognizable.

(define-condition inexistent-request-part (rerl-error)
  ((query-path :initarg :query-path :accessor rerl-error.query-path
               :initform "#<unknown>"))
  (:documentation "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."))
(define-condition inexistent-application-name (inexistent-request-part)
  ()
  (:documentation "Signalled when the server can't determine an
application for a particular request."))
(define-condition inexistent-entry-point (inexistent-request-part)
  ((application :initarg :application)
   (action-name :initarg :action-name)))
(define-condition inexistent-session-id (inexistent-request-part)
  ((application :initarg :application)
   (session-id :initarg :session-id)))
(define-condition inexistent-frame-id (inexistent-request-part)
  ((session :initarg :session)
   (frame-id :initarg :frame-id)))
(define-condition inexistent-callback-id (inexistent-request-part)
  ((application :initarg :application)
   (session :initarg :session)
   (frame :initarg :frame)
   (callback-id :initarg :callback-id)))
(define-condition inexistent-action-id (inexistent-request-part)
  ((frame :initarg :frame)
   (action-id :initarg :action-id)))
(define-condition badly-formatted-request (rerl-error)
  ()
  (:documentation "Class of errors signaled when a particular
  id (application, session, frame or action) is not found in the
  request."))
(define-condition session-id-missing (badly-formatted-request)
  ())
(define-condition frame-id-missing (badly-formatted-request)
  ())
(define-condition action-id-missing (badly-formatted-request)
  ())
(define-condition callback-error (rerl-error)
  ()
  (:documentation "An error has occured while handling a callback."))
(define-condition action-error (rerl-error)
  ()
  (:documentation "An error has occured during the execution of an action."))
(define-condition render-error (rerl-error)
  ()
  (:documentation "An error has occured while rendering a component."))

Standard RERL configuration variables 

Standard Component