setup liferay development environment
- Liferay server
- This is the place where Liferay and all plugins are deployed and can be accessed.
- Liferay SDK
- This is where we develop various plugin projects like portlets, hooks, themes, layouts, Ext and web plugins.
Liferay Server Setup
- Community Edition (CE).
- Enterprise Edition (EE).
Community version is freely available.We will go through two process to setup fully working liferay environment.
1) Setting up Server (ex. Liferay-tomcat bundle)
2) Setting up Plugin-SDK (Will be used to develop custom plugins like portlets, theme, hook, layout and Extension environment).
Further there are two way to do setup of liferay portal (Server)
1) With the help of WAR package
- In this type, we can download WAR file of liferay and we can install on various servers like Tomcat, Jboss etc.
2) With the help of Bundle (Bundle is the pre-installed liferay on server like tomcat).
The easiest way to jump into liferay developmen is to use liferay-tomcat bundle.
Liferay community portal(Bundle) can be downloaded from following link
Just download and un-zip the tomcat bundle from above link into your local machine’s drive (ex. c:/project). After un-zip the folder name will be something like liferay-portal-6.0-XX-sp2. (This is sample format. XX will be either ce or ee).
The folder structure of bundle will be as blow.
data Folder :-
Liferay-Tomcat bundle comes with embedded HSQL database. data folder shown in screenshot contains the data file of HSQL database along with other data like document library’s folder to store document, lucene index folder etc.
This folder is the place where we can put pluggin’s WAR files and liferay will automatically start deploying on server.
Contains log information.
tomcat-6.0.32 (Version may be very) Folder:-
This is actual tomcat server folder.
This is properties file which provide facility to define our own custom properties. This properties can be accessible to all plugins (including portlets, theme,hook,ext and theme).
We also can override properties that is provided by liferay out of the box. (the properties file provided by liferay is portal.properties while this properties file is portal-ext.properties means this is the extension of what liferay is providing. If we don’t mentioned any properties in portal-ext file then all properties defined in portal.properties will be available. We only have to define the properties which we want to override). We also can define our own custom properties in portal-ext file.
Liferay Plugin SDK Setup
First download plugin SDK from following url
Select PluginSDK and click download button from community section (select Plugin-SDK at the last in drop down). This is part of liferay development environment setup.
Next you need to create folder like liferay-plugins-sdk-6.0.6 and unzip the plugin sdk zip file.
We need to create one property file with specific name. The format of name will be as below
E.g. if user name is nilang.patel then property file name will be build.nilang.patel.properties.
(to get logged in user name type echo %username% in command prompt).
paste the following properties in this property file
app.server.type = tomcat
app.server.dir = D:\Project\Project1\liferay-portal-6.0.6\tomcat-6.0.32
app.server.deploy.dir = D:\Project\Project1\liferay-portal-6.0.6\tomcat-6.0.32\webapps
app.server.lib.global.dir = D:\Project\Project1\liferay-portal-6.0.6\tomcat-6.0.32\lib\ext
app.server.portal.dir = D:\Project\Project1\liferay-portal-6.0.6\tomcat-6.0.32\webapps\ROOT
This file pointing the path of liferay server. Liferay plugins (like portlets, hooks, theme, etc) referring classes present with liferay tomcat bundle. Therefore pointing out the server path with above properties will help to compile these plugins with these API dependencies.
When we build any plugin WAR from Plugin-SDK, it will place WAR file inside deploy folder of server. The whole process will be as below.
Plugins like Portlets,themes,layouts hooks etc. developed with plugin SDK may only import classes from portal-service.jar and other jar in lib folder of that plugin but will not allow to access classes from portal-impl.jar file which contains implementation of core features as shown in below diagram.
Finally it is done. Now you can start Liferay development.