forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <>
Subject Re: Making Forrest serve Lenya content
Date Sun, 28 Aug 2005 16:44:33 GMT
On Sun, 2005-08-28 at 18:10 +0200, Joachim Breitsprecher wrote:
> 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:generate
> src="lenya://lenya/pubs/{page-envelope:publication-id}/content/{page-envelope:area}/{page-envelope:document-path}"

> />
>    <map:serialize type="xml" />
> </map:match>
> 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" />
> </match>
> 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" />
> </lenya>
> And voila! Forrest served Lenya's content by browsing to 
> http://localhost:8888/lenya/index.xml.
> 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? :)

<map:match pattern="lenya/**.xml">
  <map:generate type="html" src="{lm:{0}}" />
  <map:transform src="{forrest:stylesheets}/html2document.xsl" />
  <map:serialize type="xml"/>

Basically you need to transform the html to our internal format first 
with above pipe you can do this. Add it to the sitemap.xmap of your project.

Anyway IMO we should just add a xdocs doctype to the lenya default pub and directly serving
That would allow to handle the content more efficient.

If you have some working code that you can attach to the issue tracker? I will take care of
it. ;-)
Thanks jb and welcome to forrest. Nice to see you over here and hope you stay. ;-)


"Together we stand, divided we fall!" 
Hey you (Pink Floyd)

View raw message