forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Piroumian Konstantin <KPiroum...@protek.com>
Subject RE: [PATCH] fix tabs
Date Tue, 10 Sep 2002 07:57:49 GMT
Thanks Jeff, for fixing this!

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.

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'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>

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 


> -----Original Message-----
> From: Jeff Turner [mailto:jefft@apache.org] 
> Sent: Tuesday, September 10, 2002 10:52 AM
> To: forrest-dev@xml.apache.org
> Subject: [PATCH] fix tabs
> 
> 
> Hi,
> 
> This patch fixes tabs on Forrest-based websites. In the current
> tab2menu.xsl, there is a hardcoded '/forrest' context path:
> 
> <a href="/forrest/{@dir}">
> 
> Which a) makes tab2menu.xsl unusable for non-Forrest sites, 
> and b) forces
> the Forrest context to be '/forrest'. Also because it's trying to be
> server-relative, the links are broken on static local docs: 
> they appear
> as file:///forrest/community/howto/index.html
> 
> My fix is to make the generated link relative. As the link must be
> relative to the current directory, I've written an XSL, dotdots.xsl,
> which returns the appropriate number of ../'s to negate the 
> current tab's
> directories. From the file's description. Here's the examples:
> 
> Examples:
>   Input                           Output 
>     index.html                    ""
>     dir/index.html                "../"
>     dir/subdir/index.html         "../../"
>     dir//index.html              "../"
>     dir/                          "../"
>     dir//                         "../"
>     \some\windows\path            "../../"
>     \some\windows\path\           "../../../"
>     \Program Files\mydir          "../"
> 
> Anyway, it's used in tab2menu.xsl to work out the correct links for
> non-selected tabs. So if the user is in 
> community/howto/index.html, the
> 'Home' link goes to ../../
> 
> I have also modified the sitemap to allow linking to 
> directories. Links
> to '**/' are now redirected to '**/index.html'. Without this, 
> tabs were
> broken in the live webapp, since each tab is a directory 
> link. Statically
> generated sites worked because (presumably) the crawler 
> rewrites links to
> 'directory/' to 'directory/index.html'.
> 
> Also, previously directories in tabs.xml had to end in '/':
> 
>   <tab label="Home" dir=""/>
>   <tab label="How-Tos" dir="community/howto/"/>
>   <tab label="XML Site" dir="xml-site/"/>
> 
> Now tab2menu.xsl adds a trailing '/' regardless, so it is no longer
> required (although it won't hurt).
> 
> I've verified that offline generation works correctly with this patch.
> The NPEs, broken links and zillion FOP error messages are not 
> my fault ;)
> 
> 
> --Jeff
> 

Mime
View raw message