Index: openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl,v diff -u -r1.93.2.41 -r1.93.2.42 --- openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 16 Sep 2021 08:52:58 -0000 1.93.2.41 +++ openacs-4/packages/xotcl-core/tcl/01-debug-procs.tcl 4 Oct 2021 17:18:27 -0000 1.93.2.42 @@ -152,7 +152,7 @@ ::nx::Slot method type=localurl ::nx::Slot method type=html ::nx::Slot method type=nohtml - ::nx::Slot method type=range + ::nx::Slot method type=range ::nx::Object nsfproc ::nsf::debug::call ::nx::Object nsfproc ::nsf::debug::exit } @@ -263,6 +263,7 @@ ns_set update $form show_source [::xo::cc query_parameter show_source:integer 1] ns_set update $form show_methods [::xo::cc query_parameter show_methods:integer 2] ns_set update $form show_variables [::xo::cc query_parameter show_variables:integer 1] + ns_set update $form as_img 1 rp_internal_redirect /packages/xotcl-core/www/show-object ad_script_abort } Index: openacs-4/packages/xotcl-core/www/show-object.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/www/show-object.tcl,v diff -u -r1.27.2.7 -r1.27.2.8 --- openacs-4/packages/xotcl-core/www/show-object.tcl 4 Oct 2021 14:22:36 -0000 1.27.2.7 +++ openacs-4/packages/xotcl-core/www/show-object.tcl 4 Oct 2021 17:18:27 -0000 1.27.2.8 @@ -1,7 +1,10 @@ ad_page_contract { Show an XOTcl class or object + @param as_img do NOT include svg content in the HTML rendering + @author Gustaf Neumann + @cvs-id $Id$ } -query { {object:nohtml,trim ::xotcl::Object} @@ -403,9 +406,13 @@ } } -if {$as_img} { +# +# "as_img" true means: do not include SVG in the code. +# +if {!$as_img} { # - # Construct the dot code from the provided classes. + # Construct the dot code from the provided classes as embedded svg + # code. # # TODO: it would be nice to pass the selected options from the # dimensional slider to dotcode, since with svg, the dot code @@ -421,19 +428,22 @@ set dot "" catch {set dot [::util::which dot]} # final resort for cases, where ::util::which is not available - if {$dot eq "" && [file executable /usr/bin/dot]} {set dot /usr/bin/dot} + if {$dot eq "" && [file executable /usr/bin/dot]} { + set dot /usr/bin/dot + } if {$dot eq ""} { #ns_return 404 plain/text "dot not found" ns_log warning "program 'dot' is not available" #ad_script_abort } else { - set svgfile [ad_tmpnam].svg - #ns_log notice "svg $svgfile" + set stem [ad_tmpnam] + set svgfile $stem.svg + set dotfile $stem.dot - set f [open "|$dot -Tsvg -o $svgfile" w]; puts $f $dot_code + set f [open $dotfile w]; puts $f $dot_code; close $f try { - close $f + exec $dot -Tsvg -o $svgfile $dotfile } on error {errorMsg} { ns_log warning "dot returned $errorMsg" } @@ -448,7 +458,7 @@ set svg "
$svg
" file delete -- $svgfile - #file delete -- $dotfile + file delete -- $dotfile } }