Index: openacs-4/packages/xowiki/xowiki.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/xowiki.info,v diff -u -r1.88 -r1.89 --- openacs-4/packages/xowiki/xowiki.info 28 Aug 2008 12:36:09 -0000 1.88 +++ openacs-4/packages/xowiki/xowiki.info 1 Sep 2008 21:15:35 -0000 1.89 @@ -8,7 +8,7 @@ f xowiki - + Gustaf Neumann A more generic xotcl-based wikis example with object types and subtypes based on the content repository (with category support) @@ -54,17 +54,18 @@ BSD-Style 0 - + - + + Index: openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl,v diff -u -r1.43 -r1.44 --- openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 25 Aug 2008 11:33:56 -0000 1.43 +++ openacs-4/packages/xowiki/tcl/xowiki-callback-procs.tcl 1 Sep 2008 21:15:35 -0000 1.44 @@ -27,7 +27,39 @@ } } + ad_proc -public ::xowiki::before-uninstantiate { + {-package_id:required} + } { + Callback to be called whenever a package instance is deleted. + + @author Gustaf Neumann + } { + ns_log notice "Executing before-uninstantiate" + ::xowiki::delete_gc_messages -package_id $package_id + ns_log notice " before-uninstantiate DONE" + } + + ad_proc -public ::xowiki::delete_gc_messages { + {-package_id:required} + } { + Deletes the messages of general comments to allow to + uninstantiate the package without violating constraints. + + @author Gustaf Neumann + } { + set comment_ids [db_list get_comments " + select g.comment_id + from general_comments g, cr_items i,acs_objects o + where i.item_id = g.object_id + and o.object_id = i.item_id + and o.package_id = $package_id"] + foreach comment_id $comment_ids { + ::xo::db::sql::acs_message delete -message_id $comment_id + } + } + + # # upgrade logic #