PrimeFaces Portlet Tutorial
For this tutorial, I am using:
- Liferay IDE 188.8.131.52311051611-m2
- Liferay Portal 6.2.0 ga1 bundled with Tomcat 7.0.42
- 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.
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 #