<?xml version="1.0" encoding="ISO-8859-1"?><!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
--><document> 
  <header> 
    <title>forrest:views - x output formats, one config</title>
    <abstract>This plugin depends on a ViewHelper and a BusinessHelper implementation.</abstract> 
  </header> 
  <body> 
    <section>
      <title>view</title>
      <p>Together with the ViewHelper and the BusinessHelper (to be implemented) 
        plugin this plugin is following the <link href="ext:sun/j2ee/patterns/dispatcherView">DispatcherView pattern</link> 
        and building the final view which will be delivered to the client. This implementation follows exactly the pattern shown on 
          <link href="ext:corej2eepatterns/patterns/dispatcherView">corej2eepatterns.com</link>
        </p><p>
        A view will be configured by a config file 
        which basically contains the following tags (it is still evolving): </p>
<source xml:space="preserve">&lt;forrest:view type="xhtml"&gt;
  &lt;forrest:css url="common.css"/&gt;
  &lt;forrest:contract name="meta"/&gt;
  &lt;forrest:hook name="container"&gt;
   &lt;forrest:contract name="feedback"/&gt;
  &lt;/forrest:hook /&gt;
&lt;/forrest:view&gt;</source>
<p>The view tag's @type determines the final output format. The idea is to
configure different output formats within a forrest:views. That means a forrest:views 
can contain n different "forrest:view" configurations for n different formats. <br/>
In short: x formats, one config. :)</p>
<source xml:space="preserve">&lt;forrest:views
  xmlns:forrest="http://apache.org/forrest/templates/1.0"&gt;
&lt;forrest:view type="xhtml"&gt;
  &lt;forrest:css url="common.css"/&gt;
  &lt;forrest:contract name="meta"/&gt;
  &lt;forrest:hook name="container"&gt;
   &lt;forrest:contract name="feedback"/&gt;
  &lt;/forrest:hook /&gt;
&lt;/forrest:view&gt;
&lt;forrest:view type="fo"&gt;
  &lt;forrest:hook name="container"&gt;
   &lt;forrest:contract name="feedback"/&gt;
  &lt;/forrest:hook /&gt;
&lt;/forrest:view&gt;
/forrest:views&gt;</source>
</section>
<section>
  <title>viewHelper</title>
  <p>viewHelper class/implementation - a class/implementation which will
access the presentation model and transform its models. In other words
it is a presentation producing factory.
</p>
<note>The &lt;forrest:contract name="nav-main"/&gt; expects a certain model
(now produced by leather-dev - tab2menu.xsl) to transform it. In the
future this dependency will be on a businessHelper implementation that
has to be defined in the view. For now it depends on leather-dev. I
guess leather-dev is still not dead till the businessHelper plugin comes
(which will implement the businessHelper of leather-dev). ;-)</note>
<p>
Each forrest:css will be transformed into a &lt;link rel="stylesheet" type="text/css" url="{$root}skin/{url}"&gt; tag (in html
output [only format that has an implementation]). 
This tags are designed to help <strong>web-designers</strong> to freely implemend their own css-implementations for a view.
</p>
<p>
Each forrest:hook will be transformed into a &lt;div/&gt; tag (in html
output [only format that has an implementation]). 
This tags are designed to help <strong>web-designers</strong> to freely move
around and group contracts into design container.
</p>
<p>Each forrest:contract will dispatch a xml file (ViewHelper) that contains
xsl:stylesheets (for now, but other implementations to transform the presentation
 model are/should be possible) for the different output formats of a contract.
  For html, the only format that we have implemented so far, we
have three different kind of templates:</p><p>
&lt;xsl:templates name="{contract/@name}-css/&gt;<br/>
Here the contract specific css will be stored.
</p><p>
&lt;xsl:templates name="{contract/@name}-head/&gt;<br/>
Here goes everything that belongs in the html head. e.g. scripts.
</p><p>
&lt;xsl:templates name="{contract/@name}-body/&gt;<br/>
Everything that belongs into the body.
  </p>
  </section>
  <section>
    <title>BusinessHelper </title>
    <p><strong>businessHelper class/implementation </strong>- a class/implementation which will
access businessServices to produce models for the presentation model. In
other word it is a data producing factory.
</p>
<note>Right now we are using the default forrest businessHelper (defined
by the skin you are using). There are contracts that depend on a
businessHelper implementation of leather-dev (tab2menu.xsl, site2xhtml.xsl,...). 
We will create a businessHelper plugin to overcome this problem.</note>
  <p>Right now it is implemented for the forrest way of producing the models
for the view but we will create an independent BusinessHelper to
access all BusinessServices you may have in your application. </p>
    </section>
    <section>
      <title>links</title>
      <note>There are/were lots of mails on the dev-list. Please, search the list</note>
      <p>Background mailings around the views concept</p>
      <ul>
        <li><link href="ext:mailings/dev/pInfra">[RT] plugin infrastructure</link> </li>
        <li><link href="ext:mailings/dev/ftLeather">[RT] Forrest templates for second generation skining - towards Corium</link> </li>
      </ul>

    </section>
  </body>
</document>
