Version 1 (modified by tstuij, 8 years ago)

--

Advanced form handling <- back | toc | forward -> Miscellaneous

Debugging

Next to your standard debugging aids, ucw sports a few extra methods like debugging output deferred to the callers web-page and calling components from the repl.

First for completeness the different debugging switches and levers described at their respective sections: The ucw-inspector and ucw-debugger web-switch described in the configuration section, the log-level lever described in the configuration section, and the debug-on-error switch of an application described in the initial environment section.

Furthermore, your standard ucw-sources come supplied with an administration page that is divided in a few sections. Click UCW web-admin from the examples page and log in with guest:guest. Ah, just play around. It's got some info screens, configure switches, a web-repl and a web inspector.

Last but certainly not least: Perhaps you would like to test your components at the repl. There is a problem here because calling components requires you to include some context-information that's normally only present when ucw actually tries to handle incoming requests. To circumvent this problem ucw has a with-dummy-request macro on board. It accepts a list of keys and a body. The keys are :render :action and :application. Render defaults to t, which means the component will be rendered and the output will be shown on *trace-output*. If nil no output. If :action is true (by default), the body will be treated as an action, if not it will be wrapped in a progn. With application you can pass an application object. If it's not given, the macro will try *default-application*, else a standard-application will be created. With url-prefix /DUMMY/, although that is a bit irrelevant. The output of with-dummy-request-context is the output of the render method followed by the component under scrutiny, so you wish to inspect it:

UCW-INTRO> (with-dummy-context (:action nil :application *ucw-intro-application*)
    (call 'tal-component))
    
-->
16:36 UCW-LOGGER/+INFO+: CALL'ing to /#<BASICS {AE183A1}> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
<html
  ><head
...
  ></html
>
#<BASICS {AE183A1}>
    
UCW-INTRO> (with-dummy-context ()
             (get-stuff-to-say * "bla"))
    
-->
16:40 UCW-LOGGER/+INFO+: Serving action (/#<BASICS {B00FDA9}>/UCW-INTRO::GET-STUFF-TO-SAY #<BASICS {B00FDA9}> "bla")
16:40 UCW-LOGGER/+INFO+: CALL'ing to /#<THE-OTHER-ONE {B1707B1}> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
<html
  ><head
...
  ></html
>
    
UCW-INTRO> (with-dummy-context (:render nil :application *ucw-intro-application*)
                      (call 'tal-component))
    
-->
; in: LAMBDA NIL
;     (IT.BESE.UCW:CONTEXT.WINDOW-COMPONENT IT.BESE.UCW:*CONTEXT*)
; ==>
;   IT.BESE.UCW:*CONTEXT*
; 
; note: deleting unreachable code
; 
; compilation unit finished
;   printed 1 note
16:48 UCW-LOGGER/+INFO+: CALL'ing to /#<TAL-COMPONENT {B6EEE21}> 
#<TAL-COMPONENT {B6EEE21}>
    

Advanced form handling <- back | toc | forward -> Miscellaneous