Index: openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl,v diff -u -r1.27.8.22 -r1.27.8.23 --- openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 10 Sep 2014 20:19:26 -0000 1.27.8.22 +++ openacs-4/packages/acs-api-browser/tcl/acs-api-documentation-procs.tcl 11 Sep 2014 08:01:04 -0000 1.27.8.23 @@ -105,7 +105,7 @@ regsub -all {\#.*$} $line "" line set line [string trim $line] if { $line ne "" } { - set has_contract_p [regexp {^ad_page_contract\s} $line] + set has_contract_p [regexp {(^ad_page_contract\s)|( initialize )} $line match] break } } @@ -116,20 +116,25 @@ } doc_set_page_documentation_mode 1 + #ns_log notice "Sourcing $::acs::rootdir/$path in documentation mode" set errno [catch { source "$::acs::rootdir/$path" } error] doc_set_page_documentation_mode 0 - if { $errno == 1 } { - if { [regexp {^ad_page_contract documentation} $::errorInfo] } { + + # + # In documentation mode, we expect ad_page_contract (and counterparts) + # to break out of sourcing with an error to avoid side-effects of sourcing + # + if { $errno == 1} { + if {[regexp {^ad_page_contract documentation} $::errorInfo] } { array set doc_elements $error } - } else { - return -code $errno -errorcode $::errorCode -errorinfo $::errorInfo $error + if { [info exists doc_elements] } { + return [array get doc_elements] + } + return [list] } - if { [info exists doc_elements] } { - return [array get doc_elements] - } - return [list] + return -code $errno -errorcode $::errorCode -errorinfo $::errorInfo $error } ad_proc -public api_script_documentation { @@ -928,9 +933,7 @@ @return boolean value } { set result 0 - if {[string match "::*" $proc_name]} { ;# only check for absolute names - catch {set result [::xotcl::api inscope $scope ::xotcl::Object isobject $proc_name]} - } + catch {set result [::xotcl::api inscope $scope ::xotcl::Object isobject $proc_name]} return $result } Index: openacs-4/packages/acs-api-browser/www/content-page-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/content-page-view.tcl,v diff -u -r1.5.4.7 -r1.5.4.8 --- openacs-4/packages/acs-api-browser/www/content-page-view.tcl 10 Sep 2014 20:19:26 -0000 1.5.4.7 +++ openacs-4/packages/acs-api-browser/www/content-page-view.tcl 11 Sep 2014 08:01:05 -0000 1.5.4.8 @@ -12,7 +12,7 @@ } { version_id:naturalnum,optional source_p:integer,optional,trim - path + path:trim } -properties { title:onevalue context:onevalue @@ -29,7 +29,7 @@ } if { ![info exists version_id] && \ - [regexp {^packages/([^ /]+)/} $path "" package_key] } { + [regexp {^packages/([^ /]+)/} $path . package_key] } { db_0or1row version_id_from_package_key { select version_id from apm_enabled_package_versions Index: openacs-4/packages/acs-api-browser/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/index.adp,v diff -u -r1.18.2.2 -r1.18.2.3 --- openacs-4/packages/acs-api-browser/www/index.adp 11 Sep 2014 06:05:14 -0000 1.18.2.2 +++ openacs-4/packages/acs-api-browser/www/index.adp 11 Sep 2014 08:01:05 -0000 1.18.2.3 @@ -8,14 +8,13 @@
+ Content File Source
+
+
+
+ @file_contents;literal@