forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joachim Breitsprecher>
Subject Making Forrest serve Lenya content
Date Sun, 28 Aug 2005 16:10:59 GMT
Inspired by recent discussions on this list I decided to give it a try 
and implement the suggestions about integrating Lenya content into 
Forrest. However, I was stopped short by my lack of knowledge about 
Forrest internals. Maybe someone can provide some hints about how to go on.

Here's a step-by-step description of what I did:

I checked out and compiled Forrest Trunk, Lenya Trunk and Cocoon 2.1.x. 
Then I modified to start Jetty on Port 18888 instead of 8888 
and started Lenya.
After logging in to Lenya and publishing some documents (index and 
tutorial) I added a pipeline to lenya/pubs/default/sitemap.xmap, right 
above <map:match pattern="*/**.html"> (line 157):

<!-- FORREST -->
<map:match pattern="*/**.xml">

   <map:serialize type="xml" />

This pipe returns only the contents of the requested document in Lenya's 
internal format (XHTML in the default publication), without any 
processing or decorations (like navigation etc).

I then created a new Forrest sample site using "forrest seed-sample; 
forrest run" and added the following match to the locationmap.xml:

<match pattern="lenya/**.xml">
   <location src="{1}.xml" />

and my two published documents to site.xml:

<lenya label="Lenya Test" href="lenya/">
   <index label="Index Page" href="index.html" description="I don't know
what to write here" />
   <tutorial label="Tutorial Page" href="tutorial.html" description="I
don't know what to write here" />

And voila! Forrest served Lenya's content by browsing to 

However, http://localhost:8888/lenya/index.html still returns an empty 
page with just the decorations and navigation, but no content. The 
reason for this is probably that Forrest expects content in XDocs 
format, while Lenya serves XHTML.
The embedded_html example in the sample site works fine, so there seems 
to be a way. I just don't know how to make Forrest recognize the Lenya 
content as XHTML. Changing the Locationmap match to "lenya/**.html" 
results in a 404 "Resource not found" when requesting the pages.

Any hints? :)


View raw message