Index: openacs-4/packages/dotlrn/sql/oracle/dotlrn-applet-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/Attic/dotlrn-applet-sc-create.sql,v diff -u -r1.10 -r1.11 --- openacs-4/packages/dotlrn/sql/oracle/dotlrn-applet-sc-create.sql 29 Mar 2002 19:14:44 -0000 1.10 +++ openacs-4/packages/dotlrn/sql/oracle/dotlrn-applet-sc-create.sql 30 Apr 2002 21:23:30 -0000 1.11 @@ -213,7 +213,7 @@ -- remove the applet from a community foo := acs_sc_msg_type.new( msg_type_name => 'dotlrn_applet.RemoveAppletFromCommunity.InputType', - msg_type_spec => 'community_id:integer' + msg_type_spec => 'community_id:integer,package_id:integer' ); foo := acs_sc_msg_type.new( 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.108 -r1.109 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 28 Apr 2002 18:56:29 -0000 1.108 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 30 Apr 2002 21:23:30 -0000 1.109 @@ -660,18 +660,19 @@ } db_transaction { + # aks - dont do this yet # Set up a portal page for that user and that community - set portal_id [portal::create \ - -name "Your [get_community_name $community_id] page" \ - -template_id [get_portal_template_id $community_id] \ - $user_id \ - ] + # set portal_id [portal::create \ + # -name "Your [get_community_name $community_id] page" \ + # -template_id [get_portal_template_id $community_id] \ + # $user_id \ + # ] # Create the form with the portal_id if {[empty_string_p $extra_vars]} { set extra_vars [ns_set create] } - ns_set put $extra_vars portal_id $portal_id + # ns_set put $extra_vars portal_id $portal_id ns_set put $extra_vars user_id $user_id ns_set put $extra_vars community_id $community_id @@ -1181,12 +1182,21 @@ return [db_string select_community_type_name {} -default ""] } + ad_proc -public set_community_name { + {-community_id:required} + {-pretty_name:required} + } { + update the name for a community + } { + db_dml update_community_name {} + } + ad_proc -public get_community_name { community_id } { get the name for a community } { - return [util_memoize "dotlrn_community::get_community_name_not_cached $community_id"] + return [util_memoize "dotlrn_community::get_community_name_not_cached $community_id" 10] } ad_proc -private get_community_name_not_cached { @@ -1298,7 +1308,7 @@ } - ad_proc -public remove_applet { + ad_proc -public remove_applet_from_community { community_id applet_key } { @@ -1317,15 +1327,18 @@ } # Callback - applet_call $applet_key RemoveApplet [list $community_id $package_id] + ns_log notice "aks3 $applet_key" + applet_call $applet_key RemoveAppletFromCommunity [list $community_id $package_id] + ns_log notice "aks4 $applet_key" # Delete from the DB - db_dml delete_applet {} + set applet_id [dotlrn_applet::get_applet_id_from_key -applet_key $applet_key] + db_dml delete_applet_from_community {} } } ad_proc -public delete { - {-community_id ""} + {-community_id:required} } { Delete a community } { @@ -1337,15 +1350,17 @@ # Remove all applets foreach applet [list_applets -community_id $community_id] { - remove_applet $community_id $applet + remove_applet_from_community $community_id $applet } # Clean up db_1row select_things_to_clean "select portal_id, admin_portal_id, portal_template_id, package_id from dotlrn_communities where community_id= :community_id" - # Remove the row - db_exec_plsql remove_community "begin acs_object.delete(:community_id) end;" + # delete the rel segments + delete_rel_segments -community_id $community_id + # Remove the row + db_exec_plsql remove_community "begin dotlrn_community.delete(:community_id); end;" if {![empty_string_p $portal_id]} { portal::delete $portal_id } Index: openacs-4/packages/dotlrn/tcl/community-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.xql,v diff -u -r1.52 -r1.53 --- openacs-4/packages/dotlrn/tcl/community-procs.xql 28 Apr 2002 18:56:29 -0000 1.52 +++ openacs-4/packages/dotlrn/tcl/community-procs.xql 30 Apr 2002 21:23:30 -0000 1.53 @@ -315,6 +315,12 @@ + + +update dotlrn_communities set pretty_name = :pretty_name where community_id= :community_id + + + select pretty_name from dotlrn_communities where community_id= :community_id @@ -366,10 +372,10 @@ - + -delete from dotlrn_community_applets where -community_id= :community_id and applet_key= :applet_key +delete from dotlrn_community_applets +where community_id= :community_id and applet_id = :applet_id