cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <>
Subject Re: AW: AW: AW: AW: Design note - Building a template mechanism
Date Fri, 08 Apr 2005 00:21:55 GMT

I had a look on the wiki page you posted
and it gave me some really good
ideas for the view plugin I am working on in forrest.

Together with another plugin (right now called leather but will be
renamed to ViewHelper) it is following the DispatcherView pattern and building a

I am using right now a different approach then you but it seems we are
trying to solve the same problem.

Have a look at

That is a view on a site. The link is the default view for the site but
you can define a new view for each page of your webapp.

A view basically contains three tags (for now - it is in a really early
  xmlns:forrest="" type="xhtml">
  <forrest:contract name="meta"/>
  <forrest:hook name="container">
   <forrest:contract name="feedback"/>
  </forrest:hook />

The view tag's @type determines the final output format. The idea is to
configure different output formats via a view. That is the biggest
different to your approach.

Each forrest:hook will be transformed into a <div/> tag (in html
output). This tags are designed to help web-designers to freely move
around and group contracts into design container.

Each forrest:contract will dispatch a xml file (ViewHelper) that contains
xsl:stylesheets for the different output formats, a contract can
implement. For html, the only format that I have implemented so far, we
have three different kind of templates:

<xsl:templates name="{contract/@name}-css/>
Here the contract specific css will be stored.

<xsl:templates name="{contract/@name}-head/>
Here goes everything that belongs in the html head. e.g. scripts.

<xsl:templates name="{contract/@name}-body/>
Everything that belongs into the body.


The view follows exactly the pattern shown here:
Right now it is implemented for the forrest way of producing the models
for the view but I am planing to create independent BusinessHelper to
access all BusinessServices you may have in your application.

shows that the $config has to be in the presentation model. Right now there are only forrest
core BusinessHelper.

One workaround is
where I pass the models via <xsl:param name="main"/> into the ViewHelper. That 


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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message