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.31 -r1.32
--- openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 30 Apr 2002 21:34:33 -0000 1.31
+++ openacs-4/packages/dotlrn-bboard/tcl/dotlrn-bboard-procs.tcl 6 May 2002 23:56:23 -0000 1.32
@@ -35,11 +35,6 @@
namespace eval dotlrn_bboard {
- ad_proc -private my_package_key {
- } {
- return "dotlrn-bboard"
- }
-
ad_proc -public applet_key {} {
get the applet key
} {
@@ -69,54 +64,58 @@
# our service contract is in the db, but we must tell dotlrn
# that we exist and want to be active
if {![dotlrn_applet::is_applet_mounted -url "bboard"]} {
- dotlrn_applet::add_applet_to_dotlrn -applet_key "dotlrn_bboard"
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
# Mount the package
dotlrn_applet::mount -package_key "dotlrn-bboard" -url "bboard" -pretty_name "Bboards"
}
}
+ ad_proc -public remove_applet {
+ community_id
+ package_id
+ } {
+ remove the applet from the community
+ } {
+ }
+
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 portal_id [dotlrn_community::get_portal_id -community_id $community_id]
- # set up the DS for the portal template
- bboard_portlet::make_self_available $pt_id
+ bboard_portlet::make_self_available $portal_id
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
- bboard_portlet::add_self_to_page $pt_id 0
+ bboard_portlet::add_self_to_page $portal_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]
+ set package_id [dotlrn::instantiate_and_mount -mount_point "forums" $community_id [package_key]]
-
set auto_create_forum_p [ad_parameter \
- -package_id [apm_package_id_from_key [my_package_key]] \
- "auto_create_forum_p" "f"]
+ -package_id [apm_package_id_from_key "dotlrn-bboard"] \
+ "auto_create_forum_p" "f" \
+ ]
set auto_create_forum_name [ad_parameter \
- -package_id [apm_package_id_from_key [my_package_key]] \
- "auto_create_forum_name" "Discussions"]
+ -package_id [apm_package_id_from_key "dotlrn-bboard"] \
+ "auto_create_forum_name" "Discussions" \
+ ]
if {$auto_create_forum_p == "t"} {
# 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_forum_new -bboard_id $package_id -short_name $auto_create_forum_name -context_id $package_id
}
- bboard_portlet::add_self_to_page $pt_id $package_id
+ bboard_portlet::add_self_to_page $portal_id $package_id
# set up the DS for the admin page
- set admin_portal_id [dotlrn_community::get_community_admin_portal_id $community_id]
+ set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
bboard_admin_portlet::make_self_available $admin_portal_id
bboard_admin_portlet::add_self_to_page $admin_portal_id $package_id
@@ -131,23 +130,17 @@
return $package_id
}
- ad_proc -public remove_applet {
+ ad_proc -public add_user {
community_id
- package_id
} {
- remove the applet from the community
+ Called when the user is initially added as a dotlrn user.
+ For one-time init stuff
} {
- # Dropping all messages, forums
-
- # Killing the package
-
}
- ad_proc -public add_user {
- community_id
+ ad_proc -public remove_user {
+ user_id
} {
- Called when the user is initially added as a dotlrn user.
- For one-time init stuff
} {
}
@@ -157,82 +150,23 @@
} {
Add a user to a specific dotlrn community
} {
- # Get the package_id by callback
- set package_id [dotlrn_community::get_applet_package_id \
- $community_id \
- dotlrn_bboard
- ]
+ set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]]
+ set portal_id [dotlrn::get_workspace_portal_id $user_id]
- # Get the personal per comm portal_id by callback
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- if {[exists_and_not_null $portal_id]} {
- # we have personal per comm portals
-
- # Make bboard DS available to this page
- bboard_portlet::make_self_available $portal_id
-
- # Call the portal element to be added correctly
- set element_id [bboard_portlet::add_self_to_page \
- $portal_id \
- $package_id
- ]
-
- # Make sure that the group name is not displayed here
- portal::set_element_param $element_id \
- "display_group_name_p" \
- "f"
- }
-
- # Now for the user workspace
- set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id]
-
- # Add the portlet here
- if {[exists_and_not_null $workspace_portal_id]} {
- set element_id [bboard_portlet::add_self_to_page \
- $workspace_portal_id \
- $package_id
- ]
-
- # Make sure that the group name IS displayed here
- portal::set_element_param $element_id "display_group_name_p" "t"
- }
+ set element_id [bboard_portlet::add_self_to_page $portal_id $package_id]
+ portal::set_element_param $element_id "display_group_name_p" "t"
}
- ad_proc -public remove_user {
- user_id
- } {
- } {
- }
-
ad_proc -public remove_user_from_community {
community_id
user_id
} {
Remove a user from a community
} {
- # Get the portal_id
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- # 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]
- # Remove the portal element
bboard_portlet::remove_self_from_page $portal_id $package_id
-
- # Buh Bye.
- bboard_portlet::make_self_unavailable $portal_id
-
- # remove user permissions to see bboards
- # nothing to do here
-
- # Remove from the main workspace
- set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id]
-
- # Remove the portlet here
- if { $workspace_portal_id != "" } {
- bboard_portlet::remove_self_from_page $workspace_portal_id $package_id
- }
}
}
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.44 -r1.45
--- openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 6 May 2002 22:06:18 -0000 1.44
+++ openacs-4/packages/dotlrn-calendar/tcl/dotlrn-calendar-procs.tcl 6 May 2002 23:56:24 -0000 1.45
@@ -378,6 +378,7 @@
} {
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::remove_self_from_page $workspace_portal_id $g_cal_id
calendar_full_portlet::remove_self_from_page $workspace_portal_id $g_cal_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.20 -r1.21
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 30 Apr 2002 21:34:33 -0000 1.20
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-dotlrn-procs.tcl 6 May 2002 23:56:26 -0000 1.21
@@ -68,8 +68,7 @@
} {
Add the dotlrn applet to a specific community
} {
- # get the portal_template_id
- set pt_id [dotlrn_community::get_portal_template_id $community_id]
+ set pt_id [dotlrn_community::get_portal_id -community_id $community_id]
dotlrn_portlet::make_self_available $pt_id
dotlrn_portlet::add_self_to_page $pt_id $community_id
@@ -78,7 +77,7 @@
}
# set up the DS for the admin page
- set admin_portal_id [dotlrn_community::get_community_admin_portal_id $community_id]
+ set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
dotlrn_admin_portlet::make_self_available $admin_portal_id
dotlrn_admin_portlet::add_self_to_page $admin_portal_id $community_id
@@ -107,48 +106,26 @@
return
}
+ ad_proc -public remove_user {
+ user_id
+ } {
+ } {
+ }
ad_proc -public add_user_to_community {
community_id
user_id
} {
Called when a user is added to a spceific dotlrn community
} {
- # Get the portal_id by callback
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- if { [exists_and_not_null $portal_id] } {
- dotlrn_portlet::make_self_available $portal_id
- dotlrn_portlet::add_self_to_page $portal_id $community_id
- }
}
- ad_proc -public remove_user {
- user_id
- } {
- } {
- }
-
ad_proc -public remove_user_from_community {
community_id
user_id
} {
Remove a user from a community
} {
- # Get the portal_id
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- # Get the package_id by callback
- # set package_id [dotlrn_community::get_package_id $community_id]
-
- # Remove the portal element
- dotlrn_portlet::remove_self_from_page $portal_id $community_id
-
- # Buh Bye.
- dotlrn_portlet::make_self_unavailable $portal_id
-
- # remove user permissions to see dotlrns
- # nothing to do here
}
}
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.4 -r1.5
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 16 Apr 2002 13:58:05 -0000 1.4
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-procs.tcl 6 May 2002 23:56:26 -0000 1.5
@@ -79,9 +79,9 @@
Add the dotlrn applet to a specific community
} {
# portal template stuff
- set pt_id [dotlrn_community::get_portal_template_id $community_id]
+ set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
- dotlrn_members_portlet::make_self_available $pt_id
+ dotlrn_members_portlet::make_self_available $portal_id
set community_type [dotlrn_community::get_community_type_from_community_id $community_id]
@@ -91,17 +91,15 @@
set page_name [get_community_default_page]
}
- 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 \
+ -portal_id $portal_id \
-page_name $page_name \
]
dotlrn_members_portlet::add_self_to_page \
-page_id $page_id \
- $pt_id \
+ $portal_id \
$community_id
return $community_id
@@ -123,6 +121,11 @@
return
}
+ ad_proc -public remove_user {
+ user_id
+ } {
+ } {
+ }
ad_proc -public add_user_to_community {
community_id
@@ -132,32 +135,12 @@
} {
}
- ad_proc -public remove_user {
- user_id
- } {
- } {
- }
-
ad_proc -public remove_user_from_community {
community_id
user_id
} {
Remove a user from a community
} {
- # Get the portal_id
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- # Get the package_id by callback
- # set package_id [dotlrn_community::get_package_id $community_id]
-
- # Remove the portal element
- dotlrn_members_portlet::remove_self_from_page $portal_id $community_id
-
- # Buh Bye.
- dotlrn_members_portlet::make_self_unavailable $portal_id
-
- # remove user permissions to see dotlrns
- # nothing to do here
}
}
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.2 -r1.3
--- openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 29 Mar 2002 19:17:09 -0000 1.2
+++ openacs-4/packages/dotlrn-dotlrn/tcl/dotlrn-members-staff-procs.tcl 6 May 2002 23:56:26 -0000 1.3
@@ -31,14 +31,6 @@
namespace eval dotlrn_members_staff {
- # aks - don't need this, I think
- # ad_proc -public package_key {
- # } {
- # get the package_key this applet deals with
- # } {
- # return "dotlrn"
- # }
-
ad_proc portal_element_key {
} {
Returns the key for the portal element this applet uses
@@ -65,18 +57,10 @@
} {
Add the dotlrn applet to a specific community
} {
- # Not shown on the Non-member page for a comm
+ set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
- # portal template stuff
- set pt_id [dotlrn_community::get_portal_template_id $community_id]
-
- # set up the DS for the portal template
- dotlrn_members_staff_portlet::make_self_available $pt_id
-
- # add the portlet to the first page
- dotlrn_members_staff_portlet::add_self_to_page $pt_id $community_id
-
- return $community_id
+ dotlrn_members_staff_portlet::make_self_available $portal_id
+ dotlrn_members_staff_portlet::add_self_to_page $portal_id $community_id
}
ad_proc -public remove_applet {
@@ -95,6 +79,11 @@
return
}
+ ad_proc -public remove_user {
+ user_id
+ } {
+ } {
+ }
ad_proc -public add_user_to_community {
community_id
@@ -104,32 +93,12 @@
} {
}
- ad_proc -public remove_user {
- user_id
- } {
- } {
- }
-
ad_proc -public remove_user_from_community {
community_id
user_id
} {
Remove a user from a community
} {
- # Get the portal_id
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- # Get the package_id by callback
- # set package_id [dotlrn_community::get_package_id $community_id]
-
- # Remove the portal element
- dotlrn_members_staff_portlet::remove_self_from_page $portal_id $community_id
-
- # Buh Bye.
- dotlrn_members_staff_portlet::make_self_unavailable $portal_id
-
- # remove user permissions to see dotlrns
- # nothing to do here
}
}
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.25 -r1.26
--- openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 30 Apr 2002 21:35:52 -0000 1.25
+++ openacs-4/packages/dotlrn-faq/tcl/dotlrn-faq-procs.tcl 6 May 2002 23:56:27 -0000 1.26
@@ -14,16 +14,6 @@
# details.
#
-
-
-#
-# Procs for DOTLRN Faq Applet
-# Copyright 2001 OpenForce, inc.
-# Distributed under the GNU GPL v2
-#
-# October 5th, 2001
-#
-
ad_library {
Procs to set up the dotLRN Faq applet
@@ -72,32 +62,27 @@
} {
Add the faq applet to a specifc community
} {
- # portal template stuff
- # get the portal_template_id by callback
- set pt_id [dotlrn_community::get_portal_template_id $community_id]
+ set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
# set up the DS for the portal template
- faq_portlet::make_self_available $pt_id
+ faq_portlet::make_self_available $portal_id
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
- faq_portlet::add_self_to_page $pt_id 0
+ faq_portlet::add_self_to_page $portal_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
+ faq_portlet::add_self_to_page $portal_id $package_id
# set up the DS for the admin page
- set admin_portal_id [dotlrn_community::get_community_admin_portal_id $community_id]
+ set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
faq_admin_portlet::make_self_available $admin_portal_id
faq_admin_portlet::add_self_to_page $admin_portal_id $package_id
- # Set up some permissions
- # for FAQ, it's all good as is
-
# return the package_id
return $package_id
}
@@ -108,12 +93,6 @@
} {
remove the applet from the community
} {
- # Remove all instances of the faq portlet! (this is some serious stuff!)
-
- # Dropping all messages, forums
-
- # Killing the package
-
}
ad_proc -public add_user {
@@ -124,42 +103,22 @@
return
}
- ad_proc -public add_user_to_community {
- community_id
+ ad_proc -public remove_user {
user_id
} {
- Called when a user is added to a specific dotlrn community
} {
- # Get the faq applet's package_id by callback
- set package_id [dotlrn_community::get_applet_package_id \
- $community_id \
- dotlrn_faq
- ]
-
- # Get the portal_id by callback
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- if { [exists_and_not_null $portal_id] } {
- # Make faq DS available to this page
- faq_portlet::make_self_available $portal_id
-
- # Call the portal element to be added correctly
- faq_portlet::add_self_to_page $portal_id $package_id
- }
-
- # Now for the user workspace
- set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id]
-
- # Add the portlet here
- if { [exists_and_not_null $workspace_portal_id] } {
- faq_portlet::add_self_to_page $workspace_portal_id $package_id
- }
}
- ad_proc -public remove_user {
+ ad_proc -public add_user_to_community {
+ community_id
user_id
} {
+ Called when a user is added to a specific dotlrn community
} {
+ 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
}
ad_proc -public remove_user_from_community {
@@ -168,25 +127,10 @@
} {
Remove a user from a community
} {
- # Get the portal_id
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- # 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]
- # Remove the portal element
faq_portlet::remove_self_from_page $portal_id $package_id
-
- # Buh Bye.
- faq_portlet::make_self_unavailable $portal_id
-
- # Remove from main workspace
- set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id]
-
- # Remove the portlet
- if {![empty_string_p $workspace_portal_id]} {
- faq_portlet::remove_self_from_page $workspace_portal_id $package_id
- }
}
}
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.53 -r1.54
--- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 30 Apr 2002 21:35:52 -0000 1.53
+++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.tcl 6 May 2002 23:56:28 -0000 1.54
@@ -28,6 +28,13 @@
namespace eval dotlrn_fs {
+ ad_proc -public applet_key {
+ } {
+ get the applet_key
+ } {
+ return "dotlrn_fs"
+ }
+
ad_proc -public package_key {
} {
get the package_key this applet deals with
@@ -116,7 +123,7 @@
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 [applet_key]
# Mount the package
dotlrn_applet::mount -package_key "dotlrn-fs" -url "fs" -pretty_name "File Storage"
@@ -128,13 +135,11 @@
} {
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 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
- fs_portlet::make_self_available $pt_id
+ fs_portlet::make_self_available $portal_id
# add the portlet to the "file storage" page for this comm
@@ -147,18 +152,10 @@
set page_name [get_community_default_page]
}
- set page_id [portal::get_page_id \
- -portal_id $pt_id \
- -page_name $page_name \
- ]
+ 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 \
- $pt_id \
- 0 \
- 0
-
+ fs_portlet::add_self_to_page -page_id $page_id $portal_id 0 0
return
}
@@ -180,11 +177,7 @@
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 \
- $pt_id \
- $package_id \
- $folder_id
+ fs_portlet::add_self_to_page -page_id $page_id $portal_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"
@@ -235,17 +228,10 @@
# non-member page stuff
# Get non member portal_id
- set non_member_portal_id \
- [dotlrn_community::get_community_non_members_portal_id \
- $community_id \
- ]
+ 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 -force_region 2 $non_member_portal_id $package_id $public_folder_id
return $package_id
}
@@ -256,11 +242,6 @@
} {
remove the applet from the community
} {
- # Remove all instances of the fs portlet!
-
- # Dropping all messages, forums
-
- # Killing the package
}
ad_proc -private get_public_folder_id {
@@ -277,7 +258,7 @@
} {
Get the internal name for a user's root folder.
} {
- return "dotlrn_fs_${user_id}_root_folder"
+ return "[applet_key]_${user_id}_root_folder"
}
ad_proc -public get_user_root_folder {
@@ -299,7 +280,7 @@
} {
Get the internal name for a user's root folder.
} {
- return "dotlrn_fs_${user_id}_shared_folder"
+ return "[applet_key]_${user_id}_shared_folder"
}
ad_proc -public get_user_shared_folder {
@@ -373,8 +354,6 @@
-page_name [get_user_default_page] \
]
- ns_log notice "[get_url]all-objects"
-
# add the portlet here
if {![empty_string_p $portal_id]} {
fs_portlet::add_self_to_page \
@@ -412,47 +391,6 @@
}
}
- ad_proc -public add_user_to_community {
- community_id
- user_id
- } {
- Add a user to a to a specifc dotlrn community
- } {
- # Get the package_id by callback
- set package_id [dotlrn_community::get_applet_package_id \
- $community_id \
- "dotlrn_fs" \
- ]
-
- # Get the user's per comm portal_id by callback
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- if { [exists_and_not_null $portal_id] } {
- # fs portlet needs folder_id too
- set folder_id [fs::get_root_folder -package_id $package_id]
-
- # Make file storage available at community-user page level
- fs_portlet::add_self_to_page $portal_id $package_id $folder_id
- }
-
- # 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 {[exists_and_not_null $portal_id]} {
- fs_portlet::add_self_to_page \
- -page_id $page_id \
- $portal_id \
- $package_id \
- $folder_id
- }
- }
-
ad_proc -public remove_user {
user_id
} {
@@ -487,33 +425,32 @@
}
+ ad_proc -public add_user_to_community {
+ community_id
+ user_id
+ } {
+ Add a user to a to a specifc dotlrn community
+ } {
+ # 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
+ }
+
ad_proc -public remove_user_from_community {
community_id
user_id
} {
Remove a user from a community
} {
- # Remove from the main workspace
- set workspace_portal_id \
- [dotlrn::get_workspace_portal_id $user_id]
-
- set package_id [dotlrn_community::get_applet_package_id \
- $community_id \
- "dotlrn_fs"
- ]
-
+ 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]
- # Add the portlet here
- if {![empty_string_p $workspace_portal_id]} {
- fs_portlet::remove_self_from_page \
- $workspace_portal_id \
- $package_id \
- $folder_id
- }
-
- # remove user permissions to see fs folders
- # nothing to do here
+ fs_portlet::remove_self_from_page $portal_id $package_id $folder_id
}
}
Index: openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.xql 29 Mar 2002 19:39:33 -0000 1.3
+++ openacs-4/packages/dotlrn-fs/tcl/dotlrn-fs-procs.xql 6 May 2002 23:56:28 -0000 1.4
@@ -2,10 +2,14 @@
-
-
-select folder_id from cr_folders,cr_items where name='public' and parent_id= :parent_folder_id
-
-
+
+
+ select folder_id
+ from cr_folders,
+ cr_items
+ where name = 'public'
+ and parent_id = :parent_folder_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.16 -r1.17
--- openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 30 Apr 2002 21:35:52 -0000 1.16
+++ openacs-4/packages/dotlrn-news/tcl/dotlrn-news-procs.tcl 6 May 2002 23:56:29 -0000 1.17
@@ -32,6 +32,13 @@
namespace eval dotlrn_news {
+ ad_proc -public applet_key {
+ } {
+ return the applet_key
+ } {
+ return "dotlrn_news"
+ }
+
ad_proc -public package_key {
} {
get the package_key this applet deals with
@@ -57,37 +64,35 @@
} {
One time init - must be repeatable!
} {
- dotlrn_applet::add_applet_to_dotlrn -applet_key "dotlrn_news"
+ dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
}
ad_proc -public add_applet_to_community {
community_id
} {
Add the news applet to a specifc dotlrn community
} {
- # portal template stuff
- set pt_id [dotlrn_community::get_portal_template_id $community_id]
+ set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
- # set up the DS for the portal template
- news_portlet::make_self_available $pt_id
+ news_portlet::make_self_available $portal_id
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
- news_portlet::add_self_to_page $pt_id 0
+ news_portlet::add_self_to_page $portal_id 0
return
}
- # Callback to get node_id from community
# REVISIT this (ben)
set node_id [site_node_id [ad_conn url]]
# create the news 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]
- news_portlet::add_self_to_page $pt_id $package_id
+ news_portlet::add_self_to_page $portal_id $package_id
# set up the DS for the admin portal
- set admin_portal_id [dotlrn_community::get_community_admin_portal_id $community_id]
+ set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
+
news_admin_portlet::make_self_available $admin_portal_id
news_admin_portlet::add_self_to_page $admin_portal_id $package_id
@@ -100,12 +105,6 @@
} {
remove the applet from the community
} {
- # Remove all instances of the news portlet! (this is some serious stuff!)
-
- # Dropping all messages, forums
-
- # Killing the package
-
}
ad_proc -public add_user {
@@ -116,68 +115,34 @@
return
}
+ ad_proc -public remove_user {
+ user_id
+ } {
+ } {
+ }
+
ad_proc -public add_user_to_community {
community_id
user_id
} {
Add a user to a specifc dotlrn community
} {
-
- # Get the package_id by callback
- set package_id [dotlrn_community::get_applet_package_id \
- $community_id \
- dotlrn_news
- ]
+ set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]]
+ set portal_id [dotlrn::get_workspace_portal_id $user_id]
- # Get the personal per comm portal_id by callback
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- if {[exists_and_not_null $portal_id]} {
- # we have personal per comm portals
- # Allow user to see the news folders
- # nothing for now
-
- # Make news DS available to this page
- news_portlet::make_self_available $portal_id
-
- news_portlet::add_self_to_page $portal_id $package_id
- }
-
- # Now for the user workspace
- set workspace_portal_id [dotlrn::get_workspace_portal_id $user_id]
-
- # Add the portlet here
- if { $workspace_portal_id != "" } {
- news_portlet::add_self_to_page $workspace_portal_id $package_id
- }
+ news_portlet::add_self_to_page $portal_id $package_id
}
- ad_proc -public remove_user {
- user_id
- } {
- } {
- }
-
ad_proc -public remove_user_from_community {
community_id
user_id
} {
Remove a user from a community
} {
- # Get the portal_id
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- # Get the package_id by callback
- set package_id [dotlrn_community::get_package_id $community_id]
+ set package_id [dotlrn_community::get_applet_package_id $community_id [applet_key]]
+ set portal_id [dotlrn::get_workspace_portal_id $user_id]
- # Remove the portal element
- news_portlet::remove_self_from_page $portal_id $package_id
-
- # Buh Bye.
- news_portlet::make_self_unavailable $portal_id
-
- # remove user permissions to see news folders
- # nothing to do here
+ news_portlet::remove_self_from_page $portal_id $package_id
}
}
Index: openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.xql 29 Mar 2002 19:39:58 -0000 1.4
+++ openacs-4/packages/dotlrn-portlet/www/dotlrn-admin-portlet.xql 6 May 2002 23:56:30 -0000 1.5
@@ -1,18 +1,20 @@
-
-
- select community_type,
- pretty_name,
- description,
- portal_template_id,
- join_policy,
- admin_portal_id
- from dotlrn_communities,groups
- where community_id = :community_id
- and groups.group_id = community_id
-
-
+
+
+ select community_type,
+ pretty_name,
+ description,
+ join_policy,
+ portal_id,
+ non_member_portal_id,
+ admin_portal_id
+ from dotlrn_communities,groups
+ where community_id = :community_id
+ and groups.group_id = community_id
+
+
+
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.2 -r1.3
--- openacs-4/packages/dotlrn-research/tcl/dotlrn-research-admin-procs.tcl 29 Mar 2002 19:22:48 -0000 1.2
+++ openacs-4/packages/dotlrn-research/tcl/dotlrn-research-admin-procs.tcl 6 May 2002 23:56:32 -0000 1.3
@@ -67,24 +67,23 @@
dotlrn_applet::add_applet_to_dotlrn -applet_key [applet_key]
}
- ad_proc -public add_applet_to_community {
+ ad_proc -public remove_applet {
community_id
+ package_id
} {
- Add the research paper applet to a specifc dotlrn community
+ remove the applet from the community
} {
- # get the portal_template_id by callback
- set pt_id [dotlrn_community::get_community_admin_portal_id $community_id]
-
- research_admin_portlet::make_self_available $pt_id
- research_admin_portlet::add_self_to_page $pt_id "" $community_id
}
- ad_proc -public remove_applet {
+ ad_proc -public add_applet_to_community {
community_id
- package_id
} {
- remove the applet from the community
+ Add the research paper applet to a specifc dotlrn community
} {
+ 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
}
ad_proc -public add_user {
@@ -94,23 +93,17 @@
} {
}
- ad_proc -public add_user_to_community {
- community_id
+ ad_proc -public remove_user {
user_id
} {
- Add a user to a to a specifc dotlrn community
} {
- # Get the portal_id by callback
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- # Call the portal element to be added correctly
- # Make research paper applet available at community-user page level
- research_admin_portlet::add_self_to_page $portal_id "" $community_id
}
- ad_proc -public remove_user {
+ ad_proc -public add_user_to_community {
+ community_id
user_id
} {
+ Add a user to a to a specifc dotlrn community
} {
}
@@ -120,14 +113,6 @@
} {
Remove a user from a community
} {
- # Get the portal_id
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- # Remove the portal element
- research_admin_portlet::remove_self_from_page $portal_id "" $party_id
-
- # Buh Bye.
- research_admin_portlet::make_self_unavailable $portal_id
}
}
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.7 -r1.8
--- openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 30 Apr 2002 21:35:52 -0000 1.7
+++ openacs-4/packages/dotlrn-research/tcl/dotlrn-research-procs.tcl 6 May 2002 23:56:32 -0000 1.8
@@ -78,20 +78,19 @@
} {
Add the research paper applet to a specifc dotlrn community
} {
- # get the portal_template_id by callback
- set pt_id [dotlrn_community::get_portal_template_id $community_id]
+ set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
- research_portlet::make_self_available $pt_id
+ research_portlet::make_self_available $portal_id
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
- research_portlet::add_self_to_page $pt_id "" $community_id
+ research_portlet::add_self_to_page $portal_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
+ research_portlet::add_self_to_page $portal_id "" $community_id
dotlrn_research_admin::add_applet_to_community $community_id
}
@@ -122,13 +121,6 @@
} {
Add a user to a to a specifc dotlrn community
} {
- # we have a per user comm portal
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- if { [exists_and_not_null $portal_id] } {
- research_portlet::make_self_available $portal_id
- research_portlet::add_self_to_page $portal_id "" $community_id
- }
}
ad_proc -public remove_user_from_community {
@@ -137,14 +129,6 @@
} {
Remove a user from a community
} {
- # Get the portal_id
- set portal_id [dotlrn_community::get_portal_id $community_id $user_id]
-
- # Remove the portal element
- research_portlet::remove_self_from_page $portal_id "" $user_id
-
- # Buh Bye.
- research_portlet::make_self_unavailable $portal_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.13 -r1.14
--- openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 16 Apr 2002 13:58:05 -0000 1.13
+++ openacs-4/packages/dotlrn-static/tcl/dotlrn-static-procs.tcl 6 May 2002 23:56:33 -0000 1.14
@@ -82,64 +82,56 @@
} {
Add the static applet to a dotlrn community
} {
- set community_type \
- [dotlrn_community::get_community_type_from_community_id $community_id]
+ set community_type [dotlrn_community::get_community_type_from_community_id $community_id]
- set pt_id [dotlrn_community::get_portal_template_id $community_id]
+ set portal_id [dotlrn_community::get_portal_id -community_id $community_id]
- ns_log notice "aks7: $pt_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"
if {$community_type == "dotlrn_club"} {
+
set content_id [static_portal_content::new \
-instance_id $community_id \
-content " " \
-pretty_name "[dotlrn::parameter clubs_pretty_name] Info"
]
- static_portal_content::add_to_portal \
- -content_id $content_id \
- -portal_id $pt_id
+ static_portal_content::add_to_portal -content_id $content_id -portal_id $portal_id
} elseif {$community_type == "dotlrn_community"} {
set content_id [static_portal_content::new \
- -instance_id $community_id \
- -content " " \
- -pretty_name "[dotlrn::parameter subcommunities_pretty_name] Info"
+ -instance_id $community_id \
+ -content " " \
+ -pretty_name "[dotlrn::parameter subcommunities_pretty_name] Info"
]
- static_portal_content::add_to_portal \
- -content_id $content_id \
- -portal_id $pt_id
+ static_portal_content::add_to_portal -content_id $content_id -portal_id $portal_id
+
} else {
+
set content_id [static_portal_content::new \
- -instance_id $community_id \
- -content " " \
- -pretty_name "[dotlrn::parameter class_instances_pretty_name] Info"
+ -instance_id $community_id \
+ -content " " \
+ -pretty_name "[dotlrn::parameter class_instances_pretty_name] Info"
]
- static_portal_content::add_to_portal \
- -content_id $content_id \
- -portal_id $pt_id
+ static_portal_content::add_to_portal -content_id $content_id -portal_id $portal_id
+
}
if {[dotlrn_community::dummy_comm_p -community_id $community_id]} {
return
}
# the non-member page gets the same static portlet
- set n_p_id [dotlrn_community::get_community_non_members_portal_id $community_id]
+ set n_p_id [dotlrn_community::get_non_member_portal_id -community_id $community_id]
- static_portal_content::add_to_portal \
- -content_id $content_id \
- -portal_id $n_p_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]
+ set admin_portal_id [dotlrn_community::get_admin_portal_id -community_id $community_id]
static_admin_portlet::make_self_available $admin_portal_id
static_admin_portlet::add_self_to_page $admin_portal_id $community_id
@@ -151,8 +143,6 @@
} {
remove the applet from the community
} {
- # Remove all instances of the static portlet!
- # Killing the package
}
ad_proc -public add_user {
@@ -165,31 +155,26 @@
}
+ ad_proc -public remove_user {
+ user_id
+ } {
+ } {
+ }
ad_proc -public add_user_to_community {
community_id
user_id
} {
Add a user to a specific dotlrn community
} {
- # This needs to loop through all content items for this community
- # and add them to the user's portlet
- # FIXME
}
- ad_proc -public remove_user {
- user_id
- } {
- } {
- }
-
ad_proc -public remove_user_from_community {
community_id
user_id
} {
Remove a user from a community
} {
- # Remove all static_portlet instances from the user-community portal
- # FIXME
}
+
}