Commit 262bceb7 authored by Frank Bergmann's avatar Frank Bergmann

- OpenACS 5.9

parent 867286ab
......@@ -2,24 +2,25 @@
<!-- Generated by the OpenACS Package Manager -->
<package key="acs-bootstrap-installer" url="http://openacs.org/repository/apm/packages/acs-bootstrap-installer" type="apm_service">
<package-name>Bootstrap Installer</package-name>
<pretty-plural>Bootstrap Installers</pretty-plural>
<package-name>ACS Bootstrap Installer</package-name>
<pretty-plural>ACS Bootstrap Installers</pretty-plural>
<initial-install-p>t</initial-install-p>
<singleton-p>t</singleton-p>
<implements-subsite-p>f</implements-subsite-p>
<inherit-templates-p>t</inherit-templates-p>
<version name="5.10.0d1" url="http://openacs.org/repository/download/apm/acs-bootstrap-installer-5.10.0d1.apm">
<version name="5.9.0" url="http://openacs.org/repository/download/apm/acs-bootstrap-installer-5.9.0.apm">
<owner url="mailto:dhogaza@pacifier.com">Don Baccus</owner>
<summary>Bootstraps an OpenACS installation.</summary>
<release-date>2013-09-08</release-date>
<release-date>2015-10-04</release-date>
<vendor url="http://openacs.org">OpenACS</vendor>
<description format="text/html">This package bootstraps OpenACS. If the core packages have not yet been installed, it calls the installer which leads the user through the steps necessary to do so. It also checks that the installation meets the requirements for a successful install of OpenACS.</description>
<license>GPL</license>
<maturity>3</maturity>
<provides url="acs-bootstrap-installer" version="5.10.0d1"/>
<requires url="acs-kernel" version="5.10.0d1"/>
<provides url="acs-bootstrap-installer" version="5.9.0"/>
<requires url="acs-kernel" version="5.9.0"/>
<requires url="acs-templating" version="5.9.0"/>
<callbacks>
<callback type="after-upgrade" proc="apm_bootstrap_upgrade"/>
......
......@@ -186,10 +186,16 @@ if { $errno && $errno != 2 } {
# to display the error message, rather than leaving the site administrator
# to guess what broke.
# If the $errorCode is "bootstrap_fatal_error", then the error was explicitly
# If the $::errorCode is "bootstrap_fatal_error", then the error was explicitly
# thrown by a call to bootstrap_fatal_error. If not, bootstrap_fatal_error was
# never called, so we need to call it now.
if {$::errorCode ne "bootstrap_fatal_error" } {
bootstrap_fatal_error "Error during bootstrapping" 0
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -205,3 +205,9 @@ ln -s /usr/bin/ksh /bin/ksh
set my_error_p 1
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -35,9 +35,9 @@ proc db_bootstrap_checks { errors error_p } {
nsv_set ad_database_version . $version
}
if { $version < 8.0 } {
append my_errors "<li>Your installed version of Postgres is too old. Please install PostgreSQL 8.0 or later.\n"
set my_error_p 1
if { $version < 9.0 } {
append my_errors "<li>WARNING: Your installed version of Postgres is too old. Please install PostgreSQL 9.0 or later.\n"
# set my_error_p 1
}
if { [catch { ns_pg_bind 1row $db "select count(*) from pg_class" }] } {
......@@ -59,8 +59,6 @@ proc db_bootstrap_checks { errors error_p } {
set my_error_p 1
}
# RBM: Remove check for 7.1 since we don't support it anymore. 2002-01-14
ns_db releasehandle $db
if { [info exists my_error_p] } {
......@@ -76,3 +74,9 @@ proc db_installer_checks { errors error_p } {
proc db_helper_checks { errors error_p } {
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -7,3 +7,9 @@
# Create a mutex for the installer
nsv_set acs_installer mutex [ns_mutex create oacs:installer]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -25,7 +25,7 @@ ad_proc -private install_input_widget {
set type_attribute [ad_decode $type "" "" "type=\"$type\""]
if { $value ne "" } {
append extra_attributes " value=\"[ad_quotehtml $value]\""
append extra_attributes " value=\"[ns_quotehtml $value]\""
}
set input_widget "<input name=\"$param_name\" size=\"$size\" $type_attribute $extra_attributes>"
......@@ -298,9 +298,8 @@ your URL and try again.
} error] } {
# In case of an error, don't forget to unlock the mutex.
ns_mutex unlock [nsv_get acs_installer mutex]
global errorInfo
install_return 500 "Error" "The following error occurred in an installation script:\n\
<blockquote><pre>[ns_quotehtml $errorInfo]</pre></blockquote>\n"
<blockquote><pre>[ns_quotehtml $::errorInfo]</pre></blockquote>\n"
}
if {[array size errors] > 0} {
install_return 500 "Error" [install_load_errors_formatted errors]
......@@ -359,10 +358,10 @@ ad_proc -private install_load_errors_formatted {errorVarName} {
set result ""
if {[array size errors] > 0} {
append result "<blockquote><pre>\n"
foreach {package errorInfos} [array get errors] {
foreach {package error_infos} [array get errors] {
append result "<h4>Error in Package $package:</h4>\n"
foreach {fileName backTrace} $errorInfos {
append result "<strong>Error in File $fileName</strong>\n\n[ad_quotehtml $backTrace]\n\n\n"
foreach {fileName backTrace} $error_infos {
append result "<strong>Error in File $fileName</strong>\n\n[ns_quotehtml $backTrace]\n\n\n"
}
}
append result "</pre></blockquote>\n"
......
......@@ -53,7 +53,7 @@ a suite of fully-integrated enterprise-class solutions
for collaborative commerce.
This is the OpenACS Installer which performs all the steps necessary
to get the OpenACS Community System running on your server.<p>
Please read the <a href=\"/doc/release-notes.html\">Release Notes</a>
Please read the <a href=\"/doc/release-notes\">Release Notes</a>
before proceeding to better understand what is contained in this release.
"
......@@ -112,6 +112,11 @@ Once you're sure everything is installed and configured correctly, restart AOLse
return
}
#
# Unset array errors, in case it exists
#
if {[array exists errors]} {array unset errors}
# Perform database-specific checks
db_installer_checks errors error_p
......@@ -195,8 +200,8 @@ the user executing the web server, normally <code>nsadmin</code>, and the owner
on this directory. You can correct this by running the following script as root.
To give another user access to the files, add them to <code>web</code> group.
<blockquote><pre>
groupadd web
chown -R nsadmin:web $::acs::rootdir
groupadd nsadmin
chown -R nsadmin:nsadmin $::acs::rootdir
chmod -R ug+rw $::acs::rootdir
</pre></blockquote>
</strong></p>"
......@@ -211,8 +216,8 @@ if { ![file writable [file join $::acs::rootdir packages]] } {
script as root.
To give another user access to the files, add them to <code>web</code> group.
<blockquote><pre>
groupadd web
chown -R nsadmin:web $::acs::rootdir/packages
groupadd nsadmin
chown -R nsadmin:nsadmin $::acs::rootdir/packages
chmod -R ug+rw $::acs::rootdir/packages
</pre></blockquote></strong></p>"
set error_p 1
......@@ -388,3 +393,9 @@ The email address to send New registration notifications.<br><br>
}
install_return 200 "Welcome" $body
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -204,3 +204,9 @@ if { $post_installation_message ne "" } {
}
ns_write [install_footer]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -7,11 +7,35 @@
#
# $Id$
# handling NaviServer deprecated ns_info subcommands.
namespace eval acs {
set ::acs::pageroot [expr {[catch {ns_server pagedir}] ? [ns_info pageroot] : [ns_server pagedir]}]
set ::acs::tcllib [expr {[catch {ns_server tcllib}] ? [ns_info tcllib] : [ns_server tcllib]}]
set ::acs::rootdir [file dirname [string trimright $::acs::tcllib "/"]]
#
# Determine, under which server we are running
#
set ::acs::useNaviServer [expr {[ns_info name] eq "NaviServer"}]
#
# Initialize the list of known database types . User code should use the database
# API routine db_known_database_types rather than reference the nsv list directly.
# We might change the way this is implemented later. Each database type is
# represented by a list consisting of the internal name, driver name, and
# "pretty name" (used by the APM to list the available database engines that
# one's package can choose to support). The driver name and "pretty name" happen
# to be the same for Postgres and Oracle but let's not depend on that being true
# in all cases...
#
set ::acs::known_database_types {
{oracle Oracle Oracle}
{postgresql PostgreSQL PostgreSQL}
}
#
# Enable / disable features depending on availability
#
set ::acs::pageroot [expr {$::acs::useNaviServer ? [ns_server pagedir] : [ns_info pageroot]}]
set ::acs::tcllib [expr {$::acs::useNaviServer ? [ns_server tcllib] : [ns_info tcllib]}]
set ::acs::rootdir [file dirname [string trimright $::acs::tcllib "/"]]
set ::acs::useNsfProc [expr {[info commands ::nsf::proc] ne ""}]
}
# Determine the OpenACS root directory, which is the directory right above the
......@@ -49,3 +73,9 @@ if { [file isfile $bootstrap_file] } {
} else {
ns_log "Error" "$bootstrap_file does not exist. Aborting the OpenACS load process."
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -51,3 +51,9 @@ foreach dir {www tcl} {
}
nsv_unset ad_after_server_initialization .
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -96,24 +96,43 @@ template::head::add_javascript -script {
# Add css for the current subsite, defaulting to the old list/form css which was
# hard-wired in previous versions of OpenACS.
set css [parameter::get -package_id [ad_conn subsite_id] -parameter ThemeCSS -default ""]
if {$css ne "" } {
set cssList [parameter::get -package_id [ad_conn subsite_id] -parameter ThemeCSS -default ""]
if {![string is list $cssList]} {
ns_log error "ignore value in ThemeCSS, since it is not a valid list: $cssList"
} elseif { [llength $cssList] > 0 } {
# DRB: Need to handle two cases, the lame first attempt and the more complete current
# attempt which allows you to specify all of the parameters to template::head::add_css
# (sigh, remove this kludge for 5.5.1). We need to handle the old case so upgrades
# to 5.5 for mgh and various of my sites work correctly.
foreach css $css {
if { [llength $css] == 2 && [llength [lindex $css 0]] == 1 } {
template::head::add_css -href [lindex $css 0] -media [lindex $css 1]
} else {
#
# The following syntaxes are supported
#
# 1) pairs: {/resources/acs-templating/lists.css all} ...
# 2) nested list of pairs: {{href /resources/acs-templating/lists.css} {media all} ... } ...
# 3) flat list of -att val pairs: {-href /resources/acs-templating/lists.css -media all ... } ...
#
foreach css $cssList {
set first [lindex $css 0]
if { [llength $css] == 2 && [llength $first] == 1 && [string range $first 0 0] ne "-"} {
template::head::add_css -href $first -media [lindex $css 1]
} elseif {[llength $first] == 2} {
set params [list]
foreach param $css {
lappend params -[lindex $param 0] [lindex $param 1]
}
template::head::add_css {*}$params
}
if {[catch {template::head::add_css {*}$params} errorMsg]} {
ns_log error $errorMsg
}
} else {
if {![string match -* [lindex $css 0]]} {
error "CSS specification '$css' is incorrect"
}
if {[catch {template::head::add_css {*}$css} errorMsg]} {
ns_log error $errorMsg
}
}
}
} else {
......@@ -125,6 +144,22 @@ if {$css ne "" } {
-media "all"
}
#
# Add js files via ThemeJS for the current subsite, similar to
# ThemeCSS. Syntax is the flat list syntax (3) from ThemeCSS, valid
# parameters are determined by template::add_script. It is possible to
# add head and body scripts.
set jsSpecs [parameter::get -package_id [ad_conn subsite_id] -parameter ThemeJS -default ""]
if {![string is list $jsSpecs]} {
ns_log error "ignore value in ThemeJS since it is not a valid list: $jsSpecs"
} else {
foreach jsSpec $jsSpecs {
if {[catch {template::add_script {*}$jsSpec} errorMsg]} {
ns_log error $errorMsg
}
}
}
#
# Temporary (?) fix to get xinha working
#
......@@ -212,12 +247,16 @@ if { [info exists ::acs_blank_master(tinymce)] } {
" -order tinymceZ
}
if { [info exists ::acs_blank_master(ckeditor4)] } {
template::head::add_javascript -src "//cdn.ckeditor.com/4.5.2/standard/ckeditor.js"
}
if {![info exists doc(title)]} {
set doc(title) "[ad_conn instance_name]"
ns_log warning "[ad_conn url] has no doc(title) set."
}
# AG: Markup in <title> tags doesn't render well.
set doc(title) [ns_striphtml $doc(title)]
#set doc(title) [ns_striphtml $doc(title)]
if {![info exists doc(charset)]} {
set doc(charset) [ns_config ns/parameters OutputCharset [ad_conn charset]]
......@@ -226,12 +265,15 @@ if {![info exists doc(charset)]} {
template::head::add_meta \
-content "text/html; charset=$doc(charset)" \
-http_equiv "content-type"
template::head::add_meta \
-content "text/css" \
-http_equiv "Content-Style-Type"
template::head::add_meta \
-content "text/javascript" \
-http_equiv "Content-Script-Type"
#
# The following meta tags are unknwon for HTML5, therefore discouraged
#
# template::head::add_meta \
# -content "text/css" \
# -http_equiv "Content-Style-Type"
# template::head::add_meta \
# -content "text/javascript" \
# -http_equiv "Content-Script-Type"
# The document language is always set from [ad_conn lang] which by default
# returns the language setting for the current user. This is probably
......@@ -272,3 +314,9 @@ set header [template::get_header_html]
set footer [template::get_footer_html]
template::head::prepare_multirows
set event_handlers [template::get_body_event_handlers]
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -12,3 +12,9 @@ proc site_failure_handler { conn arg why } {
ns_register_filter preauth GET * site_failure_handler
ns_register_filter preauth POST * site_failure_handler
ns_register_filter preauth HEAD * site_failure_handler
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -6,22 +6,25 @@ nsv_array set api_library_doc [list]
nsv_array set proc_doc [list]
nsv_array set proc_source_file [list]
#
# Safetybelt for ::acs::useNsfProc for upgrade phase to oacs-5-9
#
if {![info exists ::acs::useNsfProc]} {
ns_log notice "use fallback value for ::acs::useNsfProc"
set ::acs::useNsfProc 0
}
if {![info exists ::acs::useNaviServer]} {
ns_log notice "use fallback value for ::acs::useNaviServer"
set ::acs::useNaviServer [expr {[ns_info name] eq "NaviServer"}]
}
proc number_p { str } {
return [regexp {^[-+]?[0-9]*(.[0-9]+)?$} $str]
# Note that this will return true for empty string!
# TODO: Presumably this is by design? Probably better to use
# ad_var_type_check_number_p anyway.
#
# Note that ACS 3.2 defined number_p like this:
#
# if { $var eq "" } {
# return 0
# } else {
# return [regexp {^-?[0-9]*\.?[0-9]*$} $var match]
# }
#
# --atp@piskorski.com, 2003/03/16 21:09 EST
return [regexp {^[-+]?[0-9]*(.[0-9]+)?$} $str]
# Note that this will return true for empty string!
#
# TODO: Why not use Tcl's "string is double" ?
}
proc empty_string_p { query_string } {
......@@ -175,7 +178,10 @@ proc ad_proc args {
set n_args_remaining [expr { [llength $args] - $i }]
if {$callback eq ""} {
# We are creating a normal proc so the proc name is an argument
#
# We are creating an ordinary proc so the proc name is an
# argument
#
if { $n_args_remaining < 3 || $n_args_remaining > 4} {
return -code error "Wrong number of arguments passed to ad_proc"
}
......@@ -184,13 +190,17 @@ proc ad_proc args {
set proc_name [lindex $args $i]
} else {
if {$impl ne "" } {
# We are creating an implementation...
#
# We are creating a callback implementation
#
if {$n_args_remaining != 3} {
return -code error "ad_proc callback implementation must have: arguments (can be empty) docs code_body"
}
}
if {$impl eq ""} {
# We are creating an callback contract...
#
# We are creating a contract for a callback
#
if {!( $n_args_remaining == 3 || $n_args_remaining == 2 ) } {
return -code error "ad_proc callback contract must have: arguments docs \[empty_code_body\]"
} elseif {$n_args_remaining == 3
......@@ -242,8 +252,7 @@ proc ad_proc args {
if { $callback ne "" } {
# Do a namespace eval of each namespace to ensure it exists
set namespaces [split $proc_name ::]
set namespaces [lrange $namespaces 0 end-1]
set namespaces [lrange [split $proc_name ::] 0 end-1]
set curr_ns ""
foreach ns $namespaces {
......@@ -265,8 +274,7 @@ proc ad_proc args {
}
set code_block [lindex $args end]
if {$callback ne ""
&& $impl ne "" } {
if {$callback ne "" && $impl ne "" } {
if {[info exists doc_elements(see)]} {
lappend doc_elements(see) "callback::${callback}::contract"
} else {
......@@ -428,7 +436,9 @@ proc ad_proc args {
return
} else {
# we are creating a callback so create an empty body
set code_block { # this is a callback contract which only invokes its arg parser for input validation }
set code_block {
# this is a callback contract which only invokes its arg parser for input validation
}
}
}
......@@ -438,6 +448,7 @@ proc ad_proc args {
}
if { $callback ne "" && $impl ne "" } {
if { [info commands "::callback::${callback}::contract__arg_parser"] eq "" } {
# We create a dummy arg parser for the contract in case
# the contract hasn't been defined yet. We need this
......@@ -448,12 +459,55 @@ proc ad_proc args {
# We are creating a callback implementation so we invoke the
# arg parser of the contract proc
uplevel [::list proc $proc_name_as_passed args " ::callback::${callback}::contract__arg_parser\n${log_code}$code_block"]
if {$::acs::useNsfProc} {
uplevel [::list proc $proc_name_as_passed args \
" ::callback::${callback}::contract__arg_parser {*}\$args\n${log_code}$code_block"]
} else {
uplevel [::list proc $proc_name_as_passed args \
" ::callback::${callback}::contract__arg_parser\n${log_code}$code_block"]
}
} elseif { $callback eq "" && [llength $switches] == 0 } {
#
# Nothing special is used in the argument definiton, create a
# plain proc
#
uplevel [::list proc $proc_name_as_passed $arg_list "${log_code}$code_block"]
} else {
set parser_code " ::upvar args args\n"
#
# Default case, plain Tcl can't handle these cases
#
if {$::acs::useNsfProc} {
#
# nsf::proc can handle these cases. Just in case of the
# callback implementations we have to provide an
# arg_parser of the contract, since OpenACS uses always
# the argument definition of the contract to pass
# arguments in the implementation (which can be very
# confusing).
#
if {$callback ne ""} {
uplevel [::list ::nsf::proc -ad ::callback::${callback}::contract__arg_parser $arg_list {
foreach _ [info vars] {
uplevel [::list set $_ [set $_]]
}
}]
}
#ns_log notice "---- define nsf::proc for [::list proc $proc_name_as_passed $arg_list $code_block]"
uplevel [::list ::nsf::proc -ad $proc_name_as_passed $arg_list ${log_code}$code_block]
return
}
#
# There is no nsf::proc available. Define for every remaining
# function two procs, one for argument parsing, and one for
# the invocation. The latter one is defined with "args" and
# calls as first step the argument parser.
#
set parser_code " ::upvar args args\n"
foreach { name value } [array get default_values] {
append parser_code " ::upvar $name val ; ::set val [::list $value]\n"
}
......@@ -508,6 +562,12 @@ $switch_code
ns_write "PARSER CODE:\n\n$parser_code\n\n"
}
#
# old style proc
# for a function foo, define "foo $args" and "foo__arg_parser"
#
#ns_log notice "=== old style proc $proc_name_as_passed"
uplevel [::list proc ${proc_name_as_passed}__arg_parser {} $parser_code]
uplevel [::list proc $proc_name_as_passed args " ${proc_name_as_passed}__arg_parser\n${log_code}$code_block"]
}
......@@ -788,7 +848,7 @@ ad_proc -public callback {
set base ::callback::${callback}::impl
foreach procname [lsort [info commands ${base}::$impl]] {
set c [catch {::uplevel 1 $procname $args} ret]
set c [catch {::uplevel 1 [::list $procname {*}$args]} ret]
switch -exact $c {
0 { # code ok
if { $ret ne "" } {
......@@ -946,3 +1006,9 @@ ad_proc -public ad_assert_arg_value_in_list {
return 1
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -62,3 +62,9 @@ ad_proc -public ad_find_all_files {
}
return $files
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -15,9 +15,9 @@ ad_proc -private db_available_pools {dbn} {
@creation-date 2003/03/16
} {
if { $dbn eq "" } {
set dbn [nsv_get {db_default_database} .]
set dbn $::acs::default_database
}
return [nsv_get {db_available_pools} $dbn]
return [nsv_get db_available_pools $dbn]
}
ad_proc -private db_pool_to_dbn_init {} {
......@@ -31,7 +31,7 @@ ad_proc -private db_pool_to_dbn_init {} {
} {
foreach dbn [nsv_array names {db_available_pools}] {
foreach pool [db_available_pools $dbn] {
nsv_set {db_pool_to_dbn} $pool $dbn
nsv_set db_pool_to_dbn $pool $dbn
}
}
}
......@@ -92,17 +92,17 @@ ad_proc db_bootstrap_set_db_type { errors } {
# connecting to the same database and user in each pool, but at the moment
# that's seems anal even by DRB's standards.
# Initialize the list of known database types . User code should use the database
# API routine db_known_database_types rather than reference the nsv list directly.
# We might change the way this is implemented later. Each database type is
# represented by a list consisting of the internal name, driver name, and
# "pretty name" (used by the APM to list the available database engines that
# one's package can choose to support). The driver name and "pretty name" happen
# to be the same for Postgres and Oracle but let's not depend on that being true
# in all cases...
# The same information is as well in 0-acs-init.tcl; it is kept
# here for a while to guarantee a smooth migration, since the
# db-interface is essential and we have to deal with situations,
# where still an old 0-acs-init.tcl is active. This could be
# removed around OpenACS 6.*
#
set ::acs::known_database_types {
{oracle Oracle Oracle}
{postgresql PostgreSQL PostgreSQL}
}
nsv_set ad_known_database_types . \
[list [list "oracle" "Oracle" "Oracle"] [list "postgresql" "PostgreSQL" "PostgreSQL"]]
#
# Initialize the list of available pools
......@@ -133,7 +133,7 @@ ad_proc db_bootstrap_set_db_type { errors } {
# all_pools to ensure that the pool is valid.
set dbn_pools [ns_config $config_path "pools_${dbn}"]
nsv_set {db_available_pools} $dbn $dbn_pools
nsv_set db_available_pools $dbn $dbn_pools
ns_log Notice "$proc_name: For database '$dbn', the following pools are available: $dbn_pools"
}
......@@ -144,7 +144,8 @@ ad_proc db_bootstrap_set_db_type { errors } {
}
}
nsv_set {db_default_database} . $default_dbn
set ::acs::default_database $default_dbn
ns_log Notice "$proc_name: Default database (dbn) is: '$default_dbn'"
if { $old_availablepool_p } {
......@@ -178,11 +179,9 @@ ad_proc db_bootstrap_set_db_type { errors } {
# them in plain english
if { [llength $pools] == 0 } {
set database_problem "There are no database pools specified in your OpenNSD
configuration file."
set database_problem "There are no database pools specified in your NaviServer configuration file."
} elseif { [llength $pools] < 3 } {
set database_problem "OpenACS requires three database pools in order to
run correctly."
set database_problem "OpenACS requires three database pools in order to run correctly."
}
# We're done with the mult-db dbn stuff, from now on we deal only
......@@ -206,7 +205,7 @@ ad_proc db_bootstrap_set_db_type { errors } {
set bad_pools [list]
set long_error 0
foreach pool $pools {
if { [catch { set db [ns_db gethandle -timeout 15 $pool]}] || $db eq "" } {
if { [catch { set db [ns_db gethandle -timeout 15 $pool]} errorMsg] || $db eq "" } {
ns_log Warning "$proc_name: couldn't allocate a handle from database pool \"$pool\"."
lappend bad_pools "<li>OpenACS could not allocate a handle from database pool \"$pool\"."
set long_error 1
......@@ -217,7 +216,7 @@ ad_proc db_bootstrap_set_db_type { errors } {
set database_problem "RDBMS type could not be determined: $errmsg"
ns_log Error "$proc_name: RDBMS type could not be determined: $errmsg"
} else {
foreach known_database_type [nsv_get ad_known_database_types .] {
foreach known_database_type $::acs::known_database_types {
set this_type [lindex $known_database_type 1]
......@@ -267,3 +266,9 @@ ad_proc db_bootstrap_set_db_type { errors } {
}
}
}
# Local variables:
# mode: tcl
# tcl-indent-level: 4
# indent-tabs-mode: nil
# End:
......@@ -322,7 +322,7 @@ ad_proc -private apm_guess_db_type { package_key path } {
if {$db_dir eq "common"} {
return ""
}
foreach known_database_type [db_known_database_types] {
foreach known_database_type $::acs::known_database_types {
if {[lindex $known_database_type 0] eq $db_dir} {
return $db_dir
}
......@@ -332,7 +332,7 @@ ad_proc -private apm_guess_db_type { package_key path } {
}
set file_name [file tail $path]
foreach known_database_type [nsv_get ad_known_database_types .] {
foreach known_database_type $::acs::known_database_types {
if { [regexp -- "\-[lindex $known_database_type 0]\.(xql|tcl|sqlj)\$" $file_name match] } {
return [lindex $known_database_type 0]
}
......@@ -602,7 +602,7 @@ ad_proc apm_bootstrap_upgrade {
acs-bootstrap-installer package (rather than a full tar file
install as in eralier versions).
Caveat: don't modify these files in your local installation, addin
Caveat: don't modify these files in your local installation, adding
extra files to $::acs::rootdir/tcl is fine.
} {
set source $::acs::rootdir/packages/acs-bootstrap-installer/installer/tcl
......
......@@ -236,6 +236,13 @@ ad_proc -public db_qd_load_query_file {file_path {errorVarName ""}} {
}
}
# small compatibility function to avoid existence checks at runtime
if {[info commands ::nsf::strip_proc_name] eq ""} {
namespace eval ::nsf {
proc ::nsf::strip_proc_name {name} {return $name}
}
}
ad_proc -public db_qd_get_fullname {local_name {added_stack_num 1}} {
Find the fully qualified name of the query
......@@ -252,7 +259,7 @@ ad_proc -public db_qd_get_fullname {local_name {added_stack_num 1}} {
# (eg. from bootstrap.tcl), in which case we return what we
# were given
if { [catch {string trimleft [info level [expr {-1 - $added_stack_num}]] ::} proc_name] } {
return $local_name
return [::nsf::strip_proc_name $local_name]
}
# If util_memoize, we have to go back up one in the stack
......@@ -261,6 +268,7 @@ ad_proc -public db_qd_get_fullname {local_name {added_stack_num 1}} {
set proc_name [info level [expr {-2 - $added_stack_num}]]
}
set proc_name [::nsf::strip_proc_name $proc_name]
set list_of_source_procs {ns_sourceproc apm_source template::adp_parse template::frm_page_handler rp_handle_tcl_request}
# We check if we're running the special ns_ proc that tells us
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment