Showing posts with label liferay setup. Show all posts
Showing posts with label liferay setup. Show all posts

Friday, February 7, 2014

Liferay Plugins Development Introduction

Introduction:

Liferay have very good development SDK to develop applications in liferay. This development SDK is called Plugins SDK.

What is Liferay Plugins SDK?

Liferay Plugins SDK is developer kit to develop liferay applications. This Plugins SDK provide set of packages by using this we will develop liferay application

We will use Plugins SDK for customize liferay portal, modify liferay source code and add new applications in liferay. For doing such thing liferay came up with different Plugins i.e. Hook, Theme, Portlet, Layout and Ext and each one has its own ability from which we can do many things in liferay portal development. Here each piece is called Plugin

What is Plugin?

A Plugin is small component which will give additional support to core component. These components are we can use as plug and play.

Here we will have one core component and we will use Plugins to add additional ability or support to core component.

In liferay we can say liferay portal is core component and we will use hook, portlet, theme and layout are Plugins and it will add addition ability to liferay portal to meet our requirement.

Why Liferay Plugins SDK?

Liferay Plugins SDK will provide you platform to develop Plugins for liferay portal. We all know in software development we need Standard Development Kit to develop new applications. We will use Java JDK to develop java application similarly we will use Liferay SDK to develop Liferay Applications.

What Liferay Plugins SDK Contains?

Plugins SDK contains set of java classes and dependence jar files. We will use these java classes and jar file to create Liferay Plugins.

This Plugins SDK will provide feature like compile, package and deploy the applications into servers.

What is Default Tool Liferay Plugins SDK Use to Build Application?

Liferay Plugins SDK use ANT tool to build applications and build nothing but compile, packaging and deploy into server. Liferay Plugin SDK can support MAVEN tool to build application.

What are the minimum things we required to develop Liferay Plugins?

To develop liferay Plugins we need following things
  • Liferay Plugins SDK
  • ANT Tool
  • Liferay Portal Server
  • Database (optional)

Liferay Plugins SDK

Liferay Plugin Development Kit we can download from Liferay web site. We have different version of Plugins SDK.

The following is liferay Plugins download URL



Liferay have different Plugins for different purpose liferay have Portlet, Theme, Hook, Layout and EXT Plugins.

The following is screen shows you different Plugins in liferay which comes with Liferay Plugins SDK



ANT Tool

ANT is build tool used to compile, package and deploy the application.
Each application have one file called build.xml file there we will define our application build plan like compile, packaging and deploy. Each build file has many tasks and we call tasks as ant targets.

We have different targets like compile, jar, and war and deploy. Each one has its own meaning so that we will use build.xml file to define our application deployment process.

In liferay when we develop liferay Plugins then each Plugin already have its own build file so we need not write any special build.xml file to build or deploy the liferay Plugins. This is very convenient so that we can simple use some targets to deploy the application like compile, deploy.

The following is ANT download place


Note:

Before start liferay Plugins development we need to install ANT tool in our system and we need set ANT_HOME and we need add ANT path in system path variable.

Liferay Portal Server

Liferay Portal Server is bundle which contains application server and liferay portal which ready use.

This is simple bundle and liferay portal already deployed in application server so that we simple start the server, as soon as server starts liferay portal will be ready. This is liferay core portal.
Whatever the liferay Plugins we developed these will be deployed into liferay portal server and these deployed Plugins will give more ability or additional features to core liferay portal.

Like we may change look and feel, we may add new feature and we may customize. All these things will be done by liferay Plugins.

The following is liferay portal and application server bundle download location


Note:

 Liferay Portal is web application so it need application server. We simple get bundle and extract bundle then start server you liferay portal will be ready.

The following is tutorial how to setup liferay portal.


Database (optional)

In the development data base is optional liferay portal server which include HSQL database. So as soon as liferay start it will connect to HSQL database and all the data and tables will be available in HSQL database.

Liferay Plugin Development Setups

We have many ways to set up Liferay Plugins Development Environments
The following are the ways
  1. LiferayPlugins Development Using ANT Tool
  2. LiferayPlugins Development Using Liferay IDE with Eclipse.
  3. Liferay Plugin Development Using Liferay Developer Studio
  4. Liferay Plugin Development Using MAVEN


