acs_admin::require_site_wide_package (public)

 acs_admin::require_site_wide_package -package_key package_key \
    [ -node_name node_name ] [ -package_name package_name ] \
    [ -parameters parameters ] \
    [ -configuration_command configuration_command ]

Defined in packages/acs-admin/tcl/site-wide-procs.tcl

Require a package under the site-wide subsite. If such a package does not exist, it is created with the provided parameters. When a configuration command is passed-in it will be called with "-package_id $package_id" of the new instance appended.

Switches:
-package_key (required)
of the required package
-node_name (optional)
name of the mount point (defaults to the package_key)
-package_name (optional)
name of the package_instance (defaults to the package_key)
-parameters (optional)
package parameter for initialization of the package
-configuration_command (optional)
when a configuratio
Returns:
package_id of the required package

Partial Call Graph (max 5 caller/called nodes):
%3 test_acs_admin_require_site_wide acs_admin_require_site_wide (test acs-admin) acs_admin::require_site_wide_package acs_admin::require_site_wide_package test_acs_admin_require_site_wide->acs_admin::require_site_wide_package acs_admin::require_site_wide_subsite acs_admin::require_site_wide_subsite (public) acs_admin::require_site_wide_package->acs_admin::require_site_wide_subsite parameter::set_value parameter::set_value (public) acs_admin::require_site_wide_package->parameter::set_value site_node::exists_p site_node::exists_p (public) acs_admin::require_site_wide_package->site_node::exists_p site_node::get site_node::get (public) acs_admin::require_site_wide_package->site_node::get site_node::get_from_object_id site_node::get_from_object_id (public) acs_admin::require_site_wide_package->site_node::get_from_object_id

Testcases:
acs_admin_require_site_wide
Source code:
        if {![info exists node_name]} {
            set node_name $package_key
        }
        if {![info exists package_name]} {
            set package_name $package_key
        }
        set site_wide_subsite [::acs_admin::require_site_wide_subsite]
        set node_info [site_node::get_from_object_id -object_id $site_wide_subsite]

        set path [dict get $node_info url]$node_name
        #
        # Flush site node cache to avoid potential bootstrap
        # problems. We call the flush operation via the internal
        # acs::site_node object, since the this known the proper cache
        # to flush. Maybe, we can develop a more general API in the
        # future.
        #
        acs::site_node flush_pattern id-$path*

        if {[site_node::exists_p -url $path]} {
            #
            # During bootstrap, the package_id might be empty, because
            # the after_initiate callback might call the
            # site-wide-init, which in turn might initiate another
            # instance. Therefore, we might be called between site-node
            # creation and mounting .. which will result in an empty
            # package_id.
            #
            set node_info [site_node::get -url $path]
            set package_id [dict get $node_info object_id]
            if {$package_id eq ""} {
                ns_log notice "::acs_admin::require_site_wide_package for <$path>"  "returns empty. This should only happen during bootstrap."
            }

        } else {
            set package_id [site_node::instantiate_and_mount  -parent_node_id [dict get $node_info node_id]  -node_name $node_name  -package_name $package_name  -package_key $package_key]
            foreach {parameter value} $parameters {
                parameter::set_value -package_id $package_id -parameter $parameter -value $value
            }
            if {[llength $configuration_command] > 0} {
                {*}$configuration_command -package_id $package_id
            }
        }
        return $package_id
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: