You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Mario Ivankovits <ma...@ops.co.at> on 2006/02/27 19:23:55 UTC

documentTag et al

Hi!

Sorry for the lenghty mail.

I would like to get rid of the ExtensionFilter when it comes to buffer
and parse the response.


Now there are a couple of methods how to archive this:

1) documentTag

Having something like

<f:view>
<t:document>
    <t:documentHead>
    </t:documentHead>
    <t:documentBody>
    </t:documentBody>
</t:document>
</f:view>

when using the HTML render kit, t:document renders the <html stuff,
t:documentHead <head and t:documentBody the <body eqivalent
This, e.g. documentBody will accept all html attributes required for the
html <body tag.

The main disadvantage I see here is that you cant put the documentBody
in an include. Remember, you have to close a jsp-tag within the same
compilation unit.


2) During writing this mail, I decided to discard the other method I had
in mind as the above is nicer ;-)
It was something like
<t:script name="header"/>
<t:script name="bodyStart"/>
<t:script name="bodyEnd"/>

you simply place them as hook points in your html where the extension
filter can insert its scripts.
Even if simpler, we still have to use the HTML html/head/body tags -
this is something solution (1) will solve too.


Back to 1)
ok, the document/documentBody problem is still there and we have to find
a solution for this.
Its not uncommon to have a jsp like this:

<jsp:include file="inc/header.jsp" />
<t:panelLayout>
<f:facet name="header" >
....
<f:facet name="footer" >
...
</t:panelLayout>
<jsp:include file="inc/footer.jsp" />


using the documentTag it will look like

<t:document>
<jsp:include file="inc/header.jsp" /> <=documentHead and documentBody
inside here>
<t:panelLayout>
<f:facet name="header" >
....
<f:facet name="footer" >
...
</t:panelLayout>
<jsp:include file="inc/footer.jsp" /> <= documentBody inside end here>
</t:document>

One might argue to take the document* tags outside of the includes, but
shouldn't we try to put common tags to central places?
The panelLayout already is a compromise.

So, one solution can be to have
<t:document state="start" />
<t:documentBody state="start" />
<t:documentBody state="end" />
<t:document state="end" />

Then the tags are closed and thus we can put it in an include, but I
have to admit this is absolutely not nice.

So, now ... What do you think? Other ideas?

Thanks!
Mario


Re: documentTag et al

Posted by Martin Marinschek <ma...@gmail.com>.
o-k.

let's do it like this!

+1

regards,

Martin

On 2/27/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi!
> > I think we might end up wanting both - the document based approach,
> > _and_ your scripts-tag.
> >
> What if we implement the "state" attribute, but having the "state" optional.
> So these tags can work with both scenarios.
>
> We should only make sure, that no one tries to instrument the children
> in one of the tags - this cant work when using the self-closing tags.
>
> I think I gonna like this.
>
> Ciao,
> Mario
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: documentTag et al

Posted by Mario Ivankovits <ma...@ops.co.at>.
Hi!
> I think we might end up wanting both - the document based approach,
> _and_ your scripts-tag.
>   
What if we implement the "state" attribute, but having the "state" optional.
So these tags can work with both scenarios.

We should only make sure, that no one tries to instrument the children
in one of the tags - this cant work when using the self-closing tags.

I think I gonna like this.

Ciao,
Mario


Re: documentTag et al

Posted by Martin Marinschek <ma...@gmail.com>.
I think we might end up wanting both - the document based approach,
_and_ your scripts-tag.

what do you think?

maybe we should start off with the scripts tag, and then add document
tags as we go?

regards,

Martin

On 2/27/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> Martin Marinschek schrieb:
> > in panelLayout you have HTML, HEAD, BODY, FOOT (ok, you get my point ;)
> >
> Yes, this is why I put a inc/header.jsp (and footer for sure) outside of
> panelLayout.
> So I have a header/footer for the content outside of BODY (but for sure,
> including the body) and use facet=header/body for the "real" stuff
> inside the BODY.
>
> So the one is the "technical" body/footer and the other is the "content"
> one.
>
> I hope you wont suggest to not to use the panelLayout :-o
>
> Ciao,
> Mario
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: documentTag et al

Posted by Mario Ivankovits <ma...@ops.co.at>.
Martin Marinschek schrieb:
> in panelLayout you have HTML, HEAD, BODY, FOOT (ok, you get my point ;)
>   
Yes, this is why I put a inc/header.jsp (and footer for sure) outside of
panelLayout.
So I have a header/footer for the content outside of BODY (but for sure,
including the body) and use facet=header/body for the "real" stuff
inside the BODY.

So the one is the "technical" body/footer and the other is the "content"
one.

I hope you wont suggest to not to use the panelLayout :-o

Ciao,
Mario


Re: documentTag et al

Posted by Martin Marinschek <ma...@gmail.com>.
I believe that the problem is that

the panelLayout and HTML is incompatible

in HTML you have HTML, HEAD, BODY

in panelLayout you have HTML, HEAD, BODY, FOOT (ok, you get my point ;)

So in fact, the panelLayout is wrong, wrong, wrong.

regards,

Martin

On 2/27/06, Mario Ivankovits <ma...@ops.co.at> wrote:
> Hi!
>
> Sorry for the lenghty mail.
>
> I would like to get rid of the ExtensionFilter when it comes to buffer
> and parse the response.
>
>
> Now there are a couple of methods how to archive this:
>
> 1) documentTag
>
> Having something like
>
> <f:view>
> <t:document>
>     <t:documentHead>
>     </t:documentHead>
>     <t:documentBody>
>     </t:documentBody>
> </t:document>
> </f:view>
>
> when using the HTML render kit, t:document renders the <html stuff,
> t:documentHead <head and t:documentBody the <body eqivalent
> This, e.g. documentBody will accept all html attributes required for the
> html <body tag.
>
> The main disadvantage I see here is that you cant put the documentBody
> in an include. Remember, you have to close a jsp-tag within the same
> compilation unit.
>
>
> 2) During writing this mail, I decided to discard the other method I had
> in mind as the above is nicer ;-)
> It was something like
> <t:script name="header"/>
> <t:script name="bodyStart"/>
> <t:script name="bodyEnd"/>
>
> you simply place them as hook points in your html where the extension
> filter can insert its scripts.
> Even if simpler, we still have to use the HTML html/head/body tags -
> this is something solution (1) will solve too.
>
>
> Back to 1)
> ok, the document/documentBody problem is still there and we have to find
> a solution for this.
> Its not uncommon to have a jsp like this:
>
> <jsp:include file="inc/header.jsp" />
> <t:panelLayout>
> <f:facet name="header" >
> ....
> <f:facet name="footer" >
> ...
> </t:panelLayout>
> <jsp:include file="inc/footer.jsp" />
>
>
> using the documentTag it will look like
>
> <t:document>
> <jsp:include file="inc/header.jsp" /> <=documentHead and documentBody
> inside here>
> <t:panelLayout>
> <f:facet name="header" >
> ....
> <f:facet name="footer" >
> ...
> </t:panelLayout>
> <jsp:include file="inc/footer.jsp" /> <= documentBody inside end here>
> </t:document>
>
> One might argue to take the document* tags outside of the includes, but
> shouldn't we try to put common tags to central places?
> The panelLayout already is a compromise.
>
> So, one solution can be to have
> <t:document state="start" />
> <t:documentBody state="start" />
> <t:documentBody state="end" />
> <t:document state="end" />
>
> Then the tags are closed and thus we can put it in an include, but I
> have to admit this is absolutely not nice.
>
> So, now ... What do you think? Other ideas?
>
> Thanks!
> Mario
>
>


--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces