In this Blog, I will post concise instructions to setup and develop JSF based portlets with ICEfaces and Liferay using NetBeans.
The steps outlined in this Blog should be followed in sequence. I will try to make the steps very straightforward, explicit, and easy to follow. To help get you up-and-running as quickly as possible, I will not offer too many explanations or wordy comments for each of the steps.
Background
Initially, I spent a great deal of time trying to install the Liferay portlet development environment. I tried the Liferay SDK and the EXT environment. I found that the Liferay documentation was outdated in many cases, the steps were not explicitly clear, and the organization of the documentation made it difficult to find the right instructions for someone who simply wanted to get started developing portlets for Liferay.
The most surprising thing I discovered, when I had finally built and deployed my first ICEfaces portelt into Liferay, was that I didn't even need the Liferay EXT environment or the Liferay SDK!
IDE
After much trial and error with Eclipse, I found that NetBeans has a very straightforward and effortless portal server integration. Portal servers can be started and stopped within NetBeans. Also, you can do all of your work in the NetBeans IDE and don't have to execute command line scripts to code Liferay portelts. In contrast, I found that Eclipse + Liferay integration required me to pull in build scripts and dependencies form the EXT environment, and I never could get past missing library references within the IDE. As a result of this experience, my initial posts will focus on using NetBeans. (At some point in the future I will give Eclipse another try, since it seems others have had success with this environment, and I will post step-by-step instructions for Eclipse at that time).
JSF
In addition to using Liferay, I wanted to use JSF to create portlets, because JSF provides a rich tag library for building user interfaces and has a very nice MVC (Model View Controller) paradigm, which cleanly separates the presentation layer (JSFs) from the business layer (Managed Beans).
Since SUN has abandoned Woodstock, they have recommended migrating to ICEfaces. Yet again, I was faced with the lack of clear documentation on creating JSF (or ICEfaces) based portlets for Liferay. ICEfaces facilitates developing portlets through a NetBeans / Liferay plugin, and the ICEfaces framework does not rquire a JSF/Portlet bridge, like other JSF/portlet implentations.
Platform
The software versions used in developing these instructions are as follows. I expect future versions of the software to be backward compatible, so these instructions should be usable for some time. I will attempt to update these instructions as newer versions of the software are released.
- SUN JDK 1.6.0_16
- Liferay 5.2.3 for Tomcat 6.0.18
- Liferay 5.2.3 for Glassfish 3 (optional)
- Tomcat 6.0.20 (optional)
- NetBeans 6.7.1
- NetBeans PortalPack 3.0.2
- ICEfaces 1.8.2
The development hardware I am using is a 64 Bit Intel CPU with 4GB, running Kubuntu 9.04 x64 Linux (
http://www.kubuntu.org/). I'm sure these instructions will work for other hardware and Linux distributions, as well. For Windows installations, the sequence of steps and downloads needed are probably accurate, but you will have to use alternatives for some of the Linux commands I have listed. (For example, in Windows, use Notepad to edit files, instead of the Linux
sed "search and replace" command; use WinZip to extract files; and ignore the
chown and
chmod commands that set Linux file permissions and ownership).
ConventionsFinally, to save save time and help list required steps concisely, I have adopted the following conventions in my posts...
$...
- Execute something on the command-line.
- For example, $ ls
- Of course, you should not copy the command prompt "$" when cutting/pasting these commands
| (pipe)...
- Separates left mouse button click actions.Whenever a right mouse click is necessary, it is explicitly stated.
- For example, K | System Settings | Advanced | Login Manager | Cancel means click on the K menu, then select System Settings, then click on the Advanced tab, then click on the Login Manager icon, then click on the Cancel button.
DOWNLOAD:...
- The file you should download
FROM URL:...
- Where you should download the file from