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: *setup* 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 forrest.properties: project.required.plugins=org.apache.forrest.plugin.output.viewHelper.xhtml,org.apache.forrest.plugin.internal.view 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) project.skin=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 http://svn.apache.org/viewcvs.cgi/*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 forrest.properties by #project.xdocs-dir=${project.content-dir}/content/xdocs To change the default view of your project you have to create a default.fv (copy above mentioned) in the dir defined in the forrest.properties by #project.conf-dir=${project.content-dir}/conf I now assume you have the following files new added to the seed (if you did not change any default props): src/documentation/conf/default.fv src/documentation/content/xdocs/index.fv 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: http://localhost:8888/index.html You will find that the grouplogo will not be rendered. Now let test how the other pages look like: http://localhost:8888/samples/sample.html You see again the grouplogo. To change it in all pages we have to edit src/documentation/conf/default.fv. Now all pages do not have the grouplogo. For further information see e.g. http://marc.theaimsgroup.com/?l=forrest-dev&m=111800598325769&w=2 *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: http://marc.theaimsgroup.com/?t=111360815400001&r=1&w=2&n=7 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) src/documentation/skins |-- 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) ;-). HTH salu2 -- thorsten "Together we stand, divided we fall!" Hey you (Pink Floyd)