Index: openacs-4/packages/acs-content-repository/sql/postgresql/doc-package.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/sql/postgresql/doc-package.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/sql/postgresql/doc-package.sql 28 Mar 2001 02:15:10 -0000 1.2 +++ openacs-4/packages/acs-content-repository/sql/postgresql/doc-package.sql 9 May 2001 05:15:58 -0000 1.3 @@ -25,12 +25,9 @@ declare proc_name alias for $1; package_name alias for $2; - v_function_name varchar; begin - v_function_name := package_name || ''__'' proc_name; - return get_func_header(v_function_name); - + return definition from acs_func_headers where fname = proc_name::name limit 1; end;' language 'plpgsql'; Index: openacs-4/packages/acs-content-repository/tcl/doc-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/doc-procs-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-content-repository/tcl/doc-procs-postgresql.xql 27 Apr 2001 02:27:09 -0000 1.1 +++ openacs-4/packages/acs-content-repository/tcl/doc-procs-postgresql.xql 9 May 2001 05:15:58 -0000 1.2 @@ -38,7 +38,7 @@ select - proname as line_header + 'function ' || proname as line_header from pg_proc where @@ -53,7 +53,7 @@ select - proname as line_header + 'function ' || proname as line_header from pg_proc where Index: openacs-4/packages/acs-content-repository/tcl/doc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/doc-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/doc-procs.tcl 27 Apr 2001 02:27:09 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/doc-procs.tcl 9 May 2001 05:15:58 -0000 1.3 @@ -7,7 +7,7 @@ namespace eval doc { # Set up a data source with overall package info (overview, see also, etc.) - proc package_info { package_name info_ref } { + ad_proc -public package_info { package_name info_ref } { upvar $info_ref info @@ -36,7 +36,7 @@ # Retreive the function header for a specific function # and parse out the javadoc comment - proc get_proc_header { proc_name package_name doc_ref code_ref { db "" } } { + ad_proc -public get_proc_header { proc_name package_name doc_ref code_ref { db "" } } { variable start_text; variable end_text; @@ -64,7 +64,7 @@ # Prepare a multirow datasource for the param tags # Prepare a onerow datasource for all the other tags - proc parse_proc_header { doc_block code_block param_ref tags_ref code_ref {level 2}} { + ad_proc -public parse_proc_header { doc_block code_block param_ref tags_ref code_ref {level 2}} { upvar $level "${param_ref}:rowcount" param_rowcount upvar $level $tags_ref tags @@ -110,15 +110,15 @@ # Query the database and prepare the datasources # The user should call this procedure - proc get_proc_doc { proc_name package_name param_ref tags_ref code_ref args } { + ad_proc -public get_proc_doc { proc_name package_name param_ref tags_ref code_ref args } { upvar $tags_ref tags set opts(db) "" template::util::get_opts $args - get_proc_header $proc_name $package_name doc_block code_block $opts(db) - parse_proc_header $doc_block $code_block $param_ref $tags_ref $code_ref + doc::get_proc_header $proc_name $package_name doc_block code_block $opts(db) + doc::parse_proc_header $doc_block $code_block $param_ref $tags_ref $code_ref # Get the proc name if { [template::util::is_nil tags(name)] } { @@ -150,7 +150,7 @@ # Return a list of all the packages in the data model, in form # { {label value} {label value} ... } - proc package_list { {db ""} } { + ad_proc -public package_list { {db ""} } { template::query get_packages result multilist " select distinct @@ -169,7 +169,7 @@ # Return a list of all the function creation headers in a package, in form # { value value ... } - proc func_list { package_name {db ""} } { + ad_proc -public func_list { package_name {db ""} } { template::query get_funcs result multilist " select distinct @@ -202,7 +202,7 @@ # Return a multirow datatsource for all the functions # { value value ... } - proc func_multirow { package_name result_ref {db ""} } { + ad_proc -public func_multirow { package_name result_ref {db ""} } { upvar "${result_ref}:rowcount" result_rowcount set result_rowcount 0 Index: openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl 27 Apr 2001 02:27:09 -0000 1.2 +++ openacs-4/packages/acs-content-repository/tcl/filter-procs.tcl 9 May 2001 05:15:58 -0000 1.3 @@ -22,7 +22,7 @@ # If the value resulting from the search does not start with a '/' # it is taken to be relative to [acs_root_dir] -proc get_template_root {} { +ad_proc -public get_template_root {} { # Look for package-defined root set package_id [ad_conn package_id] @@ -48,21 +48,21 @@ # return true if the request has content associated with it -proc has_content {} { +ad_proc -public has_content {} { variable item_id return [info exists item_id] } -proc get_item_id {} { +ad_proc -public get_item_id {} { variable item_id return $item_id } -proc get_content {} { +ad_proc -public get_content {} { variable item_id variable revision_id @@ -137,7 +137,7 @@ } -proc get_template_url {} { +ad_proc -public get_template_url {} { variable template_url @@ -147,7 +147,7 @@ # Set a data source in the calling frame with folder URL and label # Useful for generating a context bar -proc get_folder_labels { { varname "folders" } } { +ad_proc -public get_folder_labels { { varname "folders" } } { variable item_id @@ -189,7 +189,7 @@ } } -proc init { urlvar rootvar {content_root ""} {template_root ""} {context "public"}} { +ad_proc -public init { urlvar rootvar {content_root ""} {template_root ""} {context "public"}} { upvar $urlvar url $rootvar root_path @@ -271,7 +271,7 @@ # render the template and write it to the file system -proc deploy { url_stub } { +ad_proc -public deploy { url_stub } { set output_path [ns_info pageroot]$url_stub Index: openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl 3 May 2001 04:00:49 -0000 1.3 +++ openacs-4/packages/acs-content-repository/tcl/revision-procs.tcl 9 May 2001 05:15:58 -0000 1.4 @@ -1,6 +1,6 @@ # upload an item revision from a file -proc cr_revision_upload { title item_id path } { +ad_proc -public cr_revision_upload { title item_id path } { set revision_id [db_exec_plsql get_revision_id "begin :1 := content_revision.new(title => :title, Index: openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/00-database-procs-postgresql.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl 6 May 2001 14:53:16 -0000 1.12 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl 9 May 2001 05:15:58 -0000 1.13 @@ -189,7 +189,7 @@ return $lsql } -ad_proc -private db_exec { type db statement_name pre_sql args } { +ad_proc -private db_exec { type db statement_name pre_sql {ulevel 2} } { A helper procedure to execute a SQL statement, potentially binding depending on the value of the $bind variable in the calling environment @@ -205,7 +205,7 @@ # insert tcl variable values (Openacs - Dan) if {![string equal $sql $pre_sql]} { - set sql [uplevel 2 [list subst -nobackslashes $sql]] + set sql [uplevel $ulevel [list subst -nobackslashes $sql]] } ns_log Notice "POST-QD: the SQL is $sql" @@ -214,16 +214,16 @@ upvar bind bind if { [info exists bind] && [llength $bind] != 0 } { if { [llength $bind] == 1 } { - return [eval [list ns_pg_bind $type $db -bind $bind $sql] $args] + return [eval [list ns_pg_bind $type $db -bind $bind $sql]] } else { set bind_vars [ns_set create] foreach { name value } $bind { ns_set put $bind_vars $name $value } - return [eval [list ns_pg_bind $type $db -bind $bind_vars $sql] $args] + return [eval [list ns_pg_bind $type $db -bind $bind_vars $sql]] } } else { - return [uplevel 2 [list ns_pg_bind $type $db $sql] $args] + return [uplevel $ulevel [list ns_pg_bind $type $db $sql]] } } error] @@ -535,7 +535,7 @@ set file_name [file tail $file] cd [file dirname $file] - set fp [open "|[file join [db_get_pgbin] psql] [db_get_database] -f $file_name" "r"] + set fp [open "|[file join [db_get_pgbin] psql] -f $file_name [db_get_database]" "r"] while { [gets $fp line] >= 0 } { # Don't bother writing out lines which are purely whitespace. Index: openacs-4/packages/acs-templating/tcl/0-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/Attic/0-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/0-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/0-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -108,7 +108,7 @@ # Generic wrapper for registered tag handlers. -proc template_tag { name arglist body } { +ad_proc -public template_tag { name arglist body } { switch [llength $arglist] { Index: openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/acs-integration-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -11,7 +11,7 @@ # License. Full text of the license is available from the GNU Project: # http://www.fsf.org/copyleft/gpl.html -ad_proc ad_return_template { +ad_proc -public ad_return_template { -string:boolean {template ""} } { @@ -31,14 +31,14 @@ } -proc ad_template_return {{file_stub ""}} { +ad_proc -public ad_template_return {{file_stub ""}} { uplevel 1 "ad_return_template $file_stub" } # Get the server root directory (supposing we run under ACS) -proc get_server_root {} { +ad_proc -public get_server_root {} { file dir [ns_info tcllib] } Index: openacs-4/packages/acs-templating/tcl/data-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/data-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/data-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/data-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -9,12 +9,12 @@ # License. Full text of the license is available from the GNU Project: # http://www.fsf.org/copyleft/gpl.html -proc template::data::validate { type value_ref message_ref } { +ad_proc -public template::data::validate { type value_ref message_ref } { return [validate::$type $value_ref $message_ref] } -proc template::data::validate::integer { value_ref message_ref } { +ad_proc -public template::data::validate::integer { value_ref message_ref } { upvar 2 $message_ref message $value_ref value @@ -27,13 +27,13 @@ return $result } -proc template::data::validate::text { value_ref message_ref } { +ad_proc -public template::data::validate::text { value_ref message_ref } { # anything is valid for text return 1 } -proc template::data::validate::keyword { value_ref message_ref } { +ad_proc -public template::data::validate::keyword { value_ref message_ref } { upvar 2 $message_ref message $value_ref value @@ -46,7 +46,7 @@ return $result } -proc template::data::validate::filename { value_ref message_ref } { +ad_proc -public template::data::validate::filename { value_ref message_ref } { upvar 2 $message_ref message $value_ref value @@ -59,7 +59,7 @@ return $result } -proc template::data::validate::url { value_ref message_ref } { +ad_proc -public template::data::validate::url { value_ref message_ref } { upvar 2 $message_ref message $value_ref value @@ -73,7 +73,7 @@ return $result } -proc template::data::validate::date { value_ref message_ref } { +ad_proc -public template::data::validate::date { value_ref message_ref } { upvar 2 $message_ref message $value_ref value @@ -84,12 +84,12 @@ # transformation to be applied correctly. In reality, the transformation # should be on the element, not on the datatype. -proc template::data::validate::search { value_ref message_ref } { +ad_proc -public template::data::validate::search { value_ref message_ref } { return 1 } -proc template::data::validate::currency { value_ref message_ref } { +ad_proc -public template::data::validate::currency { value_ref message_ref } { upvar 2 $message_ref message $value_ref value @@ -118,7 +118,7 @@ } } -proc template::data::transform { type value_ref } { +ad_proc -public template::data::transform { type value_ref } { set proc_name [info procs ::template::data::transform::$type] Index: openacs-4/packages/acs-templating/tcl/date-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/date-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/date-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/date-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -12,11 +12,11 @@ # Prepare an array to map symbolic month names to their indices # Dispatch procedure for the date object -proc template::util::date { command args } { +ad_proc -public template::util::date { command args } { eval template::util::date::$command $args } -proc template::util::date::init {} { +ad_proc -public template::util::date::init {} { variable month_data variable fragment_widgets variable fragment_formats @@ -62,7 +62,7 @@ } # Return the specified month name (short or long) -proc template::util::date::monthName { month length } { +ad_proc -public template::util::date::monthName { month length } { variable month_data if { [string equal $length long] } { @@ -83,7 +83,7 @@ # Return the number of days in a month, accounting for leap years # IS THE LEAP YEAR CODE CORRECT ? -proc template::util::date::daysInMonth { month {year 0} } { +ad_proc -public template::util::date::daysInMonth { month {year 0} } { variable month_data set month_desc $month_data($month) set days [lindex $month_desc 2] @@ -102,7 +102,7 @@ # I chose to implement the date objects as lists instead of # arrays, because arrays are not first-class in TCL -proc template::util::date::create { +ad_proc -public template::util::date::create { {year {}} {month {}} {day {}} {hours {}} {minutes {}} {seconds {}} {format "DD MONTH YYYY"} } { @@ -111,13 +111,13 @@ # Create a new date with some predefined value # Basically, create and set the date -proc template::util::date::acquire { type { value "" } } { +ad_proc -public template::util::date::acquire { type { value "" } } { set the_date [template::util::date::create] return [template::util::date::set_property $type $the_date $value] } # Create a new Date object for the current date -proc template::util::date::today {} { +ad_proc -public template::util::date::today {} { set now [clock format [clock seconds] -format "%Y %m %d"] set today [list] @@ -131,7 +131,7 @@ } # Create a new Date object for the current date and time -proc template::util::date::now {} { +ad_proc -public template::util::date::now {} { set now [clock format [clock seconds] -format "%Y %m %d %H %M %S"] set today [list] @@ -147,7 +147,7 @@ # Is it better to name them symbolically, as opposed to # using the format string codes ? -proc template::util::date::get_property { what date } { +ad_proc -public template::util::date::get_property { what date } { variable month_data @@ -273,7 +273,7 @@ # Perform date comparison; same syntax as string compare -proc template::util::date::compare { date1 date2 } { +ad_proc -public template::util::date::compare { date1 date2 } { set str_1 [lrange $date1 0 5] set str_2 [lrange $date2 0 5] @@ -283,7 +283,7 @@ # mutate properties of the Date object -proc template::util::date::set_property { what date value } { +ad_proc -public template::util::date::set_property { what date value } { # Erase leading zeroes from the value, but make sure that 00 # is not completely erased @@ -348,7 +348,7 @@ # Get the default ranges for all the numeric fields of a Date object -proc template::util::date::defaultInterval { what } { +ad_proc -public template::util::date::defaultInterval { what } { switch $what { year { return [list 2000 2010 1 ] } month { return [list 1 12 1] } @@ -364,7 +364,7 @@ # Set the variables for each field of the date object in # the calling frame -proc template::util::date::unpack { date } { +ad_proc -public template::util::date::unpack { date } { uplevel { set year [lindex $date 0] set month [lindex $date 1] @@ -378,7 +378,7 @@ # Check if a value is less than zero, but return false # if the value is an empty string -proc template::util::negative { value } { +ad_proc -public template::util::negative { value } { if { [string equal $value {}] } { return 0 } else { @@ -390,7 +390,7 @@ # 0 otherwise. Set the error_ref variable to contain # an error message, if any -proc template::util::date::validate { date error_ref } { +ad_proc -public template::util::date::validate { date error_ref } { # If the date is empty, it's valid if { ![get_property not_null $date] } { @@ -469,7 +469,7 @@ # Pad a string with leading zeroes -proc template::util::leadingPad { string size } { +ad_proc -public template::util::leadingPad { string size } { if { [string equal $string {}] } { return {} @@ -483,7 +483,7 @@ # Trim the leading zeroes from the value, but preserve the value # as "0" if it is "00" -proc template::util::leadingTrim { value } { +ad_proc -public template::util::leadingTrim { value } { set empty [string equal $value {}] set value [string trimleft $value 0] if { !$empty && [string equal $value {}] } { @@ -495,7 +495,7 @@ # Create an html fragment to display a numeric range widget # interval_def is in form { start stop interval } -proc template::widget::numericRange { name interval_def size {value ""} } { +ad_proc -public template::widget::numericRange { name interval_def size {value ""} } { set options [list [list "--" {}]] @@ -514,7 +514,7 @@ # Otherwise, determines the proper widget based on the element flags, # which may be text or a picklist -proc template::widget::dateFragment { +ad_proc -public template::widget::dateFragment { element_reference fragment size type value } { upvar $element_reference element @@ -541,7 +541,7 @@ } # Create a widget that shows the am/pm selection -proc template::widget::ampmFragment { +ad_proc -public template::widget::ampmFragment { element_reference fragment size type value } { upvar $element_reference element @@ -554,7 +554,7 @@ # Create a month entry widget with short or long month names -proc template::widget::monthFragment { +ad_proc -public template::widget::monthFragment { element_reference fragment size type value } { variable ::template::util::date::month_data @@ -592,7 +592,7 @@ # the array in range_ref determines interval ranges; the keys # are the date fields and the values are in form {start stop interval} -proc template::widget::date { element_reference tag_attributes } { +ad_proc -public template::widget::date { element_reference tag_attributes } { variable ::template::util::date::fragment_widgets @@ -705,7 +705,7 @@ # Collect a Date object from the form -proc template::data::transform::date { element_ref } { +ad_proc -public template::data::transform::date { element_ref } { upvar $element_ref element set element_id $element(id) Index: openacs-4/packages/acs-templating/tcl/debug-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/Attic/debug-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/debug-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/debug-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -1,6 +1,6 @@ # tracks each file by interpreter to ensure that it is up-to-date -proc watch_files {} { +ad_proc -public watch_files {} { set files [list ats/paginator-procs.tcl ats/query-procs.tcl \ ats/debug-procs.tcl ats/filter-procs.tcl ats/util-procs.tcl] Index: openacs-4/packages/acs-templating/tcl/doc-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/doc-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/doc-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/doc-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -19,7 +19,7 @@ # @param id # The ID of the foo passed with the request. -proc template::parse_directives { code } { +ad_proc -public template::parse_directives { code } { # remove carriage returns if present regsub -all {\r|\r\n} $code {\n} code @@ -75,7 +75,7 @@ # Assemble directives into data source(s) for presentation. -proc template::get_datasources { code } { +ad_proc -public template::get_datasources { code } { upvar datasources:rowcount rowcount set rowcount 0 @@ -157,7 +157,7 @@ } } -proc template::verify_datasources {} { +ad_proc -public template::verify_datasources {} { return 1 } Index: openacs-4/packages/acs-templating/tcl/doc-tcl-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/doc-tcl-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/doc-tcl-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/doc-tcl-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -15,7 +15,7 @@ # @private doc::util::dbl_colon_fix -proc doc::util::dbl_colon_fix { text } { +ad_proc -public doc::util::dbl_colon_fix { text } { regsub -all {::} $text {__} text return $text @@ -27,7 +27,7 @@ # @param element2 {default actually, no default value for this because it is required} the # second of the two elements to be compared -proc doc::util::sort_see { element1 element2 } { +ad_proc -public doc::util::sort_see { element1 element2 } { if { [lindex $element1 3 ] < [lindex $element2 3] } { return -1 @@ -43,7 +43,7 @@ # @private sort_@see # procedure to deal with @see comments -proc doc::sort_@see { list_ref directive_comments } { +ad_proc -public doc::sort_@see { list_ref directive_comments } { upvar $list_ref see_list set type [lindex $directive_comments 0] set see_name [lindex $directive_comments 1] @@ -89,7 +89,7 @@ # @see proc doc::parse_namespace doc.html#doc::parse_namespace # @see proc doc::util::text_divider -proc doc::util::find_marker_indices { text marker } { +ad_proc -public doc::util::find_marker_indices { text marker } { set indices_list [list] set last_index -1 @@ -117,7 +117,7 @@ # @see proc doc::util::find_marker_indices -proc doc::util::text_divider { text_ref marker } { +ad_proc -public doc::util::text_divider { text_ref marker } { upvar $text_ref text set indices_list [doc::util::find_marker_indices $text $marker] @@ -149,7 +149,7 @@ # because it essentially asks for the tcl library path and # strips off the last /tcl directory -proc template::util::server_root {} { +ad_proc -public template::util::server_root {} { set path_length [expr [llength [file split [ns_library private]]] - 1] set svr_root "/[join [lreplace [file split [ns_library private]] $path_length $path_le\ngth] / ]" @@ -163,7 +163,7 @@ # @param template the name of the template to be used in making the file # @param file_name the name of the file to be created -proc template::util::write_from_template { template file_name} { +ad_proc -public template::util::write_from_template { template file_name} { upvar template_name template_name set template_name $template @@ -183,7 +183,7 @@ # @private display_value # a proc used for debugging, just prints out a value to the error log -proc template::util::display_value { ref } { +ad_proc -public template::util::display_value { ref } { upvar $ref value ns_log notice " $ref: @@ -195,13 +195,13 @@ # capitalizes the first letter of a string # @return returns formatted string -proc template::util::proper_noun { string_ref } { +ad_proc -public template::util::proper_noun { string_ref } { } # @private string_range -proc template::util::string_range { string indices } { +ad_proc -public template::util::string_range { string indices } { return [string range $string [lindex $indices 0] [lindex $indices 1]] } @@ -216,7 +216,7 @@ # @return same text but with a space behind each quote; double quotes # that are already trailed by a space are unaffected -proc template::util::quote_space {text} { +ad_proc -public template::util::quote_space {text} { regsub -all {"} $text {" } text regsub -all {" } $text {" } text return $text @@ -227,14 +227,14 @@ # @private bracket_space puts a space after all closing curly brackets, does not # add a space when brackets are already followed by a space -proc doc::util::bracket_space {text} { +ad_proc -public doc::util::bracket_space {text} { regsub -all {(\})} $text {\1 } text regsub -all {(\}) } $text {\1 } text return $text } # @private escape_square_brackets escapes out all square brackets -proc doc::util::escape_square_brackets {text} { +ad_proc -public doc::util::escape_square_brackets {text} { regsub -all {(\[)} $text {\\\1} text regsub -all {(\])} $text {\\\1} text return $text @@ -243,7 +243,7 @@ # @private make_text_listable -proc doc::util::make_text_listable {text_ref} { +ad_proc -public doc::util::make_text_listable {text_ref} { upvar $text_ref text set text [doc::util::bracket_space $text] set text [template::util::quote_space $text] @@ -257,7 +257,7 @@ # @param text # @return text -proc template::util::comment_text_normalize {text} { +ad_proc -public template::util::comment_text_normalize {text} { regsub -all {"} $text {\"} text regsub -all {(\n)\s*#\s*} $text {\1 } text regsub {(\A)\s*#\s*} $text {\1 } text @@ -273,7 +273,7 @@ # @return either the proper list index for an alphabetized insertion or -1 if the entry is # already in the list -proc template::util::alphabetized_index {list entry} { +ad_proc -public template::util::alphabetized_index {list entry} { set result [lsearch -exact $list $entry] if { $result != -1 } { @@ -294,7 +294,7 @@ # @private proc_element_compare # used to compare two different elements in a list of parsed data for public or private procs -proc template::util::proc_element_compare { element1 element2 } { +ad_proc -public template::util::proc_element_compare { element1 element2 } { return [string compare -nocase [lindex [lindex [lindex element2 1] 0] 1] [lindex [lindex [lindex element1 1] 0] 1]] @@ -305,7 +305,7 @@ # @private set_proc_name_source_txt called by parse_comment_text # @param comment_text this should include the source text -proc doc::set_proc_name_source_text_comment_text { proc_block } { +ad_proc -public doc::set_proc_name_source_text_comment_text { proc_block } { upvar source_txt source_txt upvar proc_name proc_name upvar comment_text comment_text @@ -324,7 +324,7 @@ # @param comment_text body of comment text to be parsed through # @param source_text source text of the procedure -proc doc::parse_comment_text { proc_block } { +ad_proc -public doc::parse_comment_text { proc_block } { doc::set_proc_name_source_text_comment_text $proc_block @@ -416,7 +416,7 @@ # @param text_lines namespace text body -proc doc::parse_namespace { text_lines } { +ad_proc -public doc::parse_namespace { text_lines } { # total_result_listing will contain our complete data set, # namespace_list is just a temp variable used for easy bookkeeping; @@ -579,7 +579,7 @@ # creating a lookup on namespace name. -proc doc::parse_file { path } { +ad_proc -public doc::parse_file { path } { set text [template::util::read_file $path] @@ -612,7 +612,7 @@ # @return a long lists of lists of lists, each list element contains a three-element list of # the format { {info} {public procedures listing } {private procedures listing}} -proc doc::parse_tcl_library { dir_list } { +ad_proc -public doc::parse_tcl_library { dir_list } { # namespace_list will be a list containing namespace names only, and should be ordered # with respect to namespaces in the same order as the list result Index: openacs-4/packages/acs-templating/tcl/element-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/element-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/element-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/element-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -10,7 +10,7 @@ # License. Full text of the license is available from the GNU Project: # http://www.fsf.org/copyleft/gpl.html -proc template::element { command form_id element_id args } { +ad_proc -public template::element { command form_id element_id args } { eval template::element::$command $form_id $element_id $args } @@ -56,7 +56,7 @@ # element. If a default value is specified, the default # is used instead. -proc template::element::create { form_id element_id args } { +ad_proc -public template::element::create { form_id element_id args } { set level [template::adp_level] @@ -127,7 +127,7 @@ # @see create -proc template::element::set_properties { form_id element_id args } { +ad_proc -public template::element::set_properties { form_id element_id args } { get_reference # create a reference to opts as expected by get_opts @@ -146,7 +146,7 @@ # @param element_id The unique identifier of the element. # @param value The value to apply -proc template::element::set_value { form_id element_id value } { +ad_proc -public template::element::set_value { form_id element_id value } { get_reference @@ -165,7 +165,7 @@ # @return The current value of the element. # @see get_values -proc template::element::get_value { form_id element_id } { +ad_proc -public template::element::get_value { form_id element_id } { get_reference @@ -189,7 +189,7 @@ # @return A list of current values for the element. # @see get_value -proc template::element::get_values { form_id element_id } { +ad_proc -public template::element::get_values { form_id element_id } { get_reference @@ -208,7 +208,7 @@ # @return The value of the property, or "" if the property does not exist # @see set_properties -proc template::element::get_property { form_id element_id property } { +ad_proc -public template::element::get_property { form_id element_id property } { get_reference @@ -233,7 +233,7 @@ # @param form_id The identifier of the form containing the element. # @param element_id The unique identifier of the element. -proc template::element::validate { form_id element_id } { +ad_proc -public template::element::validate { form_id element_id } { set level [template::adp_level] @@ -365,7 +365,7 @@ # template. # @param message The text of the error message. -proc template::element::set_error { form_id element_id message } { +ad_proc -public template::element::set_error { form_id element_id message } { set level [template::adp_level] @@ -378,7 +378,7 @@ # Get all values for an element, performing any transformation defined # for the datatype. -proc template::element::querygetall { element_ref } { +ad_proc -public template::element::querygetall { element_ref } { upvar $element_ref element @@ -409,7 +409,7 @@ # @return 1 if the element exists in the form, or 0 otherwise -proc template::element::exists { form_id element_id } { +ad_proc -public template::element::exists { form_id element_id } { set level [template::adp_level] @@ -424,7 +424,7 @@ # element, and throws and error if the element does not exist. Called # at the beginning of several of the element commands. -proc template::element::get_reference {} { +ad_proc -public template::element::get_reference {} { uplevel { @@ -451,7 +451,7 @@ # @return A string containing the HTML for an INPUT, SELECT or TEXTAREA # form element. -proc template::element::render { form_id element_id tag_attributes } { +ad_proc -public template::element::render { form_id element_id tag_attributes } { get_reference @@ -469,7 +469,7 @@ # @param element_id The unique identifier of the element within the form. # @param tag_attributes Reserved for future use. -proc template::element::render_help { form_id element_id tag_attributes } { +ad_proc -public template::element::render_help { form_id element_id tag_attributes } { get_reference @@ -487,7 +487,7 @@ # radio button or checkbox, such as JavaScript # handlers or special formatting. -proc template::element::options { form_id element_id tag_attributes } { +ad_proc -public template::element::options { form_id element_id tag_attributes } { get_reference @@ -541,7 +541,7 @@ # define values from value, if the latter is more defined -proc template::element::copy_value_to_values_if_defined {} { +ad_proc -public template::element::copy_value_to_values_if_defined {} { upvar opts opts # values is always defined, init to "" from template::element::defaults if { [info exists opts(value)] && [llength $opts(values)] == 0 } { @@ -551,4 +551,4 @@ set opts(values) [list $opts(value)] } } -} \ No newline at end of file +} Index: openacs-4/packages/acs-templating/tcl/filter-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/filter-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/filter-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/filter-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -12,7 +12,7 @@ # Sample filter for handling pages with the ADP to Tcl compiler -proc acs_page_filter { why } { +ad_proc -public acs_page_filter { why } { # Check for updates to Tcl library files # watch_files @@ -65,7 +65,7 @@ # Redirect and abort processing -proc template::forward { url } { +ad_proc -public template::forward { url } { if { ! [string match http://* $url] } { @@ -88,7 +88,7 @@ # a reference (not the value) to a variable containing the URL of # the template to parse. The filter procedure may modify this. -proc template::filter { command args } { +ad_proc -public template::filter { command args } { variable filter_list @@ -110,7 +110,7 @@ # Show the compiled template (for debugging) -proc cmp_page_filter { why } { +ad_proc -public cmp_page_filter { why } { if { [catch { set url [ad_conn url] @@ -137,7 +137,7 @@ # Show the comments for the template (for designer) -proc dat_page_filter { why } { +ad_proc -public dat_page_filter { why } { if { [catch { set url [ad_conn url] @@ -165,7 +165,7 @@ # Return the auto-generated template for a form -proc frm_page_filter { why } { +ad_proc -public frm_page_filter { why } { namespace eval template { Index: openacs-4/packages/acs-templating/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/form-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/form-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/form-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -14,7 +14,7 @@ # Commands for managing dynamic templated forms. -proc template::form { command args } { +ad_proc -public template::form { command args } { eval template::form::$command $args } @@ -37,7 +37,7 @@ # @option elements A block of element specifications. -proc template::form::create { id args } { +ad_proc -public template::form::create { id args } { set level [template::adp_level] @@ -89,7 +89,7 @@ # @return 1 if a form with the specified ID exists. 0 if it does not. -proc template::form::exists { id } { +ad_proc -public template::form::exists { id } { set level [template::adp_level] upvar #$level $id:elements elements @@ -108,7 +108,7 @@ # @return A string containing a template for the body of the form. -proc template::form::template { id { style "" } } { +ad_proc -public template::form::template { id { style "" } } { get_reference @@ -160,7 +160,7 @@ # @return A string containing the HTML for the body of the form. -proc template::form::generate { id { style "" } } { +ad_proc -public template::form::generate { id { style "" } } { set __adp_output [template $id $style] @@ -195,7 +195,7 @@ # @param id The form identifier. # @param section The name of the current section. -proc template::form::section { id section } { +ad_proc -public template::form::section { id section } { get_reference @@ -213,7 +213,7 @@ # @return A string containing the rendered tags. -proc template::form::render { id tag_attributes } { +ad_proc -public template::form::render { id tag_attributes } { get_reference @@ -272,7 +272,7 @@ # @param id The form identifier -proc template::form::check_elements { id } { +ad_proc -public template::form::check_elements { id } { get_reference @@ -315,7 +315,7 @@ # @return 1 if true or 0 if false -proc template::form::is_request { id } { +ad_proc -public template::form::is_request { id } { return [expr ! [is_submission $id]] } @@ -331,7 +331,7 @@ # @return 1 if true or 0 if false -proc template::form::is_submission { id } { +ad_proc -public template::form::is_submission { id } { set level [template::adp_level] @@ -351,7 +351,7 @@ # @return 1 if true or 0 if false -proc template::form::is_valid { id } { +ad_proc -public template::form::is_valid { id } { set level [template::adp_level] @@ -382,7 +382,7 @@ # @param args A list of element identifiers. If the list is empty, # retreive all form elements -proc template::form::get_values { id args } { +ad_proc -public template::form::get_values { id args } { if { [llength $args] > 0 } { set elements $args @@ -411,7 +411,7 @@ # "foo" # @param return The combined list of values # -proc template::form::get_combined_values { id args } { +ad_proc -public template::form::get_combined_values { id args } { get_reference @@ -439,7 +439,7 @@ # @param array_ref The name of a local array variable whose # keys correspond to element identifiers in the form -proc template::form::set_values { id array_ref } { +ad_proc -public template::form::set_values { id array_ref } { upvar 2 $array_ref values @@ -460,7 +460,7 @@ # @return A string containing hidden input tags for inclusion in a # form. -proc template::form::export {} { +ad_proc -public template::form::export {} { set form [ns_getform] if { $form == "" } { return "" } @@ -487,7 +487,7 @@ # @param id The form identifier -proc template::form::size { id } { +ad_proc -public template::form::size { id } { template::form::get_reference return [llength $elements] } @@ -497,7 +497,7 @@ # Helper procedure used to access the basic data structures of a form object. # Called by several of the form commands. -proc template::form::get_reference {} { +ad_proc -public template::form::get_reference {} { uplevel { set level [template::adp_level] Index: openacs-4/packages/acs-templating/tcl/mime-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/mime-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/mime-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/mime-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -9,7 +9,7 @@ @cvs-id $Id$ } -proc template::register_mime_type { mime_type file_extension +ad_proc -public template::register_mime_type { mime_type file_extension header_preamble } { if { [info exists template_extension($mime_type)] } { nsv_unset template_extension($mime_type) @@ -22,23 +22,23 @@ nsv_set template_header_preamble $mime_type $header_preamble } -proc template::get_mime_template_extension { mime_type } { +ad_proc -public template::get_mime_template_extension { mime_type } { if { [nsv_exists template_extension $mime_type] } { return [nsv_get template_extension $mime_type] } else { return "adp" } } -proc template::get_mime_header_preamble { mime_type } { +ad_proc -public template::get_mime_header_preamble { mime_type } { if { [nsv_exists template_header_preamble $mime_type] } { return [nsv_get template_header_preamble $mime_type] } else { return "" } } -proc template::get_mime_type {} { +ad_proc -public template::get_mime_type {} { set mime_type [ns_set iget [ns_conn outputheaders] "content-type"] if { [empty_string_p $mime_type] } { set mime_type "text/html" Index: openacs-4/packages/acs-templating/tcl/paginator-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/paginator-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 27 Apr 2001 02:27:09 -0000 1.2 +++ openacs-4/packages/acs-templating/tcl/paginator-procs.tcl 9 May 2001 05:15:58 -0000 1.3 @@ -9,7 +9,7 @@ # License. Full text of the license is available from the GNU Project: # http://www.fsf.org/copyleft/gpl.html -proc template::paginator { command args } { +ad_proc -public template::paginator { command args } { eval paginator::$command $args } @@ -35,7 +35,7 @@ # page number,, such as the first few # letters of a title or date. -proc template::paginator::create { statement_name name query args } { +ad_proc -public template::paginator::create { statement_name name query args } { set level [template::adp_level] variable parse_level @@ -67,7 +67,7 @@ # Initialize a paginated query. Only called by create. -proc template::paginator::init { statement_name result_name query } { +ad_proc -public template::paginator::init { statement_name result_name query } { get_reference @@ -127,7 +127,7 @@ # @return A number ranging from one to the number of pages in the query result. -proc template::paginator::get_page { name rownum } { +ad_proc -public template::paginator::get_page { name rownum } { get_reference @@ -146,7 +146,7 @@ # @return A number ranging from one to the number of rows in the query result. -proc template::paginator::get_row { name pagenum } { +ad_proc -public template::paginator::get_row { name pagenum } { get_reference @@ -164,7 +164,7 @@ # @return A number ranging from one to the number of groups in the query # result, as determined by both the page size and the group size. -proc template::paginator::get_group { name pagenum } { +ad_proc -public template::paginator::get_group { name pagenum } { get_reference @@ -185,7 +185,7 @@ # @return A Tcl list of row identifiers. -proc template::paginator::get_row_ids { name pagenum } { +ad_proc -public template::paginator::get_row_ids { name pagenum } { get_reference @@ -209,7 +209,7 @@ # @return A Tcl list of page numbers. -proc template::paginator::get_pages { name group } { +ad_proc -public template::paginator::get_pages { name group } { get_reference @@ -250,7 +250,7 @@ # @return A Tcl list of page numbers. -proc template::paginator::get_groups { name group count } { +ad_proc -public template::paginator::get_groups { name group count } { get_reference @@ -296,7 +296,7 @@ # @param datasource The name of the multirow datasource to create # @param pages A Tcl list of page numbers. -proc template::paginator::get_context { name datasource pages } { +ad_proc -public template::paginator::get_context { name datasource pages } { get_reference @@ -328,7 +328,7 @@ # @return A number representing the row count. -proc template::paginator::get_row_count { name } { +ad_proc -public template::paginator::get_row_count { name } { get_reference @@ -343,7 +343,7 @@ # @return A number representing the page count. -proc template::paginator::get_page_count { name } { +ad_proc -public template::paginator::get_page_count { name } { get_reference @@ -358,7 +358,7 @@ # @return A number represeting the group count. -proc template::paginator::get_group_count { name } { +ad_proc -public template::paginator::get_group_count { name } { get_reference @@ -381,7 +381,7 @@ # @param page A page number representing the reference point from # which the display properties are calculated. -proc template::paginator::get_display_info { name datasource page } { +ad_proc -public template::paginator::get_display_info { name datasource page } { get_reference upvar 2 $datasource info @@ -423,7 +423,7 @@ # @param id_column The name of the ID column in the display query (required # to order rows properly). -proc template::paginator::get_data { statement_name name datasource query id_column page } { +ad_proc -public template::paginator::get_data { statement_name name datasource query id_column page } { set ids [get_row_ids $name $page] @@ -471,7 +471,7 @@ # Get a reference to the paginator properties (internal helper) -proc template::paginator::get_reference {} { +ad_proc -public template::paginator::get_reference {} { uplevel { Index: openacs-4/packages/acs-templating/tcl/parse-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/parse-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/parse-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/parse-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -22,7 +22,7 @@ # to an included template from its container. All # data sources may be passed by reference. -proc template::adp_parse { __adp_stub __args } { +ad_proc -public template::adp_parse { __adp_stub __args } { # declare any variables passed in to an include or master # TODO: call adp_set_vars instead. @@ -107,7 +107,7 @@ # multirow data sources. This code must be executed in the same stack frame # as adp_parse, but is in a separate proc to improve code readability. -proc template::adp_set_vars {} { +ad_proc -public template::adp_set_vars {} { uplevel { set __adp_level [adp_level 2] @@ -141,7 +141,7 @@ # Terminates processing of a template and throws away all output. -proc template::adp_abort {} { error ADP_ABORT } +ad_proc -public template::adp_abort {} { error ADP_ABORT } # @public adp_eval @@ -151,7 +151,7 @@ # @return The output produced by the compiled template code. -proc template::adp_eval { coderef } { +ad_proc -public template::adp_eval { coderef } { upvar $coderef code @@ -185,7 +185,7 @@ # @return A number, as returned by [info level], representing the stack frame # in which a template is being parsed. -proc template::adp_level { { up "" } } { +ad_proc -public template::adp_level { { up "" } } { set result "" @@ -207,7 +207,7 @@ # @public adp_levels # Get all stack frame levels -proc template::adp_levels {} { +ad_proc -public template::adp_levels {} { variable parse_level if { [info exists parse_level] } {return $parse_level} return "" @@ -225,7 +225,7 @@ # @return boolean (0 or 1): whether the (ultimate) script was found. -proc template::adp_prepare {} { +ad_proc -public template::adp_prepare {} { uplevel { @@ -271,7 +271,7 @@ # @param path The root (sans file extension) of the absolute path to the # next template to parse. -proc template::set_file { path } { +ad_proc -public template::set_file { path } { set level [adp_level] @@ -292,7 +292,7 @@ # @param file_stub The root (sans file extension) of the absolute path # to the .adp or .tcl file to source. -proc template::adp_init { type file_stub } { +ad_proc -public template::adp_init { type file_stub } { # this will return the name of the proc if it exists set proc_name [info procs ::template::mtimes::${type}::$file_stub] @@ -345,7 +345,7 @@ # @return The compiled code. -proc template::adp_compile { source_type source } { +ad_proc -public template::adp_compile { source_type source } { variable parse_list # initialize the compiled code @@ -403,7 +403,7 @@ # @param chunk A string containing markup, potentially with embedded # ATS tags. -proc template::adp_compile_chunk { chunk } { +ad_proc -public template::adp_compile_chunk { chunk } { # parse the template chunk inside the tag set remaining [ns_adp_parse -string $chunk] @@ -428,7 +428,7 @@ # ATS tags. Variable references and procedure calls are # interpreted as for any double-quoted string in Tcl. -proc template::adp_append_string { s } { +ad_proc -public template::adp_append_string { s } { adp_append_code "append __adp_output \"$s\"" } @@ -444,7 +444,7 @@ # cases where code must continue on the same line, such # as the else tag -proc template::adp_append_code { code { nobreak "" } } { +ad_proc -public template::adp_append_code { code { nobreak "" } } { if { [string is space $code] } { return } @@ -469,7 +469,7 @@ # @param text A string containing text or markup. -proc template::adp_puts { text } { +ad_proc -public template::adp_puts { text } { upvar __adp_output __adp_output @@ -483,7 +483,7 @@ # @param tag_name The name of the tag. Used for debugging purposes only. -proc template::adp_tag_init { {tag_name ""} } { +ad_proc -public template::adp_tag_init { {tag_name ""} } { # add everything either from the beginning of the template or from # the last balanced tag up to the current point in the template @@ -510,7 +510,7 @@ # @param tag The name of the enclosing tag to look for. -proc template::get_enclosing_tag { tag } { +ad_proc -public template::get_enclosing_tag { tag } { set name "" @@ -545,7 +545,7 @@ # @return The value of the attribute. -proc template::get_attribute { tag params name { default "" } } { +ad_proc -public template::get_attribute { tag params name { default "" } } { set value [ns_set iget $params $name] Index: openacs-4/packages/acs-templating/tcl/query-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/query-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/tcl/query-procs.tcl 7 May 2001 23:58:01 -0000 1.3 +++ openacs-4/packages/acs-templating/tcl/query-procs.tcl 9 May 2001 05:15:58 -0000 1.4 @@ -81,7 +81,11 @@ @param args Optional args: uplevel, cache, maxrows } { + set sql [string trim $sql] + set full_statement_name [db_qd_get_fullname $statement_name] + #set beginTime [clock clicks] + ns_log Notice "query sql = $sql" template::util::get_opts $args @@ -103,8 +107,7 @@ } db_with_handle db { - set ret_code [template::query::$type $statement_name $db $result_name \ - $sql] + set ret_code [template::query::$type $full_statement_name $db $result_name $sql] } if { [info exists opts(cache)] } { @@ -131,15 +134,13 @@ } { - set full_statement_name [db_qd_get_fullname $statement_name] - + ns_log Notice "sql = $sql" upvar opts opts upvar $opts(uplevel) $result_name result set result "" - uplevel "set __row \[db_exec 0or1row $db $full_statement_name $sql\]" - upvar __row row + set row [db_exec 0or1row $db $statement_name $sql 3] if { $row != "" } { @@ -163,12 +164,9 @@ @param sql Query to use when processing this command } { - set full_statement_name [db_qd_get_fullname $statement_name] - upvar opts opts - uplevel "set __row \[db_exec 0or1row $db $full_statement_name $sql\]" - upvar __row row + set row [db_exec 0or1row $db $statement_name $sql 3] if { $row != "" } { @@ -208,15 +206,11 @@ @param sql Query to use when processing this command } { - set full_statement_name [db_qd_get_fullname $statement_name] - upvar opts opts - uplevel "set __row \[db_exec select $db $full_statement_name $sql\]" - upvar __row row + set row [db_exec select $db $statement_name $sql 3] - upvar $opts(uplevel) $result_name:rowcount rowcount \ - $result_name:columns column_list + upvar $opts(uplevel) $result_name:rowcount rowcount $result_name:columns column_list # set a local variable as to whether we are cacheing or not if { [info exists opts(cache)] } { @@ -240,14 +234,14 @@ # break if maxrows has been reached if { $rowcount > $opts(maxrows) } { ns_db flush $db - upvar $opts(uplevel) $name:has_more_rows has_more_rows + upvar $opts(uplevel) ${result_name}:has_more_rows has_more_rows set has_more_rows 1 incr rowcount -1 break } # set the results in the calling frame - upvar $opts(uplevel) ${name}:$rowcount result + upvar $opts(uplevel) ${result_name}:$rowcount result set result(rownum) $rowcount @@ -266,7 +260,7 @@ # Execute custom code for each row if { [info exists opts(eval)] } { uplevel $opts(uplevel) " - upvar 0 ${name}:$rowcount row; $opts(eval) + upvar 0 ${result_name}:$rowcount row; $opts(eval) " } @@ -287,12 +281,9 @@ @param sql Query to use when processing this command } { - set full_statement_name [db_qd_get_fullname $statement_name] - upvar opts opts - uplevel "set __row \[db_exec select $db $full_statement_name $sql\]" - upvar __row row + set row [db_exec select $db $statement_name $sql 3] upvar $opts(uplevel) $result_name rows @@ -330,12 +321,9 @@ @param sql Query to use when processing this command } { - set full_statement_name [db_qd_get_fullname $statement_name] - upvar opts opts - uplevel "set __row \[db_exec select $db $full_statement_name $sql\]" - upvar __row row + set row [db_exec select $db $statement_name $sql 3] upvar $opts(uplevel) $result_name rows @@ -376,12 +364,9 @@ @param sql Query to use when processing this command } { - set full_statement_name [db_qd_get_fullname $statement_name] - upvar opts opts - uplevel "set __row \[db_exec select $db $full_statement_name $sql\]" - upvar __row row + set row [db_exec select $db $statement_name $sql 3] upvar $opts(uplevel) $result_name rows @@ -405,11 +390,9 @@ @param sql Query to use when processing this command } { - set full_statement_name [db_qd_get_fullname $statement_name] - upvar opts opts - uplevel "db_exec dml $db $full_statement_name \"$sql\"" + db_exec dml $db $statement_name "$sql" 3 } # @private get_cached_result @@ -533,11 +516,8 @@ @param body Code body to be execute for each result row of the returned query } { - set full_statement_name [db_qd_get_fullname $statement_name] + set result [db_exec select $db $statement_name $sql 3] - uplevel "set __result \[db_exec select $db $full_statement_name $sql\]" - upvar __result result - set rowcount 0 while { [ns_db getrow $db $result] } { Index: openacs-4/packages/acs-templating/tcl/request-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/request-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/request-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/request-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -19,7 +19,7 @@ # @see form element -proc template::request { command args } { +ad_proc -public template::request { command args } { eval request::$command $args } @@ -32,7 +32,7 @@ # Equivalent to calling set_param for each parameter, but # requiring slightly less typing. -proc template::request::create { args } { +ad_proc -public template::request::create { args } { eval template::form::create request $args @@ -84,7 +84,7 @@ # @see element::create -proc template::request::set_param { name args } { +ad_proc -public template::request::set_param { name args } { set level [template::adp_level] eval template::element::create request $name $args @@ -108,7 +108,7 @@ # @return The value of the specified parameter. -proc template::request::get_param { name } { +ad_proc -public template::request::get_param { name } { set level [template::adp_level] upvar #$level request:$name param @@ -137,7 +137,7 @@ # be used for layout purposes. # @param msg The message text associated with the condition. -proc template::request::error { args } { +ad_proc -public template::request::error { args } { set level [template::adp_level] upvar #$level request:error requesterror @@ -161,7 +161,7 @@ # @return 1 if no error conditions exist, 0 otherwise. -proc template::request::is_valid { { url "" } } { +ad_proc -public template::request::is_valid { { url "" } } { set level [template::adp_level] upvar #$level request:error requesterror Index: openacs-4/packages/acs-templating/tcl/tab-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/tab-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/tab-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/tab-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -7,7 +7,7 @@ # A tab is just a formwidget -proc template::widget::tab { element_reference tag_attributes } { +ad_proc -public template::widget::tab { element_reference tag_attributes } { upvar $element_reference element @@ -41,14 +41,14 @@ namespace eval template::tabstrip {} # Dispatch proc -proc template::tabstrip { command args } { +ad_proc -public template::tabstrip { command args } { eval template::tabstrip::$command $args } # Create a new tabbed page # accepts the -base_url tag -proc template::tabstrip::create { dlg_name args } { +ad_proc -public template::tabstrip::create { dlg_name args } { template::util::get_opts $args @@ -99,7 +99,7 @@ # -base_url base_url # any element::create options -proc template::tabstrip::add_tab { +ad_proc -public template::tabstrip::add_tab { dlg_name name label template args } { # Determine the current tab @@ -143,7 +143,7 @@ } -proc template::tabstrip::set_current_tab { dlg_name tab_name {rel_level 2}} { +ad_proc -public template::tabstrip::set_current_tab { dlg_name tab_name {rel_level 2}} { set level [template::adp_level] upvar #$level $dlg_name:properties properties Index: openacs-4/packages/acs-templating/tcl/table-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/table-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/tcl/table-procs.tcl 27 Apr 2001 02:27:09 -0000 1.2 +++ openacs-4/packages/acs-templating/tcl/table-procs.tcl 9 May 2001 05:15:58 -0000 1.3 @@ -45,7 +45,7 @@ # Create the widget data structure -proc template::widget::table::create { statement_name name args } { +ad_proc -public template::widget::table::create { statement_name name args } { upvar "tablewidget:${name}" widget @@ -56,15 +56,15 @@ } # Get the order by clause for the widget, other parameters (?) -proc template::widget::table::get_params { name {level 1} } { +ad_proc -public template::widget::table::get_params { name {level 1} } { upvar $level "tablewidget:${name}" widget set widget(orderby) [ns_queryget "tablewidget:${name}_orderby"] } # Create the default column definition if none exists -proc template::widget::table::default_column_def { name { level 2} } { +ad_proc -public template::widget::table::default_column_def { name { level 2} } { upvar $level "tablewidget:${name}" widget @@ -84,7 +84,7 @@ } # Compose the query, if neccessary, and define the datasources -proc template::widget::table::prepare { statement_name name {level 1} } { +ad_proc -public template::widget::table::prepare { statement_name name {level 1} } { upvar $level "tablewidget:${name}" widget Index: openacs-4/packages/acs-templating/tcl/tag-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/tag-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/tcl/tag-procs.tcl 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/tcl/tag-procs.tcl 9 May 2001 05:15:58 -0000 1.2 @@ -11,7 +11,7 @@ # License. Full text of the license is available from the GNU Project: # http://www.fsf.org/copyleft/gpl.html -proc template_tag_if_condition { chunk params condition_type } { +ad_proc -public template_tag_if_condition { chunk params condition_type } { set condition "$condition_type \{" @@ -63,7 +63,7 @@ # append all the tags together and then eval as a list to restore # quotes -proc template_tag_if_concat_params { params } { +ad_proc -public template_tag_if_concat_params { params } { set size [ns_set size $params] @@ -78,7 +78,7 @@ # Interpret an expression as part of the simplified IF syntax -proc template_tag_if_interp_expr {} { +ad_proc -public template_tag_if_interp_expr {} { upvar args args condition condition Index: openacs-4/packages/acs-templating/tcl/util-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/util-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/tcl/util-procs.tcl 27 Apr 2001 02:27:09 -0000 1.2 +++ openacs-4/packages/acs-templating/tcl/util-procs.tcl 9 May 2001 05:15:58 -0000 1.3 @@ -22,7 +22,7 @@ # Problem: there is currently no way to specify an option parameter that # begins with a dash. This particularly problematic for negative numbers. -proc template::util::get_opts { argv } { +ad_proc -public template::util::get_opts { argv } { upvar opts opts @@ -68,7 +68,7 @@ # @return A list of option-value pairs suitable for appending to a command. -proc template::util::list_opts { {array_ref opts} } { +ad_proc -public template::util::list_opts { {array_ref opts} } { upvar $array_ref arr @@ -89,7 +89,7 @@ # @return 1 if the variable either not exist or is an empty string. 0 if # the variable is either an array reference or a non-empty scalar. -proc template::util::is_nil { ref } { +ad_proc -public template::util::is_nil { ref } { upvar $ref var @@ -116,7 +116,7 @@ # @return 1 if the row exists, 0 if not -proc template::util::is_unique { table columns values } { +ad_proc -public template::util::is_unique { table columns values } { set query "select count(*) from $table where " @@ -142,7 +142,7 @@ # @return 0 if the variable can be interpreted as false; 1 for true if it can't. -proc template::util::is_true { x } { +ad_proc -public template::util::is_true { x } { expr [lsearch -exact {0 f false n no off ""} [string tolower $x]] == -1 } @@ -154,7 +154,7 @@ # @param ref The name of a list in the calling frame on which to operate. -proc template::util::lpop { ref } { +ad_proc -public template::util::lpop { ref } { upvar $ref the_list @@ -169,7 +169,7 @@ # traverse outward in the data structure. # @param args Subsequent nodes to traverse. -proc template::util::lnest { listref value next args } { +ad_proc -public template::util::lnest { listref value next args } { upvar $listref inlist if { ! [info exists inlist] } { @@ -236,7 +236,7 @@ # @return A list in the form { key value key value key value ... } -proc template::util::set_to_list { set args } { +ad_proc -public template::util::set_to_list { set args } { set result [list] @@ -258,7 +258,7 @@ # @param set A reference to an ns_set. # @param args Any number of keys to declare as local variables. -proc template::util::set_to_vars { set args } { +ad_proc -public template::util::set_to_vars { set args } { if { [llength $args] == 0 } { @@ -283,7 +283,7 @@ # @param arrayname The name of an array in the calling frame. -proc template::util::array_to_vars { arrayname } { +ad_proc -public template::util::array_to_vars { arrayname } { upvar $arrayname arr @@ -299,7 +299,7 @@ # @param arrayname The name of an array in the calling frame. # @param args Any number of local variables to include in the array -proc template::util::vars_to_array { arrayname args } { +ad_proc -public template::util::vars_to_array { arrayname args } { upvar $arrayname arr @@ -320,7 +320,7 @@ # The length of this list should be the same as the values # list. -proc template::util::list_to_array { values array_ref columns } { +ad_proc -public template::util::list_to_array { values array_ref columns } { upvar $array_ref array @@ -338,7 +338,7 @@ # Converts a list of lists in the form { { key value } { key value } ... } # to an array. -proc template::util::list_of_lists_to_array { lists array_ref } { +ad_proc -public template::util::list_of_lists_to_array { lists array_ref } { upvar $array_ref array @@ -360,7 +360,7 @@ # @param values A list of values # @param array_ref The name of the array to create in the calling frame. -proc template::util::list_to_lookup { values array_ref } { +ad_proc -public template::util::list_to_lookup { values array_ref } { upvar $array_ref array @@ -375,7 +375,7 @@ # Return a representation of a multirow data source as a list, # suitable for passing by value in the form { { row } { row } { row } ... } -proc template::util::multirow_to_list { name } { +ad_proc -public template::util::multirow_to_list { name } { upvar $name:rowcount rowcount @@ -390,7 +390,7 @@ return $rows } -proc template::util::list_to_multirow { name rows { level 1 } } { +ad_proc -public template::util::list_to_multirow { name rows { level 1 } } { upvar $level $name:rowcount rowcount set rowcount [llength $rows] @@ -416,7 +416,7 @@ # @return A string with the contents of the file. -proc template::util::read_file { path } { +ad_proc -public template::util::read_file { path } { set fd [open $path] set text [read $fd] @@ -432,7 +432,7 @@ # @param path The absolute path to the file # @param text A string containing the text to write to the file. -proc template::util::write_file { path text } { +ad_proc -public template::util::write_file { path text } { file mkdir [file dirname $path] @@ -445,7 +445,7 @@ # Resolve a URL into an absolute file path. -proc template::util::url_to_file { url {reference_url ""} } { +ad_proc -public template::util::url_to_file { url {reference_url ""} } { if { [string index $url 0] != "/" } { @@ -463,7 +463,7 @@ # Resolve the file name for a directory URL -proc template::util::resolve_directory_url { url } { +ad_proc -public template::util::resolve_directory_url { url } { set path [ns_info pageroot]$url @@ -479,7 +479,7 @@ # Get the directory portion of a URL. If the URL has a trailing # slash, then return the entire URL. -proc template::util::get_url_directory { url } { +ad_proc -public template::util::get_url_directory { url } { set directory $url @@ -503,7 +503,7 @@ # Retrieve the value of a cookie and return it # Return the default if no such cookie exists -proc template::util::get_cookie { name {default_value ""} } { +ad_proc -public template::util::get_cookie { name {default_value ""} } { set headers [ns_conn headers] @@ -522,7 +522,7 @@ # may be persistent, session, or a number of minutes from the current # time. -proc template::util::set_cookie { expire_state name value { domain "" } } { +ad_proc -public template::util::set_cookie { expire_state name value { domain "" } } { if { [string match $domain {}] } { set path "ns/server/[ns_info server]/module/nssock" @@ -555,7 +555,7 @@ # Expires an existing cookie. -proc template::util::clear_cookie { name { domain "" } } { +ad_proc -public template::util::clear_cookie { name { domain "" } } { if { [string match $domain {}] } { set path "ns/server/[ns_info server]/module/nssock" @@ -568,7 +568,7 @@ ns_set put [ns_conn outputheaders] "Set-Cookie" $cookie } -proc template::util::quote_html { html } { +ad_proc -public template::util::quote_html { html } { regsub -all \" [ns_quotehtml $html] \\"\; html @@ -584,7 +584,7 @@ # @author simon -proc template::util::multirow_quote_html {multirow_ref column_ref} { +ad_proc -public template::util::multirow_quote_html {multirow_ref column_ref} { upvar $multirow_ref:rowcount rowcount for { set i 1 } { $i <= $rowcount } { incr i} { @@ -609,7 +609,7 @@ # @author simon -proc template::util::multirow_foreach { name code_text } { +ad_proc -public template::util::multirow_foreach { name code_text } { upvar $name:rowcount rowcount $name:columns columns i i upvar running_code running_code @@ -642,7 +642,7 @@ # If section/key are present, read the parameter from the specified # section.key in the INI file, and cache them under the given name -proc template::util::get_param { name {section {}} {key {}} } { +ad_proc -public template::util::get_param { name {section {}} {key {}} } { if { ![nsv_exists __template_config $name] } { @@ -676,15 +676,15 @@ # Set a stored parameter -proc template::util::set_param { name value } { +ad_proc -public template::util::set_param { name value } { nsv_set __template_config $name $value } # @public nvl # Analogous to SQL NVL -proc template::util::nvl { value value_if_null } { +ad_proc -public template::util::nvl { value value_if_null } { if { [template::util::is_nil value] } { return $value_if_null } else { @@ -696,7 +696,7 @@ # Return a list of numbers, {1 2 3 ... n} -proc template::util::number_list { last_number {start_at 0} } { +ad_proc -public template::util::number_list { last_number {start_at 0} } { set ret [list] for {set i $start_at} { $i <= $ret } {incr i} { lappend ret $i @@ -705,15 +705,15 @@ } -proc pkg_root key {return "/packages/$key"} -proc pkg_widgets key {return "/packages/$key/widgets"} +ad_proc -public pkg_root key {return "/packages/$key"} +ad_proc -public pkg_widgets key {return "/packages/$key/widgets"} # @public tcl_to_sql_list # Convert a TCL list to a SQL list, for use with the "in" statement # why doesn't this use ns_dbquotevalue? -proc template::util::tcl_to_sql_list { lst } { +ad_proc -public template::util::tcl_to_sql_list { lst } { if { [llength $lst] > 0 } { set sql "'" append sql [join $lst "', '"] @@ -728,14 +728,14 @@ # Get the template directory # The body is doublequoted, so it is interpreted when this file is read -proc template::get_resource_path {} " +ad_proc -public template::get_resource_path {} " return \"[file dir [file dir [info script]]]/resources\" " # return the variables and arrays of one frame as HTML -proc stack_frame_values {level} { +ad_proc -public stack_frame_values {level} { set varlist "" foreach i [if $level { uplevel \#$level {info locals} @@ -766,7 +766,7 @@ # return the whole call stack as HTML -proc stack_dump {} { +ad_proc -public stack_dump {} { append page "

Tcl Call Trace