Index: openacs-4/packages/acs-admin/www/apm/package-delete-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/package-delete-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-admin/www/apm/package-delete-2.tcl 22 Jan 2003 18:39:11 -0000 1.2 +++ openacs-4/packages/acs-admin/www/apm/package-delete-2.tcl 31 Jan 2003 17:00:55 -0000 1.3 @@ -25,6 +25,9 @@ doc_body_append [apm_header [list "version-view?version_id=$version_id" "$pretty_name $version_name"] "Delete"] +# Invoke the Tcl callback before the sql drop scripts +apm_invoke_callback_proc -version_id $version_id -type before-uninstall -arg_list [list version_id $version_id] + if {![empty_string_p $sql_drop_scripts]} { doc_body_append "Now executing drop scripts. Index: openacs-4/packages/acs-tcl/tcl/apm-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-procs.tcl,v diff -u -r1.36 -r1.37 --- openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 29 Jan 2003 15:41:25 -0000 1.36 +++ openacs-4/packages/acs-tcl/tcl/apm-procs.tcl 31 Jan 2003 17:01:24 -0000 1.37 @@ -1315,6 +1315,18 @@ return [list package_id node_id] } + before-uninstall { + return [list version_id] + } + + before-uninstantiate { + return [list package_id] + } + + before-unmount { + return [list package_id node_id] + } + default { # By default a callback proc takes no arguments return [list] @@ -1330,7 +1342,7 @@ @author Peter Marklund } { - return [list after-install after-instantiate after-mount] + return [list after-install after-instantiate after-mount before-uninstantiate before-uninstall before-unmount] } ad_proc -public apm_package_instance_new { @@ -1398,7 +1410,11 @@ package_id } { Deletes an instance of a package -} { +} { + apm_invoke_callback_proc -package_key [apm_package_key_from_id $package_id] \ + -type before-uninstantiate \ + -arg_list [list package_id $package_id] + db_exec_plsql apm_package_instance_delete {} } Index: openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 29 Jan 2003 15:37:14 -0000 1.20 +++ openacs-4/packages/acs-tcl/tcl/site-nodes-procs.tcl 31 Jan 2003 17:01:24 -0000 1.21 @@ -121,6 +121,9 @@ } { unmount an object from the site node } { + set package_id [get_object_id -node_id $node_id] + apm_invoke_callback_proc -package_key [apm_package_key_from_id $package_id] -type before-unmount -arg_list [list package_id $package_id node_id $node_id] + db_dml unmount_object {} update_cache -node_id $node_id }