cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Santiago Gala <sg...@hisitech.com>
Subject Re: Standardizing Redirect in Cocoon
Date Sat, 14 Apr 2001 23:50:58 GMT
Donald Ball escribió:
> 
> On Fri, 13 Apr 2001, Berin Loritsch wrote:
> 
> > > > and if the "context:" protocol is specified, then the URL should be
> > > > relative to the context root.  This should be easy in Cocoon 2, because
> > > > we are limiting the access to the redirect function--I don't know about
> > > > Cocoon 1.
> > >
> > > Can you explain a bit in detail?
> >
> > Basically something like this:
> >
> > Current URI:     "http://localhost/cocoon/foo/bar/index.html"
> > Current context: "cocoon"
> >
> > CURRENTLY DONE BY SERVLET API
> > Redirect-to: "/index.html"      maps to "http://localhost/index.html"
> > Redirect-to: "../index.html"    maps to "http://localhost/cocoon/foo/index.html"
> >
> > NEW FUNCTIONALITY
> > Redirect-to: "context://index.html" maps to "http://localhost/cocoon/index.html"
> >
> > If the context is moved to "margaritaville/parrothead"
> > then the context urls won't have to be changed
> > ("http://localhost/margaritaville/parrothead/index.html")
> > to go to the new location.
> >
> > Absolute urls like "/cocoon/index.html" won't work in that case, they
> > would have to be changed in the code.
> 
> +1. i was also thinking about how to link to c2 resources as well. fer
> instance, suppose i have an image located at
> 
> context://resources/images/pretty.gif
> 
> in a webapp mounted at 'foo'. the only way i can reliably link to that
> image across all of the pages in my webapp is to link to
> 
> '/foo/resources/images/pretty.gif'
> 
> i'd think it would be pretty cool to have a filter which would check for
> context urls in certain HTML elements (a:href, img:src, etc.) and
> translate context: urls appropriately. anyone else think this would be
> useful?
> 

If our experience with Jetspeed in a completely different environment
serves you, I would say go ahead.

The best solution we found, after fighting with this problem in order to
deliver a working war file, is to have everything "context relative",
and use a <BASE href="<context uri>"> in all our pages. As cocoon will
process every generator content through the pipeline, having the
context:// uris filtered will save you quite a few headaches when
delivering static links, with unnoticeable overhead, giving about the
same functionality that a BASE uri would give.

This is WRT links (in Stephano's definition). Flows (i.e. control
information for the webapp) needs to be handled in more complex ways,
specially when aggregating different webapps together.

> - donald
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message