You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Vladimir Isakovich <iv...@gmail.com> on 2007/06/27 05:19:49 UTC

Confusion about Tomahawk with Facelets

I can see in *tomahawk.taglib.xml* all components and renderers pointed to
or.apache.myfaces package, what is done according to xyzTag classe's methods
getComponent() and getRenderer().
I'm confused, why tomahawk Tag classes are NOT pointed to tomahawk
components and renderers???
Are those components and renderers being called and how???

vlad

Re: Confusion about Tomahawk with Facelets

Posted by Martin Marinschek <ma...@gmail.com>.
The Hack-classes are not necessary with 1.2 anymore - until then, the
data-model was falsely (for extenders) private instead of protected.

regards,

Martin

On 6/27/07, Nebinger, David <dn...@tbbgl.com> wrote:
> > I just opened HtmlDataTable.class from tomahawk.jar in the
> > decompiler, and this is what I see:
> > package org.apache.myfaces.component.html.ext;
> > - not "org.apache.myfaces".
> > Also on the other thought, if two jars (tomahawk and myfaces)
> > would have the same class (I mean -in the same package) they
> > would conflict.
> > So, I'm still wondering, if and how this component class in
> > tomahawk package is called, and why xyzTag class (in
> > tomahawk) is pointing it's
> > getComponent() to "org.apache.myfaces".
> >
> > Also, I've noticed that DataTable has some more classes
> > (DataTableHack), so I just double-checked with DataScroller
> > and found the same confusion)
> >
> > vlad
>
> Okay, that's a different confusion entirely.
>
> First the faces-config.xml file defines the component and renderer types
> as, say, org.apache.myfaces.HtmlDataTable.  See the <component-type> and
> <renderer-type> elements.  These basically define aliases to the true
> class implementations defined via the <component-class> and
> <renderer-class> elements.
>
> The tomahawk TLD file defines how the tag (i.e. <t:dataTable /> maps to
> the alias values defined in the faces-config.xml.
>
> So, the <t:dataTable> tag is defined as:
>
>     <tag>
>         <tag-name>dataTable</tag-name>
>         <component>
>
> <component-type>org.apache.myfaces.HtmlDataTable</component-type>
>             <renderer-type>org.apache.myfaces.Table</renderer-type>
>         </component>
>     </tag>
>
> When you go to the faces-config.xml file, you see that the component
> type is actually defined as:
>
>     <component>
>
> <component-type>org.apache.myfaces.HtmlDataTable</component-type>
>
> <component-class>org.apache.myfaces.component.html.ext.HtmlDataTable</co
> mponent-class>
>     </component>
>
> Which shows that the full class name for the implementation is
> org.apache.myfaces.component.html.ext.HtmlDataTable.
>
> Also the renderer is defined as:
>
>     <renderer>
>         <component-family>javax.faces.Data</component-family>
>         <renderer-type>org.apache.myfaces.Table</renderer-type>
>
> <renderer-class>org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer<
> /renderer-class>
>     </renderer>
>
> Again, it identifies the class that implements the renderer.
>
> In the source files, you'll also see that they return the alias values
> defined in the <component-type> and <renderer-type> tags.
>
> It's not meant to be confusing, it is meant to simplify things by
> removing actual classpaths in the various files.  The component type and
> renderer types are prefixed with "org.apache.myfaces" so the possibility
> of naming conflicts; HtmlDataTable as a name could possibly conflict if
> the standard JSF elements were so named; by prefixing with
> "org.apache.myfaces" you can have your own HtmlDataTable component and
> still use the tomahawk components.
>
> Those *Hack classes are internal classes for the implementation; instead
> of decompiling the class files themselves, check out the source to see
> the embedded comments.  These seem to be classes to provide some
> additional visibility over the data model, although I really haven't dug
> into it to say anything factual about them.
>
>


-- 

http://www.irian.at

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

Professional Support for Apache MyFaces

RE: Confusion about Tomahawk with Facelets

Posted by "Nebinger, David" <dn...@tbbgl.com>.
> I just opened HtmlDataTable.class from tomahawk.jar in the 
> decompiler, and this is what I see:
> package org.apache.myfaces.component.html.ext;
> - not "org.apache.myfaces".
> Also on the other thought, if two jars (tomahawk and myfaces) 
> would have the same class (I mean -in the same package) they 
> would conflict.
> So, I'm still wondering, if and how this component class in 
> tomahawk package is called, and why xyzTag class (in 
> tomahawk) is pointing it's
> getComponent() to "org.apache.myfaces".
> 
> Also, I've noticed that DataTable has some more classes 
> (DataTableHack), so I just double-checked with DataScroller 
> and found the same confusion)
> 
> vlad

