forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: [Discuss] Templating language - forrest:templates and Struts Tiles
Date Mon, 22 Nov 2004 16:47:59 GMT
Thorsten Scherler wrote:
> El lun, 22-11-2004 a las 13:58, Ross Gardler escribió:
> 
>>Thorsten Scherler wrote:
>>
>>>El lun, 22-11-2004 a las 09:56, Nicola Ken Barozzi escribió:

<snip/>

>>>II. a. add atomic parts to default view
>>>
>>><forrest:view output-format="xhtml, fo" name="default">
>>>  <forrest:hook name="intro">
>>>   <forrest:nugget name="grouplogo"/>
>>>  </forrest:hook>
>>>  <forrest:hook name="newsfeedHook">
>>>    <forrest:nugget name="newsfeed"/>
>>>  </forrest:hook>
>>></forrest:view>
>>>
>>>II. b. add forrest:template and use it with <forrest:call-template/>
>>>1)
>>><forrest:template name="newsfeed" output-format="html, fo">
>>><forrest:hook name="newsfeedHook">
>>>  <forrest:nugget name="newsfeed"/>
>>></forrest:hook>
>>></forrest:template>
>>>
>>>2)
>>><forrest:view output-format="xhtml, fo" name="default">
>>>  <forrest:hook name="intro">
>>>   <forrest:nugget name="grouplogo"/>
>>>  </forrest:hook>
>>>  <forrest:call-template name="newsfeed"/>
>>></forrest:view>
>>
>>For IIb.
>>
>>Here we can learn from Eclipse. In Eclipse all GUI items define 
>>extension points. These are named positions in, for example, a menu, 
>>that plugins can insert new options. By default all menus provide an 
>>"additions" extension point, but they may also provide specific points 
>>(e.g. "Help").
>>
>>In order to add things into the Forrest GUI all one needs to do is say 
>>"insert this GUI element at this extension point". Eclipse decides when 
>>and how to disply that new GUI element.
>>
>>I see the <forrest:call-template name="newsfeed"/> as an extension 
>>point. A skin can provide a set of pre-defined extension points by 
>>inserting these elements:
>>
>><forrest:view output-format="xhtml, fo" name="default">
>>   <forrest:hook name="header">
>>    <forrest:nugget name="grouplogo"/>
>>    <forrest:nugget name="projectlogo"/>
>>    <forrest:extension-ft name="additions"/>
>>    <forrest:extension-ft name="navigation"/>
>>   </forrest:hook>

<snip/>

>>
>>To insert content at the navigation template of the header section we 
>>simply provide a template in the project called 
>>"skins/template/header/navigation.ft" and for the relatedResources in 
>>the navigation section we provide 
>>"skins/template/navigation/relatedResources.ft"

<snip/>

> 
> The big difference between the call-template and your extension point I
> see is:
> 
> I. <forrest:extension-ft name="additions"/>
> Will be provided as default by new views. -> view provider
> 
> II. <forrest:call-template name="newsfeed"/>
> Can be used by the user to extend the view. -> user
> 
> IMO it is not the skin providing this. *skin* produces placeholder for
> nuggets/fbits skelleton no design information. It is the view providing
> the extension and graphical hooks.

OI think you misunderstand the purpose of the extension point. It is 
just a standard name of a <forrest:call-template...>, I do not see the 
mechanism being any different. I think that by calling them somehthing 
different I am only confusing things. The above can be re-written as:

<forrest:view output-format="xhtml, fo" name="default">
    <forrest:hook name="header">
     <forrest:nugget name="grouplogo"/>
     <forrest:nugget name="projectlogo"/>
     <forrest:call-template name="additions"/>
     <forrest:call-template name="navigation"/>
    </forrest:hook>

The reason I renamed it is because making it a label in this way allows 
multiple plugins to extend the same extension point, which is different 
to having a user write a custom template.

Ross


Mime
View raw message