Index: openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql 9 May 2002 23:59:51 -0000 1.3 +++ openacs-4/packages/bboard-portlet/sql/oracle/bboard-admin-portlet-create.sql 12 May 2002 18:15:04 -0000 1.4 @@ -88,12 +88,12 @@ -- bboard_admin-specific procs - -- Instance_id must be configured + -- package_id must be configured portal_datasource.set_def_param ( datasource_id => ds_id, config_required_p => 't', configured_p => 'f', - key => 'instance_id', + key => 'package_id', value => '' ); Index: openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql,v diff -u -r1.18 -r1.19 --- openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql 9 May 2002 23:59:51 -0000 1.18 +++ openacs-4/packages/bboard-portlet/sql/oracle/bboard-portlet-create.sql 12 May 2002 18:15:04 -0000 1.19 @@ -90,12 +90,12 @@ -- bboard-specific procs - -- Instance_id must be configured + -- package_id must be configured portal_datasource.set_def_param ( datasource_id => ds_id, config_required_p => 't', configured_p => 'f', - key => 'instance_id', + key => 'package_id', value => '' ); Index: openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl 10 May 2002 03:58:26 -0000 1.6 +++ openacs-4/packages/bboard-portlet/tcl/bboard-admin-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.7 @@ -17,19 +17,19 @@ ad_library { Procedures to supports bboard admin portlets - + @creation-date September 30 2001 - @author arjun@openforce.net + @author arjun@openforce.net @version $Id$ } namespace eval bboard_admin_portlet { - + ad_proc -private get_my_name { } { return "bboard_admin_portlet" } - + ad_proc -public get_pretty_name { } { return "Bboard Administration" @@ -39,59 +39,57 @@ } { return "bboard-portlet" } - + ad_proc -public link { } { return "" } - - ad_proc -public add_self_to_page { - portal_id - instance_id + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} } { Adds a bboard admin PE to the admin portal - + @return new element_id } { # we use "portal::add_element" here since there is no # configuration necessary for this portlet (no params) set element_id [portal::add_element \ - -pretty_name [get_pretty_name] \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -pretty_name [get_pretty_name] \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ ] - portal::set_element_param $element_id "instance_id" $instance_id + portal::set_element_param $element_id package_id $package_id return $element_id } - + ad_proc -public remove_self_from_page { portal_id } { Removes the bboard admin PE from the portal } { portal::remove_element \ - -portal_id $portal_id \ - -datasource_name [get_my_name] + -portal_id $portal_id \ + -datasource_name [get_my_name] } - - ad_proc -public show { - cf + + ad_proc -public show { + cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "bboard-admin-portlet" - } - - ad_proc -public edit { + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "bboard-admin-portlet" + } + + ad_proc -public edit { cf } { } { return "" } } - - Index: openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl,v diff -u -r1.41 -r1.42 --- openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.41 +++ openacs-4/packages/bboard-portlet/tcl/bboard-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.42 @@ -19,18 +19,18 @@ Procedures to supports bboard portlets @creation-date September 30 2001 - @author arjun@openforce.net + @author arjun@openforce.net @version $Id$ } namespace eval bboard_portlet { - + ad_proc -private get_my_name { } { return "bboard_portlet" } - + ad_proc -public get_pretty_name { } { return "Bboards" @@ -45,48 +45,45 @@ } { return "" } - - ad_proc -public add_self_to_page { - portal_id - bboard_instance_id + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} } { - Adds a bboard PE to the given portal or appends the given bboard instance_id + Adds a bboard PE to the given portal or appends the given bboard package_id to the bboard PE that already on the portal } { - return [portal::add_element_or_append_id \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -pretty_name [get_pretty_name] \ - -value_id $bboard_instance_id \ - -force_region [ad_parameter "bboard_portlet_region" [my_package_key]] - ] + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -pretty_name [get_pretty_name] \ + -value_id $package_id \ + -force_region [ad_parameter "bboard_portlet_region" [my_package_key]] \ + ] } - - ad_proc -public remove_self_from_page { - portal_id - bboard_instance_id + + ad_proc -public remove_self_from_page { + portal_id + package_id } { - Removes a bboard PE from the given page or just the given bboard's instance_id + Removes a bboard PE from the given page or just the given bboard's package_id } { portal::remove_element_or_remove_id \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -value_id $bboard_instance_id + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -value_id $package_id } - ad_proc -public show { - cf + ad_proc -public show { + cf } { } { # no return call required with the helper proc portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "bboard-portlet" - } + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "bboard-portlet" + } } - - Index: openacs-4/packages/bboard-portlet/www/bboard-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/www/bboard-admin-portlet.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/bboard-portlet/www/bboard-admin-portlet.tcl 29 Mar 2002 19:51:44 -0000 1.2 +++ openacs-4/packages/bboard-portlet/www/bboard-admin-portlet.tcl 12 May 2002 18:15:04 -0000 1.3 @@ -25,20 +25,21 @@ array set config $cf -set list_of_instance_ids $config(instance_id) +set list_of_package_ids $config(package_id) -if {[llength $list_of_instance_ids] > 1} { +if {[llength $list_of_package_ids] > 1} { # We have a problem! return -code error "There should be only one instance of bboard for admin purposes" } -set instance_id [lindex $list_of_instance_ids 0] +set package_id [lindex $list_of_package_ids 0] -db_multirow forums select_forums " -select forum_id, short_name -from bboard_forums -where bboard_id = :instance_id" +db_multirow forums select_forums { + select forum_id, short_name + from bboard_forums + where bboard_id = :package_id +} -set url [dotlrn_community::get_url_from_package_id -package_id $instance_id] +set url [dotlrn_community::get_url_from_package_id -package_id $package_id] ad_return_template Index: openacs-4/packages/bboard-portlet/www/bboard-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bboard-portlet/www/bboard-portlet.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/bboard-portlet/www/bboard-portlet.tcl 12 Apr 2002 08:11:04 -0000 1.9 +++ openacs-4/packages/bboard-portlet/www/bboard-portlet.tcl 12 May 2002 18:15:04 -0000 1.10 @@ -17,8 +17,8 @@ array set config $cf set shaded_p $config(shaded_p) -set list_of_instance_ids $config(instance_id) -set one_instance_p [ad_decode [llength $list_of_instance_ids] 1 1 0] +set list_of_package_ids $config(package_id) +set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0] db_multirow forums select_forums " select bboard_forums.bboard_id as package_id, @@ -31,7 +31,7 @@ bboard_forums.forum_id, bboard_forums.short_name from bboard_forums - where bboard_forums.bboard_id in ([join $list_of_instance_ids ,]) + where bboard_forums.bboard_id in ([join $list_of_package_ids ,]) order by parent_name, bboard_forums.short_name " Index: openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl 9 May 2002 23:59:51 -0000 1.6 +++ openacs-4/packages/calendar-portlet/tcl/calendar-admin-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.7 @@ -15,11 +15,11 @@ # ad_library { - + Procedures to support the calendar admin portlet @creation-date Jan 2002 - @author arjun@openforce.net + @author arjun@openforce.net @author ben@openforce.net @cvs-id $Id$ } @@ -46,44 +46,45 @@ return "" } - ad_proc -public add_self_to_page { - portal_id - calendar_id + ad_proc -public add_self_to_page { + {-portal_id:required} + {-calendar_id:required} } { Adds a admin calendar PE to the given portal - + @param portal_id The page to add self to @param calendar_id The new calendar_id to add + @return element_id The new element's id } { set element_id [portal::add_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] \ ] - portal::set_element_param $element_id "calendar_id" $calendar_id + portal::set_element_param $element_id calendar_id $calendar_id return $element_id } - + ad_proc -public remove_self_from_page { portal_id } { Removes a calendar admin PE } { portal::remove_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] } - ad_proc -public show { - cf + ad_proc -public show { + cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "calendar-admin-portlet" + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "calendar-admin-portlet" } } Index: openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl 10 May 2002 19:05:41 -0000 1.6 +++ openacs-4/packages/calendar-portlet/tcl/calendar-full-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.7 @@ -16,13 +16,13 @@ ad_library { - Procedures to support the "full" calendar portlet. This is the + Procedures to support the "full" calendar portlet. This is the "wide" calendar with the navigation widget and helpful links. Not - to be confused with the (regular, narrow) calendar portlet that is titled + to be confused with the (regular, narrow) calendar portlet that is titled "Day Summary" by default. @creation-date Oct 26 2001 - @author arjun@openforce.net + @author arjun@openforce.net @cvs-id $Id$ } @@ -51,47 +51,49 @@ return "" } - ad_proc -public add_self_to_page { - {-page_id ""} - portal_id - calendar_id + ad_proc -public add_self_to_page { + {-portal_id:required} + {-page_name ""} + {-calendar_id:required} } { Adds a "full" calendar PE to the given portal - + @param portal_id The page to add self to @param calendar_id The new calendar_id to add + @return element_id The new element's id } { return [portal::add_element_or_append_id \ - -portal_id $portal_id \ - -page_id $page_id \ - -portlet_name [get_my_name] \ - -pretty_name [get_pretty_name] \ - -value_id $calendar_id \ - -key calendar_id] + -portal_id $portal_id \ + -page_name $page_name \ + -portlet_name [get_my_name] \ + -pretty_name [get_pretty_name] \ + -value_id $calendar_id \ + -key calendar_id] } ad_proc -public remove_self_from_page { portal_id calendar_id } { - Removes a "full" calendar PE from the given page or + Removes a "full" calendar PE from the given page or a calendar_id from its params } { portal::remove_element_or_remove_id \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -key calendar_id \ - -value_id $calendar_id + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key calendar_id \ + -value_id $calendar_id } - ad_proc -public show { - cf + + ad_proc -public show { + cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "calendar-full-portlet" + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "calendar-full-portlet" } } Index: openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl,v diff -u -r1.27 -r1.28 --- openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 10 May 2002 03:58:26 -0000 1.27 +++ openacs-4/packages/calendar-portlet/tcl/calendar-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.28 @@ -15,11 +15,11 @@ # ad_library { - + Procedures to support the (normal, narrow) calendar portlet a.k.a. "Day Summary". Not to be confused with the "full" calendar portlet. - @author arjun@openforce.net + @author arjun@openforce.net @cvs-id $Id$ } @@ -49,26 +49,27 @@ return "" } - ad_proc -public add_self_to_page { - {-page_id ""} - portal_id - calendar_id + ad_proc -public add_self_to_page { + {-portal_id:required} + {-page_name ""} + {-calendar_id:required} } { Adds a (normal) calendar PE to the given page or appends a calendar_id to the current calendar portlet @param portal_id The page to add self to @param calendar_id The new calendar_id to add + @return element_id The new element's id } { return [portal::add_element_or_append_id \ - -portal_id $portal_id \ - -page_id $page_id \ - -portlet_name [get_my_name] \ - -pretty_name [get_pretty_name] \ - -value_id $calendar_id \ - -force_region [ad_parameter "force_region" [my_package_key]] \ - -key calendar_id + -portal_id $portal_id \ + -page_name $page_name \ + -portlet_name [get_my_name] \ + -pretty_name [get_pretty_name] \ + -value_id $calendar_id \ + -force_region [ad_parameter "force_region" [my_package_key]] \ + -key calendar_id ] } @@ -78,24 +79,24 @@ } { Removes a calendar PE from the given page or just the given calendar_id - + @param portal_id The page to remove self from - @param calendar_id + @param calendar_id } { portal::remove_element_or_remove_id \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -key calendar_id \ - -value_id $calendar_id + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key calendar_id \ + -value_id $calendar_id } - ad_proc -public show { - cf + ad_proc -public show { + cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf + -package_key [my_package_key] \ + -config_list $cf } } Index: openacs-4/packages/dotlrn/coding-tips.txt =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/Attic/coding-tips.txt,v diff -u -r1.4 -r1.5 --- openacs-4/packages/dotlrn/coding-tips.txt 8 Mar 2002 19:20:33 -0000 1.4 +++ openacs-4/packages/dotlrn/coding-tips.txt 12 May 2002 18:17:07 -0000 1.5 @@ -23,12 +23,12 @@ - Always use fully qualified argument names in procs and funcs: - e.g. in a func named "new" with args "instance_id" and "content" + e.g. in a func named "new" with args "package_id" and "content" insert into static_portal_content - (instance_id, content) + (package_id, content) values - (new.instance_id, new.content); + (new.package_id, new.content); Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -r1.113 -r1.114 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 8 May 2002 13:28:37 -0000 1.113 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 12 May 2002 18:18:55 -0000 1.114 @@ -895,9 +895,7 @@ under a dotlrn community, such as workflow panels, that cannot be passed their community_id. } { - set parent_pkg_id [site_nodes::get_parent_object_id \ - -instance_id $package_id - ] + set parent_pkg_id [site_nodes::get_parent_object_id -package_id $package_id] return [get_community_id -package_id $parent_pkg_id] } @@ -907,8 +905,7 @@ } { Returns the parent community's id or null } { - return [util_memoize \ - "dotlrn_community::get_parent_id_not_cached -community_id $community_id"] + return [util_memoize "dotlrn_community::get_parent_id_not_cached -community_id $community_id"] } ad_proc -private get_parent_id_not_cached { Index: openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl,v diff -u -r1.21 -r1.22 --- openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.21 +++ openacs-4/packages/dotlrn/tcl/dotlrn-main-portlet-procs.tcl 12 May 2002 18:17:56 -0000 1.22 @@ -44,17 +44,17 @@ } ad_proc -public add_self_to_page { - portal_id + {-portal_id:required} } { @return new element_id } { # we use "portal::add_element" here since there is no # configuration necessary for this portlet (no params) return [portal::add_element \ - -force_region [ad_parameter "dotlrn_main_portlet_region" dotlrn] \ - -pretty_name [get_pretty_name] \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -force_region [ad_parameter "dotlrn_main_portlet_region" dotlrn] \ + -pretty_name [get_pretty_name] \ + -portal_id $portal_id \ + -portlet_name [get_my_name] \ ] } @@ -77,4 +77,5 @@ -package_key "dotlrn" \ -config_list $cf } + } Index: openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl,v diff -u -r1.37 -r1.38 --- openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 9 May 2002 23:59:52 -0000 1.37 +++ openacs-4/packages/dotlrn/tcl/dotlrn-security-procs.tcl 12 May 2002 18:19:53 -0000 1.38 @@ -125,7 +125,7 @@ ] # add the "dotlrn main" portlet to the user's workspace - dotlrn_main_portlet::add_self_to_page $portal_id + dotlrn_main_portlet::add_self_to_page -portal_id $portal_id dotlrn_community::applets_dispatch -op AddUser -list_args [list $user_id] Index: openacs-4/packages/dotlrn/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/Attic/site-nodes-procs.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/dotlrn/tcl/site-nodes-procs.tcl 6 May 2002 22:55:17 -0000 1.15 +++ openacs-4/packages/dotlrn/tcl/site-nodes-procs.tcl 12 May 2002 18:20:31 -0000 1.16 @@ -94,38 +94,38 @@ ad_proc -public get_parent_id { {-node_id ""} - {-instance_id ""} + {-package_id ""} } { get the parent_id (a node_id) of this node_id } { if {![empty_string_p $node_id]} { return [db_string select_parent_by_node_id {}] - } elseif {![empty_string_p $instance_id]} { - return [db_string select_parent_by_instance_id {}] + } elseif {![empty_string_p $package_id]} { + return [db_string select_parent_by_package_id {}] } else { ns_log error "site_nodes::get_parent_id Bad params!" ad_return_complaint 1 "site_nodes::get_parent_id Bad params! Tell your admin." } } ad_proc -public get_parent_object_id { - {-instance_id ""} + {-package_id ""} } { get the object_id (not node_id!) of the parent of this instance } { - return [db_string select_parent_oid_by_instance_id {} -default ""] + return [db_string select_parent_oid_by_package_id {} -default ""] } ad_proc -public get_parent_name { - {-instance_id ""} + {-package_id ""} } { get the name of the parent of this instance } { - return [util_memoize "site_nodes::get_parent_name_not_cached -instance_id $instance_id"] + return [util_memoize "site_nodes::get_parent_name_not_cached -package_id $package_id"] } ad_proc -public get_parent_name_not_cached { - {-instance_id ""} + {-package_id ""} } { memoizing helper } { Index: openacs-4/packages/dotlrn/tcl/site-nodes-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/Attic/site-nodes-procs.xql,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn/tcl/site-nodes-procs.xql 1 May 2002 01:19:47 -0000 1.9 +++ openacs-4/packages/dotlrn/tcl/site-nodes-procs.xql 12 May 2002 18:20:31 -0000 1.10 @@ -10,7 +10,7 @@ from site_nodes where node_id = (select parent_id from site_nodes - where object_id = :instance_id)) + where object_id = :package_id)) @@ -22,21 +22,21 @@ - + select parent_id from site_nodes - where object_id = :instance_id + where object_id = :package_id - + select object_id from site_nodes where node_id = (select parent_id from site_nodes - where object_id = :instance_id) + where object_id = :package_id) Index: openacs-4/packages/dotlrn/www/subcommunity-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/subcommunity-new.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/dotlrn/www/subcommunity-new.tcl 6 May 2002 23:55:02 -0000 1.12 +++ openacs-4/packages/dotlrn/www/subcommunity-new.tcl 12 May 2002 18:20:57 -0000 1.13 @@ -75,8 +75,7 @@ # we want to make a subgroup of a class instance # get the term_id, since the subgroup should not # outlive the class - set term_id [dotlrn_class::get_term_id \ - -class_instance_id $parent_community_id] + set term_id [dotlrn_class::get_term_id -class_instance_id $parent_community_id] ns_set put $extra_vars term_id $term_id } Index: openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl,v diff -u -r1.35 -r1.36 --- openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 10 May 2002 06:35:14 -0000 1.35 +++ openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 12 May 2002 18:15:03 -0000 1.36 @@ -77,7 +77,7 @@ ] if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { - bboard_portlet::add_self_to_page $portal_id 0 + bboard_portlet::add_self_to_page -portal_id $portal_id -package_id 0 return } @@ -102,18 +102,18 @@ # set up a forum inside that instance, with context set to the # package ID of the bboard package bboard_forum_new \ - -bboard_id $package_id \ - -short_name $auto_create_forum_name \ - -context_id $package_id + -bboard_id $package_id \ + -short_name $auto_create_forum_name \ + -context_id $package_id } - bboard_portlet::add_self_to_page $portal_id $package_id + bboard_portlet::add_self_to_page -portal_id $portal_id -package_id $package_id # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_admin_portal_id \ -community_id $community_id ] - bboard_admin_portlet::add_self_to_page $admin_portal_id $package_id + bboard_admin_portlet::add_self_to_page -portal_id $admin_portal_id -package_id $package_id # Set up permissions for basic members (Admins inherit no problem) set members [dotlrn_community::get_rel_segment_id \ @@ -163,7 +163,7 @@ ] set portal_id [dotlrn::get_workspace_portal_id $user_id] - set element_id [bboard_portlet::add_self_to_page $portal_id $package_id] + set element_id [bboard_portlet::add_self_to_page -portal_id $portal_id -package_id $package_id] portal::set_element_param $element_id "display_group_name_p" "t" } Index: openacs-4/packages/dotlrn-bboard/www/alerts.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bboard/www/alerts.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-bboard/www/alerts.adp 18 Mar 2002 04:26:46 -0000 1.1 +++ openacs-4/packages/dotlrn-bboard/www/alerts.adp 12 May 2002 18:15:03 -0000 1.2 @@ -21,7 +21,7 @@ <% set url_prefix [site_nodes::get_url_from_package_id -package_id $forum_subs(bboard_id)] %> -
  • <%= [site_nodes::get_parent_name -instance_id $forum_subs(bboard_id)] %> - @forum_subs.name@ [Unsubscribe] +
  • <%= [site_nodes::get_parent_name -package_id $forum_subs(bboard_id)] %> - @forum_subs.name@ [Unsubscribe] @@ -37,7 +37,7 @@ <% set url_prefix [site_nodes::get_url_from_package_id -package_id $category_subs(bboard_id)] %> -
  • <%= [site_nodes::get_parent_name -instance_id $category_subs(bboard_id)] %> - @category_subs.bboard_name@ - @category_subs.name@ [Unsubscribe] +
  • <%= [site_nodes::get_parent_name -package_id $category_subs(bboard_id)] %> - @category_subs.bboard_name@ - @category_subs.name@ [Unsubscribe] @@ -52,7 +52,7 @@ <% set url_prefix [site_nodes::get_url_from_package_id -package_id $thread_subs(bboard_id)] %> -
  • <%= [site_nodes::get_parent_name -instance_id $thread_subs(bboard_id)] %> - @thread_subs.bboard_name@ - @thread_subs.name@ [Unsubscribe] +
  • <%= [site_nodes::get_parent_name -package_id $thread_subs(bboard_id)] %> - @thread_subs.bboard_name@ - @thread_subs.name@ [Unsubscribe] 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 -r1.50 -r1.51 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 10 May 2002 20:21:48 -0000 1.50 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 12 May 2002 18:15:03 -0000 1.51 @@ -73,9 +73,9 @@ # Use the package_key for the -url param - "/" are not allowed! if {![dotlrn::is_package_mounted -package_key [package_key]]} { dotlrn::mount_package \ - -package_key [package_key] \ - -url [package_key] \ - -directory_p "t" + -package_key [package_key] \ + -url [package_key] \ + -directory_p "t" } # register/activate self with dotlrn @@ -111,17 +111,13 @@ # add the "full calendar" portlet to the commnuity's "calendar" page, # similar to the same thing on a user's wsp. use the get_user_def_page - set page_id [portal::get_page_id \ - -portal_id $portal_id \ - -page_name [get_user_default_page] \ - ] - + set page_name [get_user_default_page] if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { # since this is a dummy comm, set a fake g_cal_id set element_id [calendar_full_portlet::add_self_to_page \ - -page_id $page_id \ - $portal_id \ - 0 + -portal_id $portal_id \ + -page_name $page_name \ + -calendar_id 0 ] return } @@ -142,9 +138,9 @@ $element_id "scoped_p" "f" set element_id [calendar_full_portlet::add_self_to_page \ - -page_id $page_id \ - $portal_id \ - $group_calendar_id + -portal_id $portal_id \ + -page_name $page_name \ + -calendar_id $group_calendar_id ] # Add the admin portlet, too @@ -241,30 +237,27 @@ # remove the portlets, params will cascade # first the admin portlet, from the comm's admin portal - set admin_portal_id [dotlrn_community::get_admin_portal_id \ - -community_id $community_id] + set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] portal::remove_element \ - -portal_id $admin_portal_id \ - -portlet_name [calendar_admin_portlet::get_my_name] + -portal_id $admin_portal_id \ + -portlet_name [calendar_admin_portlet::get_my_name] # now for the "regular" calendar portlet from the comm's portal - set portal_id [dotlrn_community::get_portal_id \ - -community_id $community_id - ] + set portal_id [dotlrn_community::get_portal_id -community_id $community_id] # now for the "full calendar" portlet from the comm's portal portal::remove_element \ - -portal_id $portal_id \ - -portlet_name [calendar_full_portlet::get_my_name] + -portal_id $portal_id \ + -portlet_name [calendar_full_portlet::get_my_name] # and finally kill the group calendar calendar_delete -calendar_id $group_calendar_id # delete the package instance and the site node where it's mounted dotlrn::unmount_community_applet_package \ - -community_id $community_id \ - -package_key [package_key] + -community_id $community_id \ + -package_key [package_key] } ad_proc -public add_user { @@ -302,20 +295,15 @@ # add the "day summary" pe to the user's first workspace page set element_id [calendar_portlet::add_self_to_page \ - $workspace_portal_id \ - $calendar_id + -portal_id $workspace_portal_id \ + -calendar_id $calendar_id \ ] # but add the "full calendar" pe to the workspace page specified above - set page_id [portal::get_page_id \ - -portal_id $workspace_portal_id \ - -page_name [get_user_default_page] - ] - set element_id [calendar_full_portlet::add_self_to_page \ - -page_id $page_id \ - $workspace_portal_id \ - $calendar_id + -portal_id $workspace_portal_id \ + -page_name [get_user_default_page] \ + -calendar_id $calendar_id ] # Make sure this is scoped @@ -345,8 +333,13 @@ set g_cal_id [get_group_calendar_id -community_id $community_id] set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id] - calendar_portlet::add_self_to_page $workspace_portal_id $g_cal_id - calendar_full_portlet::add_self_to_page $workspace_portal_id $g_cal_id + calendar_portlet::add_self_to_page \ + -portal_id $workspace_portal_id \ + -calendar_id $g_cal_id + + calendar_full_portlet::add_self_to_page \ + -portal_id $workspace_portal_id \ + -calendar_id $g_cal_id } ad_proc -public remove_user_from_community { Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 10 May 2002 06:35:14 -0000 1.23 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 12 May 2002 18:15:03 -0000 1.24 @@ -69,15 +69,15 @@ Add the dotlrn applet to a specific community } { set pt_id [dotlrn_community::get_portal_id -community_id $community_id] - dotlrn_portlet::add_self_to_page $pt_id $community_id + dotlrn_portlet::add_self_to_page -portal_id $pt_id -community_id $community_id if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { return } # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] - dotlrn_admin_portlet::add_self_to_page $admin_portal_id $community_id + dotlrn_admin_portlet::add_self_to_page -portal_id $admin_portal_id -community_id $community_id return $community_id } Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 10 May 2002 06:35:14 -0000 1.7 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 12 May 2002 18:15:03 -0000 1.8 @@ -78,27 +78,23 @@ } { Add the dotlrn applet to a specific community } { + ns_log notice "XXX dotlrn_members::add_applet_to_community community_id is $community_id" # portal template stuff set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set community_type [dotlrn_community::get_community_type_from_community_id $community_id] - if {$community_type == "dotlrn_community"} { + if {[string equal $community_type "dotlrn_community"]} { set page_name [get_subcomm_default_page] } else { set page_name [get_community_default_page] } - # add the portlet to the correct page for this comm - set page_id [portal::get_page_id \ + ns_log notice "XXX dotlrn_members::add_applet_to_community portal_id is $portal_id; page_name is $page_name; community_id is $community_id" + dotlrn_members_portlet::add_self_to_page \ -portal_id $portal_id \ -page_name $page_name \ - ] + -community_id $community_id - dotlrn_members_portlet::add_self_to_page \ - -page_id $page_id \ - $portal_id \ - $community_id - return $community_id } Index: openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 10 May 2002 06:35:14 -0000 1.5 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 12 May 2002 18:15:03 -0000 1.6 @@ -59,7 +59,7 @@ } { set portal_id [dotlrn_community::get_portal_id -community_id $community_id] - dotlrn_members_staff_portlet::add_self_to_page $portal_id $community_id + dotlrn_members_staff_portlet::add_self_to_page -portal_id $portal_id -community_id $community_id } ad_proc -public remove_applet { Index: openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl,v diff -u -r1.29 -r1.30 --- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 10 May 2002 06:35:14 -0000 1.29 +++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 12 May 2002 18:15:03 -0000 1.30 @@ -74,18 +74,18 @@ # set up the DS for the portal template if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { - faq_portlet::add_self_to_page $portal_id 0 + faq_portlet::add_self_to_page -portal_id $portal_id -package_id 0 return } # create the faq package instance (all in one, I've mounted it) set package_id [dotlrn::instantiate_and_mount $community_id [package_key]] - faq_portlet::add_self_to_page $portal_id $package_id + faq_portlet::add_self_to_page -portal_id $portal_id -package_id $package_id # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] - faq_admin_portlet::add_self_to_page $admin_portal_id $package_id + faq_admin_portlet::add_self_to_page -portal_id $admin_portal_id -package_id $package_id # return the package_id return $package_id @@ -140,7 +140,7 @@ set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] set portal_id [dotlrn::get_workspace_portal_id $user_id] - faq_portlet::add_self_to_page $portal_id $package_id + faq_portlet::add_self_to_page -portal_id $portal_id -package_id $package_id } ad_proc -public remove_user_from_community { Index: openacs-4/packages/dotlrn-fs/dotlrn-fs.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/dotlrn-fs.info,v diff -u -r1.11 -r1.12 --- openacs-4/packages/dotlrn-fs/dotlrn-fs.info 30 Apr 2002 01:34:18 -0000 1.11 +++ openacs-4/packages/dotlrn-fs/dotlrn-fs.info 12 May 2002 18:15:03 -0000 1.12 @@ -22,13 +22,12 @@ - - + - + Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl,v diff -u -r1.58 -r1.59 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 10 May 2002 20:13:40 -0000 1.58 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 12 May 2002 18:15:03 -0000 1.59 @@ -126,12 +126,6 @@ Add the fs applet to a specifc dotlrn community } { set portal_id [dotlrn_community::get_portal_id -community_id $community_id] - - # set up the DS for the portal template - # that's the private folder_id there - # add the portlet to the "file storage" page for this comm - - # aks - this should be made into a dotlrn-fs param set community_type [dotlrn_community::get_community_type_from_community_id $community_id] if {$community_type == "dotlrn_community"} { @@ -140,19 +134,17 @@ set page_name [get_community_default_page] } - set page_id [portal::get_page_id -portal_id $portal_id -page_name $page_name] - if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { - fs_portlet::add_self_to_page -page_id $page_id $portal_id 0 0 + fs_portlet::add_self_to_page \ + -portal_id $portal_id \ + -page_name $page_name \ + -package_id 0 \ + -folder_id 0 return } set package_key [package_key] - set package_id [dotlrn::instantiate_and_mount \ - $community_id \ - $package_key \ - ] - + set package_id [dotlrn::instantiate_and_mount $community_id $package_key] set community_name [dotlrn_community::get_community_name $community_id] # set up a forum inside that instance @@ -165,7 +157,11 @@ set node_id [site_nodes::get_node_id_from_package_id -package_id $package_id] portal::mapping::new -object_id $folder_id -node_id $node_id - fs_portlet::add_self_to_page -page_id $page_id $portal_id $package_id $folder_id + fs_portlet::add_self_to_page \ + -portal_id $portal_id \ + -page_name $page_name \ + -package_id $package_id \ + -folder_id $folder_id set party_id [acs_magic_object "registered_users"] permission::revoke -party_id $party_id -object_id $folder_id -privilege "read" @@ -219,7 +215,11 @@ set non_member_portal_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] # Make public-folder the only one available at non-member page - fs_portlet::add_self_to_page -force_region 2 $non_member_portal_id $package_id $public_folder_id + fs_portlet::add_self_to_page \ + -portal_id $non_member_portal_id \ + -package_id $package_id \ + -folder_id $public_folder_id \ + -force_region 2 return $package_id } @@ -230,8 +230,8 @@ remove the fs applet from a specifc dotlrn community } { set package_id [dotlrn::get_community_applet_package_id \ - -community_id $community_id \ - -package_key [package_key] + -community_id $community_id \ + -package_key [package_key] ] set root_folder_id [fs::get_root_folder -package_id $package_id] @@ -240,9 +240,8 @@ # remove the portlet from the non_member_portal set non_member_portal_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] fs_portlet::remove_self_to_page $non_member_portal_id $package_id $public_folder_id - - ad_return_complaint 1 "aks1" + ad_return_complaint 1 "aks1" } ad_proc -public add_user { @@ -296,20 +295,13 @@ # get the user's portal set portal_id [dotlrn::get_workspace_portal_id $user_id] - - set page_id [portal::get_page_id \ - -portal_id $portal_id \ - -page_name [get_user_default_page] \ - ] - - # add the portlet here if {![empty_string_p $portal_id]} { fs_portlet::add_self_to_page \ - -page_id $page_id \ - -extra_params [list scoped_p f contents_url "[get_url]all-contents"] \ - $portal_id \ - $package_id \ - $user_root_folder_id + -portal_id $portal_id \ + -page_name [get_user_default_page] \ + -package_id $package_id \ + -folder_id $user_root_folder_id \ + -extra_params [list scoped_p f contents_url "[get_url]all-contents"] } # does this user already have a shared folder? @@ -379,10 +371,13 @@ # Get the package_id by callback set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] set portal_id [dotlrn::get_workspace_portal_id $user_id] - set page_id [portal::get_page_id -portal_id $portal_id -page_name [get_user_default_page]] set folder_id [fs::get_root_folder -package_id $package_id] - fs_portlet::add_self_to_page -page_id $page_id $portal_id $package_id $folder_id + fs_portlet::add_self_to_page \ + -portal_id $portal_id \ + -page_name [get_user_default_page] \ + -package_id $package_id \ + -folder_id $folder_id } ad_proc -public remove_user_from_community { @@ -391,10 +386,7 @@ } { Remove a user from a community } { - set package_id \ - [dotlrn_community::get_applet_package_id \ - $community_id \ - [applet_key]] + set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] set portal_id [dotlrn::get_workspace_portal_id $user_id] set folder_id [fs::get_root_folder -package_id $package_id] @@ -404,8 +396,8 @@ ad_proc -public add_portlet { args } { - A helper proc to add the underlying portlet to the given portal. - + A helper proc to add the underlying portlet to the given portal. + @param args a list-ified array of args defined in add_applet_to_community } { ns_log notice "** Error in [get_pretty_name]: 'add_portlet' not implemented!" @@ -416,13 +408,12 @@ ad_proc -public remove_portlet { args } { - A helper proc to remove the underlying portlet from the given portal. - + A helper proc to remove the underlying portlet from the given portal. + @param args a list-ified array of args defined in remove_applet_from_community } { ns_log notice "** Error in [get_pretty_name]: 'remove_portlet' not implemented!" - ad_return_complaint 1 "Please notifiy the administrator of this error: - ** Error in [get_pretty_name]: 'remove_portlet' not implemented!" + ad_return_complaint 1 "Please notifiy the administrator of this error: ** Error in [get_pretty_name]: 'remove_portlet' not implemented!" } ad_proc -public clone { @@ -432,14 +423,9 @@ Clone this applet's content from the old community to the new one } { ns_log notice "** Error in [get_pretty_name] 'clone' not implemented!" - ad_return_complaint 1 "Please notifiy the administrator of this error: - ** Error in [get_pretty_name]: 'clone' not implemented!" + ad_return_complaint 1 "Please notifiy the administrator of this error: ** Error in [get_pretty_name]: 'clone' not implemented!" } - # - # helpful procs - # - ad_proc -public get_package_id { } { returns the package_id of the dotlrn-fs package Index: openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 10 May 2002 06:35:15 -0000 1.19 +++ openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 12 May 2002 18:15:03 -0000 1.20 @@ -75,7 +75,7 @@ set portal_id [dotlrn_community::get_portal_id -community_id $community_id] if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { - news_portlet::add_self_to_page $portal_id 0 + news_portlet::add_self_to_page -portal_id $portal_id -package_id 0 return } @@ -86,12 +86,12 @@ set package_key [package_key] set package_id [dotlrn::instantiate_and_mount $community_id $package_key] - news_portlet::add_self_to_page $portal_id $package_id + news_portlet::add_self_to_page -portal_id $portal_id -package_id $package_id # set up the DS for the admin portal set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] - news_admin_portlet::add_self_to_page $admin_portal_id $package_id + news_admin_portlet::add_self_to_page -portal_id $admin_portal_id -package_id $package_id return $package_id } @@ -127,7 +127,7 @@ set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]] set portal_id [dotlrn::get_workspace_portal_id $user_id] - news_portlet::add_self_to_page $portal_id $package_id + news_portlet::add_self_to_page -portal_id $portal_id -package_id $package_id } ad_proc -public remove_user_from_community { Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 10 May 2002 06:35:15 -0000 1.7 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-admin-portlet-procs.tcl 12 May 2002 18:15:03 -0000 1.8 @@ -19,7 +19,7 @@ Procedures to supports dotlrn admin portlets @creation-date September 30 2001 - @author arjun@openforce.net + @author arjun@openforce.net @author ben@openforce.net @version $Id$ @@ -47,21 +47,22 @@ return "" } - ad_proc -public add_self_to_page { - admin_portal_id - community_id + ad_proc -public add_self_to_page { + {-portal_id:required} + {-community_id:required} } { Adds the dotlrn admin PE to the given page with the community_id as as parameter - + @param portal_id The page to add self to @param community_id The dotlrn community to show info about + @return element_id The new element's id } { set element_id [portal::add_element \ - -portal_id $admin_portal_id \ - -portlet_name [get_my_name] \ - -force_region [ad_parameter "dotlrn_admin_portlet_force_region" [my_package_key]] + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -force_region [ad_parameter "dotlrn_admin_portlet_force_region" [my_package_key]] \ ] # set the community_id param that this portlet needs @@ -70,27 +71,24 @@ return $element_id } - ad_proc -public remove_self_from_page { - portal_id + ad_proc -public remove_self_from_page { + portal_id } { Removes a dotlrn PE from the given portal } { portal::remove_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] } - ad_proc -public show { - cf + ad_proc -public show { + cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "dotlrn-admin-portlet" + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "dotlrn-admin-portlet" } } - - - Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.6 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-portlet-procs.tcl 12 May 2002 18:15:03 -0000 1.7 @@ -17,8 +17,8 @@ ad_library { Procedures to support the dotlrn "members" portlet - - @author arjun@openforce.net + + @author arjun@openforce.net @cvs-id $Id$ } @@ -46,44 +46,45 @@ return "" } - ad_proc -public add_self_to_page { - {-page_id ""} - portal_id - community_id + ad_proc -public add_self_to_page { + {-portal_id:required} + {-page_name ""} + {-community_id:required} } { - Adds the dotlrn "members" portlet to the given portal. + Adds the dotlrn "members" portlet to the given portal. Pass along the community_id } { + ns_log notice "XXX dotlrn_members_portlet::add_self_to_page portal_id is $portal_id; page_name is $page_name; community_id is $community_id" set element_id [portal::add_element \ - -pretty_name [get_pretty_name] \ - -portal_id $portal_id \ - -page_id $page_id \ - -portlet_name [get_my_name] + -pretty_name [get_pretty_name] \ + -portal_id $portal_id \ + -page_name $page_name \ + -portlet_name [get_my_name] ] - portal::set_element_param $element_id "community_id" $community_id + portal::set_element_param $element_id community_id $community_id + return $element_id } - ad_proc -public show { - cf + ad_proc -public show { + cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "dotlrn-members-portlet" + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "dotlrn-members-portlet" } - ad_proc -public remove_self_from_page { - portal_id + ad_proc -public remove_self_from_page { + portal_id } { Removes the dotlrn "memebers" PE from the given portal } { portal::remove_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] } -} - +} Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.5 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-members-staff-portlet-procs.tcl 12 May 2002 18:15:03 -0000 1.6 @@ -18,7 +18,7 @@ Procedures to supports the dotlrn "members staff" portlet aka "Staff List" - @author arjun@openforce.net + @author arjun@openforce.net @cvs-id $Id$ } @@ -44,55 +44,51 @@ return "" } - ad_proc -public add_self_to_page { - portal_id - community_id + ad_proc -public add_self_to_page { + {-portal_id:required} + {-community_id:required} } { Add the "dotlrn members staff" portlet to the page } { set force_region [ad_parameter \ - "dotlrn_members_staff_portlet_force_region" \ - [my_package_key] + "dotlrn_members_staff_portlet_force_region" \ + [my_package_key] \ ] set element_id [portal::add_element \ - -portal_id $portal_id \ - -pretty_name [get_pretty_name] \ - -portlet_name [get_my_name] \ - -force_region $force_region + -portal_id $portal_id \ + -pretty_name [get_pretty_name] \ + -portlet_name [get_my_name] \ + -force_region $force_region ] - portal::set_element_param $element_id "community_id" $community_id + portal::set_element_param $element_id community_id $community_id - return $element_id + return $element_id } - ad_proc -public remove_self_from_page { - portal_id - community_id + ad_proc -public remove_self_from_page { + portal_id + community_id } { - Removes the PE from the given page + Removes the PE from the given page } { portal::remove_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] } - ad_proc -public show { - cf + ad_proc -public show { + cf } { Call the template to display - + @param cf A config array } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "dotlrn-members-staff-portlet" + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "dotlrn-members-staff-portlet" } - } - - - Index: openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl,v diff -u -r1.29 -r1.30 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 9 May 2002 23:59:52 -0000 1.29 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 12 May 2002 18:15:03 -0000 1.30 @@ -16,13 +16,13 @@ ad_library { - Procedures to supports the "dotlrn" portlet. The "dotlrn" portlet shows + Procedures to supports the "dotlrn" portlet. The "dotlrn" portlet shows the subcommunities of the community's portal where it's located. This portal - is not to be confused with the "dotlrn-main" portal, that goes on user's - workspace portals and shows the communities that they are members of. + is not to be confused with the "dotlrn-main" portal, that goes on user's + workspace portals and shows the communities that they are members of. @creation-date September 30 2001 - @author arjun@openforce.net + @author arjun@openforce.net @cvs-id $Id$ } @@ -50,46 +50,48 @@ return "" } - ad_proc -public add_self_to_page { - portal_id - community_id + ad_proc -public add_self_to_page { + {-portal_id:required} + {-community_id:required} } { Adds a dotlrn PE to the given communities's portal - - @param portal_id + + @param portal_id @param community_id + @return element_id The new element's id } { + ns_log notice "XXX dotlrn_portlet::add_self_to_page portal_id is $portal_id; community_id is $community_id" set element_id [portal::add_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -pretty_name [get_pretty_name] \ - -force_region [ad_parameter "dotlrn_portlet_force_region" [my_package_key]] + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -pretty_name [get_pretty_name] \ + -force_region [ad_parameter "dotlrn_portlet_force_region" [my_package_key]] \ ] - portal::set_element_param $element_id "community_id" $community_id + portal::set_element_param $element_id community_id $community_id return $element_id } - ad_proc -public show { - cf + ad_proc -public show { + cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf + -package_key [my_package_key] \ + -config_list $cf } - ad_proc -public remove_self_from_page { - portal_id + ad_proc -public remove_self_from_page { + portal_id } { - Removes the dotlrn PE from the portal. + Removes the dotlrn PE from the portal. } { # since there can be only one dotlrn pe on the portal use: portal::remove_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] } } Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl 9 May 2002 23:59:52 -0000 1.9 +++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.tcl 12 May 2002 18:15:03 -0000 1.10 @@ -17,33 +17,27 @@ # www/dotlrn-admin-portlet.tcl ad_page_contract { - The display logic for the dotlrn admin portlet. This shows the + The display logic for the dotlrn admin portlet. This shows the "Group Administration" section of the group admin page. @author Arjun Sanyal (arjun@openforce.net) @author Ben Adida (ben@openforce) @cvs_id $Id$ } -properties { - } # get some basics -array set config $cf +array set config $cf set community_id $config(community_id) set dotlrn_admin_p [dotlrn::admin_p] set dotlrn_admin_url "[dotlrn::get_url]/admin" set sub_pretty_name [ad_parameter subcommunities_pretty_name dotlrn] set sub_pretty_plural [ad_parameter subcommunities_pretty_plural dotlrn] set admin_pretty_name [ad_parameter dotlrn_admin_pretty_name dotlrn] -# get the community info +# get the community info db_1row select_community_info {} # get the subcomm info set rows [dotlrn_community::get_subcomm_info_list -community_id $community_id] -template::util::list_of_ns_sets_to_multirow \ - -rows $rows \ - -var_name subgroups - - - +template::util::list_of_ns_sets_to_multirow -rows $rows -var_name subgroups Index: openacs-4/packages/dotlrn-research/tcl/dotlrn-research-admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/Attic/dotlrn-research-admin-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn-research/tcl/dotlrn-research-admin-procs.tcl 6 May 2002 23:56:32 -0000 1.3 +++ openacs-4/packages/dotlrn-research/tcl/dotlrn-research-admin-procs.tcl 12 May 2002 18:15:04 -0000 1.4 @@ -83,7 +83,7 @@ set portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] research_admin_portlet::make_self_available $portal_id - research_admin_portlet::add_self_to_page $portal_id "" $community_id + research_admin_portlet::add_self_to_page -portal_id $portal_id -package_id "" -party_id $community_id } ad_proc -public add_user { Index: openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 6 May 2002 23:56:32 -0000 1.8 +++ openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 12 May 2002 18:15:04 -0000 1.9 @@ -83,14 +83,14 @@ research_portlet::make_self_available $portal_id if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { - research_portlet::add_self_to_page $portal_id "" $community_id + research_portlet::add_self_to_page -portal_id $portal_id -package_id "" -party_id $community_id return } - set instance_id [dotlrn::instantiate_and_mount \ + set package_id [dotlrn::instantiate_and_mount \ -mount_point "research-papers" $community_id [package_key]] - research_portlet::add_self_to_page $portal_id "" $community_id + research_portlet::add_self_to_page -portal_id $portal_id -package_id "" -party_id $community_id dotlrn_research_admin::add_applet_to_community $community_id } Index: openacs-4/packages/dotlrn-research/tcl/research-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/Attic/research-admin-portlet-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-research/tcl/research-admin-portlet-procs.tcl 29 Mar 2002 19:22:48 -0000 1.2 +++ openacs-4/packages/dotlrn-research/tcl/research-admin-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.3 @@ -49,23 +49,23 @@ } ad_proc -public add_self_to_page { - {-page_id ""} - portal_id - instance_id - party_id + {-portal_id:required} + {-page_name ""} + {-package_id:required} + {-party_id:required} } { Adds a research portlet element to the specified page. - @param page_id The page to add self to + @param page_name The page to add self to @param portal_id The portal to add self to - @param instance_id XXX DO NOT KNOW WHAT THIS IS + @param package_id XXX DO NOT KNOW WHAT THIS IS @param party_id The party for which to display research papers @return element_id The new element's id } { return [portal::add_element_or_append_id \ -portal_id $portal_id \ - -page_id $page_id \ + -page_name $page_name \ -portlet_name [my_name] \ -key "party_id" \ -value_id $party_id @@ -74,13 +74,13 @@ ad_proc -public remove_self_from_page { portal_id - instance_id + package_id party_id } { Removes a research portlet element from the specified page. @param portal_id The page to remove self from - @param instance_id XXX DO NOT KNOW WHAT THIS IS + @param package_id XXX DO NOT KNOW WHAT THIS IS @param party_id The party for which to display research papers } { portal::remove_element_or_remove_id \ Index: openacs-4/packages/dotlrn-research/tcl/research-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-research/tcl/Attic/research-portlet-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn-research/tcl/research-portlet-procs.tcl 29 Mar 2002 19:22:48 -0000 1.3 +++ openacs-4/packages/dotlrn-research/tcl/research-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.4 @@ -49,23 +49,23 @@ } ad_proc -public add_self_to_page { - {-page_id ""} - portal_id - instance_id - party_id + {-portal_id:required} + {-page_name ""} + {-package_id:required} + {-party_id:required} } { Adds a research portlet element to the specified page. - @param page_id The page to add self to + @param page_name The page to add self to @param portal_id The portal to add self to - @param instance_id XXX DO NOT KNOW WHAT THIS IS + @param package_id XXX DO NOT KNOW WHAT THIS IS @param party_id The party for which to display research papers @return element_id The new element's id } { return [portal::add_element_or_append_id \ -portal_id $portal_id \ - -page_id $page_id \ + -page_name $page_name \ -portlet_name [my_name] \ -pretty_name [get_pretty_name] \ -key "party_id" \ @@ -75,13 +75,13 @@ ad_proc -public remove_self_from_page { portal_id - instance_id + package_id party_id } { Removes a research portlet element from the specified page. @param portal_id The page to remove self from - @param instance_id XXX DO NOT KNOW WHAT THIS IS + @param package_id XXX DO NOT KNOW WHAT THIS IS @param party_id The party for which to display research papers } { portal::remove_element_or_remove_id \ Index: openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 10 May 2002 06:35:15 -0000 1.16 +++ openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 12 May 2002 18:15:04 -0000 1.17 @@ -92,7 +92,7 @@ if {$community_type == "dotlrn_club"} { set content_id [static_portal_content::new \ - -instance_id $community_id \ + -package_id $community_id \ -content " " \ -pretty_name "[dotlrn::parameter clubs_pretty_name] Info" ] @@ -102,7 +102,7 @@ } elseif {$community_type == "dotlrn_community"} { set content_id [static_portal_content::new \ - -instance_id $community_id \ + -package_id $community_id \ -content " " \ -pretty_name "[dotlrn::parameter subcommunities_pretty_name] Info" ] @@ -112,7 +112,7 @@ } else { set content_id [static_portal_content::new \ - -instance_id $community_id \ + -package_id $community_id \ -content " " \ -pretty_name "[dotlrn::parameter class_instances_pretty_name] Info" ] @@ -132,7 +132,7 @@ # set up the DS for the admin page set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id] - static_admin_portlet::add_self_to_page $admin_portal_id $community_id + static_admin_portlet::add_self_to_page -portal_id $admin_portal_id -package_id $community_id } Index: openacs-4/packages/faq-portlet/tcl/faq-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/tcl/faq-admin-portlet-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/faq-portlet/tcl/faq-admin-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.4 +++ openacs-4/packages/faq-portlet/tcl/faq-admin-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.5 @@ -48,23 +48,24 @@ } ad_proc -public add_self_to_page { - portal_id - faq_package_id + {-portal_id:required} + {-package_id:required} } { Adds a faq admin PE to the given admin portal. There should only ever be one of these portals on an admin page with only one faq_package_id @param portal_id The page to add self to - @param faq_package_id the id of the faq package + @param package_id the id of the faq package + @return element_id The new element's id } { set element_id [portal::add_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] \ ] - - portal::set_element_param $element_id "package_id" $faq_package_id + portal::set_element_param $element_id package_id $package_id + return $element_id } @@ -86,5 +87,4 @@ -template_src "faq-admin-portlet" } - } Index: openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.28 +++ openacs-4/packages/faq-portlet/tcl/faq-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.29 @@ -47,51 +47,52 @@ } ad_proc -public add_self_to_page { - portal_id - faq_package_id + {-portal_id:required} + {-package_id:required} } { - Adds a faq PE to the given portal or appends the given faq_package_id to the + Adds a faq PE to the given portal or appends the given faq_package_id to the params of the faq pe already there @param portal_id The page to add self to @param faq_package_id the id of the faq package for this community + @return element_id The new element's id } { return [portal::add_element_or_append_id \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -key "package_id" \ - -value_id $faq_package_id \ - -pretty_name [get_pretty_name] \ - -force_region [ad_parameter "faq_portlet_force_region" [my_package_key]] + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value_id $package_id \ + -pretty_name [get_pretty_name] \ + -force_region [ad_parameter "faq_portlet_force_region" [my_package_key]] \ ] } ad_proc -public remove_self_from_page { portal_id - faq_package_id + package_id } { Removes a faq PE from the given page or just the passed in faq_package_id parameter from the portlet (that has other faq_package_ids) @param portal_id The page to remove self from - @param faq_package_id + @param package_id } { portal::remove_element_or_remove_id \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -key "package_id" \ - -value_id $faq_package_id + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -key package_id \ + -value_id $package_id } ad_proc -public show { cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "faq-portlet" + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "faq-portlet" } } Index: openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl 10 May 2002 03:58:26 -0000 1.36 +++ openacs-4/packages/fs-portlet/tcl/fs-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.37 @@ -53,29 +53,30 @@ } ad_proc -public add_self_to_page { - {-page_id ""} + {-portal_id:required} + {-page_name ""} + {-package_id:required} + {-folder_id:required} {-extra_params ""} {-force_region ""} - portal_id - instance_id - folder_id } { Adds a fs PE to the given page. If there's already and fs pe, it appends the values to the pe's params. @param portal_id The page to add self to @param folder_id The folder to show + @return element_id The new element's id } { if {[empty_string_p $extra_params]} { set extra_params [list] } - lappend extra_params [list "package_id" $instance_id] + lappend extra_params [list package_id $package_id] return [portal::add_element_or_append_id \ -portal_id $portal_id \ - -page_id $page_id \ + -page_name $page_name \ -pretty_name [get_pretty_name] \ -portlet_name [get_my_name] \ -force_region $force_region \ @@ -87,12 +88,12 @@ ad_proc -public remove_self_from_page { portal_id - instance_id + package_id folder_id } { Removes a fs PE from the given page } { - set extra_params [list "package_id" $instance_id] + set extra_params [list package_id $package_id] portal::remove_element_or_remove_id \ -portal_id $portal_id \ @@ -107,9 +108,8 @@ } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf + -package_key [my_package_key] \ + -config_list $cf } - } 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 -r1.138 -r1.139 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 10 May 2002 19:06:10 -0000 1.138 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 12 May 2002 18:15:03 -0000 1.139 @@ -610,8 +610,7 @@ db_1row revert_get_source_page_info {} - set target_page_id \ - [db_string revert_get_target_page_id {}] + set target_page_id [db_string revert_get_target_page_id {}] db_dml revert_page_update {} @@ -958,7 +957,7 @@ {-portal_id:required} {-portlet_name:required} {-force_region ""} - {-page_id ""} + {-page_name ""} {-pretty_name ""} } { Add an element to a portal given a datasource name. Used for procs @@ -970,10 +969,7 @@ set pretty_name $portlet_name } - if {[empty_string_p $page_id]} { - # neither page_num or page_id given, default to 0 - set page_id [portal::get_page_id -portal_id $portal_id] - } + set page_id [get_page_id -portal_id $portal_id -page_name $page_name] # Balance the portal by adding the new element to the region # with the fewest number of elements, the first region w/ 0 elts, @@ -1025,16 +1021,17 @@ ad_return_complaint 1 "portal::add_element region $force_region not in layout $layout_id" } } + return [add_element_to_region \ - -page_id $page_id \ - -layout_id $layout_id \ - -pretty_name $pretty_name \ - $portal_id \ - $portlet_name \ - $min_region] + -page_name $page_name \ + -layout_id $layout_id \ + -pretty_name $pretty_name \ + $portal_id \ + $portlet_name \ + $min_region \ + ] } - ad_proc -public remove_element { {-element_id ""} {-portlet_name ""} @@ -1067,7 +1064,7 @@ ad_proc -private add_element_to_region { {-layout_id:required} - {-page_id ""} + {-page_name ""} {-pretty_name ""} portal_id ds_name @@ -1087,19 +1084,26 @@ set pretty_name $ds_name } + set page_id [get_page_id -portal_id $portal_id -page_name $page_name] set ds_id [get_datasource_id $ds_name] # First, check if this portal 1) has a portal template and # 2) that that template has an element of this DS in it. If # so, copy stuff. If not, just insert normally. - if { [db_0or1row get_template_info_select {}] == 1 } { + if {[db_0or1row get_template_info_select {}] == 1} { set new_element_id [db_nextval acs_object_id_seq] - db_1row get_target_page_id {} + set target_page_id [get_page_id -portal_id $portal_id -page_name $page_name -sort_key $template_page_sort_key] - set bar [db_string foobar { select name from portal_element_map pem where pem.page_id = :target_page_id and pem.sort_key = :template_element_sk and pem.region = 1} -default NONE ] + set bar [db_string foobar { + select name + from portal_element_map pem + where pem.page_id = :target_page_id + and pem.sort_key = :template_element_sk + and pem.region = 1 + } -default NONE] - # ns_log notice "aks5 $template_page_sort_key / $template_element_region / $template_element_name / $template_element_sk / $bar" + # ns_log notice "aks5 $template_page_sort_key / $template_element_region / $template_element_name / $template_element_sk / $bar" db_dml template_insert {} db_dml template_params_insert {} @@ -1683,8 +1687,8 @@ {-portal_id:required} {-portlet_name:required} {-value_id:required} - {-key "instance_id"} - {-page_id ""} + {-key "package_id"} + {-page_name ""} {-pretty_name ""} {-extra_params ""} {-force_region ""} @@ -1695,10 +1699,10 @@ it appends the value_id to the element's parameters with the given key. Returns the element_id used. - @return element_id The new element's id + @return element_id The new element's id @param portal_id The page to add the portlet to @param portlet_name The name of the portlet to add - @param key the key for the value_id (defaults to instance_id) + @param key the key for the value_id (defaults to package_id) @param value_id the value of the key @param extra_params a list of extra key/value pairs to insert or append } { @@ -1714,7 +1718,7 @@ -portal_id $portal_id \ -portlet_name $portlet_name \ -pretty_name $pretty_name \ - -page_id $page_id \ + -page_name $page_name \ -force_region $force_region ] @@ -1736,17 +1740,16 @@ set element_id [lindex $element_id_list 0] # There are existing values which should NOT be overwritten - add_element_param_value -element_id $element_id \ - -key $key \ - -value $value_id + add_element_param_value -element_id $element_id -key $key -value $value_id if {![empty_string_p $extra_params]} { check_key_value_list $extra_params for {set x 0} {$x < [llength $extra_params]} {incr x 2} { - add_element_param_value -element_id $element_id \ - -key [lindex $extra_params $x] \ - -value [lindex $extra_params [expr $x + 1]] + add_element_param_value \ + -element_id $element_id \ + -key [lindex $extra_params $x] \ + -value [lindex $extra_params [expr $x + 1]] } } } @@ -1759,7 +1762,7 @@ {-portal_id:required} {-portlet_name:required} {-value_id:required} - {-key "instance_id"} + {-key "package_id"} {-extra_params ""} } { A helper proc for portlet "remove_self_from_page" procs. @@ -1772,7 +1775,7 @@ @param portal_id The portal page to act on @param portlet_name The name of the portlet to (maybe) remove - @param key the key for the value_id (defaults to instance_id) + @param key the key for the value_id (defaults to package_id) @param value_id the value of the key @param extra_params a list of extra key/value pairs to remove } { Index: openacs-4/packages/news-portlet/sql/oracle/news-admin-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/sql/oracle/news-admin-portlet-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/news-portlet/sql/oracle/news-admin-portlet-create.sql 9 May 2002 23:59:53 -0000 1.3 +++ openacs-4/packages/news-portlet/sql/oracle/news-admin-portlet-create.sql 12 May 2002 18:15:04 -0000 1.4 @@ -89,12 +89,12 @@ -- news_admin-specific params - -- news_instance_id must be configured + -- package_id must be configured portal_datasource.set_def_param ( datasource_id => ds_id, config_required_p => 't', configured_p => 'f', - key => 'news_instance_id', + key => 'package_id', value => '' ); Index: openacs-4/packages/news-portlet/sql/oracle/news-portlet-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/sql/oracle/news-portlet-create.sql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/news-portlet/sql/oracle/news-portlet-create.sql 10 May 2002 03:58:27 -0000 1.10 +++ openacs-4/packages/news-portlet/sql/oracle/news-portlet-create.sql 12 May 2002 18:15:04 -0000 1.11 @@ -93,7 +93,7 @@ datasource_id => ds_id, config_required_p => 't', configured_p => 'f', - key => 'instance_id', + key => 'package_id', value => '' ); Index: openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl 9 May 2002 23:59:53 -0000 1.4 +++ openacs-4/packages/news-portlet/tcl/news-admin-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.5 @@ -19,7 +19,7 @@ Procedures to support the news admin portlet @creation-date Jan 2002 - @author ben@openforce.net + @author ben@openforce.net @cvs-id $Id$ } @@ -46,53 +46,48 @@ return "" } - ad_proc -public add_self_to_page { - portal_id - news_instance_id + ad_proc -public add_self_to_page { + {-portal_id:required} + {-page_name ""} + {-package_id:required} } { Adds a news admin PE to the given portal @param portal_id The page to add self to - @param news_instance_id The instance_id of the news pacakge + @param package_id The package_id of the news pacakge + @return element_id The new element's id } { # there is only one news admin pe, so use: set element_id [portal::add_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] \ ] - portal::set_element_param \ - $element_id \ - "news_instance_id" \ - $news_instance_id + portal::set_element_param $element_id package_id $package_id return $element_id } - ad_proc -public remove_self_from_page { - portal_id + ad_proc -public remove_self_from_page { + portal_id } { - Removes a news admin PE from the given page + Removes a news admin PE from the given page } { portal::remove_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] } - ad_proc -public show { - cf + ad_proc -public show { + cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "news-admin-portlet" - + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "news-admin-portlet" + } - } - - - Index: openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 10 May 2002 03:58:27 -0000 1.15 +++ openacs-4/packages/news-portlet/tcl/news-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.16 @@ -19,7 +19,7 @@ Procedures to support the news portlet @creation-date Nov 2001 - @author arjun@openforce.net + @author arjun@openforce.net @cvs-id $Id$ } @@ -49,49 +49,50 @@ return "" } - ad_proc -public add_self_to_page { - portal_id - instance_id + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} } { - Adds a news PE to the given portal. - + Adds a news PE to the given portal. + @param portal_id The page to add self to - @param instance_id The community with the folder + @param package_id The community with the folder + @return element_id The new element's id } { return [portal::add_element_or_append_id \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -value_id $instance_id \ - -force_region [ad_parameter "news_portlet_force_region" [my_package_key]] \ - -pretty_name [get_pretty_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -value_id $package_id \ + -force_region [ad_parameter "news_portlet_force_region" [my_package_key]] \ + -pretty_name [get_pretty_name] ] } - ad_proc -public remove_self_from_page { - portal_id - instance_id + ad_proc -public remove_self_from_page { + portal_id + package_id } { - Removes a news PE from the given page or the instance_id of the + Removes a news PE from the given page or the package_id of the news pacakge from the portlet if there are others remaining - + @param portal_id The page to remove self from - @param instance_id + @param package_id } { portal::remove_element_or_remove_id \ - -portal_id $portal_id \ - -portlet_name [get_my_name] \ - -value_id $instance_id + -portal_id $portal_id \ + -portlet_name [get_my_name] \ + -value_id $package_id } - ad_proc -public show { - cf + ad_proc -public show { + cf } { } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "news-portlet" + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "news-portlet" } } Index: openacs-4/packages/news-portlet/www/news-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/news-admin-portlet.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/news-portlet/www/news-admin-portlet.tcl 9 May 2002 23:59:53 -0000 1.3 +++ openacs-4/packages/news-portlet/www/news-admin-portlet.tcl 12 May 2002 18:15:04 -0000 1.4 @@ -27,7 +27,7 @@ array set config $cf set user_id [ad_conn user_id] -set list_of_package_ids $config(news_instance_id) +set list_of_package_ids $config(package_id) if {[llength $list_of_package_ids] > 1} { # We have a problem! Index: openacs-4/packages/news-portlet/www/news-portlet-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/Attic/news-portlet-oracle.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/news-portlet/www/news-portlet-oracle.xql 12 Apr 2002 08:11:15 -0000 1.2 +++ openacs-4/packages/news-portlet/www/news-portlet-oracle.xql 12 May 2002 18:15:04 -0000 1.3 @@ -18,7 +18,7 @@ from news_items_approved where news_items_approved.publish_date < sysdate and (news_items_approved.archive_date >= sysdate or news_items_approved.archive_date is null) - and news_items_approved.package_id in ([join $list_of_instance_ids ", "]) + and news_items_approved.package_id in ([join $list_of_package_ids ", "]) order by parent_name, news_items_approved.publish_title Index: openacs-4/packages/news-portlet/www/news-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/www/news-portlet.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/news-portlet/www/news-portlet.tcl 9 May 2002 23:59:53 -0000 1.12 +++ openacs-4/packages/news-portlet/www/news-portlet.tcl 12 May 2002 18:15:04 -0000 1.13 @@ -28,7 +28,7 @@ set shaded_p $config(shaded_p) # Should be a list already! XXX rename me! -set list_of_instance_ids $config(instance_id) -set one_instance_p [ad_decode [llength $list_of_instance_ids] 1 1 0] +set list_of_package_ids $config(package_id) +set one_instance_p [ad_decode [llength $list_of_package_ids] 1 1 0] db_multirow news_items select_news_items {} Index: openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql 9 May 2002 23:59:54 -0000 1.3 +++ openacs-4/packages/static-portlet/sql/oracle/static-admin-portlet.sql 12 May 2002 18:15:04 -0000 1.4 @@ -88,12 +88,12 @@ -- static-admin-specific procs - -- Instance_id must be configured + -- package_id must be configured portal_datasource.set_def_param ( datasource_id => ds_id, config_required_p => 't', configured_p => 'f', - key => 'instance_id', + key => 'package_id', value => '' ); Index: openacs-4/packages/static-portlet/sql/oracle/static-core.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/oracle/static-core.sql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/static-portlet/sql/oracle/static-core.sql 16 Apr 2002 13:55:32 -0000 1.4 +++ openacs-4/packages/static-portlet/sql/oracle/static-core.sql 12 May 2002 18:15:04 -0000 1.5 @@ -32,7 +32,7 @@ references acs_objects(object_id) constraint static_p_c_pk primary key, - instance_id integer + package_id integer not null, pretty_name varchar2(100) constraint static_p_c_pretty_name_nn @@ -64,7 +64,7 @@ create or replace package static_portal_content_item as function new ( - instance_id in static_portal_content.instance_id%TYPE default null, + package_id in static_portal_content.package_id%TYPE default null, pretty_name in static_portal_content.pretty_name%TYPE default null, content in static_portal_content.content%TYPE default null, object_type in acs_objects.object_type%TYPE default 'static_portal_content', @@ -85,7 +85,7 @@ create or replace package body static_portal_content_item as function new ( - instance_id in static_portal_content.instance_id%TYPE default null, + package_id in static_portal_content.package_id%TYPE default null, pretty_name in static_portal_content.pretty_name%TYPE default null, content in static_portal_content.content%TYPE default null, object_type in acs_objects.object_type%TYPE default 'static_portal_content', @@ -106,9 +106,9 @@ ); insert into static_portal_content - (content_id, instance_id, pretty_name, content) + (content_id, package_id, pretty_name, content) values - (v_content_id, new.instance_id, new.pretty_name, new.content); + (v_content_id, new.package_id, new.pretty_name, new.content); return v_content_id; end new; Index: openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql 9 May 2002 23:59:54 -0000 1.3 +++ openacs-4/packages/static-portlet/sql/oracle/static-portlet.sql 12 May 2002 18:15:04 -0000 1.4 @@ -87,16 +87,15 @@ -- static-specific procs - -- instance_id must be configured + -- package_id must be configured portal_datasource.set_def_param ( datasource_id => ds_id, config_required_p => 't', configured_p => 'f', - key => 'instance_id', + key => 'package_id', value => '' ); - -- instance_id must be configured portal_datasource.set_def_param ( datasource_id => ds_id, config_required_p => 't', Index: openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 10 May 2002 06:30:01 -0000 1.8 +++ openacs-4/packages/static-portlet/tcl/static-admin-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.9 @@ -18,19 +18,19 @@ Procedures to support the static ADMIN portlet Copyright Openforce, Inc. - Licensed under GNU GPL v2 + Licensed under GNU GPL v2 - @author arjun@openforce.net + @author arjun@openforce.net @cvs-id $Id$ } namespace eval static_admin_portlet { - + ad_proc -private get_my_name { } { return "static_admin_portlet" } - + ad_proc -public get_pretty_name { } { return [oacs_util::parameter \ @@ -48,10 +48,10 @@ } { return "" } - - ad_proc -public add_self_to_page { - portal_id - instance_id + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} } { Adds a static admin PE to the given portal } { @@ -62,37 +62,36 @@ # there is only one static admin portlet per portal so use: set element_id [portal::add_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] ] # Set the instace of "static" that this PE will know - portal::set_element_param $element_id instance_id $instance_id + portal::set_element_param $element_id package_id $package_id return $element_id } - ad_proc -public remove_self_from_page { - portal_id + ad_proc -public remove_self_from_page { + portal_id } { - Removes static PE from the given page + Removes static PE from the given page } { # This is easy since there's one and only one instace_id portal::remove_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] } - - ad_proc -public show { - cf + + ad_proc -public show { + cf } { Display the PE } { portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "static-admin-portlet" - } -} - + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "static-admin-portlet" + } +} Index: openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 9 May 2002 23:59:54 -0000 1.6 +++ openacs-4/packages/static-portlet/tcl/static-portal-content-procs.tcl 12 May 2002 18:15:04 -0000 1.7 @@ -29,7 +29,7 @@ namespace eval static_portal_content { ad_proc -public new { - {-instance_id:required} + {-package_id:required} {-content:required} {-pretty_name:required} } { @@ -40,7 +40,7 @@ declare begin :1 := static_portal_content_item.new( - instance_id => :instance_id, + package_id => :package_id, content => :content, pretty_name => :pretty_name ); @@ -119,13 +119,13 @@ }] } - ad_proc -public get_instance_id { + ad_proc -public get_package_id { {-content_id:required} } { - Get the instance_id of the item + Get the package_id of the item } { - return [db_string get_instance_id.select { - select instance_id + return [db_string get_package_id.select { + select package_id from static_portal_content where content_id = :content_id }] Index: openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl 9 May 2002 23:59:54 -0000 1.5 +++ openacs-4/packages/static-portlet/tcl/static-portlet-procs.tcl 12 May 2002 18:15:04 -0000 1.6 @@ -18,17 +18,17 @@ Procedures to supports static portlets - @author arjun@openforce.net + @author arjun@openforce.net @cvs-id $Id$ } namespace eval static_portlet { - + ad_proc -private get_my_name { } { return "static_portlet" } - + ad_proc -public get_pretty_name { } { return "" @@ -43,45 +43,44 @@ } { return "" } - - ad_proc -public add_self_to_page { - portal_id - instance_id + + ad_proc -public add_self_to_page { + {-portal_id:required} + {-package_id:required} } { Adds a static PE to the given page } { # there is no aggregation, so use: set element_id [portal::add_element \ - -portal_id $portal_id \ - -portlet_name [get_my_name] + -portal_id $portal_id \ + -portlet_name [get_my_name] ] # Set the instace of "static-portlet" that this PE will know - portal::set_element_param $element_id instance_id $instance_id + portal::set_element_param $element_id package_id $package_id return $element_id } - - ad_proc -public remove_self_from_page { - portal_id - element_id + + ad_proc -public remove_self_from_page { + portal_id + element_id } { - Removes static PE from the given page + Removes static PE from the given page } { # This is easy since there's one and only one instace_id portal::remove_element $element_id } - ad_proc -public show { - cf + ad_proc -public show { + cf } { } { - + portal::show_proc_helper \ - -package_key [my_package_key] \ - -config_list $cf \ - -template_src "static-portlet" - } -} - + -package_key [my_package_key] \ + -config_list $cf \ + -template_src "static-portlet" + } +} Index: openacs-4/packages/static-portlet/www/element-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/Attic/element-new.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/static-portlet/www/element-new.tcl 16 Apr 2002 13:55:32 -0000 1.6 +++ openacs-4/packages/static-portlet/www/element-new.tcl 12 May 2002 18:15:05 -0000 1.7 @@ -30,7 +30,7 @@ set element_pretty_name [ad_parameter static_admin_portlet_element_pretty_name static-portlet "Custom Portlet"] set title "New $element_pretty_name" -set instance_id [ad_conn package_id] +set package_id [ad_conn package_id] form create new_static_element @@ -65,7 +65,7 @@ # insert the new content item db_transaction { set item_id [static_portal_content::new \ - -instance_id $instance_id \ + -package_id $package_id \ -content $content \ -pretty_name $pretty_name] Index: openacs-4/packages/static-portlet/www/static-admin-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/static-admin-portlet.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 6 May 2002 23:57:19 -0000 1.8 +++ openacs-4/packages/static-portlet/www/static-admin-portlet.tcl 12 May 2002 18:15:05 -0000 1.9 @@ -24,7 +24,7 @@ } array set config $cf -set instance_id $config(instance_id) +set package_id $config(package_id) set element_pretty_name [ad_parameter static_admin_portlet_element_pretty_name static-portlet "Custom Portlet"] set element_pretty_plural [ad_parameter static_admin_portlet_element_pretty_plural static-portlet "Custom Portlets"] @@ -33,7 +33,7 @@ select content_id, pretty_name from static_portal_content - where instance_id = :instance_id + where package_id = :package_id } set template_portal_id [dotlrn_community::get_portal_id]