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.29 -r1.30 --- openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 8 Apr 2002 22:00:46 -0000 1.29 +++ openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 16 Apr 2002 13:57:07 -0000 1.30 @@ -68,17 +68,30 @@ # register/activate self with dotlrn # our service contract is in the db, but we must tell dotlrn # that we exist and want to be active - dotlrn_applet::add_applet_to_dotlrn -applet_key "dotlrn_bboard" + if {![dotlrn_applet::is_applet_mounted -url "bboard"]} { + dotlrn_applet::add_applet_to_dotlrn -applet_key "dotlrn_bboard" - # Mount the package - dotlrn_applet::mount -package_key "dotlrn-bboard" -url "bboard" -pretty_name "Bboards" + # Mount the package + dotlrn_applet::mount -package_key "dotlrn-bboard" -url "bboard" -pretty_name "Bboards" + } } ad_proc -public add_applet_to_community { community_id } { Add the bboard applet to a dotlrn community } { + # get the portal_template_id by callback + set pt_id [dotlrn_community::get_portal_template_id $community_id] + + # set up the DS for the portal template + bboard_portlet::make_self_available $pt_id + + if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { + bboard_portlet::add_self_to_page $pt_id 0 + return + } + # Create and Mount set package_key [package_key] set package_id [dotlrn::instantiate_and_mount -mount_point "forums" $community_id $package_key] @@ -100,11 +113,6 @@ -context_id $package_id } - # get the portal_template_id by callback - set pt_id [dotlrn_community::get_portal_template_id $community_id] - - # set up the DS for the portal template - bboard_portlet::make_self_available $pt_id bboard_portlet::add_self_to_page $pt_id $package_id # set up the DS for the admin page 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.41 -r1.42 --- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 16 Apr 2002 05:17:17 -0000 1.41 +++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 16 Apr 2002 13:57:07 -0000 1.42 @@ -96,13 +96,6 @@ } { Add the calendar applet to a specific dotlrn community } { - # set up a nice name for the comm's calendar - set cal_name "[dotlrn_community::get_community_name $community_id] Public Calendar" - - # create the community's calendar, the "f" is for a public calendar - set group_calendar_id \ - [calendar_create [ad_conn "user_id"] "f" $cal_name] - # add this element to the portal template. # do this directly, don't use calendar_portlet::add_self_to_page here set portal_template_id \ @@ -117,9 +110,6 @@ $portal_template_id \ [calendar_portlet::my_name]] - # set the group_calendar_id parameter in the portal template, - portal::set_element_param \ - $element_id "calendar_id" $group_calendar_id # 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 @@ -129,6 +119,29 @@ -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_template_id \ + 0 + ] + + return + } + + # set up a nice name for the comm's calendar + set cal_name "[dotlrn_community::get_community_name $community_id] Public Calendar" + + # create the community's calendar, the "f" is for a public calendar + set group_calendar_id \ + [calendar_create [ad_conn "user_id"] "f" $cal_name] + + # set the group_calendar_id parameter in the portal template, + portal::set_element_param \ + $element_id "calendar_id" $group_calendar_id + set element_id [calendar_full_portlet::add_self_to_page \ -page_id $page_id \ $portal_template_id \ 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.18 -r1.19 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 29 Mar 2002 19:17:09 -0000 1.18 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 16 Apr 2002 13:57:07 -0000 1.19 @@ -68,26 +68,15 @@ } { Add the dotlrn applet to a specific community } { - # No mounting of anything - - # Non-member page stuff - # Get the non-member portal_id - - # aks20 - trying to use dotlrn-static instead of this - #set portal_id [dotlrn_community::get_community_non_members_portal_id $community_id] - - # Add the element there, too - #dotlrn_portlet::make_self_available $portal_id - #dotlrn_portlet::add_self_to_page $portal_id $community_id - - # portal template stuff # get the portal_template_id set pt_id [dotlrn_community::get_portal_template_id $community_id] - - # set up the DS for the portal template dotlrn_portlet::make_self_available $pt_id - dotlrn_portlet::add_self_to_page $pt_id $community_id + dotlrn_portlet::add_self_to_page $pt_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_community_admin_portal_id $community_id] dotlrn_admin_portlet::make_self_available $admin_portal_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.3 -r1.4 --- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 29 Mar 2002 19:17:09 -0000 1.3 +++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 16 Apr 2002 13:58:05 -0000 1.4 @@ -78,15 +78,11 @@ } { Add the dotlrn applet to a specific community } { - # Not shown on the Non-member page for a comm - # portal template stuff set pt_id [dotlrn_community::get_portal_template_id $community_id] - # set up the DS for the portal template dotlrn_members_portlet::make_self_available $pt_id - # aks - this should be made into a param set community_type [dotlrn_community::get_community_type_from_community_id $community_id] if {$community_type == "dotlrn_community"} { @@ -95,11 +91,8 @@ set page_name [get_community_default_page] } - set page_id [portal::get_page_id \ - -portal_id $pt_id \ - -page_name $page_name \ - ] - + ns_log notice "aks2 got here" + # add the portlet to the correct page for this comm set page_id [portal::get_page_id \ -portal_id $pt_id \ 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.23 -r1.24 --- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 8 Apr 2002 22:00:46 -0000 1.23 +++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 16 Apr 2002 13:57:07 -0000 1.24 @@ -72,16 +72,22 @@ } { Add the faq applet to a specifc community } { - # create the calendar package instance (all in one, I've mounted it) - set package_key [package_key] - set package_id [dotlrn::instantiate_and_mount $community_id $package_key] - # portal template stuff # get the portal_template_id by callback set pt_id [dotlrn_community::get_portal_template_id $community_id] # set up the DS for the portal template faq_portlet::make_self_available $pt_id + + if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { + faq_portlet::add_self_to_page $pt_id 0 + return + } + + # create the calendar package instance (all in one, I've mounted it) + set package_key [package_key] + set package_id [dotlrn::instantiate_and_mount $community_id $package_key] + faq_portlet::add_self_to_page $pt_id $package_id # set up the DS for the admin page 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.42 -r1.43 --- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 8 Apr 2002 22:00:46 -0000 1.42 +++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 16 Apr 2002 13:58:05 -0000 1.43 @@ -89,19 +89,53 @@ permission::revoke -party_id $party_id -object_id $folder_id -privilege "read" permission::revoke -party_id $party_id -object_id $folder_id -privilege "write" permission::revoke -party_id $party_id -object_id $folder_id -privilege "admin" - } - dotlrn_applet::add_applet_to_dotlrn -applet_key "dotlrn_fs" + dotlrn_applet::add_applet_to_dotlrn -applet_key "dotlrn_fs" - # Mount the package - dotlrn_applet::mount -package_key "dotlrn-fs" -url "fs" -pretty_name "File Storage" + # Mount the package + dotlrn_applet::mount -package_key "dotlrn-fs" -url "fs" -pretty_name "File Storage" + } } ad_proc -public add_applet_to_community { community_id } { Add the fs applet to a specifc dotlrn community } { + # portal template stuff + # get the portal_template_id by callback + set pt_id [dotlrn_community::get_portal_template_id $community_id] + + # set up the DS for the portal template + # that's the private folder_id there + fs_portlet::make_self_available $pt_id + + # 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"} { + set page_name [get_subcomm_default_page] + } else { + set page_name [get_community_default_page] + } + + set page_id [portal::get_page_id \ + -portal_id $pt_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 \ + $pt_id \ + 0 \ + 0 + + return + } + # create the calendar package instance (all in one, I've mounted it) set package_key [package_key] set package_id [dotlrn::instantiate_and_mount \ @@ -118,6 +152,12 @@ -description "${community_name}'s Files" \ ] + fs_portlet::add_self_to_page \ + -page_id $page_id \ + $pt_id \ + $package_id \ + $folder_id + set party_id [acs_magic_object "registered_users"] permission::revoke -party_id $party_id -object_id $folder_id -privilege "read" permission::revoke -party_id $party_id -object_id $folder_id -privilege "write" @@ -158,36 +198,6 @@ fs_portlet::add_self_to_page \ $non_member_portal_id $package_id $public_folder_id - # portal template stuff - # get the portal_template_id by callback - set pt_id [dotlrn_community::get_portal_template_id $community_id] - - # set up the DS for the portal template - # that's the private folder_id there - fs_portlet::make_self_available $pt_id - - # 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"} { - set page_name [get_subcomm_default_page] - } else { - set page_name [get_community_default_page] - } - - set page_id [portal::get_page_id \ - -portal_id $pt_id \ - -page_name $page_name \ - ] - - fs_portlet::add_self_to_page \ - -page_id $page_id \ - $pt_id \ - $package_id \ - $folder_id - return $package_id } 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.14 -r1.15 --- openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 29 Mar 2002 19:19:43 -0000 1.14 +++ openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 16 Apr 2002 13:58:05 -0000 1.15 @@ -65,6 +65,17 @@ } { Add the news applet to a specifc dotlrn community } { + # portal template stuff + set pt_id [dotlrn_community::get_portal_template_id $community_id] + + # set up the DS for the portal template + news_portlet::make_self_available $pt_id + + if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { + news_portlet::add_self_to_page $pt_id 0 + return + } + # Callback to get node_id from community # REVISIT this (ben) set node_id [site_node_id [ad_conn url]] @@ -73,11 +84,6 @@ set package_key [package_key] set package_id [dotlrn::instantiate_and_mount $community_id $package_key] - # portal template stuff - set pt_id [dotlrn_community::get_portal_template_id $community_id] - - # set up the DS for the portal template - news_portlet::make_self_available $pt_id news_portlet::add_self_to_page $pt_id $package_id # set up the DS for the admin portal 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.27 -r1.28 --- openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 2 Apr 2002 06:13:47 -0000 1.27 +++ openacs-4/packages/dotlrn-portlet/tcl/dotlrn-portlet-procs.tcl 16 Apr 2002 13:58:28 -0000 1.28 @@ -43,7 +43,7 @@ ad_proc -public get_pretty_name { } { - return [ad_parameter subcommunities_pretty_plural dotlrn] + return [ad_parameter -package_id [dotlrn::get_package_id] subcommunities_pretty_plural] } 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.5 -r1.6 --- openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 29 Mar 2002 19:22:48 -0000 1.5 +++ openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 16 Apr 2002 13:58:07 -0000 1.6 @@ -78,13 +78,19 @@ } { Add the research paper applet to a specifc dotlrn community } { - set instance_id [dotlrn::instantiate_and_mount \ - -mount_point "research-papers" $community_id [package_key]] - # get the portal_template_id by callback set pt_id [dotlrn_community::get_portal_template_id $community_id] research_portlet::make_self_available $pt_id + + if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { + research_portlet::add_self_to_page $pt_id "" $community_id + return + } + + set instance_id [dotlrn::instantiate_and_mount \ + -mount_point "research-papers" $community_id [package_key]] + research_portlet::add_self_to_page $pt_id "" $community_id dotlrn_research_admin::add_applet_to_community $community_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.12 -r1.13 --- openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 2 Apr 2002 05:42:01 -0000 1.12 +++ openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 16 Apr 2002 13:58:05 -0000 1.13 @@ -67,6 +67,13 @@ Add the static applet to dotlrn - for one-time init Must be repeatable! } { + # FIXME: won't work with multiple dotlrn instances + # aks - trying one mounting of static under /dotlrn (like calendar) + # Use the package_key for the -url param - "/" are not allowed! + if {![dotlrn::is_package_mounted -package_key [my_package_key]]} { + dotlrn_applet::mount -package_key [package_key] + } + dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key] } @@ -75,52 +82,21 @@ } { Add the static applet to a dotlrn community } { - # Create and Mount myself at /static under the community - set instance_id [dotlrn::instantiate_and_mount \ - -mount_point "static" $community_id [package_key]] - - # aks: comment out this until we figure out what to do with the non-members static portlet - - # we add a special static pe to the non-memebers page -## # with the comm info as the content called "$comm_name Info" -## set comm_name [dotlrn_community::get_community_name $community_id] -## set n_p_id [dotlrn_community::get_community_non_members_portal_id $community_id] -## -## set content_id [static_portal_content::new \ -## -instance_id $instance_id \ -## -content "[dotlrn_community::get_community_description $community_id] " \ -## -pretty_name "$comm_name Info" -## ] -## -## static_portal_content::add_to_portal \ -## -content_id $content_id \ -## -portal_id $n_p_id -## - - # set up the DS for the admin page - set admin_portal_id \ - [dotlrn_community::get_community_admin_portal_id $community_id] - static_admin_portlet::make_self_available $admin_portal_id - static_admin_portlet::add_self_to_page $admin_portal_id $instance_id - - # If i'm in a class, add a portlet called "class (pn) info" - # if I'm in a community, add a portlet called "community (pn) info" - # or if I'm in a subcomm, "subcomm (pn) info" set community_type \ [dotlrn_community::get_community_type_from_community_id $community_id] set pt_id [dotlrn_community::get_portal_template_id $community_id] + ns_log notice "aks7: $pt_id" - set class_pn [ad_parameter class_instances_pretty_name dotlrn] - set club_pn [ad_parameter clubs_pretty_name dotlrn] - set subg_pn [ad_parameter subcommunities_pretty_name dotlrn] - + # If i'm in a class, add a portlet called "class (pn) info" + # if I'm in a community, add a portlet called "community (pn) info" + # or if I'm in a subcomm, "subcomm (pn) info" if {$community_type == "dotlrn_club"} { set content_id [static_portal_content::new \ - -instance_id $instance_id \ + -instance_id $community_id \ -content " " \ - -pretty_name "$club_pn Info" + -pretty_name "[dotlrn::parameter clubs_pretty_name] Info" ] static_portal_content::add_to_portal \ @@ -130,28 +106,43 @@ } elseif {$community_type == "dotlrn_community"} { set content_id [static_portal_content::new \ - -instance_id $instance_id \ + -instance_id $community_id \ -content " " \ - -pretty_name "$subg_pn Info" + -pretty_name "[dotlrn::parameter subcommunities_pretty_name] Info" ] static_portal_content::add_to_portal \ -content_id $content_id \ -portal_id $pt_id } else { set content_id [static_portal_content::new \ - -instance_id $instance_id \ + -instance_id $community_id \ -content " " \ - -pretty_name "$class_pn Info" + -pretty_name "[dotlrn::parameter class_instances_pretty_name] Info" ] static_portal_content::add_to_portal \ -content_id $content_id \ -portal_id $pt_id + } + + if {[dotlrn_community::dummy_comm_p -community_id $community_id]} { + return } - # return the instance_id - return $instance_id + # the non-member page gets the same static portlet + set n_p_id [dotlrn_community::get_community_non_members_portal_id $community_id] + + static_portal_content::add_to_portal \ + -content_id $content_id \ + -portal_id $n_p_id + + # set up the DS for the admin page + set admin_portal_id \ + [dotlrn_community::get_community_admin_portal_id $community_id] + static_admin_portlet::make_self_available $admin_portal_id + static_admin_portlet::add_self_to_page $admin_portal_id $community_id + } ad_proc -public remove_applet {