Index: openacs-4/packages/dotlrn/tcl/applets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/applets-procs.tcl,v diff -u -N -r1.20 -r1.21 --- openacs-4/packages/dotlrn/tcl/applets-procs.tcl 8 Aug 2006 21:26:23 -0000 1.20 +++ openacs-4/packages/dotlrn/tcl/applets-procs.tcl 7 Jun 2007 20:32:27 -0000 1.21 @@ -31,7 +31,8 @@ ad_proc -public get_applet_url { {-applet_key:required} } { - return [site_nodes::get_info -return url -package_key $applet_key] + set applets_node_id [site_node::get_node_id -url [get_url]] + return [site_node::get_children -package_key $applet_key -node_id $applets_node_id] } ad_proc -public is_initalized {} { Index: openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl,v diff -u -N -r1.80 -r1.81 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 7 Jun 2007 14:28:58 -0000 1.80 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 7 Jun 2007 20:32:27 -0000 1.81 @@ -286,7 +286,7 @@ # Here we map the calendar to the main dotlrn package set node_url [site_node::get_children -package_key [package_key] -node_id [dotlrn::get_node_id]] - set node_id [site_node::get_node_id $node_url] + set node_id [site_node::get_node_id -url $node_url] site_node_object_map::new -node_id $node_id -object_id $calendar_id } Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -N -r1.180 -r1.181 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 15 May 2007 20:14:48 -0000 1.180 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 7 Jun 2007 20:32:27 -0000 1.181 @@ -105,9 +105,7 @@ Sometimes we need to know this for like ing templates from tcl } { - return [site_nodes::get_info -return param \ - -param url \ - -package_key [package_key]] + return [site_node::get_url_from_object_id -object_id [get_package_id]] } ad_proc -public portal::mount_point {} { Index: openacs-4/packages/new-portal/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/Attic/site-nodes-procs.tcl,v diff -u -N --- openacs-4/packages/new-portal/tcl/site-nodes-procs.tcl 7 Jun 2007 14:28:58 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,183 +0,0 @@ -# -# Copyright (C) 2001, 2002 MIT -# -# This file is part of dotLRN. -# -# dotLRN is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# - -ad_library { - Tcl procs for interface with the site-node data model. - - @author yon@openforce.net - @creation-date 2001-12-07 - @version $Id: site-nodes-procs.tcl,v 1.3 2007/06/07 14:28:58 emmar Exp $ -} - -namespace eval site_nodes {} - -ad_proc -private get_site_nodes_list { -} { - Return the list-ified site_nodes array. -} { - return [nsv_array get site_nodes] -} - -ad_proc -private get_site_nodes_list_key { - {-site_nodes_list:required} - {-index:required} -} { - return [lindex $site_nodes_list $index] -} - -ad_proc -private get_site_nodes_list_value { - {-site_nodes_list:required} - {-index:required} -} { - return [lindex $site_nodes_list [expr $index + 1]] -} - -ad_proc -private get_site_nodes_list_value_param { - {-site_nodes_list:required} - {-index:required} - {-param:required} -} { - The 'site_nodes' nsv_array is chock full of information - about every package mounted on every node in the system, let's - access that information. - - Here's a sample: - key = /portal/ - - value = directory_p t - object_type apm_package - package_key new-portal - package_id 3482 - pattern_p t - node_id 3481 - url /portal/ - object_id 3482 - - @author arjun@openforce.net -} { - array set snlv [get_site_nodes_list_value \ - -site_nodes_list $site_nodes_list \ - -index $index] - - switch $param { - "directory_p" { - return $snlv(directory_p) - } - "object_type" { - return $snlv(object_type) - } - "package_key" { - return $snlv(package_key) - } - "package_id" { - return $snlv(package_id) - } - "pattern_p" { - return $snlv(pattern_p) - } - "node_id" { - return $snlv(node_id) - } - "url" { - return $snlv(url) - } - "object_id" { - return $snlv(object_id) - } - default { - ns_log Error \ - "site_nodes::get_site_nodes_list_value_param failed! \n - bad param ($param) was specified" - ad_return_complaint 1 \ - "site_nodes::get_site_nodes_list_value_param failed! \n - bad param ($param) was specified" - } - } -} - -ad_proc -public get_info { - {-return:required} - {-param ""} - {-package_key:required} -} { - returns either 1. number of times this package_key is mounted - 2. the url a singleton is mounted at (or the first match it finds - for a multi-mounted package) or 3. a singleon's param (see list above). - Same deal appiles to non-singletons - - ret = count, url, param -} { - - set get_count_p 0 - set get_url_p 0 - set get_param_p 0 - - if {$return == "count"} { - set get_count_p 1 - set $param "package_key" - } elseif {$return == "url"} { - set get_url_p 1 - } elseif {$return == "param"} { - if {[empty_string_p $param]} { - ns_log Error \ - "site_nodes::get_info failed! \n - no param specified to get" - ad_return_complaint 1 \ - "site_nodes::get_info failed! \n - no param specified to get" - } else { - set get_param_p 1 - } - } - - set site_nodes_list [get_site_nodes_list] - - # iterate through the array, counting the number of times the - # passed in package key is in the site_nodes array - set count 0 - - for {set x 0} {$x < [llength $site_nodes_list]} {incr x 2} { - - set key [get_site_nodes_list_key \ - -site_nodes_list $site_nodes_list \ - -index $x] - - if {$get_url_p} { return $key } - - set poss_key_match [get_site_nodes_list_value_param \ - -site_nodes_list $site_nodes_list \ - -index $x \ - -param "package_key"] - - if { $poss_key_match == $package_key} { - - if {$get_param_p} { - return [get_site_nodes_list_value_param \ - -site_nodes_list $site_nodes_list \ - -index $x \ - -param $param] - } - - incr count - } - } - - if {$get_count_p} { - return $count - } else { - ns_log error "site_nodes::get_info get_count_p assertion failed! We should never get here return=$return param=$param package_key=$package_key" - } -}