You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Thorsten Scherler <th...@apache.org> on 2005/07/27 10:41:07 UTC

Re: forrest:hooks configurations examples (was [Views]
strange behaviour)

On Wed, 2005-07-27 at 08:18 +0200, Nicola Ken Barozzi wrote:
> Thorsten Scherler wrote:
> ...
> > <forrest:hook name="testIdDiv"/>
> > *or*
> > <forrest:hook name="testIdDiv" type="div"/>
> > will be transformed into 
> > <div name="testIdDiv" />
> 
> Then why not simply use
> 
>  <div name="testIdDiv" />
> 
> > The same is true for @class attribute for forrest:hooks.
> > <forrest:hook class="testClassDiv"/>
> > *or*
> > <forrest:hook class="testClassDiv" type="div"/>
> > will be transformed into 
> > <div class="testClassDiv" />
> 
> Then why not simply use:
> 
>   <div class="testClassDiv" />
> 
> > Another feature is that you can as well output span elements for
> > forrest:hooks instead of div elements.
> > <forrest:hook name="testId" type="span"/>
> > will be transformed into 
> > <span id="testId" />
> 
> Then why not simply use
> 
>   <span id="testId" />
> 
> ...
> > Here is a small summary example:
> > <forrest:hook class="testClass" type="span" nbsp="true"/>
> > <forrest:hook name="testId" type="span"/>
> > <forrest:hook class="testClassDiv" />
> > <forrest:hook name="testIdDiv" type="div" nbsp="true"/>
> > 
> > will be transformed to:
> > 
> > <span class="testClass"> </span>
> > <span id="testId" />
> > <div class="testClassDiv" />
> > <div id="testIdDiv"> </div>
> 
> Again, why cannot we use the second version instead of creating another
> new language?
> 

The downside of your suggestion is that it is limited to html. By using
<div/> and <span/> we seems to limit the use of "forrest:hooks" to html
but like I mentioned in other threads the idea of forrest:views is to
have a configuration file not only for html but as well for other
formats. 

Which is the biggest different to e.g. tiles and velocity. If we only
want to support html for forrest:views then IMO we are better off using
on of them *instead* of forrest:views. 

I looked a little bit more into velocity and making experiments to use
them *within* a forrest:view configuration (*.fv). Actually that would
leverage the logic part of forrest:views but still using the new concept
in combination with special velocity templates (not outputting html
directly but the forrest:view dsl). 

Now to some arguments for not using <span/>,.... 
Lets say I want to implement a "fo" forrest:view. If we use <div/> and
<span/> we limit the usecase of forrest:hooks to this "graphical helper
container" of html which do not exist in fo. A div would probably be
e.g. a <fo:block/>.

Now using <forrest:hook type="block"/> is easier extensible for new
upcoming formats that are based on forrest:views. The other thing is
that a hook in e.g. inx can as well structure the document into multiple
pages. This hooks do not got transformed into an element but rather used
for structuring purposes only.

The last example would be something like <forrest:hook type="table"/>.
If we use <table/> instead that will not work for fo the same way like
in html both format will need another structure for "table". When hiding
the implementation behind the "forrest:hook" interface we can use
<forrest:hook type="table"/> for html and fo the same way and the format
implementation will take of the different processing.

Summary:
A forrest:hook is an abstract layer for *any* "graphical helper
container" (not only html), like an "interface". Each format can
implement special matcher and transformer which decide how and whether
forrest:hooks get transformed in the final output format.

WDYT?

salu2
-- 
thorsten

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


Re: forrest:hooks configurations examples (was [Views]
strange behaviour)

Posted by Thorsten Scherler <th...@apache.org>.
On Wed, 2005-07-27 at 14:06 +0200, Cyriaque Dupoirieux wrote:

> I think that's because we talked about type="span" and type="div" which 
> are well known for XHTML writer.
> We might have talked about type="inline" and type="block" but it would 
> have been a little bit <fo> oriented :-) .

