El sáb, 24-09-2005 a las 12:10 +0100, Ross Gardler escribió: ... > Notice how the template in the above is named with the name of the > contract, for example, in the content-main contract we have: > > <xsl:template name="content-main-body" > > > THe *-body part means that template will be called to insert relevant > content into the body. > > Now look at the skeleton template I created for you in the voice plugin: > > http://svn.apache.org/repos/asf/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.output.voice/templates/voice-markup.ft > > It is called voice-markup and has a template named voice-markup-head. > That template will be called to gneerate the head stuff for a document > using this contract. > > So, your stylesheet above should have something like: > > <xsl:template name="voice-markup-head"> > <xsl:apply-templates select="//body"/> > </xsl:template> > > However, Thorsten is making changes to views right now. These changes > are affecting the way the contracts should be built and at present I > have no idea what we are supposed to do because the work is incomplete > and I am not in the position to examine what has been done so far. He is > reading this thread though so he'll speak up if we need to know anything. > > Ross
Thanks Ross for this perfect explanation how contracts work with a given presentation model (pm) and in general. A presentation model is a given data model that has to been transformed. Now I just used the features that always have been part of views to not use a default pm anymore. That means that all data (pm) needed by contracts should be requested by the view and pass it over to the contract. The most famous content-feeder contract is the example of how we will do it in the core (requesting the pm instead of taking it for granted): <forrest:contract name="content-feeder"> <forrest:properties contract="content-feeder"> <forrest:property name="content-feeder" nugget="get.nugget.feeder"> <url>/feeds/somefeed.xml</url> </forrest:property> </forrest:properties> </forrest:contract> Ross found a better way how to enhance this way and is preparing a proposal for making views cocoon-block enable. I am looking forward to it. :) ...and yes views are a moving target like os in general, which is the good thing about it. Things get enhanced through growing. ;-) salu2 -- thorsten "Together we stand, divided we fall!" Hey you (Pink Floyd)