Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Liad Ron
Hosting JSF application as a portlet in LifeRay
April 10, 2012 1:49 AM
Answer

Liad Ron

Rank: New Member

Posts: 8

Join Date: April 10, 2012

Recent Posts

Hi,
I would like to add a JSF portlet to my LifeRay portal.
I have read about Liferay Faces Bridge and it is looks like a good solution to my problem.
Is there any easy guide with some examples that shows you how to do it?
From where do I start?

Sincerely,
Liad.
Neil Griffin
RE: Hosting JSF application as a portlet in LifeRay
April 10, 2012 3:51 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

I recommend starting out with one of the reference portlets (JSF2, ICEFaces3, PrimeFaces3, RichFaces4) that you can download from the demos page:
http://www.liferay.com/community/liferay-projects/liferay-faces/demos

Then make small iterative development changes to one of these portlets until you have a portlet that meets your requirements.
Liad Ron
RE: Hosting JSF application as a portlet in LifeRay
April 10, 2012 7:11 AM
Answer

Liad Ron

Rank: New Member

Posts: 8

Join Date: April 10, 2012

Recent Posts

Hi Neil,
Thank you for your quick responsed.
Maybe I should had ask this question before the one that I have already asked.
Is there any benefit to hosting a 3rd party JSF application as a portlet, or will it be the same as using an IFrame?
What is your best suggestion to host a JSF application?

Thanks in advanced,
Liad Ron.
Neil Griffin
RE: Hosting JSF application as a portlet in LifeRay
April 10, 2012 2:34 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

In general, portlets can currently be deployed in Liferay in one of three ways:

1. As a local portlet
2. As a remote portlet (via WSRP)
3. Within an <iframe>

Liferay Faces Bridge supports #1 right now, but doesn't yet support WSRP.

#3 doesn't require a portlet bridge.

Here are some benefits of #1 instead of #3:

1. The HTML markup of the portlet is part of the larger portal page and can better leverage the Liferay Theme CSS and JavaScript
2. User actions (button clicks, etc) invoke portlet URLs that execute the portlet lifecycle. This is a good thing because the portlet can better participate in context of the portlet session, and it can leverage the security features that are built-in to Liferay.

In general I recommend #1 with Liferay.
Liad Ron
RE: Hosting JSF application as a portlet in LifeRay
April 11, 2012 6:17 AM
Answer

Liad Ron

Rank: New Member

Posts: 8

Join Date: April 10, 2012

Recent Posts

Hi again,
We have a few more questions:
We downloaded JSF2 Portlet and trying to compare the structure of the demo project with
our project (Decision Center).
1. we have found some differences in the web.xml file and trying to understand how our
web.xml file in our project should look like. In the demo we saw:
1    <!-- The following listener is required for deployment on JBoss AS. See FACES-183 for more info. -->
2    <!--
3    <listener>
4        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
5    </listener>

We are using Tomcat server and not JBoss, so what should we use as our listner class?

2. Faces_Config.xml is different from our file. In the demo we found:
1    <lifecycle>
2        <phase-listener>com.liferay.faces.bridge.lifecycle.BridgeDebugPhaseListener</phase-listener>
3    </lifecycle>

and in our file we have:
1    <lifecycle>
2        <phase-listener>ilog.rules.teamserver.web.table.TablePhaseListener</phase-listener>
3        <phase-listener>ilog.rules.teamserver.web.tree.taglib.IlrUITreePhaseListener</phase-listener>
4        <phase-listener>ilog.rules.teamserver.web.event.ErrorHandlerPhaseListener</phase-listener>
5        <phase-listener>ilog.rules.teamserver.web.navigation.IlrBackButtonPhaseListener</phase-listener>
6        <phase-listener>ilog.rules.teamserver.web.permalink.IlrPermanentLinkPhaseListener</phase-listener>
7        <phase-listener>ilog.rules.teamserver.web.event.IlrShortcutsPhaseListener</phase-listener>
8    </lifecycle>

should we add our phases to the exsiting one or not?

3. Our project has a file called: skin-faces-config.xml. Should we change anything in it?

Thanks,
Liad Ron.
David H Nebinger
RE: Hosting JSF application as a portlet in LifeRay
April 11, 2012 6:27 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7238

Join Date: September 1, 2006

Recent Posts

1. That listener doesn't have anything to do with jboss vs tomcat.

Just from the package name I can see it is a config listener for sun's faces, probably 1.2., and that has nothing to do with the container.

Use the listener as-is.

2. Phase listeners are used within the implementation code of the portlet. Clearly the first portlet needs the BridgeDebugPhaseListener, while the second uses the list of listeners. The implementation determines which listeners are needed, you don't just start adding them to a project because someone else listed them in their config.

3. Again, this faces config file has something in it the portlet depends upon, but the dependency is within the code itself. If there's no dependency on the items in the skin-faces-context, then the file is unnecessary.
Neil Griffin
RE: Hosting JSF application as a portlet in LifeRay
April 11, 2012 7:52 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

I agree with David. I would just add that explicitly registering com.sun.faces.config.ConfigureListener is not necessary with Tomcat. See http://stackoverflow.com/questions/8716352/the-listener-com-sun-faces-config-configurelistener-is-already-configured-for
Neil Griffin
RE: Hosting JSF application as a portlet in LifeRay
May 9, 2012 9:17 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2179

Join Date: July 26, 2005

Recent Posts

FYI, WSRP is now supported in Liferay Portal. See: FACES-1181 for more info.