site_node::delete (public)
site_node::delete -node_id node_id [ -delete_subnodes ] \ [ -delete_package ]
Defined in packages/acs-tcl/tcl/site-nodes-procs.tcl
delete the site node
- Switches:
- -node_id (required)
- -delete_subnodes (optional, boolean)
- -delete_package (optional, boolean)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- site_node_update_cache, xowiki_test_cases, slot_interactions, path_resolve
Source code: if {!$delete_subnodes_p} { set n_subnodes [llength [site_node::get_children -node_id $node_id]] if {$n_subnodes != 0} { error "Site node has subnodes. To force use -delete_subnodes option" } } set nodes_to_delete {} # breadth-first visit of the node tree, so we can delete children # starting from leaves, then their parents and so on to the top # (and thus not triggering reference constraint errors) set queue [list $node_id] while {$queue ne ""} { set parent_id [lindex $queue 0] lappend nodes_to_delete $parent_id set queue [lrange $queue 1 end] lappend queue {*}[site_node::get_children -element "node_id" -node_id $parent_id] } # delete nodes in reverse order, starting from leaves foreach node_id [lreverse $nodes_to_delete] { # first delete package_id under this node... set package_id [site_node::get_object_id -node_id $node_id] set url [site_node::get_url -node_id $node_id] if {$delete_package_p} { apm_package_instance_delete $package_id } # ...then the node itself # # TODO: The names of the function in the database should be # aligned. # if {[db_driverkey ""] eq "oracle"} { acs::dc call site_node del -node_id $node_id } else { acs::dc call site_node delete -node_id $node_id } acs::dc call site_node delete -node_id $node_id update_cache -node_id $node_id -url $url -object_id $package_id }Generic XQL file: packages/acs-tcl/tcl/site-nodes-procs.xql
PostgreSQL XQL file: packages/acs-tcl/tcl/site-nodes-procs-postgresql.xql
Oracle XQL file: packages/acs-tcl/tcl/site-nodes-procs-oracle.xql