Introduction to Liferay (for New Developers)

This article needs updating. For more information, see Wiki - Need Updating.

If you do not plan on doing development using Liferay (creating custom portlets, customizing the existing Liferay system, etc.), and instead plan to use the existing features of Liferay unmodified, you may instead be more interested in Introduction to Liferay (for New Users).

Key Technologies #

These technologies are used in Liferay (the more you know about these, the easier Liferay is):

  • JSR 286 Portlet Specification 2.0 http://jcp.org/aboutJava/communityprocess/final/jsr286/index.html
  • J2EE (Servlets and .JSPs, optionally EJBs if transactions needed)
  • Tomcat or JBoss (or numerous other application servers) http://tomcat.apache.org/
  • Any SQL database (mySQL or numerous other SQL databases)
  • Struts + Tiles http://struts.apache.org/ (while Liferay supports a variety of presentation technologies, the pre-packaged portlets are developed using JSP and Struts)
  • Velocity http://velocity.apache.org/
  • EasyConf http://easyconf.sourceforge.net/
  • Hibernate http://www.hibernate.org/
  • Spring http://www.springframework.org/

Setting up a development environment #

There are two major parts to the Liferay system: the "Portal Container" itself (referred to as the kernel), and the individual portlets (sometimes referred to as "plug-ins"). When developing for Liferay, you can set up your environment in a variety of ways (see also "platform specific tips" below):

Liferay v. >= 6

Last updated: 18-06-2010

There are several plugin types that you can use:

  1. Themes - new look for the portal
  2. Portlets - your own applications
  3. Layouts - templates for defining portlets' placement on the page
  4. Hooks - lightweight changes of the portal
  5. Web Plugin - simple way how to integrate existing web application using IFrame Portlet
  6. Ext Plugin - extending the portal core

Thus development can be divided into 2 ways:

  1. Creating new functionality - you can use Themes, Layout Template, Portlets and Webs, see Plugins SDK wiki page
  2. Extending portal - using Portal Hook Plugins and Ext Plugin

There is Liferay Plugins SDK which covers all types of plugins you can deploy into the portal. The Plugins SDK use Ant for building the plugins into WAR files, which can be easily deployed.

For development using Maven please see Liferay Maven SDK - innovation for the Liferay v. 6.

You can also create all types of plugins using your favorite IDE. All these plugins are just standard web applications with its proprietary configuration files.

Liferay v. > 4.3.3 <= 5.2.3

Needs to be covered too!

Liferay v. <= 4.3.3

Last updated: 11-04-2007 Covers version: 4.3.3

  • Develop "hot deployable" portlets that are stand-alone .WAR files and can be deployed on any free-standing Liferay distribution. For more information, see:

Platform specific tips #

IDE specific tips #

Customizing and Extending Liferay #

  • The "look and feel" of the portlets and the portal in general is the responsibility of the Liferay Theme system. See Themes and Layout Template
  • The words and phrases displayed throughout the Liferay system can be customized using Liferay's support for language customizations. See Language/display customization or Languagedisplay customization
  • JSPs, some entries from portal.properties and language bundles can be changed through Hooks. Hooks also enables definition of event handlers and model listeners. Additionally, there is support for over-defining Spring beans (from Liferay v. 6). See Portal Hook Plugins
  • Extension Environment (EXT) was used to change the portal core. For Liferay 6 is EXT deprecated and you can use Ext Plugin.

Developing portlets #

Liferay supports a wide variety of presentation technologies. You can develop your portlets using JSP+Struts, JSF (both JSP and Facelets), as well as many others. Sample portlets and source code can be found at the Official Plugs download page. The latest sources for these samples, as well as newer presentation technology samples can found in the SVN repository in the plugins/trunk/portlets sub-directory of the lportal project. For more information on the repository, see SourceForge, and Liferay's SVN FishEye.

Sources of documentation #

  • The XML DTDs for many of the portal files (like liferay-portlet.xml, liferay-display.xml, liferay-look-and-feel.xml, etc.) contain a wealth of human readable documentation. You can find the DTDs in the source tree under /portal/definitions. They also appear in the binary distribution on a deployed server in the webapps/ROOT/dtd directory (that is the location for Tomcat).
  • The file "portal.properties" contains many settings that you can customize in your portal deployment. See the file /portal/portal-impl/classes/portal.properties
  • The file "system.properties" contains many settings that you can customize in your portal deployment. See the file /portal/portal-impl/classes/system.properties
  1. Portal SVN
  2. Plugins SVN

Developer tips and tricks #

Other developer resources #

0 Attachments
57883 Views
Average (2 Votes)
Comments

Showing 0 Comments