forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <>
Subject [views] Survival guide and setup
Date Mon, 06 Jun 2005 00:24:06 GMT
On Sun, 2005-06-05 at 23:01 +0100, Shaun Evans wrote: 
> I like it too, and I'm glad to see that there is some progress that is 
> visible to end users! I would like to continue to maintain scale-dev but 
> I have ran into problems with view/viewHelper, namely the lack of a 
> "getting started" guide. I'm sure that will be fixed after 0.7 is out 
> and everyone has more time to work on the next-generation features, as 
> hopefully somebody will also want to work on documentation. For now, I 
> would be very grateful if somebody (Thorsten ;-)) could point me in the 
> right direction for getting views working from the HEAD version.

I will write a howto on that I promise! For now try the following
survival guide:

1) The first step is to build the view and the viewHelper plugins (that
will be easier in the future, we promise)
cd {forrest-trunk}
svn up
cd whiteboard/plugins/org.apache.forrest.plugin.internal.view/
ant local-deploy
cd ../org.apache.forrest.plugin.output.viewHelper.xhtml/
ant local-deploy

2) Then seed an new project:
cd ~/src/newSeed
forrest seed

3) Then add the plugins to the

4) Change the project skin to leather-dev (we exchanging only
site2xhtml.xsl of that skin by the plugins and some contracts are based
on e.g. document2html.xsl output of leather-dev)

5) prepare default.fv directory (project.conf-dir)
mkdir src/documentation/conf

6) Now you have finished the preparation and the setup to finally try
forrest run

Note: When developing styles with views 'forrest run' is the quickest
way. You will see you do not have to build your project to see the
changes on your pages when working with *.fv. 

*changing views* - *.fv
For changing the view of a page, you can start by copying*checkout*/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.view/resources/views/default.fv
to e.g. index.fv. This view *has to* be in the same dir as the document
(e.g. index.xml). This is defined in by

To change the default view of your project you have to create a
default.fv (copy above mentioned) in the dir defined in the by

I now assume you have the following files new added to the seed (if you
did not change any default props):

Now the rule for the view matching is 
1.) page specific view (e.g. index.fv)
2.) default view (src/documentation/conf/default.fv)

Lets try this rule by changing in index.fv:
<!--<forrest:contract name="grouplogo"/>-->
save and test:

You will find that the grouplogo will not be rendered. Now let test how
the other pages look like:

You see again the grouplogo. To change it in all pages we have to edit

Now all pages do not have the grouplogo. For further information see

*CSS support*
Note: Right now we still have the css generation out of contracts but
that will be history as soon we can provide a default.css that is doing
this job. You will find in samples/sample.html (as indicator):
<link href="../skin/contracts-samples/sample.css" rel="stylesheet"
type="text/css" />

Now to add your own css to the view:

Basically you have to add 
<forrest:css url="someCss.css"/>
to the view to add your own css-stylesheet.

This tag has to be direct son from forrest:view!

In the resource.xmap of the plugins we defined a matching rule for
custom css:
<map:when test="{project:skins-dir}{path}/{name}.css">

That means e.g.
<forrest:css url="prosimii-screen-alt.css"/>

would expect (with default values) 
 |-- css
     `-- prosimii-screen-alt.css

For programming contracts see my recent thread and the upcoming how-to
(where you can find a lot of what you just read) ;-).



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

View raw message