apm_load_packages (public)

 apm_load_packages [ -force_reload ] \
    [ -load_libraries_p load_libraries_p ] \
    [ -load_queries_p load_queries_p ] [ -packages packages ]

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

Load Tcl libraries and queries for the packages with given keys. Only loads procs into the current interpreter. Will load Tcl tests if the acs-automated-testing package is enabled.

Switches:
-force_reload (boolean) (defaults to "0") (optional)
Reload Tcl libraries even if they are already loaded.
-load_libraries_p (defaults to "1") (optional)
Switch to indicate if Tcl libraries in (-procs.tcl and -init.tcl) files should be loaded. Defaults to true.
-load_queries_p (defaults to "1") (optional)
Switch to indicate if xql query files should be loaded. Default true.
-packages (optional)
A list of package_keys for packages to be loaded. Defaults to all enabled packages. These packages, along with the packages they depend on, will be loaded in dependency-order using the information provided in the packages' "provides" and "requires" attributes.
Author:
Peter Marklund

See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-bootstrap-installer/bootstrap.tcl packages/acs-bootstrap-installer/ bootstrap.tcl apm_load_packages apm_load_packages packages/acs-bootstrap-installer/bootstrap.tcl->apm_load_packages apm_enabled_packages apm_enabled_packages (public) apm_load_packages->apm_enabled_packages apm_load_libraries apm_load_libraries (private) apm_load_packages->apm_load_libraries apm_load_queries apm_load_queries (private) apm_load_packages->apm_load_queries apm_load_tests_p apm_load_tests_p (public) apm_load_packages->apm_load_tests_p apm_package_load_libraries_order apm_package_load_libraries_order (public) apm_load_packages->apm_package_load_libraries_order

Testcases:
No testcase defined.
Source code:
    if { $packages eq "" } {
        set packages [apm_enabled_packages]
    }

    set packages_to_load [list]
    foreach package_key $packages {
        foreach package_to_load [::apm_package_load_libraries_order $package_key] {
            if {$package_to_load ni $packages_to_load} {
                lappend packages_to_load $package_to_load
            }
        }
    }

    # Should acs-automated-testing tests be loaded?
    set load_tests_p [apm_load_tests_p]

    # Load *-procs.tcl files
    if { $load_libraries_p } {
        apm_load_libraries -force_reload=$force_reload_p -packages $packages_to_load -procs
    }

    # Load up the Queries (OpenACS, ben@mit.edu)
    if { $load_queries_p } {
        apm_load_queries -packages $packages_to_load
    }

    # Load up the Automated Tests and associated Queries if necessary
    if {$load_tests_p} {
        apm_load_libraries -force_reload=$force_reload_p -packages $packages -test_procs
        apm_load_queries -packages $packages_to_load -test_queries
    }

    if { $load_libraries_p } {
        # branimir: acs-lang needs to be initialized before anything else
        # because there are packages whose *-init.tcl files depend on it.
        apm_load_libraries -force_reload=$force_reload_p -init -packages acs-lang
        set p [lsearch $packages_to_load acs-lang]
        if {$p > -1} {
            set unique_packages [lreplace $packages_to_load $p $p]
        } else {
            set unique_packages $packages_to_load
        }
        apm_load_libraries -force_reload=$force_reload_p -init -packages $unique_packages
    }

    # Load up the Automated Tests initialization scripts if necessary
    if {$load_tests_p} {
        apm_load_libraries -force_reload=$force_reload_p -packages $packages_to_load -test_init
    }
Generic XQL file:
packages/acs-tcl/tcl/apm-procs.xql

PostgreSQL XQL file:
packages/acs-tcl/tcl/apm-procs-postgresql.xql

Oracle XQL file:
packages/acs-tcl/tcl/apm-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: