« Back to Liferay Faces

PrimeFaces Portlet Tutorial

Requirements:

For this tutorial, I am using:

  • Liferay IDE 2.0.0.201311051611-m2
  • Liferay Portal 6.2.0 ga1 bundled with Tomcat 7.0.42
  • liferay-plugins-sdk-6.2.0

Assumptions

  • You have already configured liferay portal instance and plugins SDK in your workspace
  • You have already completed and understand the basic ideas from following the steps in the development guide
    • Installing Liferay IDE
    • Setting Up the Liferay Plugins SDK
    • Liferay Portal Runtime and Server Setup
    • Launching and Testing Your Liferay Server

.

Step 1 - Create a Portlet Project #

File -> New -> Liferay Plugin Project

Enter the name of your portlet project, maybe something like "Primefaces-portlet"

Select Portlet -> Next

Select JSF 2 -> Next

Select PrimeFaces -> Finish

.

This could be a good time to add an additional repository to your ivy-settings.xml in your plugins-sdk if you need artifacts that are not in the default set of repositories that come configured in the plugins-sdk, such as sonatype's snapshot repository.

Step 2 - Get some coding done #

Yay!  Now it is time to work on a portlet page, and maybe add some content.  Add a primefaces calendar in the Primefaces-portlet/docroot/views/view.xhtml file under the hello world message like this:

<br />
<br />
<h:form>
   <p:calendar></p:calendar>
</h:form>

.

Step 3 - deploy your portlet #

Deploy the Primefaces portlet to your instance of Liferay Portal in one of the following two ways:

1) Drag the project to the running Liferay Portal Server entry in the "Servers" tab of Eclipse servers_tab

You may want to stop and start the server at this point.  I did have to do this once when running through this tutorial.

    or

2) from the command line inside your plugins SDK directory run the "ant war" command, and then copy the resulting war into the Liferay Portal deploy directory.

.

Step 4 - Add your portlet to a page #

.

Step 5 - Look at what you've done #

12 Attachments
32490 Views
Average (2 Votes)
The average rating is 5.0 stars out of 5.
Comments
Threaded Replies Author Date
Hi, this may help someone... Filipe C November 14, 2012 6:24 AM
Hi, Thanks for your contribution. Excellent... Vishal Panchal February 18, 2013 10:47 PM
hi tnx for Wiki .. I can fix "Red X " , but my... ami sa February 6, 2014 5:12 AM

Hi,
this may help someone
http://issues.liferay.com/browse/LPS-29049
Posted on 11/14/12 6:24 AM.
Hi,

Thanks for your contribution.
Excellent tutorial.

Regards,
Vishal
Posted on 2/18/13 10:47 PM.
hi
tnx for Wiki ..
I can fix "Red X " , but my portlet show empty content , dont show anything !!!
plz help emoticon
Posted on 2/6/14 5:12 AM.