site-node-object-map-procs.tcl
Does not contain a contract.
- Location:
- /packages/acs-tcl/tcl/site-node-object-map-procs.tcl
Related Files
- packages/acs-tcl/tcl/site-node-object-map-procs.xql
- packages/acs-tcl/tcl/site-node-object-map-procs.tcl
[ hide source ] | [ make this the default ]
File Contents
# tcl/portal-node-mapping-procs.tcl ad_library { Portal Node Mappings @author Ben Adida (ben@openforce.net) @creation-date April 2002 @cvs-id $Id: site-node-object-map-procs.tcl,v 1.7 2024/09/11 06:15:48 gustafn Exp $ } namespace eval site_node_object_map {} d_proc -public site_node_object_map::new { {-object_id:required} {-node_id:required} } { map object object_id to site_node node_id in table site_node_object_mappings } { db_transaction { site_node_object_map::del -object_id $object_id db_dml set_node_mapping { insert into site_node_object_mappings (object_id, node_id) values (:object_id, :node_id) } } } d_proc -public site_node_object_map::del { {-object_id:required} } { unmap object object_id from site_node node_id in table site_node_object_mappings } { db_dml unset_node_mapping { delete from site_node_object_mappings where object_id = :object_id } } d_proc -public site_node_object_map::get_node_id { {-object_id:required} } { @return the node_id of the site_node of the passed object_id } { return [db_string select_node_mapping {} -default ""] } d_proc -public site_node_object_map::get_url { {-object_id:required} } { @return the url corresponding to the site_node to which the passed object_id is mapped. } { set node_id [site_node_object_map::get_node_id -object_id $object_id] if {$node_id eq ""} { return {} } return [site_node::get_url -node_id $node_id] } # Local variables: # mode: tcl # tcl-indent-level: 4 # indent-tabs-mode: nil # End: