Index: openacs-4/packages/acs-admin/acs-admin.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/acs-admin.info,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/acs-admin/acs-admin.info 16 Sep 2002 12:40:26 -0000 1.15 +++ openacs-4/packages/acs-admin/acs-admin.info 24 Sep 2002 00:14:39 -0000 1.16 @@ -147,6 +147,10 @@ + + + + Index: openacs-4/packages/acs-content-repository/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/index.vuh,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/acs-content-repository/www/index.vuh 14 Sep 2001 04:53:02 -0000 1.4 +++ openacs-4/packages/acs-content-repository/www/index.vuh 24 Sep 2002 00:14:40 -0000 1.5 @@ -21,13 +21,16 @@ [db_string content_root "select content_item.get_root_folder from dual"] set template_root \ [db_string template_root "select content_template.get_root_folder from dual"] + # Serve the page -ns_log notice "RESOLVING URL: $the_root $the_url" +# DRB: Note that content::init modifies the local variable the_root, which is treated +# as though it's been passed by reference. This requires that the redirect treat the +# path as an absolute path within the filesystem. + if { [content::init the_url the_root $content_root $template_root public $revision_id] } { set file "$the_root/$the_url" - ns_log notice "RESOLVED URL: $file" - rp_serve_abstract_file $file + rp_internal_redirect -absolute_path $file } else { # ns_returnnotfound set page "[ad_header {Content Item Not Found}]" Index: openacs-4/packages/acs-content-repository/www/doc/guide/publish.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/publish.html,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-content-repository/www/doc/guide/publish.html 13 Sep 2002 16:46:25 -0000 1.2 +++ openacs-4/packages/acs-content-repository/www/doc/guide/publish.html 24 Sep 2002 00:14:41 -0000 1.3 @@ -52,9 +52,12 @@ [db_string template_root "select content_template.get_root_folder from dual"] # Serve the page +# DRB: Note that content::init modifies the local variable the_root, which is treated +# as though it's been passed by reference. This requires that the redirect treat the +# path as an absolute path within the filesystem. if { [content::init the_url the_root $content_root $template_root] } { set file "$the_root/$the_url" - rp_serve_abstract_file $file + rp_internal_redirect -absolute_path $file } else { ns_returnnotfound } @@ -146,4 +149,4 @@ - \ No newline at end of file + Index: openacs-4/packages/acs-core-docs/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/index.vuh,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/acs-core-docs/www/index.vuh 13 Mar 2001 22:59:26 -0000 1.1 +++ openacs-4/packages/acs-core-docs/www/index.vuh 24 Sep 2002 00:14:42 -0000 1.2 @@ -9,9 +9,9 @@ "doc[string range [ad_conn path_info] [string length $package_key] end]" if {![string compare [ad_conn path_info] "index.html"]} { - rp_serve_abstract_file "[acs_root_dir]/packages/acs-core-docs/www/index.adp" + rp_internal_redirect "/packages/acs-core-docs/www/index.adp" } elseif {[file isdirectory "[acs_root_dir]/packages/$package_key/www/doc"]} { - rp_serve_abstract_file "[acs_root_dir]/packages/$package_key/www/$path_tail" + rp_internal_redirect "/packages/$package_key/www/$path_tail" } else { - rp_serve_abstract_file "[acs_root_dir]/packages/$package_key/$path_tail" + rp_internal_redirect "/packages/$package_key/$path_tail" } Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 20 Sep 2002 21:50:26 -0000 1.24 +++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 24 Sep 2002 00:14:42 -0000 1.25 @@ -14,17 +14,23 @@ # ##### -ad_proc -public rp_internal_redirect { path } { +ad_proc -public rp_internal_redirect { + -absolute_path:boolean + path +} { Tell the request processor to return some other page. The path can either be relative to the current directory (e.g. "some-template") - or absolute from the server root (e.g. "/packages/my-package/www/some-template"). + relative to the server root (e.g. "/packages/my-package/www/some-template"), or + an absolute path (e.g. "/home/donb/openacs-4/templates/some-cms-template"). + When there is no extension then the request processor will choose the matching file according to the extension preferences. Parameters will stay the same as in the initial request. + @param absolute_path If set the path is an absolute path within the host filesystem @param path path to the file to serve } { @@ -39,11 +45,13 @@ incr __rp_internal_redirect_recursion_counter } - if { [string index $path 0] != "/" } { - # it's a relative path, prepend the current location - set path "[file dirname [ad_conn file]]/$path" - } else { - set path "[acs_root_dir]$path" + if { [string is false $absolute_path_p] } { + if { [string index $path 0] != "/" } { + # it's a relative path, prepend the current location + set path "[file dirname [ad_conn file]]/$path" + } else { + set path "[acs_root_dir]$path" + } } # save the current file setting Index: openacs-4/packages/cms/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/www/index.vuh,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/cms/www/index.vuh 20 Apr 2001 20:51:09 -0000 1.1 +++ openacs-4/packages/cms/www/index.vuh 24 Sep 2002 00:14:43 -0000 1.2 @@ -2,7 +2,6 @@ # Try and look up the item in the content repository ################################################# - # Get the paths set the_url [ad_conn path_info] @@ -17,11 +16,13 @@ # Serve the page -ns_log notice "RESOLVING URL: $the_root $the_url" +# DRB: Note that content::init modifies the local variable the_root, which is treated +# as though it's been passed by reference. This requires that the redirect treat the +# path as an absolute path within the filesystem. + if { [content::init the_url the_root $content_root $template_root] } { set file "$the_root/$the_url" - ns_log notice "RESOLVED URL: $file" - rp_serve_abstract_file $file + rp_internal_redirect -absolute_path $file } else { ns_returnnotfound } Index: openacs-4/packages/edit-this-page/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/edit-this-page/www/index.vuh,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/edit-this-page/www/index.vuh 27 Sep 2001 18:16:04 -0000 1.2 +++ openacs-4/packages/edit-this-page/www/index.vuh 24 Sep 2002 00:14:44 -0000 1.3 @@ -26,19 +26,17 @@ ns_returnnotfound } -set server_root [file dirname [ns_info pageroot]] - if {[empty_string_p $name] || $name == "index"} { - set path "$server_root/[etp::get_application_param index_template]" + set path "/[etp::get_application_param index_template]" } elseif {[string match "etp*" $name]} { # this trickery is for serving pages from the top level, # where the acs-subsite package is mounted rather than # the editthispage package. normally the request processor # finds these before invoking this file. - set path "$server_root/packages/edit-this-page/www/$name" + set path "/packages/edit-this-page/www/$name" } else { - set path "$server_root/[etp::get_application_param content_template]" + set path "/[etp::get_application_param content_template]" # set up form variables so we can pass the "name" # variable to the content page. @@ -49,7 +47,7 @@ ns_log Notice "Edit This Page index.vuh: serving $path" -rp_serve_abstract_file $path +rp_internal_redirect $path