Posted to tcl by colin at Wed Jul 29 09:33:48 GMT 2009view raw

  1. Nub code /select/ {
  2. <form> action /deliver/ method post [subst {
  3. [<fieldset> fs title "Select Item" {
  4. [<text> number legend "Item Number:" {}]
  5. [<submit> submit Ok]
  6. }]
  7. }]
  8. }
  9.  
  10. Nub code /deliver/ {
  11. dict set r -Query [Query parse $r]
  12. set query [Query flatten [dict get $r -Query]]
  13. set number [dict get $query number]
  14.  
  15. # ... TODO run the process as an [open |prog], consume the input and call [done $r $content]
  16.  
  17. return [Httpd Suspend $r 100000]
  18. }
  19.  
  20. proc done {r content} {
  21. dict set r -content $content
  22. dict set r content-type application/pdf
  23. Httpd Resume $r
  24. }