Liferay Portlet

Lets start with creating a demo portlet. Follow this link. If you hit any error during creation of portlet like Run-time JRE in invalid (snap).Just delete the server from work-space and create it again.

Note : Create your portlet inside the Plugin SDK folder. As per my setup  “E:liferayliferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760portlets” this is the folder to place portlet code,otherwise you won’t able deploy with ant build script. 

Deploying Portlet into Liferay.

==> You can manually deploy using the information provided at this link

==> Deploying portlet by using build script. read below

  • Right Click on build script and run the “Deploy Task”
  • Unfortunately you may hit an error. saying “Task cannot continue because ECJ is not installed“. (snap) .Interesting lets fix it.
  1. You simply need to put the ecj.jar file into the lib directory of the Ant plugin directory in your Eclipse install
  2. Go to Window> Preferences> Ant> Runtime > Classpath  (snap)
  3. Add External jar  (E:liferayliferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760libecj.jar) , i.e. ecj.jar located under your plugin sdk folder.
  4. Now Re-run the build script 🙂

Adding Your Portlet to Liferay

Login to liferay account (http://lcoahost:8080), remove all existing portlets and add yours (how to add).

Here is how it looks.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: