JavaOne 2008 – The wonderful world of JavaFX, JSR-268 (Portlet specification) and SCA

It is the day after. The second day of JavaOne 2008 is about to begin. I should quickly go into the Schedule Builder to make some last minute refinements to my planned sessions. The trends of this conference start to emerge, and of course I have to be where the action is. Yesterday I was in one of the shortest lines outside any session – so I must have picked a not so hot topic… Or I am an early adopter, way ahead of the crowds. Well anyway, yesterday was intensive and mostly interesting. The general session was not good in my opinion. Hardly any news, a lot about OpenSolaris which to me is not extremely relevant (and the same applies I guess to most Java adepts), too much airtime for sponsors without any news (Amazon, SonyEricsson) and too many demos failing. I liked the story told and demonstrated by Neil Young. I am wondering whether Sun may just have too big a hold on this conference. Perhaps we should have a four day JavaCommunityOne and a one day SunOne conference?

My day consisted of presentations on the new Portal 2.0/JSR-268 specification, JavaFX in action, Eclipselink and NetBeans, SCA, a visit to the Pavilion and chat with many old and new friends.

JSR 268/ Portal 2.0

The first session of the day was by Stefan Hepper (IBM), specification lead for JSR 268. He explained what has been defined in JSR-268, which was approved in March 2008 and is currently being published on the JCP site . JSR-268 extends the existing JSR-168 in a lot of aspects, most importantly the ability for the Portlets to interact – publishing and consuming events, sharing parameters – within the Portal that consumes them and support for AJAX style portlet refresh, Portlets working with Web frameworks such as Struts and JSF and better support for Resource Serving. Portlets also get a chance to manipulate Headers and Cookies (this is achieved by splitting the render step in the portlet lifecyle into two steps: RENDER_HEADERS and RENDER_MARKUP. Stefan introduced the Portlet Filter mechanism, a filter chain invoked  by the Portlet Container, that allows preprocessing request and response sent to and from the Portlet.

JSR-268 describes how an AJAX request from an individual Portlet in the client is routed to the Portlet in its container by the Portal and has its response returned to the client. In the past, direct references from Portlet to Portlet Container had to be used. There is one important issue remaining: the AJAX request can lead to an updated Portlet but it does not include other Portlets. So even if the one Portlet emits events or changes shared parameters, there is no automatic mechanism prescribed for the Portal to also refresh other Portlets. For that to happen, client side coordination is required. Different vendors may provide their own custom solutions for this challenge.

Resource Serving was a major topic: in the past, the portlet returned its markup but any resources (JavaScript, images,..) associated with it were not served via the Portal but by direct URL references. In JSR-268, a new lifecycle method is introduced: serveResource. This method gives the Portlet control over the resources being served.

Stefan explained in a clear, straightforward manner what had been done, demonstrating several aspects in both WebSphere Portal and Apache Pluto (the Reference Implementation). For me personally his talk fit well in with the experience regarding Portlets and also WSRP 2.0 I have been gaining with Oracle WebCenter.

The JavaFXâ„¢ Platform: Sexy Interfaces For Mere Mortals

My favorite session of the day was Joshua’s Smith presentation on JavaFX. Brisk pace, clear explanations, great demos and an interesting topic. He positioned JavaFX as ‘for over the top UIs’ – things that were too much trouble to do with plain Swing, Java2D and Java 3D have now become accessible, for mobile, web and desktop applications. Whenever you like to add animated graphic representation of information to an application and still have it tightly integrated with the functionality of the application, JavaFX may be an option. You can add JavaFX applets to web pages, embed JavaFX in Swing applications (desktop or applet) and create JavaFX for mobile devices. Note that Swing can also be embedded in the JavaFX program.

Josh demonstrated how easy it is to implement animation of objects, morphing them, supporting drag & drop handling etc. Is most interesting demo showed ‘slide transitions’, one slide morphing into another, performing a little dance with the next one, floating into outer space etc. It seemed a lot of fun to do a little scripting.

At this point the main relevance of JavaFX to me is the ability to extend my Web Applications with rich visual representations and possibly interactive controls. I do not at this point expect the development of entire applications using JavaFX in the near future. Given the unclarity from Sun about its plans – and especially their delivery on them – for JavaFX we will have to plot our trajectory carefully. I will be most interested in learning how to embed and integrate JavaFX gadgets in plain old HTML web applications.

Of crucial importance to the future of applets or “how to make applets not suck”, that is how Josh described the importance of the Java 6 SE Upgrade 10. Providing a much faster download and much better user experience, this upgrade should make a huge difference in the user experience with applets.

You can preregister for the JavaFX SDK – scheduled for July 2008 – at www.javafx.com.

Joshua’s blog at http://devjfx.com/  will have this presentation available in a few days time. He will post his code samples at: http://code.google.com/p/devjfx/ . He suggested to take a look at project SceneGraph (https://scenegraph.dev.java.net/ ), which provides “scene
graph” functionality at the Java level, as well as providing
one of the important runtime elements that the JavaFX Script
language depends upon from the underlying platform. From the project scenegraph you can download the JavaFXPad that has you create and run JavaFX script applications in no time.

JavaOne 2008 - The wonderful world of JavaFX, JSR-268 (Portlet specification) and SCA

More information on JavaFX also found on James Weaver’s weblog: http://learnjavafx.typepad.com/ . He provides a number of examples that can be ran for example in the Pad shown above.

The articles Creating Rich Internet Applications With Compiled JavaFX Script Technology and Using UI Components in Compiled JavaFX Script Technology provide a lot of information on how to get started with JavaFX.

 

 

One Response