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.163 -r1.164 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 9 Aug 2002 18:39:25 -0000 1.163 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 14 Aug 2002 19:22:01 -0000 1.164 @@ -55,7 +55,9 @@ -pretty_name $pretty_name \ -directory_p "t"] - dotlrn_community::set_type_package_id $community_type $package_id + dotlrn_community::set_type_package_id \ + -community_type $community_type \ + -package_id $package_id parameter::set_value -package_id $package_id -parameter dotlrn_level_p -value 0 parameter::set_value -package_id $package_id -parameter community_type_level_p -value 1 @@ -85,7 +87,6 @@ array set parent_node [site_node::get -node_id $parent_node_id] db_transaction { - # Create the class directly using PL/SQL API set community_type_key [db_exec_plsql create_community_type {}] set package_id [site_node_apm_integration::new_site_node_and_package \ @@ -102,21 +103,51 @@ parameter::set_value -package_id $package_id -parameter community_level_p -value 0 # Set the site node - dotlrn_community::set_type_package_id $community_type_key $package_id + dotlrn_community::set_type_package_id \ + -community_type $community_type_key \ + -package_id $package_id } return $community_type_key } + ad_proc -public delete_type { + {-community_type_key:required} + } { + delete a community type + } { + db_transaction { + # Get the package_id for the type + set package_id [dotlrn_community::get_type_package_id \ + -community_type $community_type_key \ + ] + + # Create type + db_exec_plsql delete_community_type {} + + # blow away the package_id and ALL associated site nodes + site_node_apm_integration::delete_site_nodes_and_package \ + -package_id $package_id + } + } + ad_proc -public set_type_package_id { - community_type - package_id + {-community_type:required} + {-package_id:required} } { - Update the package ID for the community type + map the type's name to it's package_id } { db_dml update_package_id {} } + ad_proc -public get_type_package_id { + {-community_type:required} + } { + get the type's package_id + } { + db_string select_package_id {} + } + ad_proc -public get_type_node_id { community_type } {