Actually I really like type="inline" and type="block" because it saying
something about the functionality of the hook even that this name
coincident with fo. I reckon we should rename it this way.

WDOT?
-- 
thorsten

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


Re: forrest:hooks configurations examples (was [Views]
strange behaviour)

Posted by Ross Gardler <rg...@apache.org>.
Nicola Ken Barozzi wrote:
> Cyriaque Dupoirieux wrote:
> ...
> 
>>I think that's because we talked about type="span" and type="div" which
>>are well known for XHTML writer.
>>We might have talked about type="inline" and type="block" but it would
>>have been a little bit <fo> oriented :-) .
> 
> 
> Which actually is interesting.
> 
> 
>>Maybe we should find others words to clearly means that we are not
>>systematically going to produce XHTML or FO or IDon'tKnowWhat.
>>
>>The concepts of div and span in XHTML can be respectively assimilated to
>>block and inline in <fo>.
>>
>>Maybe something like type="layer" - for div, block and type="flow" for
>>span or inline ...
> 
> 
> Too late, you already said it! I prefer type="inline" and type="block"
> 
> :-P :-)
> 

+1 to inline and block, they seem far more desriptive than div and span, 
and are certainly more generic (yes they have fo connotations, but they 
are common in publishing circles in general)

Ross

Re: forrest:hooks configurations examples (was [Views]
strange behaviour)

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Cyriaque Dupoirieux wrote:
...
> I think that's because we talked about type="span" and type="div" which
> are well known for XHTML writer.
> We might have talked about type="inline" and type="block" but it would
> have been a little bit <fo> oriented :-) .

Which actually is interesting.

> Maybe we should find others words to clearly means that we are not
> systematically going to produce XHTML or FO or IDon'tKnowWhat.
> 
> The concepts of div and span in XHTML can be respectively assimilated to
> block and inline in <fo>.
> 
> Maybe something like type="layer" - for div, block and type="flow" for
> span or inline ...

Too late, you already said it! I prefer type="inline" and type="block"

:-P :-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: forrest:hooks configurations examples (was [Views]
strange behaviour)

Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
Ross Gardler a écrit :

> Nicola Ken Barozzi wrote:
>
>> Thorsten Scherler wrote:
>
>
> ...
>
>>> Summary:
>>> A forrest:hook is an abstract layer for *any* "graphical helper
>>> container" (not only html), like an "interface". Each format can
>>> implement special matcher and transformer which decide how and whether
>>> forrest:hooks get transformed in the final output format.
>>
>>
>>
>> Wait a second, I don't mean that writing <span> I want that outputted
>> directly.
>>
>> What I really mean is:
>>
>>   <forrest:span forrest:class="testClass"> </forrest:span>
>>
>> Using a default namespace, it becomes:
>>
>>   <span class="testClass"> </span>
>
>
> I have to admit that my first response was to agree with Nicola, but 
> Thorsstens reply convinced me otherwise. The main reason I like 
> Thorstens approach is that it keeps the language small.
>
> I think the argument is a little bogus (less HTML dependant, as Nicola 
> says it's just naming), but with Thorstens version we will not need to 
> invent new tags for new formats, whereas with Nicolas we will.

I also agree with Thorsten, the main thing is that this solution solve 
the previous problem of tag closure.

I forgot the language independance that we want to keep.

I think that's because we talked about type="span" and type="div" which 
are well known for XHTML writer.
We might have talked about type="inline" and type="block" but it would 
have been a little bit <fo> oriented :-) .

Maybe we should find others words to clearly means that we are not 
systematically going to produce XHTML or FO or IDon'tKnowWhat.

The concepts of div and span in XHTML can be respectively assimilated to 
block and inline in <fo>.

Maybe something like type="layer" - for div, block and type="flow" for 
span or inline ...

Regards,
Cyriaque,



