RichFaces + JSF RI + JBossPortletBridge + Liferay Portal on JBoss AS 4.2.x

The task to make few portlets for Liferay 5.1 Portal using RichFaces + JSF RI looks trivial. But it isn't.
There are few decisions:

  1. Use Liferay listener for Sun JSF with Sun's FacesPortlet.
  2. Use JBossPortletBridge, because it supports RichFaces and AJAX.

I choosed the second with understanding that JBossPortletBridge is in beta and everywhere says that it supports JBossPortal, but I did not find where says - "It supports Liferay too". It does not support Liferay Portal 5.0.
I found few interesting things, that anyone should know before starting write portlets with RichFaces for Liferay using JBossPortletBridge 1.0.x Beta:

  1. RichFaces should be at least 3.2.1.
  2. You should configure portlet as ajaxable with server side state saving policy
  3. Override the javax.portlet.faces.GenericFacesPortlet given with JBossPortletBridge. You'll need manually setup the request attribute javax.servlet.include.path_info with correct viewId you want to process and render. Or you can setup this request attribute at the PortletExternalContextImpl class in calculateServletPath() method (remember JBossPortletBridge 1.0.x Beta).
  4. Use <a4j:commandXXX/> components to process navigation. <h:commandXXX/> will not help ((.


Good luck!



Update:
My friend Andriy has described the solution with details and configuration samples, and you can find his post by the url http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1712557. It really can be useful for you.



I've uploaded the portlet sample prototype, so it's ready and waits for you :)
http://www.esnips.com/doc/de8b5661-fb6d-4fc7-83a3-ed09aa72c695/PortletPrototype

7 comments:

Unknown said...

Hi,
i'm trying to run portlets in liferay.
Do you have a working example to show?

Thanks in advance

Fiorenzo

Ruslan K said...

Hi Fiorenzo,
Sorry, was in travel, so couldn't answer before. I have working demo portlet with RichFaces for Liferay 5.1. Send you be email archive with sources and WAR-file. You may open the project with IntellijIdea.

Please, see class FacesPortlet to find what I proposed in the post.

Ruslan

Oli3377 said...

Hi,

We are also trying to deploy richfaces portlets in Liferay 5.1.x

Can you send me you successfully deployed example

Thanks in advance

Oli

Vincent said...

Hi Ruslan,

I'am working on RichFaces with Liferay Portal, but still don't know how.

Could you kindly send me the example source to me also, it will be very helpful.

My email is vincent.lin02@gmail.com

Thanks in advance

Vincent

nbhatta said...

Hi Ruslan,

I also desperately need that demo using RichFaces + LifeRay.
Please can I get that.
Any help wud be really appreciable.
My email is: netra.707@gmail.com

Thanks in advance

Netra

alexsmirnov said...

I've fixed most of Liferay compatibility issues just after RichFaces 3.3.1.CR2 / portletbridge 1.0.0.CR1 releases. The only coming portletbridge 1.0.0.CR2 release works with Liferay portal. It is not available for download yet, but you can built it from source code that already tagged in the SVN repository http://anonsvn.jboss.org/repos/portletbridge/tags/1.0.0.CR2 .
I'm going to put instructions at my blog http://alexsmirnov.wordpress.com/ - anyway, it is good occasion to start that :-)

Balazs Zsoldos said...

Hi,

for me Liferay 6.0.4, Richfaces 3.3.3 and a patched Portletbridge 2.0.0 works great.

The patch is available at https://jira.jboss.org/browse/PBR-191 and the link to the compiled patched jar files with some description are available at https://maven2.everit.biz/browse/org.jboss.portletbridge