In this set up we will use only ANT tool develop liferay Plugins. We can build and deploy Plugins using ANT tool.

The following is tutorial setup development environment using ANT tool


Liferay Community has developed Liferay IDE this is eclipse Plugin so that we can use with eclipse to develop Plugins. This is free software.

The following is tutorial setup development environment using Liferay IDE with eclipse


Liferay Plugin Development Using Liferay Developer Studio

Liferay have developed Liferay Developer Studio is kind of IDE form this we can develop liferay Plugins. This is Enterprise Tool so we need purchase from liferay.

The following is more information about Liferay Developer Studio


Liferay Plugin Development Using MAVEN

We can build application using MAVEN tool this is like ANT tool uses to build applications. Liferay have maven support so we can maven also.

The following is more information about Liferay MAVEN Support


Note:

For Liferay Community Edition Liferay Developers I can suggest Liferay IDE and MAVEN Development Environments are best choices.

Author

Wednesday, December 11, 2013

Liferay 6.2 Portal Installation



Environment: Windows,Tomcat Server and Liferay 6.2CE with MySQL

Note:

 I have used windows 7 operating system .you can apply same steps to any environment. Only change in setting environment variables and download software based on OS remaining all are same for any operating system.

Required Steps

  1. Install JDK and setting required environment variables (JAVA_HOME, path)
  2. Download MySQL server and Start MySQL server
  3. Download HeidiSQL and install(Optional)
  4. Connecting to MySQL server and create Database for Liferay
  5. Download Liferay 6.2 Tomcat Bundles
  6. Configure database setting in portal-ext.properties file and place properties file in Liferay Home directory.
  7. Start tomcat server and access Liferay Portal
  8. Complete required basic configurations for liferay portal


Install JDK and setting required environment variables (JAVA_HOME, path)

We need to install JDK in our system and we need to set java path environment variables
Down load java SDK 1.6 from following location 



  

Setting required environment variables

Go to your computer properties 





Accessing System environment variables from following screen.




Creating JAVA_HOME variable as follows

Variable Name: JAVA_HOME
Variable Value: The path where your java installed means JDK home directory

 The following screen shows you creating JAVA_HOME



Edith system path variable and specify the java path

In the existed system path variable add java path value (%JAVA_HOME%/bin)

In the System variables block you can see path variable, select path variable and click on edit button.




Add java path as follows

Once click on edit in variable value you can see existed path variable.

You can add   ;%JAVA_HOME%/bin;   to existed path value. Here each value is separated by semicolon.

This specify the java path which will used by java applications and servers.

The following diagram shows edit the system path variable





Download MySQL server and Start MySQL server

Download MySQL sever 5.1 from following location.





 
Extract the zip file in your desired drive

Start MySQL database server

               Open command prompt and go MySQL bin directory (mysql-5.1.70-winx64/bin) then use following command to start MySQL database server


mysqld --console


Example:

The following is command prompt it start server and I am showing last line which indicate data base server started successfully.




Download HeidiSQL and install

Download HeidiSQL to access MySQL server databases. This is very good user interface to access database and modifies the data base tables.

Download HeidiSQL from following location 


The following screen shows you download page of HeidiSQL



 
Double click on exe file and follow the installation steps to complete the successful installation.

HeidiSQL is data base browser we can manage database. Its very light weight and user friendly.

Connecting to MySQL server and create Database for Liferay

We can do this in two ways 

  1.   Connecting MySQL from HeidiSQL and create Liferay Data base 
  2.  Connecting to MySQL from MS DOS command prompt and create data base for liferay


Connecting MySQL from HeidiSQL and create Liferay Data base

Once successful installation of HeidiSQL, go to windows start and click on HeidiSQL.




In Login window enter following details and connect to MySQL server.

Click on New and enter the following details

Host Name:  127.0.0.1  OR  localhost
User: root
Password: nothing it’s empty




Once you successfully login you can see databases view as follows



 


Create lportal database for Lifera portal. Right click on root node and select create new database





Enter database name lportal and click on Ok then database will be created




Connecting to MySQL from MS DOS command prompt and create data base for liferay

This is another way to connecting to MySQL server with windows command prompt