>
> Ross
>
>

Re: forrest:hooks configurations examples (was [Views]
strange behaviour)

Posted by Ross Gardler <rg...@apache.org>.
Nicola Ken Barozzi wrote:
> Thorsten Scherler wrote:

...

>>Summary:
>>A forrest:hook is an abstract layer for *any* "graphical helper
>>container" (not only html), like an "interface". Each format can
>>implement special matcher and transformer which decide how and whether
>>forrest:hooks get transformed in the final output format.
> 
> 
> Wait a second, I don't mean that writing <span> I want that outputted
> directly.
> 
> What I really mean is:
> 
>   <forrest:span forrest:class="testClass"> </forrest:span>
> 
> Using a default namespace, it becomes:
> 
>   <span class="testClass"> </span>

I have to admit that my first response was to agree with Nicola, but 
Thorsstens reply convinced me otherwise. The main reason I like 
Thorstens approach is that it keeps the language small.

I think the argument is a little bogus (less HTML dependant, as Nicola 
says it's just naming), but with Thorstens version we will not need to 
invent new tags for new formats, whereas with Nicolas we will.

Ross

Re: forrest:hooks configurations examples (was [Views]
strange behaviour)

Posted by Nicola Ken Barozzi <ni...@apache.org>.
Thorsten Scherler wrote:
> On Wed, 2005-07-27 at 08:18 +0200, Nicola Ken Barozzi wrote:
> 
>>Thorsten Scherler wrote:
>>...
>>>Here is a small summary example:
>>><forrest:hook class="testClass" type="span" nbsp="true"/>
>>><forrest:hook name="testId" type="span"/>
>>><forrest:hook class="testClassDiv" />
>>><forrest:hook name="testIdDiv" type="div" nbsp="true"/>
>>>
>>>will be transformed to:
>>>
>>><span class="testClass"> </span>
>>><span id="testId" />
>>><div class="testClassDiv" />
>>><div id="testIdDiv"> </div>
>>
>>Again, why cannot we use the second version instead of creating another
>>new language?
> 
> The downside of your suggestion is that it is limited to html. 

It is not, it's just naming.

What makes:

  <forrest:hook class="testClassDiv" />

less html-dependant than:

  <span class="testClass"> </span>

...
> I looked a little bit more into velocity and making experiments to use
> them *within* a forrest:view configuration (*.fv). Actually that would
> leverage the logic part of forrest:views but still using the new concept
> in combination with special velocity templates (not outputting html
> directly but the forrest:view dsl). 
...
> Now to some arguments for not using <span/>,.... 
> Lets say I want to implement a "fo" forrest:view. If we use <div/> and
> <span/> we limit the usecase of forrest:hooks to this "graphical helper
> container" of html which do not exist in fo. A div would probably be
> e.g. a <fo:block/>.
> 
> Now using <forrest:hook type="block"/> is easier extensible for new
> upcoming formats that are based on forrest:views. The other thing is
> that a hook in e.g. inx can as well structure the document into multiple
> pages. This hooks do not got transformed into an element but rather used
> for structuring purposes only.
> 
> The last example would be something like <forrest:hook type="table"/>.
> If we use <table/> instead that will not work for fo the same way like
> in html both format will need another structure for "table". When hiding
> the implementation behind the "forrest:hook" interface we can use
> <forrest:hook type="table"/> for html and fo the same way and the format
> implementation will take of the different processing.
> 
> Summary:
> A forrest:hook is an abstract layer for *any* "graphical helper
> container" (not only html), like an "interface". Each format can
> implement special matcher and transformer which decide how and whether
> forrest:hooks get transformed in the final output format.

Wait a second, I don't mean that writing <span> I want that outputted
directly.

What I really mean is:

  <forrest:span forrest:class="testClass"> </forrest:span>

Using a default namespace, it becomes:

  <span class="testClass"> </span>

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------