A portlet is a component of a portal application. It is a part of the portal. Several portlets combined make a portal application.

If you are new to Liferay check “how to setup Liferay portal” on windows.

This is a simple tutorial about how to create a simple portlet using Liferay Developer Studio. The following are the steps.

  • Open LDS and Navigate to File > New > Liferay Plugin Project, as shown below:
LiferayPortlet1
  • Add the Project Name in the field, set up the SDK location and run time environment.
  • Please note that we have selected the checkbox Include sample code below. This will add a sample JSP page and other required portlet configurations.
  • We can add new portlets to the plugin project from New > Liferay Portlet option.
  • A Liferay plugin project can contain multiple portlets.
LiferayPortlet2
  • Plugin SDK can be configured by adding plugin path from plugin SDK configuration window as shown below and click on the OK button.
LiferayPortlet3
  • Run time environment can be set up using Liferay Runtime configuration window as follows:
LiferayPortlet4.png
  • Select the version of the server and click on the Next button. Select the tomcat path as shown below and click finish button.
LiferayPortlet5
  • Click on next button of portlet configuration window and select Liferay MVC radio button and click on the finish as shown:
LiferayPortlet6.png
  • The Portlet is now created. It contains the following folder structure:
LiferayPortlet7
  • Deploy the portlet by Right Click on portlet > Liferay > SDK > direct-deploy/deploy as shown below:
LiferayPortlet8.png
  • Add the portlet from the Add button of Liferay application page as shown:
LiferayPortlet9.png

Note: Version details: Liferay version 6.2 + Apache Tomcat 7 server.

You may also interested in