Forum OpenACS Q&A: Re: url abstraction

Collapse
13: Re: url abstraction (response to 1)
Posted by bill kellerman on
so there is no formal treatment of url abstraction in the openacs?

i can definitely take what you've told me and build a custom solution, but i'm wondering what everyone thinks of the idea at all?  why wouldn't it be in the oacs?

the library i work at manages a huge amount of electronic resources in a database.  i'd like to easily be able to use a file cache/static mirror of the site, and http://library/resources/id/30/format/50245/ (or some format along those lines) would seem to be a good way to do that?  ...in addition to getting rid of ugly querystrings and not breaking search engines.

it would seem to me, off the top of my head, you could build a package with procs to do the url -> querystring translation (according to your defined url format), then make an on/off switch set on subsite instantiation which inherits it's value from the parent subsite.  you could use those same procs to generate proper urls for hyperlinks (regular query string or abstracted url according to the subsite's abstraction setting) within a page.  in case a page is for some reason bookmarked or hyperlinked from another page with a regular querystring, the abstraction procs would still receive the proper variables:

http://library/resources/id/30/format/50245/
and
http://library/resources/?id=30&format=50245

would generate the same page.

...just wondering out loud.

Collapse
14: Re: url abstraction (response to 13)
Posted by Tom Jackson on

Yes, you could setup a page which takes query variables, and still use an index.vuh file to grab the information from the url, then use rp_internal_redirect to the regular page. You would not necessarily need to put the variable names in the url you could use http://library/resources/30/50245/ for instance. The point is you can do it any way you want, there are no limitations.