forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: [PATCH] fix tabs
Date Tue, 10 Sep 2002 15:51:28 GMT
On Tue, Sep 10, 2002 at 11:57:49AM +0400, Piroumian Konstantin wrote:
> Thanks Jeff, for fixing this!

Thanks for applying, it makes generating subsequent patches easier.

> A minor problem: now the tabs from static version point to URLs like:
> file:///D:/ApacheCVS/xml-forrest/build/docs/ (e.g. from the HowTos section).
> Hadn't yet time to investigate where the problem comes from, but this
> results in opening the directory in IE and not the index.html as it was
> supposed.

I had a look, and the problem is in Cocoon's crawler. It gets the link
'../../' from the LinkSerializer. Then in this line:

String absoluteLink = NetUtils.normalize(NetUtils.absolutize(path, relativeLink));

normalizes 'community/howto/../../' to ''.

Then it tries to translate this '' link in this method:

    public String translateURI(String uri) throws Exception {
        if (null == uri || "".equals(uri)) {
            log.warn("translate empty uri");
            if (verbose) System.out.println("translate empty uri");
            return "";
        }

Which returns '' instead of 'index.html'.

Other directory links, like 'xml-site/' get expanded to
'xml-site/index.html'.

If it is correct behaviour to interpret '' as 'index.html', then the
attached patch for Main.java does this. I've tried it in Forrest and it
does fix the problem, and doesn't break anything else in the static docs
or webapp. I'll put it in Cocoon's patch queue tomorrow.

> BTW, you've patched all the skins. It's good, but we've agreed a while ago
> that we will support only the 'basic' and 'forrest-site' skins. So, I think
> that we should remove the old skins from the repository to avoid redundant
> work in future. Any objections?

I kinda like the avalon skin. I think it's more worth preserving than
'basic'. Given that there's a README file explaining the situation, is
there any harm in leaving them? It's kinda cool to be able to
s/forrest-site/avalon-site/g in front of the boss and see the whole look
change :)

> I've noticed that you are using an action to get the request context path.
> With the new InputModules this kind of things can be rewritten like this:
> 
> <map:match pattern="**/">
> 	<map:redirect-to uri="{request:context}/{1}/index.html"/>
> </map:match>

That seems nicer. I wonder if Bruno knew when he did the CAP Action
thingy..


--Jeff


> Though, there is no yet an InputModule for request:context.
> 
> Thanks for a good work!
> Patches are on their way to CVS.
> 
> Regards,
>   Konstantin Piroumian 
> 
> 

Mime
View raw message