site-node-apm-integration-procs.tcl

site node / apm integration procs

Location:
packages/acs-tcl/tcl/site-node-apm-integration-procs.tcl
Created:
2002-07-10
Authors:
arjun <arjun@openforce.net>
yon <yon@openforce.net>
CVS Identification:
$Id: site-node-apm-integration-procs.tcl,v 1.16 2024/09/11 06:15:48 gustafn Exp $

Procedures in this file

Detailed information

site_node_apm_integration::child_package_exists_p (public)

 site_node_apm_integration::child_package_exists_p \
    [ -package_id package_id ] -package_key package_key

This may become either a private interface or be deprecated in the future. In most cases, site_node::get_children is what you want. One difference is, this API is not cached, so it will always return the actual status from the database.

Switches:
-package_id (optional)
-package_key (required)
Returns:
1 if there exists a child package with the given package_key, or 0 if not.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_attachments_enabled attachments_enabled (test calendar) site_node_apm_integration::child_package_exists_p site_node_apm_integration::child_package_exists_p test_attachments_enabled->site_node_apm_integration::child_package_exists_p site_node_apm_integration::get_child_package_id site_node_apm_integration::get_child_package_id (public) site_node_apm_integration::child_package_exists_p->site_node_apm_integration::get_child_package_id

Testcases:
attachments_enabled

site_node_apm_integration::delete_site_nodes_and_package (public)

 site_node_apm_integration::delete_site_nodes_and_package \
    -package_id package_id

First deletes ALL the site nodes this instance is mapped to, then deletes the instance.

Switches:
-package_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 apm_package_instance_delete apm_package_instance_delete (public) db_transaction db_transaction (public) site_node::delete site_node::delete (public) site_node::get_all_from_object_id site_node::get_all_from_object_id (public) site_node::unmount site_node::unmount (public) site_node_apm_integration::delete_site_nodes_and_package site_node_apm_integration::delete_site_nodes_and_package site_node_apm_integration::delete_site_nodes_and_package->apm_package_instance_delete site_node_apm_integration::delete_site_nodes_and_package->db_transaction site_node_apm_integration::delete_site_nodes_and_package->site_node::delete site_node_apm_integration::delete_site_nodes_and_package->site_node::get_all_from_object_id site_node_apm_integration::delete_site_nodes_and_package->site_node::unmount

Testcases:
No testcase defined.

site_node_apm_integration::get_child_package_id (public)

 site_node_apm_integration::get_child_package_id \
    [ -package_id package_id ] -package_key package_key

Get the package_id of package_key that is mounted directly under package_id. This may become either a private interface or be deprecated in the future. In most cases, site_node::get_children is what you want. One difference is, this API is not cached, so it will always return the actual status from the database.

Switches:
-package_id (optional)
-package_key (required)
Returns:
empty string if not found.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 test_attachments_enabled attachments_enabled (test calendar) site_node_apm_integration::get_child_package_id site_node_apm_integration::get_child_package_id test_attachments_enabled->site_node_apm_integration::get_child_package_id ad_conn ad_conn (public) site_node_apm_integration::get_child_package_id->ad_conn db_string db_string (public) site_node_apm_integration::get_child_package_id->db_string site_node_apm_integration::child_package_exists_p site_node_apm_integration::child_package_exists_p (public) site_node_apm_integration::child_package_exists_p->site_node_apm_integration::get_child_package_id

Testcases:
attachments_enabled
[ hide source ] | [ make this the default ]

Content File Source

ad_library {

    site node / apm integration procs

    @author arjun (arjun@openforce.net)
    @author yon (yon@openforce.net)
    @creation-date 2002-07-10
    @cvs-id $Id: site-node-apm-integration-procs.tcl,v 1.16 2024/09/11 06:15:48 gustafn Exp $

}

namespace eval site_node_apm_integration {

    d_proc -public delete_site_nodes_and_package {
        {-package_id:required}
    } {
        First deletes ALL the site nodes this instance is mapped to, then deletes the instance.

    } {
        db_transaction {
            # should here be a pre-destruction proc like the post instantiation proc?
            foreach site_node_info_list [site_node::get_all_from_object_id -object_id $package_id] {

                ns_log debug "delete_site_nodes_and_package: $site_node_info_list"

                array set site_node $site_node_info_list

                site_node::unmount -node_id $site_node(node_id)
                site_node::delete -node_id $site_node(node_id)
                site_node::update_cache -node_id $site_node(node_id)
            }

            apm_package_instance_delete $package_id
        }
    }

    d_proc -public get_child_package_id {
        {-package_id ""}
        {-package_key:required}
    } {

        Get the package_id of package_key that is mounted directly
        under package_id.

        This may become either a private interface or be deprecated in
        the future. In most cases, site_node::get_children is what you
        want. One difference is, this API is not cached, so it will
        always return the actual status from the database.

        @see site_node::get_children

        @return empty string if not found.
    } {
        if {$package_id eq ""} {
            if {[ns_conn isconnected]} {
                set package_id [ad_conn package_id]
            } else {
                error "Not in a connection and no package_id provided"
            }
        }

        return [db_string select_child_package_id {} -default ""]
    }

    d_proc -public child_package_exists_p {
        {-package_id ""}
        {-package_key:required}
    } {
        This may become either a private interface or be deprecated in
        the future. In most cases, site_node::get_children is what you
        want. One difference is, this API is not cached, so it will
        always return the actual status from the database.

        @see site_node::get_children

        @return 1 if there exists a child package with the given
                package_key, or 0 if not.
    } {
        set child_package_id [get_child_package_id \
            -package_id $package_id \
            -package_key $package_key ]

        if {$child_package_id eq ""} {
            return 0
        } else {
            return 1
        }
    }

}

# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: