dev@jsftemplating.java.net

Re: getting back into jsft

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Sat, 07 Apr 2007 01:53:55 -0700

Hi Mike,

I see that you made it on IRC!  I wasn't at my computer while you where there, though.

The developer meeting that I was referring to was sent out on the dev alias on Friday: https://jsftemplating.dev.java.net/servlets/ReadMsg?list=dev&msgNo=512 .  I will provide a dial in # and other meeting details by Monday.

JSFTemplating doesn't use JSP tags b/c it doesn't use JSP.  Instead, it provides component factories which instantiate UIComponents.  That is exactly what JSP tags in JSF do also.  However, JSFTemplating factories are easier to create and are declared with Java 5 annotations.  And, the factory pattern allows you to do interesting things when creating UIComponents such as allowing you to customize UIComponents easily.  The annotations are processed at build-time, which generates a simple properties file mapping the factory class to a tag name (like "sun:textField").  When the LayoutViewHandler builds the UIComponent tree, it matches tags declared in the requested page with the values in this Map to know which factory to invoke to build each UIComponent.

I don't have any good document describing the architecture.  The slides on the web site explain some of it.  This is an area that needs improvement!  You're welcome to contribute (encouraged) to contribute documentation on any area you learn. :)  Handlers are next on my list to document... so I hope to get to this soon.  However, there is api documentation for Handlers at: https://jsftemplating.dev.java.net/nonav/javadoc/index.html .  Goto the com.sun.jsftemplating.layout.descriptors.handler package and star there.  You may also be interested in the annotation package which declares the Handler annotation.

As for what are handlers used for... everything. ;)  You can use them for any "event" exposed by JSFTemplating (or even custom events you define).  The events replace existing JSF mechanisms (such as action / actionListener) and define new ones (such as beforeEncode / afterEncode / beforeCreate / afterCreate).  A Handler is a Java method that takes a HandlerContext object (see JavaDoc).  The Handler implemenation can do anything and has access to lots of information via the HandlerContext, including input values passed in via the JSFTemplating page.  Inputs and outputs do automatic type conversion and checking.  JSFTemplating comes with many useful handlers built-in, and encourages users to define their own handlers for application specific needs.  Defining a handler is simple using Java annotations (which register the handlers similar to how ComponentFactories are registered).  You can find may examples of defining handlers in the "com.sun.jsftemplating.handler" package -- you probably want to look at this source code, but feel free to read the JavaDoc also.

If you are using JSFTemlating in DEBUG mode (see JSFTemplating setup tutorial for more info), then you can access the "info.jsf" page.  This page lists all the handlers / component factories defined via annotations.  It also describes there I/O.

For lots of examples of JSFTemlating, look at the GlassFish admin-gui source code.  There are also some samples checked into JSFTemplating also.... including a woodstock sample (note: this is a port of the JSP version and doesn't make use of JFSTemplating features to simplify the app.

I cc'd the dev list so everyone can see the questions / answers.

Thank you!

Ken Paulsen
ken.paulsen@sun.com
https://jsftemplating.dev.java.net


Michael Phoenix wrote:
Hey Ken,

I'm working on getting an IRC client up and running and connected. In th emenatime I could use clarification on a couple of points. Where and what time are the developer meetings held? I'm not sure what email you are referring to. Also how are the jsf tags implemnted? It is difficult  to see how the tags relate to the java code. Are their any documents on the project architecture? Finally the handler documentation isn't bad, it's non-existent. What are they used for and how are they implemented in creating a jsf page?

Thanks,
Mike

On 4/6/07, Ken Paulsen <Ken.Paulsen@sun.com> wrote:

Hi Michael,

This is great to hear! :)  There is plenty of opportunity to get
involved and yes, I can point you to documentation and other support
resources.

"sun:" components are the Woodstock components.  Their documentation can
be found at:

    https://woodstock.dev.java.net

The last time I checked, however, you had to build the documentation
from their source code. :(  They were planning on fixing this soon...
but it's been a month or two w/o any changes.

For quick JSFTemplating questions and developer discussion, the best
place to go is the IRC channel at irc.freenode.net : #jsftemplating.  I
am usually there as are a few other JSFTemplating developers.

To see open issues, you can goto the "Issue Tracker" on the
JSFTemplating web site.  There is plenty more than those issues to work
on, including anything you feel you'd like to improve with
JSFTemplating.  One person is currently working on providing
compatibility with Facelets, for example.

Handlers are not well documented on the web site.  You can read the
documentation in the JavaDoc, but you may want to talk about it on the
IRC or w/ my directly.

TLD are not necessary b/c of the annotations and the factory classes
that are used by JSFTemplating.  Look in the
"com.sun.jsftemplating.component.factory.sun" package for a bunch of
factory classes that define the Woodstock components and how they are
accessed from the .jsf pages.  You will see the annotation that declares
this on the class declaration.

Next Tuesday I am hoping to have a developer meeting where we discuss
development plans.  I hope you can make it (see my previous email).

I hope to see you on IRC (search the mail archives for IRC if you need
instructions on how to join the IRC chat)!

Talk to you later,

Ken


Michael Phoenix wrote:
> Hi Ken,
>
> I was distracted for awhile by a few things including on-line classes
> and job openings that didn't pan out, but now I'm finally where I can
> devote some serious effort to working on your project. I have
> completed the tutorial. It took me only a couple of hours as there's
> not much to it.  So I thought I'd talk to you about what I should do
> next.
>
> Is there any documentation and the "SUN:" tags and the other tags for
> events and components? Maybe you can point me to some project docs
> that would explain this and the architecture a little more clearly.
> What is the story with handlers? Apparently they are not covered in
> the tutorial. I noticed that there are no taglibs in .jsf files. How
> do you reference the tags back to their source?
>
> If you have any tasks for the project that you think I might be ready
> to sart out on, I'm ready. I do have a basic  understanding of J2EE
> concepts through Sang's excellent course and I have a good basic
> knowledge of the platform. however, I make no claims to being an
> expert. Expertise is what I am trying to develop.
>
> Thanks,
> Mike