Thursday, June 14, 2007

JSF Portlet Fun: Request Scoped Beans Don't Survive From Action to Render Phase

Not sure if this is Pluto specific, but request scoped beans basically don't work as expected since they get initialized on the action phase and then again on the render phase. This is with MyFaces 1.1.4 and Pluto 1.1.3. At least with GridSphere 2.1.5 and MyFaces 1.0.9, I know that request scoped beans do work. See for more information. The workaround is basic and actually standard from the Portlet API point of view. The idea is that for any thing that you want to carry over from the action phase to the render phase, then just add this as a render parameter. In this example, a field of the request scoped bean called "success" is a boolean. So in the action method, I do this:

// add the success field to a render parameter so it will be available in
// the render phase. See constructor as well.
ExternalContext extContext = FacesContext.getCurrentInstance().getExternalContext();
if (extContext.getResponse() instanceof ActionResponse) {
ActionResponse actionResponse = (ActionResponse) extContext.getResponse();
actionResponse.setRenderParameter("success", Boolean.toString(success));

Then in the contructor for the bean I have:
// Pull success value from render parameter set in action phase, i.e., submit()
ExternalContext extContext = facesContext.getExternalContext();
Map params = extContext.getRequestParameterMap();

if (params.containsKey("success")) {
this.success = Boolean.parseBoolean((String)params.get("success"));

Wednesday, June 06, 2007

TeraGrid 2007, Day 3

In the Software Provider Forum, I gave a talk on PURSe (using slides provided to me by Rachana Anathakrishnan) and also about the PURSe portlets work I've been doing.

In the presentation I give a sketch of a roadmap for a PURSe portlets 1.1 release, which should be out within a month.

TeraGrid 2007, Day 2

Stu Martin and I gave a talk on GRAM Auditing and integration of it with the LEAD Portal.

Tuesday, June 05, 2007

TeraGrid 2007, Day 1

During most of the first day at TeraGrid 07, I was involved in the TeraGrid Institute tutorial, a kind of "TeraGrid for beginners" tutorial. We did a demo/tutorial using the LEAD Portal as a way of demonstrating how a science gateway can make effective use of TeraGrid, how the sum of TeraGrid is greater than it's individual parts. A screencast we developed in support of the tutorial is available.

Near the end of the day, I had a talk about the LEAD Portal for the "Build your own science gateway" tutorial. It's titled The LEAD Portal: An OGCE based weather science gateway, and you can see it below.

I talked with Kent Milfeld briefly afterward about the difficulty in supporting and managing production and development deployments.