Developer Woes

September 19, 2007

Yesterday was one of the days were everything begins promising and after hours and hours it ends in a developer desaster. Although I tried 13 hours to get a Liferay portlet with hibernate, icefaces and myfaces to work it did not work. After all these hours I think there might be a reason why Liferay distributes its icefaces sample portlet with the SUN Reference Implementation of Java Server Faces and not Apache’s MyFaces.

It all began yesterday morning when I accessed Alfresco which was deployed as a portlet within Liferay via the WSRP Api. Strange to say this worked out of the box which made me very happy and maybe also brought me the motivation to go on more than 12 hours from that point.

In the afternoon I simply needed a JSF Tag which can iterate over a List and display its content. After some googling I found out that there is no JSF tag which supports this function. So I decided to write my own JSF component with the help of some examples with similar functionality. Unfortunately this did not work out of the box and after some more googling I found out that Apache MyFaces provides a tag called dataList which exactly was what I needed. So why don’t switch to icefaces with MyFaces? This combination would have been phenomenal as there could have been a solution to also get tomahawk working and to have a really big choice of prebuilt JSF components then. Well it wouldn’t work. After many hours of experimenting it boilt down to one Exception within one of the Liferay portlet JSF helper classes. It looked like this helper class could not deal with the ICEFaces workaround of handling the FacesContext. After some more googling I found out that ICEFaces within portlets is not considered production ready until version 1.7 of ICEFaces and so I switched to MyFaces and Tomahawk instead of ICEFaces for this portlet completely. AJAX components are not that useful in this portlet context and so the switch is acceptable whereas the big amount of wasted time is not :-).

But that was yesterday. The Myfaces, Facelets example is working now within Liferay and hopefully the accessing of Alfresco will too.

Have a nice day

Phillip