Open MS Dos command prompt from your system

Go to MySQL server bin directory from command prompt and enter following command and press enter

 It will ask password no need to enter password (because our password is empty) and again press enter 


mysql -u root –p


The following screen shows you admin login into MySQL server



Now create data base using following command and press enter then loprtal data base will be created.


create database lportal;


Note:

Don’t forget semicolon end of the above SQL statement.



Download Liferay 6.2 Tomcat bundle.

Download Liferay 6.2 Tomcat bundle from following location 







Now extract the Liferay 6.2 Tomcat Bundle Zip file in your desired location of your system

Once you extract the zip file go to extracted folder then you can see following directories and files.



Note: 

This extracted directory is called Liferay Home

Configure database setting in portal-ext.properties file and place properties file in Liferay Home directory 

Once you extracted the zip file then you can see liferay-potal-6.2.0-ce-rc4 directory this is called Liferay Home directory or we can say the directory which contains tomcat server is called Liferay Home directory

Create one file called portal-ext.properties file in Lifeay Home Directory and add following MySQL data base configurations.

    
jdbc.default.driverClassName=com.mysql.jdbc.Driver
jdbc.default.url=jdbc:mysql://localhost:3306/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false
jdbc.default.username=root
jdbc.default.password=


Note: 

Here our data base name is lportal already we created in previous step. You can create any database name of your choice but you need specify in portal-ext.properties file.

The following screen shows you portal-ext.properties file in Liferay Home directory



Start Tomcat server and access Liferay Portal

Go to Liferay Home and you can find tomcat (tomcat-7.0.40) directory

Open tomcat directory in side you can find bin directory

 Open bin directory double click on startup.bat then tomcat server will be started.

The following screen shows tomcat bin directory startup.bat   
  



Another way start tomcat server from command prompt

Open command prompt and in command line go to tomcat bin directory enter startup.bat and press enter. Then tomcat server will be started.

As soon as you started the tomcat server from command prompt you can see the Environment variables information.

The following screen shows you tomcat server start from command prompt



 As soon as you double click on startup.bat or you start tomcat from command prompt either way you can see following tomcat console in other window. It will show the log information of liferay portal.

When you see the server startup in some seconds then it indicates liferay application is started
The following screen shows server is started.



Access Liferay Portal

Use following URL in browser address bar to access liferay portal


Note:

Tomcat server default port is 8080 make sure no other application should not run in same port otherwise you can see address bind exception in console.

Complete required basic configurations for liferay portal

Once access Liferay portal from above URL it will show basic configuration page and we need to fill information like

Portal Name: anything your choice
Default Language: your choice from select box
Admin First Name: anything your choice
Admin Last Name: anything your choice
Admin Email: anything your choice (default is test@liferay.com)
In data base section you can find our lportal congigurations

After fill the information click on Finish Configuration button it will take few seconds to store configurations.

Note: 

Remember email which you have given, this is admin email for next login.

The following is liferay portal basic configuration page




As soon as you finished the basic configuration these configuration stored in portal-setup-wizard.properties this file available in Liferay Home directory

The following screen shows you portal-setup-wizard.properties path 



Now go to your portal by clicking on Go to My Portal button then you will get Liferay Terms and condition page simple Click on I Agree button 

The following screen shows you liferay terms and condition page



As soon as you click on I Agree button then it will ask the password for administrator

The following screen ask you the password for administrator




Note:

 Remember Admin email and password these are portal administrator credentials for next time login. Portal administrator has full control over the portal.

Once you done with save the password then it will go to password remainder screen. You can select any question and give the value 

The following is Password Reminder web page



After finish all above configuration then you can see portal welcome page now your liferay portal is ready and you can enjoy exploring the liferay portal.

The following is liferay portal welcome page

Go through following liferay user guide to do more things in your portal
https://www.liferay.com/documentation/liferay-portal/6.2/user-guide



Important points


We have used liferay tomcat bundle portal we can get many liferay portal with different servers.



When we start the server first time it will create many tables and populated with default data. 

This information you can see in server console at time of liferay starting.



We can apply these steps for any environment only difference is we need to download compatible software’s.
 


Author
Meera Prince



Recent Posts

Recent Posts Widget

Popular Posts