Foren

Hosting JSF application as a portlet in LifeRay

Liad Ron, geändert vor 12 Jahren.

Hosting JSF application as a portlet in LifeRay

New Member Beiträge: 8 Beitrittsdatum: 10.04.12 Neueste Beiträge
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.
thumbnail
Neil Griffin, geändert vor 12 Jahren.

RE: Hosting JSF application as a portlet in LifeRay

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Hosting JSF application as a portlet in LifeRay

New Member Beiträge: 8 Beitrittsdatum: 10.04.12 Neueste Beiträge
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.
thumbnail
Neil Griffin, geändert vor 12 Jahren.

RE: Hosting JSF application as a portlet in LifeRay

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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, geändert vor 12 Jahren.

RE: Hosting JSF application as a portlet in LifeRay

New Member Beiträge: 8 Beitrittsdatum: 10.04.12 Neueste Beiträge
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:
	<!-- The following listener is required for deployment on JBoss AS. See FACES-183 for more info. -->
	<!--
	<listener>
		<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
	</listener>
</code></pre><br />We are using Tomcat server and not JBoss, so what should we use as our listner class?<br /><br />2. Faces_Config.xml is different from our file. In the demo we found:<br /><pre><code>	<lifecycle>
		<phase-listener>com.liferay.faces.bridge.lifecycle.BridgeDebugPhaseListener</phase-listener>
	</lifecycle>
</code></pre><br />and in our file we have:<br /><pre><code>	<lifecycle>
		<phase-listener>ilog.rules.teamserver.web.table.TablePhaseListener</phase-listener>
		<phase-listener>ilog.rules.teamserver.web.tree.taglib.IlrUITreePhaseListener</phase-listener>
		<phase-listener>ilog.rules.teamserver.web.event.ErrorHandlerPhaseListener</phase-listener>
		<phase-listener>ilog.rules.teamserver.web.navigation.IlrBackButtonPhaseListener</phase-listener>
		<phase-listener>ilog.rules.teamserver.web.permalink.IlrPermanentLinkPhaseListener</phase-listener>
		<phase-listener>ilog.rules.teamserver.web.event.IlrShortcutsPhaseListener</phase-listener>
	</lifecycle>
</code></pre> <br />should we add our phases to the exsiting one or not?<br /><br />3. Our project has a file called: skin-faces-config.xml. Should we change anything in it?<br /><br />Thanks,<br />Liad Ron.-->
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: Hosting JSF application as a portlet in LifeRay

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
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.
thumbnail
Neil Griffin, geändert vor 12 Jahren.

RE: Hosting JSF application as a portlet in LifeRay

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
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
thumbnail
Neil Griffin, geändert vor 11 Jahren.

RE: Hosting JSF application as a portlet in LifeRay

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
FYI, WSRP is now supported in Liferay Portal. See: FACES-1181 for more info.