Index: openacs-4/packages/acs-tcl/tcl/site-node-apm-integration.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/site-node-apm-integration.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-tcl/tcl/site-node-apm-integration.tcl 11 Jul 2002 00:38:01 -0000 1.1 @@ -0,0 +1,46 @@ +ad_library { + + site node / apm integration procs + + @author arjun (arjun@openforce.net) + @author yon (yon@openforce.net) + @creation-date 2002-07-10 + @version $Id: site-node-apm-integration.tcl,v 1.1 2002/07/11 00:38:01 arjun Exp $ + +} + +namespace eval site_node_apm_integration { + + ad_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. returns empty string if not found. + } { + if {[empty_string_p $package_id]} { + set package_id [ad_conn package_id] + } + + return [db_string select_child_package_id {} -default ""] + } + + ad_proc -public child_package_exists_p { + {-package_id ""} + {-package_key:required} + } { + Returns 1 if there exists a child package with the given package_key, + or 0 if not. + } { + set child_package_id [site_nodes::get_child_package_id \ + -package_id $package_id \ + -package_key $package_key + ] + + if {[empty_string_p $child_package_id]} { + return 0 + } else { + return 1 + } + } +} Index: openacs-4/packages/acs-tcl/tcl/site-node-apm-integration.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/Attic/site-node-apm-integration.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-tcl/tcl/site-node-apm-integration.xql 11 Jul 2002 00:38:01 -0000 1.1 @@ -0,0 +1,17 @@ + + + + + + select sn1.object_id + from site_nodes sn1, + apm_packages + where sn1.parent_id = (select sn2.node_id + from site_nodes sn2 + where sn2.object_id = :package_id) + and sn1.object_id = apm_packages.package_id + and apm_packages.package_key = :package_key + + + +