install::xml::action::source (private)

 install::xml::action::source node

Defined in packages/acs-tcl/tcl/install-procs.tcl

Source an install.xml file, SQL file or Tcl script during execution of the current install.xml. If no type attribute is specified then this tag will attempt to guess type of the sourced script from the file extension, otherwise it defaults to install.xml. The type of the sourced script may be explicitly declared as 'tcl', 'sql' or 'install.xml' using the type attribute.

Parameters:
node (required)
Author:
Lee Denison lee@xarg.co.uk
Created:
2005-02-04

Partial Call Graph (max 5 caller/called nodes):
%3 apm::process_install_xml apm::process_install_xml (public) apm_attribute_value apm_attribute_value (public) apm_required_attribute_value apm_required_attribute_value (public) db_source_sql_file db_source_sql_file (public) install::xml::util::get_id install::xml::util::get_id (public) install::xml::action::source install::xml::action::source install::xml::action::source->apm::process_install_xml install::xml::action::source->apm_attribute_value install::xml::action::source->apm_required_attribute_value install::xml::action::source->db_source_sql_file install::xml::action::source->install::xml::util::get_id

Testcases:
No testcase defined.
Source code:
    set src [apm_required_attribute_value $node src]
    set type [apm_attribute_value -default {} $node type]

    if {$type eq ""} {
        switch -glob $src {
            *.tcl { set type tcl }
            *.sql { set type sql }
            default { set type install.xml }
        }
    }

    set params [xml_node_get_children [lindex $node 0]]

    foreach param $params {
        if {[xml_node_get_name $param] ne "param"} {
            error "Unknown xml element \"[xml_node_get_name $param]\""
        }

        set name [apm_required_attribute_value $param name]
        set id [apm_attribute_value -default {} $param id]
        set value [apm_attribute_value -default {} $param value]

        if {$id ne ""} {
            set value [install::xml::util::get_id $id]
        }

        set parameters($name$value
    }

    switch -exact $type {
        tcl {
            set code [template::util::read_file $::acs::rootdir$src]
            set out [eval $code]
        }
        sql {
            db_source_sql_file $::acs::rootdir$src
            set out "$src completed"
        }
        install.xml {
            set binds [array get parameters]
            set out [apm::process_install_xml -nested $src $binds]
        }
        default {
            error "Unknown script type $type"
        }
    }

    return $out
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: