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 12:58:04 GMT
Thorsten Scherler wrote:
> El lun, 22-11-2004 a las 09:56, Nicola Ken Barozzi escribió:

<snip/>

>>>This templates then can be easily overridden and adjust by designer. The
>>>idea is that the designer can add his own implementation of the
>>>contracts.
>>
>>There are two things I want to have your opinion about, and how to 
>>insert them in the above scenario:
>>
>>1 - Users should be able to add nuggest without changing skin or theme.
>>     For example, adding an extra newsfeed on the right hand side.
> 
> 
> The user do not have to change the skin (see above) but have to extend
> the default forrest:view provided by e.g. leather. 
> 
> This based on the need that the user (designer) wants to place the new
> nugget on certain position. For the sake of design he may introduce a
> new forrest:hook and the newsfeed forrest:nugget to his main view.
> 
> I. default view:
> 
> <forrest:view output-format="xhtml, fo" name="default">
>   <forrest:hook name="intro">
>    <forrest:nugget name="grouplogo"/>
>   </forrest:hook>
> </forrest:view>
> 
> 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>
   <forrest:hook name="navigation">
    <forrest:nugget name="home"/>
    <forrest:nugget name="sectionMenu"/>
    <forrest:extension-ft name="localMenu"/>
    <forrest:nugget name="siteMenu"/>
    <forrest:extension-ft name="additions"/>
    <forrest:extension-ft name="relatedResources"/>
   </forrest:hook>
   <forrest:hook name="content">
    <forrest:nugget name="body"/>
    <forrest:extension-ft name="additions"/>
   </forrest:hook>
  </forrest:view>

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"

If the skin does not provide a suitable extension point then the site 
developer can revert to optin I or III.

Ross


Mime
View raw message