Index: openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql,v
diff -u -r1.21 -r1.22
--- openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql 9 Jul 2002 18:47:33 -0000 1.21
+++ openacs-4/packages/dotlrn/tcl/community-procs-oracle.xql 14 Aug 2002 19:22:24 -0000 1.22
@@ -26,6 +26,17 @@
+
+
+ declare
+ begin
+ :1 := dotlrn_community_type.delete(
+ community_type => :community_type_key
+ );
+ end;
+
+
+
declare
Index: openacs-4/packages/dotlrn/tcl/community-procs-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs-postgresql.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/dotlrn/tcl/community-procs-postgresql.xql 12 Jul 2002 21:26:48 -0000 1.2
+++ openacs-4/packages/dotlrn/tcl/community-procs-postgresql.xql 14 Aug 2002 19:22:24 -0000 1.3
@@ -23,6 +23,14 @@
+
+
+ select dotlrn_community_type__delete(
+ :community_type_key
+ );
+
+
+
select dotlrn_community__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.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
} {