parameter::get (public)

 parameter::get [ -localize ] [ -boolean ] [ -package_id package_id ] \
    -parameter parameter [ -default default ]

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

Get the value of a package instance parameter.

Switches:
-localize (optional, boolean)
should we attempt to localize the parameter
-boolean (optional, boolean)
ensure boolean parameters are normalized to 0 or 1
-package_id (optional)
what package to get the parameter from. Defaults to [ad_conn package_id]
-parameter (required)
which parameter's value to get
-default (optional)
what to return if we don't find a value. Defaults to returning the empty string.
Returns:
The string trimmed (leading and trailing spaces removed) parameter value
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_subsite_test_email_confirmation acs_subsite_test_email_confirmation (test acs-subsite) parameter::get parameter::get test_acs_subsite_test_email_confirmation->parameter::get test_auth_password_change auth_password_change (test acs-authentication) test_auth_password_change->parameter::get test_cookie_consent__setup cookie_consent__setup (test cookie-consent) test_cookie_consent__setup->parameter::get test_locale__test_system_package_setting locale__test_system_package_setting (test acs-lang) test_locale__test_system_package_setting->parameter::get test_logout_from_everywhere logout_from_everywhere (test acs-tcl) test_logout_from_everywhere->parameter::get ad_parameter_cache ad_parameter_cache (public) parameter::get->ad_parameter_cache ad_parameter_from_configuration_file ad_parameter_from_configuration_file (public) parameter::get->ad_parameter_from_configuration_file ad_requested_object_id ad_requested_object_id (private) parameter::get->ad_requested_object_id apm_package_key_from_id apm_package_key_from_id (public) parameter::get->apm_package_key_from_id lang::util::localize lang::util::localize (public) parameter::get->lang::util::localize Class ::acs::Cluster Class ::acs::Cluster (public) Class ::acs::Cluster->parameter::get _acs_tcl__acs_tcl_external_dependencies_helper _acs_tcl__acs_tcl_external_dependencies_helper (private) _acs_tcl__acs_tcl_external_dependencies_helper->parameter::get aa_test::xml_report_dir aa_test::xml_report_dir (public) aa_test::xml_report_dir->parameter::get acs::Cluster instproc check_state acs::Cluster instproc check_state (public) acs::Cluster instproc check_state->parameter::get acs::Cluster instproc dynamic_cluster_nodes acs::Cluster instproc dynamic_cluster_nodes (public) acs::Cluster instproc dynamic_cluster_nodes->parameter::get

Testcases:
auth_password_change, locale__test_system_package_setting, acs_subsite_test_email_confirmation, password_recovery_page, subsite_api, parameter_register_test, parameter__check_procs, logout_from_everywhere, cookie_consent__setup
Source code:

    if {$package_id eq ""} {
        set package_id [ad_requested_object_id]
    }
    set value ""

    # 1. check whether there is a parameter by this name specified for
    # the package in the parameter file.  The name
    # ad_parameter_from_configuration_file is a misnomer, since it checks
    # ns_config values
    #
    if {$package_id ne ""} {
        set package_key [apm_package_key_from_id $package_id]
        set value [ad_parameter_from_configuration_file $parameter $package_key]
    }

    # 2. check the parameter cache
    if {$value eq ""} {
        set value [ad_parameter_cache $package_id $parameter]
    }

    # 3. use the default value
    if {$value eq ""} {
        set value $default
    }

    if { $localize_p } {
        # Replace message keys in hash marks with localized texts
        set value [lang::util::localize $value]
    }
    #
    # Normalize boolean results if required, since "true" and "false"
    # can be written in many different ways.
    #
    if { $boolean_p } {
        set value [string is true -strict $value]
    }

    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: