Forum OpenACS Q&A: Re: package name in the url

Collapse
Posted by Gustaf Neumann on
This can be achieved via a .vuh (virtual url handler) file.
Here is an example for achieving this for xowiki
http://alice.wu-wien.ac.at:8000/xowiki-doc/#package-prefix
You will have to alter this file to be useful for other packages.
Collapse
Posted by robert parker on
Hi Gustaf

Sorry but I'm still not able to get this working. I've read the /doc/tutorial-vuh.html and can see how this works for re-direction within the same package.

Does the request processor scan all vuh files in all packages for a matching page to serve?

Does "http://hostname/admin"; use a .vuh file to serve the page "/packages/acs-subsite/www/admin/index.adp" ? If so which vuh file specifies this redirection?

Do I need to set up a watch so that changes to .vuh files are detected?

Thanks, Robert

Collapse
Posted by Gustaf Neumann on
The magic is in the request processor and is - when looking at the details - quite tricky. The .vuh files are called in situations, where a path could not be resolved by other means (from e.g. files and the site node entries).

use find YOUR_INSTALLATION/openacs-4/packages/acs* -name index.vuh to see, what .vuh files are in use in your installation.

Here is a simple example of an index.vuh file to test cases, when the vuh file is called. Save it under openacs-4/openacs-4/www/index.vuh" and then try "http://hostname/schnabbelbrnft";

util_user_message -message "Hey, you called [ns_conn url]"
if {[ns_conn url] ne "/"} {
  ad_returnredirect /
} else {
 rp_internal_redirect /packages/acs-subsite/www/index.tcl
}

You can redirect to every package you like, as in the xowiki-case to an instance /xowiki.

The .vuh files don't have to be watched, they are sourced upon requests.