Okay, that's a different confusion entirely.

First the faces-config.xml file defines the component and renderer types
as, say, org.apache.myfaces.HtmlDataTable.  See the <component-type> and
<renderer-type> elements.  These basically define aliases to the true
class implementations defined via the <component-class> and
<renderer-class> elements.

The tomahawk TLD file defines how the tag (i.e. <t:dataTable /> maps to
the alias values defined in the faces-config.xml.

So, the <t:dataTable> tag is defined as:

    <tag>
        <tag-name>dataTable</tag-name>
        <component>
 
<component-type>org.apache.myfaces.HtmlDataTable</component-type>
            <renderer-type>org.apache.myfaces.Table</renderer-type>
        </component>
    </tag>

When you go to the faces-config.xml file, you see that the component
type is actually defined as:

    <component>
 
<component-type>org.apache.myfaces.HtmlDataTable</component-type>
 
<component-class>org.apache.myfaces.component.html.ext.HtmlDataTable</co
mponent-class>
    </component>

Which shows that the full class name for the implementation is
org.apache.myfaces.component.html.ext.HtmlDataTable.

Also the renderer is defined as:

    <renderer>
        <component-family>javax.faces.Data</component-family>
        <renderer-type>org.apache.myfaces.Table</renderer-type>
 
<renderer-class>org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer<
/renderer-class>
    </renderer>

Again, it identifies the class that implements the renderer.

In the source files, you'll also see that they return the alias values
defined in the <component-type> and <renderer-type> tags.

It's not meant to be confusing, it is meant to simplify things by
removing actual classpaths in the various files.  The component type and
renderer types are prefixed with "org.apache.myfaces" so the possibility
of naming conflicts; HtmlDataTable as a name could possibly conflict if
the standard JSF elements were so named; by prefixing with
"org.apache.myfaces" you can have your own HtmlDataTable component and
still use the tomahawk components.

Those *Hack classes are internal classes for the implementation; instead
of decompiling the class files themselves, check out the source to see
the embedded comments.  These seem to be classes to provide some
additional visibility over the data model, although I really haven't dug
into it to say anything factual about them.


RE: Confusion about Tomahawk with Facelets

Posted by vlad10 <iv...@yahoo.com>.
I just opened HtmlDataTable.class from tomahawk.jar in the decompiler, and
this is what I see:
package org.apache.myfaces.component.html.ext; 
- not "org.apache.myfaces".
Also on the other thought, if two jars (tomahawk and myfaces) would have the
same class (I mean -in the same package) they would conflict.
So, I'm still wondering, if and how this component class in tomahawk package
is called, and why xyzTag class (in tomahawk) is pointing it's
getComponent() to "org.apache.myfaces".

Also, I've noticed that DataTable has some more classes (DataTableHack), so
I just double-checked with DataScroller and found the same confusion)

vlad


Nebinger, David wrote:
> 
> Um, if you look at the package naming for the classes themselves you'll
> see that the package naming is "org.apache.myfaces".  They are still
> tomahawk components.
> 
> 
> ________________________________
> 
> 	From: Vladimir Isakovich [mailto:ivlad10@gmail.com] 
> 	Sent: Tuesday, June 26, 2007 11:20 PM
> 	To: users@myfaces.apache.org
> 	Subject: Confusion about Tomahawk with Facelets
> 	
> 	
> 	I can see in tomahawk.taglib.xml all components and renderers
> pointed to or.apache.myfaces package, what is done according to xyzTag
> classe's methods getComponent() and getRenderer().
> 	I'm confused, why tomahawk Tag classes are NOT pointed to
> tomahawk components and renderers??? 
> 	Are those components and renderers being called and how???
> 	 
> 	vlad
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Confusion-about-Tomahawk-with-Facelets-tf3986056.html#a11327860
Sent from the MyFaces - Users mailing list archive at Nabble.com.


RE: Confusion about Tomahawk with Facelets

Posted by "Nebinger, David" <dn...@tbbgl.com>.
Um, if you look at the package naming for the classes themselves you'll
see that the package naming is "org.apache.myfaces".  They are still
tomahawk components.


________________________________

	From: Vladimir Isakovich [mailto:ivlad10@gmail.com] 
	Sent: Tuesday, June 26, 2007 11:20 PM
	To: users@myfaces.apache.org
	Subject: Confusion about Tomahawk with Facelets
	
	
	I can see in tomahawk.taglib.xml all components and renderers
pointed to or.apache.myfaces package, what is done according to xyzTag
classe's methods getComponent() and getRenderer().
	I'm confused, why tomahawk Tag classes are NOT pointed to
tomahawk components and renderers??? 
	Are those components and renderers being called and how???
	 
	vlad