parameter::get_from_package_key (public)

 parameter::get_from_package_key [ -localize ] [ -boolean ] \
    -package_key package_key -parameter parameter [ -default default ]

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

Gets an instance parameter for the package corresponding to package_key. Note that this makes the assumption that the package is a singleton. New packages should use global parameters instead.

Switches:
-localize
(boolean) (optional)
-boolean
(boolean) (optional)
-package_key
(required)
what package to get the parameter from. We will try to get the package_id from the package_key. This may cause an error if there are more than one instance of this package
-parameter
(required)
which parameter's value to get
-default
(optional)
what to return if we don't find a value

Partial Call Graph (max 5 caller/called nodes):
%3 test_parameter__check_procs parameter__check_procs (test acs-tcl) parameter::get_from_package_key parameter::get_from_package_key test_parameter__check_procs->parameter::get_from_package_key test_spellcheck__get_element_formtext spellcheck__get_element_formtext (test acs-templating) test_spellcheck__get_element_formtext->parameter::get_from_package_key test_spellcheck__spellcheck_properties spellcheck__spellcheck_properties (test acs-templating) test_spellcheck__spellcheck_properties->parameter::get_from_package_key ad_parameter_from_file ad_parameter_from_file (public) parameter::get_from_package_key->ad_parameter_from_file apm_package_id_from_key apm_package_id_from_key (public) parameter::get_from_package_key->apm_package_id_from_key apm_package_singleton_p apm_package_singleton_p (private) parameter::get_from_package_key->apm_package_singleton_p parameter::get parameter::get (public) parameter::get_from_package_key->parameter::get parameter::get_global_value parameter::get_global_value (public) parameter::get_from_package_key->parameter::get_global_value Object ::throttle Object ::throttle (public) Object ::throttle->parameter::get_from_package_key aa_selenium_init aa_selenium_init (private) aa_selenium_init->parameter::get_from_package_key acs::disk_cache_eval acs::disk_cache_eval (public) acs::disk_cache_eval->parameter::get_from_package_key acs_admin::check_expired_certificates acs_admin::check_expired_certificates (private) acs_admin::check_expired_certificates->parameter::get_from_package_key acs_mail_lite::address_domain acs_mail_lite::address_domain (private) acs_mail_lite::address_domain->parameter::get_from_package_key

Testcases:
parameter__check_procs, spellcheck__get_element_formtext, spellcheck__spellcheck_properties
Source code:
        #
        # 1. Check to see if this parameter is being set in the server's
        #    configuration file; this value has highest precedence.
        #
        set value [ad_parameter_from_file $parameter $package_key]

        #
        # 2. Try to get the value from a global package parameter.
        #
        if {$value eq ""} {
            set value [parameter::get_global_value  -localize=$localize_p  -boolean=$boolean_p  -package_key $package_key  -parameter $parameter  -default ""]
        }

        #
        # 3. Try to get the value from the package_id of this package_key
        #    and use the standard parameter::get function to get the
        #    value. Note that this lookup only makes sense for singleton
        #    packages.
        #
        if {$value eq ""} {
            if {[apm_package_singleton_p $package_key]} {
                set value [parameter::get  -localize=$localize_p  -boolean=$boolean_p  -package_id [apm_package_id_from_key $package_key]  -parameter $parameter  -default $default  ]
            } else {
                ns_log notice "tried to lookup parameter $parameter from non-singleton package $package_key"
                set value $default
            }
        }

        return $value
Generic XQL file:
packages/acs-tcl/tcl/parameter-procs.xql

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

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

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