Index: openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl,v diff -u -r1.115 -r1.116 --- openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 18 Apr 2018 09:09:12 -0000 1.115 +++ openacs-4/packages/acs-tcl/tcl/apm-install-procs.tcl 23 Apr 2018 18:24:56 -0000 1.116 @@ -12,7 +12,7 @@ namespace eval apm::package_version::attributes {} namespace eval ::install::xml::action {} -ad_proc apm_scan_packages { +ad_proc apm_scan_packages { {-callback apm_dummy_callback} {-new:boolean} {path ""} @@ -49,7 +49,7 @@ continue } } - + # Locate the .info file for this package. if { [catch { set info_file [apm_package_info_file_path -path $path $package_key] } error] } { apm_callback_and_log -severity Warning $callback "Unable to locate specification file for package $package_key: $error" @@ -58,10 +58,10 @@ # We found the .info file. lappend new_spec_files $info_file } - + if { [llength $new_spec_files] == 0 } { ns_log Notice "apm_scan_packages: No new packages found in $path" - } + } return $new_spec_files } @@ -75,8 +75,8 @@ Returns 1 if the current system provides the dependency inquired about. Returns -1 if the version number is too low. Returns 0 otherwise. - @param dependency_list Specify this if you want to a check a list of dependencies of form - {dependency_name dependency_version} in addition to querying the database for what the + @param dependency_list Specify this if you want to a check a list of dependencies of form + {dependency_name dependency_version} in addition to querying the database for what the system currently provides. @param dependency_uri The dependency that is being checked. @param dependency_version The version of the dependency being checked. @@ -110,13 +110,13 @@ if { $provided_p } { ns_log Debug "apm_dependency_provided_p: Dependency satisfied in list of provisions." return 1 - } else { + } else { set old_version_p 1 } } } } - + if { $old_version_p} { return -1 } else { @@ -138,7 +138,7 @@ @param requires A list of requirements provided by the package.. @param dependency_p Can the package be installed without violating dependency checking. @param comment Some text about the package. Useful to explain why it fails dependency check. - @return a list whose first element is a package key and whose second element is a path + @return a list whose first element is a package key and whose second element is a path to the associated .info file. } { return [list $package_key $spec_file_path $embeds $extends $provides $requires $dependency_p $comment] @@ -253,7 +253,7 @@ ## Every time we satisfy another package, remove it from install_pend, and loop again. ## If we don't satisfy at least one more package, halt. ## install_in - Package info structures for packages that can be installed in a satisfactory order. - ## install_pend - Stores package info structures fro packages that might have their dependencies satisfied + ## install_pend - Stores package info structures fro packages that might have their dependencies satisfied ## by packages in the install set. ## extra_package_keys - package keys of extra packages to install to satisfy all requirements. @@ -264,8 +264,8 @@ foreach spec_file $spec_files { if { [catch { array set package [apm_read_package_info_file $spec_file] - if { ($package(initial-install-p) eq "t" || !$initial_install_p) - && [apm_package_supports_rdbms_p -package_key $package(package.key)] + if { ($package(initial-install-p) eq "t" || !$initial_install_p) + && [apm_package_supports_rdbms_p -package_key $package(package.key)] } { lappend install_pend [pkg_info_new \ $package(package.key) \ @@ -289,12 +289,12 @@ } } errmsg]} { # Failed to parse the specification file. - apm_callback_and_log $callback "$spec_file could not be parsed correctly. It is not being installed. + apm_callback_and_log $callback "$spec_file could not be parsed correctly. It is not being installed. The error: $errmsg" } } - # Outer loop tries to find a package from the pkg_info_all list to add if + # Outer loop tries to find a package from the pkg_info_all list to add if # we're stuck because of unsatisfied dependencies set updated_p 1 while { $updated_p } { @@ -309,7 +309,7 @@ foreach prov [pkg_info_provides $pkg_info] { lappend install_in_provides $prov } - } + } # Now determine if we can add another package to the install set. foreach pkg_info $install_pend { set satisfied_p 1 @@ -320,7 +320,7 @@ set satisfied_p 0 # Check to see if we've recorded it already set errmsg "Requires [lindex $req 0] of version >= [lindex $req 1]." - if { ![info exists install_error([pkg_info_key $pkg_info])] || + if { ![info exists install_error([pkg_info_key $pkg_info])] || $errmsg ni $install_error([pkg_info_key $pkg_info])} { lappend install_error([pkg_info_key $pkg_info]) $errmsg } @@ -346,10 +346,10 @@ } set updated_p 0 - + if { [info exists install_pend] && $install_pend ne "" && [llength $pkg_info_all] > 0 } { # Okay, there are some packages that could not be installed - + # Let's find a package, which # - have unsatisfied requirements # - and we have a package in pkg_info_all which provides what this package requires @@ -360,17 +360,17 @@ set counter 0 foreach pkg_info_add $pkg_info_all { # Will this package do anything to change whether this requirement has been satisfied? - if { [pkg_info_key $pkg_info_add] eq [lindex $req 0] + if { [pkg_info_key $pkg_info_add] eq [lindex $req 0] && [apm_dependency_provided_p -dependency_list [pkg_info_provides $pkg_info_add] \ - [lindex $req 0] [lindex $req 1]] == 1 + [lindex $req 0] [lindex $req 1]] == 1 } { # It sure does. Add it to list of packages to install lappend install_pend $pkg_info_add # Add it to list of extra package keys lappend extra_package_keys [pkg_info_key $pkg_info_add] - + # Remove it from list of packages that we can possibly install set pkg_info_all [lreplace $pkg_info_all $counter $counter] @@ -392,7 +392,7 @@ } } } - + set install_order(order) $install_in # Update all of the packages that cannot be installed. if { [info exists install_pend] && $install_pend ne "" } { @@ -413,13 +413,13 @@ {-package_keys:required} } { Checks dependencies and finds out which packages are required to install the requested packages. - In case some packages cannot be installed due to failed dependencies, it returns which packages out + In case some packages cannot be installed due to failed dependencies, it returns which packages out of the requested can be installed, and which packages, either originally requested or required by those, could not be installed, and why. @param package_keys The list of package_keys of the packages requested to be installed. - @param repository_array Name of an array in the caller's namespace containing the repository of + @param repository_array Name of an array in the caller's namespace containing the repository of available packages as returned by apm_get_package_repository. @return An array list with the following elements: @@ -428,18 +428,18 @@
[lindex $operations 1] $version(package-name), version $version(name).
" } on error {errmsg} { ns_log Error "apm_package_install: Error installing $version(package-name) version $version(name): $errmsg\n$::errorInfo" @@ -945,15 +945,15 @@- NOTE: If the error comes from a sql script you may try to source it manually. When you are done with that you should revisit the APM and try again but remember to leave the manually souced sql scipts unchecked on the previous page. + NOTE: If the error comes from a sql script you may try to source it manually. When you are done with that you should revisit the APM and try again but remember to leave the manually souced sql scipts unchecked on the previous page.
}] return 0 } # Enable the package if { $enable_p } { - nsv_set apm_enabled_package $package_key 1 + nsv_set apm_enabled_package $package_key 1 apm_version_enable -callback $callback $version_id } @@ -970,7 +970,7 @@ set parent_id [site_node::get_node_id -url "/"] if { [catch { - db_transaction { + db_transaction { set node_id [site_node::new -name $priority_mount_path -parent_id $parent_id] } } error] } { @@ -999,7 +999,7 @@ set error_text "Package $version(package-name) could not be mounted at /$version(auto-mount) , there may already be a package mounted there, the error is: $error" ns_log Error "apm_package_install: $error_text \n\n$::errorInfo" apm_callback_and_log $callback "$error_text
" - } + } } elseif { $package_type eq "apm_service" && $singleton_p == "t" } { # This is a singleton package. Instantiate it automatically, but don't mount. @@ -1009,7 +1009,7 @@ -package_key $package_key } - + if {[file exists $::acs::rootdir/packages/$package_key/install.xml]} { # # Run install.xml only for new installs @@ -1108,7 +1108,7 @@ ad_proc -private apm_package_deinstall { - {-callback apm_dummy_callback} + {-callback apm_dummy_callback} package_key } { @@ -1163,7 +1163,7 @@ # get the supposedly unique enabled version of this package set version_id [apm_version_id_from_package_key $package_key] - # Unmount all instances of this package with the Tcl API that + # Unmount all instances of this package with the Tcl API that # invokes before-unmount callbacks db_transaction { db_foreach all_package_instances { @@ -1177,7 +1177,7 @@ site_node::unmount -node_id $node_id } - # Delete the package instances with Tcl API that invokes + # Delete the package instances with Tcl API that invokes # before-uninstantiate callbacks db_foreach all_package_instances { select package_id @@ -1210,12 +1210,12 @@ db_source_sql_file -callback $callback "[acs_package_root_dir $package_key]/$path" apm_callback_and_log $callback "" } - } + } # Optionally remove the files from the filesystem if {$remove_files_p==1} { - if { [catch { - file delete -force -- [acs_package_root_dir $package_key] + if { [catch { + file delete -force -- [acs_package_root_dir $package_key] } error] } { apm_callback_and_log $callback "[string totitle $package_key] not installed.
Error:
" - } + } } } @@ -1649,7 +1636,7 @@ ad_proc -private apm_package_upgrade_from { package_key version_name } { @param package_key The package you're installing @param version_name The version of the package you're installing - @return the version of the package currently installed, which we're upgrading from, if it's + @return the version of the package currently installed, which we're upgrading from, if it's different from the version_name passed in. If this is not an upgrade, returns the empty string. } { return [db_string apm_package_upgrade_from {} -default ""] @@ -1662,7 +1649,7 @@ } { db_exec_plsql apm_version_upgrade {} -} +} ad_proc -private apm_upgrade_for_version_p {path initial_version_name final_version_name} { @@ -1694,12 +1681,12 @@ set f1 [lindex [split $f1 /] end] set f2 [lindex [split $f2 /] end] - # Get the version number from, e.g. the 2.0 from upgrade-2.0-3.0.sql - if {[regexp {\-(.*)-.*.sql} $f1 match f1_version_from] + # Get the version number from, e.g. the 2.0 from upgrade-2.0-3.0.sql + if {[regexp {\-(.*)-.*.sql} $f1 match f1_version_from] && [regexp {\-(.*)-.*.sql} $f2 match f2_version_from] } { # At this point we should have something like 2.0 and 3.1d which Tcl string - # comparison can handle. + # comparison can handle. set f1_version_from [db_exec_plsql test_f1 {}] set f2_version_from [db_exec_plsql test_f2 {}] return [string compare $f1_version_from $f2_version_from] @@ -1716,7 +1703,7 @@ } { @param version_id What version the files belong to. @param upgrade Set this switch if you want the scripts for upgrading. - @return A list of files and file types of form [list [list "foo.sql" "data_model_upgrade"] ...] + @return A list of files and file types of form [list [list "foo.sql" "data_model_upgrade"] ...] } { set types_to_retrieve [list "sqlj_code"] if {$upgrade_from_version_name eq ""} { @@ -1772,20 +1759,20 @@ package_key file_list } { - @param file_list A list of files and file types of form [list [list "foo.sql" "data_model_upgrade"] ...] + @param file_list A list of files and file types of form [list [list "foo.sql" "data_model_upgrade"] ...] } { set query_file_list [list] foreach file $file_list { - lassign $file path file_type file_db_type + lassign $file path file_type file_db_type ns_log Debug "apm_query_files_find: Checking \"$path\" of type \"$file_type\" and db_type \"$file_db_type\"." # DRB: we return query files which match the given database type or for which no db_type # is defined, which we interpret to mean a file containing queries that work with all of our # supported databases. - if {"query_file" eq $file_type + if {"query_file" eq $file_type && ($file_db_type eq "" || [db_type] eq $file_db_type ) } { ns_log Debug "apm_query_files_find: Adding $path to the list of query files." @@ -1819,7 +1806,7 @@ ns_log Notice "apm_mount_core_packages: Starting mounting of core packages" # Mount acs-lang - ns_log Notice "apm_mount_core_packages: Mounting acs-lang" + ns_log Notice "apm_mount_core_packages: Mounting acs-lang" set acs_lang_id [site_node::instantiate_and_mount -package_key acs-lang] permission::grant -party_id [acs_magic_object the_public] \ -object_id $acs_lang_id \ @@ -1830,20 +1817,20 @@ site_node::instantiate_and_mount -package_key acs-admin # Mount acs-service-contract - ns_log Notice "apm_mount_core_packages: Mounting acs-service-contract" + ns_log Notice "apm_mount_core_packages: Mounting acs-service-contract" site_node::instantiate_and_mount -package_key acs-service-contract # Mount the acs-content-repository - ns_log Notice "apm_mount_core_packages: Mounting acs-content-repository" + ns_log Notice "apm_mount_core_packages: Mounting acs-content-repository" site_node::instantiate_and_mount -package_key acs-content-repository # Mount acs-core-docs - ns_log Notice "apm_mount_core_packages: Mounting acs-core-docs" + ns_log Notice "apm_mount_core_packages: Mounting acs-core-docs" site_node::instantiate_and_mount -node_name doc \ -package_key acs-core-docs # Mount the acs-api-browser - ns_log Notice "apm_mount_core_packages: Mounting acs-api-browser" + ns_log Notice "apm_mount_core_packages: Mounting acs-api-browser" set api_browser_id \ [site_node::instantiate_and_mount -node_name api-doc \ -package_key acs-api-browser] @@ -1855,7 +1842,7 @@ permission::set_not_inherit -object_id $api_browser_id # Mount acs-automated-testing - ns_log Notice "apm_mount_core_packages: Mounting acs-automated-testing" + ns_log Notice "apm_mount_core_packages: Mounting acs-automated-testing" site_node::instantiate_and_mount -node_name test \ -package_key acs-automated-testing @@ -1880,7 +1867,7 @@ Example: -[ns_quotehtml $errmsg][ns_quotehtml $::errorInfo]
@@ -1946,9 +1933,9 @@ {-from_version_name:required} {-to_version_name:required} } { - apm_upgrade_logic \ - -from_version_name $from_version_name \ - -to_version_name $to_version_name \ + apm_upgrade_logic \ + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ -spec { 1.1 1.2 { ... @@ -1986,9 +1973,9 @@ # Check that # from_version_name < elm_from < elm_to < to_version_name - if { [apm_version_names_compare $from_version_name $elm_from] <= 0 - && [apm_version_names_compare $elm_from $elm_to] <= 0 - && [apm_version_names_compare $elm_to $to_version_name] <= 0 + if { [apm_version_names_compare $from_version_name $elm_from] <= 0 + && [apm_version_names_compare $elm_from $elm_to] <= 0 + && [apm_version_names_compare $elm_to $to_version_name] <= 0 } { set chunks($elm_from,$elm_to) $elm_chunk } @@ -2027,34 +2014,34 @@ upvar 1 $array repository #ns_log notice "apm_get_package_repository repository_url=$repository_url" - + apm_get_installed_versions -array installed_version if { $repository_url ne "" } { set manifest_url "${repository_url}manifest.xml" #ns_log notice "apm_get_package_repository manifest_url=$manifest_url" - + # See if we already have it in a client property set manifest [ad_get_client_property acs-admin [string range $manifest_url end-49 end]] if { $manifest eq "" } { # Nope, get it now #ns_log notice [list util::http::get -timeout 120 -url $manifest_url] set dict [util::http::get -timeout 120 -url $manifest_url] - + if { [dict get $dict status] ne "200" } { error "Couldn't get the package list. Please try again later. Status: [dict get $dict status]" } - + set manifest [dict get $dict page] - + # Store for subsequent requests ad_set_client_property -clob t acs-admin [string range $manifest_url end-49 end] $manifest } # Parse manifest - + set tree [xml_parse -persist $manifest] set root_node [xml_doc_get_first_node $tree] @@ -2095,8 +2082,8 @@ apm::package_version::attributes::parse_xml \ -parent_node $package_node \ - -array version - + -array version + foreach dependency_type { provides requires embeds extends } { set version($dependency_type) {} foreach dependency_node [xml_node_get_children_by_name $package_node "$dependency_type"] { @@ -2106,13 +2093,13 @@ } } foreach install_node [xml_node_get_children_by_name $package_node "install"] { - lappend version(install) [xml_node_get_attribute $install_node "package"] + lappend version(install) [xml_node_get_attribute $install_node "package"] } if { ![info exists installed_version($version(package.key))] } { # Package is not installed set version(install_type) install - } elseif { $version(name) eq $installed_version($version(package.key)) || + } elseif { $version(name) eq $installed_version($version(package.key)) || [apm_higher_version_installed_p $version(package.key) $version(name)] != 1 } { # This version or a higher version already installed set version(install_type) already_installed @@ -2122,7 +2109,7 @@ } ns_log Debug "apm_get_package_repository: $version(package.key) = $version(install_type) -- [array get installed_version]" - + if { $version(install_type) ne "already_installed" } { set repository($version(package.key)) [array get version] } @@ -2135,14 +2122,14 @@ ad_try { array unset version array set version [apm_read_package_info_file $spec_file] - + # If the package doesn't support this RDBMS, it's not really available for install if { [apm_package_supports_rdbms_p -package_key $version(package.key)] } { if { ![info exists installed_version($version(package.key))] } { # Package is not installed set version(install_type) install - } elseif { $version(name) eq $installed_version($version(package.key)) || + } elseif { $version(name) eq $installed_version($version(package.key)) || [apm_higher_version_installed_p $version(package.key) $version(name)] != 1 } { # This version or a higher version already installed set version(install_type) already_installed @@ -2166,7 +2153,7 @@ ad_proc -public apm_get_repository_channel {} { Returns the channel to use when installing software from the repository. - Based on the version of the acs-kernel package, e.g. if acs-kernel is + Based on the version of the acs-kernel package, e.g. if acs-kernel is version 5.0.1, then this will return 5-0. } { set kernel_versionv [split [ad_acs_version] .] @@ -2224,14 +2211,14 @@ set __the_body__ [read $file] close $file # Interpolate the vars. - if {$binds ne ""} { + if {$binds ne ""} { foreach {var val} $binds { set $var [ns_quotehtml $val] } - if {![info exists Id]} { + if {![info exists Id]} { set Id {$Id} } - if {[catch {set __the_body__ [subst -nobackslashes -nocommands ${__the_body__}]} err]} { + if {[catch {set __the_body__ [subst -nobackslashes -nocommands ${__the_body__}]} err]} { error $err } } @@ -2245,7 +2232,7 @@ -install_from_repository:boolean filename binds } { - process an xml install definition file which is expected to contain + process an xml install definition file which is expected to contain directives to install, mount and configure a series of packages. @param filename path to the xml file relative to serverroot. @@ -2260,9 +2247,9 @@ # If it's not a nested call then initialize the ids array. # If it is nested we will typically need id's from the parent if {!$nested_p} { - array unset ids + array unset ids array set ids [list] - + # set default ids for the main site and core packages set ids(ACS_KERNEL) [apm_package_id_from_key acs-kernel] set ids(ACS_TEMPLATING) [apm_package_id_from_key acs-templating] @@ -2273,7 +2260,7 @@ lappend ::template::parse_level [info level] - set root_node [apm_load_install_xml $filename $binds] + set root_node [apm_load_install_xml $filename $binds] set acs_application(name) [apm_required_attribute_value $root_node name] set acs_application(pretty_name) [apm_attribute_value -default $acs_application(name) $root_node pretty-name] @@ -2340,8 +2327,8 @@ ############# ad_proc -private apm::package_version::attributes::set_all_instances_names {} { - Set all names of the instances for those packages that have - the attribute package_instance_name. After running + Set all names of the instances for those packages that have + the attribute package_instance_name. After running this script you must restart your installation. } { # packages list @@ -2356,7 +2343,7 @@ set path [apm_package_info_file_path $package_key] array set version_properties [apm_read_package_info_file $path] set package_name $version_properties(package-name) - + # Getting instances name db_foreach get_instances_names { select instance_name @@ -2365,7 +2352,7 @@ } { # Removing the character "#". regsub -all {[\#]*} $instance_name {\1} instance_name - + # Verifying whether this instance_name is a message_key set is_msg [lang::message::message_exists_p [ad_conn locale] $instance_name] if {$package_name eq $instance_name && $is_msg eq 0} { @@ -2379,7 +2366,7 @@ } } } - } + } } } } @@ -2388,7 +2375,7 @@ Return the package_instance_name which is used for naming instances in .LRN, every time that we are creating a class. - + @author Cesar Hernandez } { @@ -2582,15 +2569,15 @@ values (:attribute_name, :attribute_value, :version_id) } } - } + } } } ad_proc -private apm::package_version::attributes::get { {-version_id:required} {-array:required} } { - Set an array with the attribute values of a certain package version. + Set an array with the attribute values of a certain package version. @param version_id The id of the package version to return attribute values for @@ -2641,7 +2628,7 @@ set xml_string "${indentation}<$element_name $attribute_name=\"[ns_quotehtml $value]\"/>\n" } } - return $xml_string + return $xml_string } ad_proc -private apm::package_version::attributes::generate_xml { @@ -2665,7 +2652,7 @@ -array attributes] set attribute_defs [apm::package_version::attributes::get_spec] - # sort the array so that the xml is always in the same order so + # sort the array so that the xml is always in the same order so # its stable for CVS. foreach attribute_name [lsort [array names attributes]] { # 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.8 -r1.9 --- openacs-4/packages/acs-templating/tcl/doc-procs.tcl 7 Aug 2017 23:48:01 -0000 1.8 +++ openacs-4/packages/acs-templating/tcl/doc-procs.tcl 23 Apr 2018 18:24:56 -0000 1.9 @@ -22,151 +22,151 @@ namespace eval template {} ad_proc -public template::parse_directives { - code + code } { - Parse out directives embedded in the code parameter. + Parse out directives embedded in the code parameter. } { - # remove carriage returns if present - regsub -all {\r|\r\n} $code {\n} code + # remove carriage returns if present + regsub -all {\r|\r\n} $code {\n} code - # remove extra blank lines - regsub -all {(\n)\n} $code {\1} code + # remove extra blank lines + regsub -all {(\n)\n} $code {\1} code - set lines [split $code "\n"] + set lines [split $code "\n"] - # regular expression for match directive comments - set direxp {^\#[\s]*@([a-zA-Z0-9\-_]+)[\s]+(.*)$} + # regular expression for match directive comments + set direxp {^\#[\s]*@([a-zA-Z0-9\-_]+)[\s]+(.*)$} - set directives [list] + set directives [list] - foreach line $lines { + foreach line $lines { - if { [regexp $direxp $line x next_directive next_comment] } { + if { [regexp $direxp $line x next_directive next_comment] } { - # start a new directive + # start a new directive - if { [info exists directive] } { + if { [info exists directive] } { - # finish last directive - lappend directives [list $directive $comment] - } + # finish last directive + lappend directives [list $directive $comment] + } - set directive $next_directive - set comment $next_comment - - } elseif { [info exists directive] } { + set directive $next_directive + set comment $next_comment - if { [regexp {^\#\s*(.*)$} $line x add_comment] } { + } elseif { [info exists directive] } { - # append this line to the current directive - append comment " $add_comment" + if { [regexp {^\#\s*(.*)$} $line x add_comment] } { - } else { + # append this line to the current directive + append comment " $add_comment" - # finish directive - lappend directives [list $directive $comment] - unset directive - unset comment - } + } else { + + # finish directive + lappend directives [list $directive $comment] + unset directive + unset comment + } + } } - } - if { [info exists directive] } { - lappend directives [list $directive $comment] - } + if { [info exists directive] } { + lappend directives [list $directive $comment] + } - return $directives + return $directives } ad_proc -public template::get_datasources { code } { Assemble directives into data source(s) for presentation. } { - upvar datasources:rowcount rowcount - set rowcount 0 + upvar datasources:rowcount rowcount + set rowcount 0 - #for debugging purposes - upvar output text - set text [parse_directives $code] + #for debugging purposes + upvar output text + set text [parse_directives $code] - foreach directive [parse_directives $code] { - - switch -exact [lindex $directive 0] { + foreach directive [parse_directives $code] { - datasource { + switch -exact [lindex $directive 0] { - # directive is a new datasource - set info [lindex $directive 1] - set name [lindex $info 0] - set structure [lindex $info 1] - set comment [lrange $info 2 end] + datasource { - if { [string match "one*" $structure] } { + # directive is a new datasource + set info [lindex $directive 1] + # Assign the first elements of $info to 'name' and 'structure', + # and the rest to 'comment' + set comment [lassign $info name structure] - # directive is a onevalue or onelist. add a row and move on - incr rowcount - upvar datasources:$rowcount datasource + if { [string match "one*" $structure] } { - set datasource(rownum) $rowcount - set datasource(name) $name - set datasource(structure) $structure - set datasource(comment) $comment - } - } + # directive is a onevalue or onelist. add a row and move on + incr rowcount + upvar datasources:$rowcount datasource - data_input { - # directive is a new form - set info [lindex $directive 1] - set name [lindex $info 0] - set structure [lindex $info 1] - set comment [lrange $info 2 end] - } - - input { - set info [lindex $directive 1] - set input_name [lindex $info 0] - set input_type [lindex $info 1] - set input_comment [lrange $info 2 end] - - incr rowcount - upvar datasources:$rowcount datasource - - set datasource(rownum) $rowcount - set datasource(structure) $structure - set datasource(comment) $comment - set datasource(name) $name + set datasource(rownum) $rowcount + set datasource(name) $name + set datasource(structure) $structure + set datasource(comment) $comment + } + } - set datasource(input_name) $input_name - set datasource(input_type) $input_type - set datasource(input_comment) $input_comment - } - - column { + data_input { + # directive is a new form + set info [lindex $directive 1] + # Assign the first elements of $info to 'name' and 'structure', + # and the rest to 'comment' + set comment [lassign $info name structure] + } - set info [lindex $directive 1] - set column_name [lindex $info 0] - set column_comment [lrange $info 1 end] + input { + set info [lindex $directive 1] + # Assign the first elements of $info to 'input_name' and + # 'input_type', and the rest to 'input_comment' + set input_comment [lassign $info input_name input_type] - incr rowcount - upvar datasources:$rowcount datasource + incr rowcount + upvar datasources:$rowcount datasource - set datasource(rownum) $rowcount - set datasource(name) $name - set datasource(structure) $structure - set datasource(comment) $comment + set datasource(rownum) $rowcount + set datasource(structure) $structure + set datasource(comment) $comment + set datasource(name) $name - set datasource(column_name) $column_name - set datasource(column_comment) $column_comment - } + set datasource(input_name) $input_name + set datasource(input_type) $input_type + set datasource(input_comment) $input_comment + } + + column { + set info [lindex $directive 1] + # Assign the first element of $info to 'column_name', and the + # rest to 'column_comment' + set column_comment [lassign $info column_name] + + incr rowcount + upvar datasources:$rowcount datasource + + set datasource(rownum) $rowcount + set datasource(name) $name + set datasource(structure) $structure + set datasource(comment) $comment + + set datasource(column_name) $column_name + set datasource(column_comment) $column_comment + } + } } - } } ad_proc -public template::verify_datasources {} { - @return True (1) + @return True (1) } { - return 1 + return 1 }