Index: openacs-4/packages/simulation/tcl/object-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/object-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/simulation/tcl/object-procs.tcl 11 Nov 2003 16:58:30 -0000 1.4 +++ openacs-4/packages/simulation/tcl/object-procs.tcl 18 Nov 2003 13:31:32 -0000 1.5 @@ -9,6 +9,40 @@ namespace eval simulation::object {} namespace eval simulation::object::xml {} +ad_proc -private simulation::object::url { + {-package_id ""} + {-name:required} +} { + The URL for the page displaying contents and name of + an item. +} { + if { [empty_string_p $package_id] } { + set package_url [ad_conn package_url] + } else { + set package_id [ad_conn package_id] + set package_url "[ad_url][apm_package_url_from_id $package_id]" + } + + return "${package_url}object/${name}" +} + +ad_proc -private simulation::object::content_url { + {-package_id ""} + {-name:required} +} { + The URL for serving up only the content of an item + with given name. +} { + if { [empty_string_p $package_id] } { + set package_url [ad_conn package_url] + } else { + set package_id [ad_conn package_id] + set package_url "[ad_url][apm_package_url_from_id $package_id]" + } + + return "${package_url}object-content/${name}" +} + ad_proc -private simulation::object::xml::file_sweeper {} { Loop over all simulation package instances and re-generate XML map files for them. @@ -181,8 +215,6 @@ set package_id [ad_conn package_id] } - set full_package_url "[ad_url][apm_package_url_from_id $package_id]" - # Get table names and id column names for the on_map_p attribute of each object type # By using the multirow we avoid a nested db_foreach set parent_id [bcms::folder::get_id_by_package_id -package_id $package_id] @@ -228,12 +260,12 @@ order by ci.name " db_foreach select_on_map_objects $query { - set url "${full_package_url}object/$uri" + set url [simulation::object::content_url -package_id $package_id -name $uri] set thumbnail_url "" if { [lsearch -exact {sim_location sim_prop sim_character} $content_type] != -1 } { if { ![empty_string_p $thumbnail_uri] } { - set thumbnail_url "${full_package_url}object-content/${thumbnail_uri}" + set thumbnail_url [simulation::object::content_url -package_id $package_id -name $thumbnail_uri] } }