forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <>
Subject Re: 'broken link' causes..
Date Mon, 04 Nov 2002 15:42:12 GMT
On Tue, Nov 05, 2002 at 01:23:21AM +1100, Jeff Turner wrote:
> On Mon, Nov 04, 2002 at 06:35:11AM -0500, Rodent of Unusual Size wrote:
> The Forrest sitemap is in xml-forrest/src/resources/conf/sitemap.xmap:
> A full description of it is at:
> The sitemap is like a switchboard for incoming requests.  The problem in
> incubator-site is that you've got this link:
>   <link href="forms/ASF_Contributor_License_2_form.pdf"
> Which matches this sitemap rule:
> <map:match pattern="**.pdf">
>     <map:generate src="content/xdocs/{1}.xml"/>
>     <map:transform
>     src="skins/{defaults:skin}/xslt/fo/document2fo.xsl"/>
>     <map:serialize type="fo2pdf"/>
> </map:match>
> which tries to generate a PDF from
> content/xdocs/forms/ASF_Contributor_License_2_form.xml

Continuing on from this..

The solution is to add a custom sitemap rule for "forms/*.pdf", and put
it before the more general "**.pdf" rule ('**' matches subdirectories).

So, to fix incubator-site:

- Update your xml-forrest (I've just added a fix to enable this stuff)
- Run './' to regen the shbat distribution
- Copy xml-forrest/src/resources/conf/sitemap.xmap to
- Edit incubator-site/src/documentation, and add the following sitemap
  rule before the "**.pdf" one listed above:

<map:match pattern="forms/**.pdf">
  <map:read src="content/forms/{1}.pdf" mime-type="application/pdf"/>

- Move incubator-site/src/documentation/resources/forms to

- Run 'forrest' in incubator-site/, and the broken link should disappear.

Just to be clear: the incubator-site sitemap should differ from the
standard Forrest one as follows:

--- /home/jeff/apache/xml/xml-forrest/src/resources/conf/sitemap.xmap   2002-11-05 01:45:24.000000000
+++ src/documentation/sitemap.xmap      2002-11-05 02:25:22.000000000 +1100
@@ -406,6 +406,10 @@
     <map:serialize type="fo2pdf"/>
+   <map:match pattern="forms/**.pdf">
+     <map:read src="content/forms/{1}.pdf" mime-type="application/pdf"/>
+   </map:match>
    <map:match pattern="**.pdf">
     <map:generate src="content/xdocs/{1}.xml"/>
     <map:transform src="skins/{defaults:skin}/xslt/fo/document2fo.xsl"/>

Incidentally, this is also how one could generate .htaccess files, with a rule

<map:match pattern="**/.htaccess">
  <map:read src="content/xdocs/.htaccess"/>

I'll write up this info tomorrow and add it to the site.  Thanks for being a
model user, not accepting my half-assed reply ;P I'm sure lots of other people
bang their heads against this.


PS:  Once it's all working, try typing 'forrest run', and then point a browser
at http://localhost:8888/.  Any content edited in build/webapp/content/xdocs is
instantly rendered in the browser, making page development much faster.

View raw message