xo::Package instproc reply_to_user (public)

 <instance of xo::Package[i]> reply_to_user text

Defined in /var/www/openacs/packages/xotcl-core/tcl/06-package-procs.tcl

Apply the HTTP caching policy and run any pending continuation. Otherwise, send the response through the package delivery handler.

Parameters:
text (required)
Response body.

Testcases:
create_folder_with_page, create_workflow_with_instance, create_form_with_form_instance
Source code:

:handle_http_caching

#:log "REPLY [::xo::cc exists __continuation]"
if {[::xo::cc exists __continuation]} {
  #:log "REPLY [::xo::cc set __continuation]"
  eval [::xo::cc set __continuation]
} else {
  if {[string length $text] > 1} {
    set default_status_code 200
  } else {
    set default_status_code 204
  }
  set status_code [expr {[::xo::cc exists status_code]
                         ? [::xo::cc set status_code]
                         : $default_status_code}]
  #:log "REPLY ${:delivery} $status_code ${:mime_type} - length: [string length $text] - [ad_conn peeraddr]"
  ${:delivery} $status_code ${:mime_type} $text
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: