rp_url2file

one of the documented procedures in this installation of the ACS
Usage:
rp_url2file   urlv
What it does:
Returns the file corresponding to a particular URL (taking mappings made with rp_register_directory_map into account).
Defined in: /web/philip/packages/acs-core/request-processor-procs.tcl

Source code:


    if { [llength $urlv] < 1 } {
	error "Input list to rp_url2file must contain at least one component"
    }

    set url_0 [lindex $urlv 0]
    set url_1 [lindex $urlv 1]

    # Check to see if a mapping in rp_register_directory_map applies to this
    # URL. If someone registered "/foo" and this URL is "/foo/bar", replace
    # the first component with the mapping.
    if { [nsv_exists rp_directory_map $url_0] } {
	set fs_directory [nsv_get rp_directory_map $url_0]
	return "[acs_root_dir]/packages/[join [lreplace $urlv 0 0 "$fs_directory/www"] "/"]"
    }

    # If someone registered "/foo" and this URL is "/admin/foo/bar", replace
    # the first two components with the mapping.
    if { [string equal $url_0 "admin"] &&  [nsv_exists rp_directory_map $url_1] } {
	set fs_directory [nsv_get rp_directory_map $url_1]
	return "[acs_root_dir]/packages/[join [lreplace $urlv 0 1 "$fs_directory/admin-www"] "/"]"
    }

    # No mappings - just use [ns_info pageroot].
    return "[ns_info pageroot]/[join $urlv "/"]"


philg@mit.edu