Index: openacs-4/packages/acs-tcl/tcl/db-query-dispatcher-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/db-query-dispatcher-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-tcl/tcl/db-query-dispatcher-procs.tcl 15 Apr 2001 23:09:55 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/db-query-dispatcher-procs.tcl 16 Apr 2001 04:46:21 -0000 1.5 @@ -152,27 +152,52 @@ return $local_name } + # Test stuff (ben) + for {set i 0} {$i < 5} {incr i} { + if {[catch {ns_log Notice "QD = LEVEL $i = [info level [expr "0 - $i"]]"} errmsg]} { + break + } + } + # Get the proc name being executed. set proc_name [info level [expr "-1 - $added_stack_num"]] # We check if we're running the special ns_ proc that tells us # whether this is an URL or a Tcl proc. - if {[regexp {^ns_sourceproc} $proc_name all]} { + if {[regexp {^ns_sourceproc} $proc_name all] || \ + [regexp {^acs_source} $proc_name all]} { # Means we are running inside an URL + # Now we do a check to see if this is a directly accessed URL or a sourced URL + if {[regexp {^ns_sourceproc} $proc_name all]} { + set real_url_p 1 + set url [ns_conn url] + } else { + set real_url_p 0 + set url [lindex $proc_name 1] + set url [ad_make_relative_path $url] + regsub {^/?packages} $url {} url + } + # Get the URL and remove the .tcl - set url [ns_conn url] + regsub {^/} $url {} url regsub {\.tcl$} $url {} url # Change all dots to colons, and slashes to dots regsub -all {\.} $url {:} url regsub -all {/} $url {.} url # We insert the "www" after the package key - regexp {^([^\.]*)(.*)} url all package_key rest + regexp {^([^\.]*)(.*)} $url all package_key rest - set full_name "acs.${package_key}.www.${rest}.${local_name}" + ns_log Notice "QD = package key is $package_key and rest is $rest" + + if {$real_url_p} { + set full_name "acs.${package_key}.www${rest}.${local_name}" + } else { + set full_name "acs.${package_key}${rest}.${local_name}" + } } else { # Let's find out where this Tcl proc is defined!! # Get the first word, which is the Tcl proc