Showing posts with label Layout. Show all posts
Showing posts with label Layout. 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

Monday, January 13, 2014

Introduction to Liferay Portal

Liferay is Portlet technology which follows the JSR 168 and JSR 286 Compliants.

Liferay is very good open source for portlet technology have very good working group and community.

Portlet technology is similar to servlet technology but portlet is small part of dynamic content in web page.

In normal web application when we send request then server serve the response to the client or browser. Here entire page will be served by one response.

Coming to portlet technology in one web page there may be many portlets and each portlet have its own request and response.

Each portlet can send request and get the response from server then the response belongs to only the portlet which send the request.

We can say portlet is small fragment of dynamic content in the page. Page is aggregation of multiple fragments of dynamic content and each dynamic fragment is managed by one portlet in the web page.

In one page we can accommodate multiple portlet and each portlet is responsible for generate dynamic content for page. Multiple portlet together generate the dynamic content and all the portlet dynamic content aggregation will be generated as one web page.


Liferay

Liferay is implemented portlet technology and it exposed as opens source.

Liferay portlet technology  follows the JSR 168 and JSR 286 Compliant which was given by java community people. Portlet technology should follow the JSR portlet specification.

Like that liferay have implemented portlet specification and give to us as open source. Anybody can get source code and they can customize and add new features to Liferay portal.

Liferay portal consist set of portlets and ready to build web application and we can also develop new portlet application using liferay. Liferay have its own frame work and standards to add new feature and customize existed portal.

Liferay have given two kinds of portal

  1. Liferay Enterprise Edition
  2. Liferay Community Edition


Liferay Enterprise Edition:

Liferay Enter Price Edition is paid portal which have enterprise license from liferay Inc. Liferay Enter Price Edition  have support from Liferay Inc and it’s have more benefits than Liferay Community Edition version.

Liferay Community Edition

Liferay Community Edition is available to public and anybody can get source code and then can add or customize. Very good working group and community people working for this. We can also contribute our effort to liferay community.

The following is Difference between CE and EE


Major Liferay Versions:


Liferay 6.2.x CE&EE, Liferay 6.1.x CE&EE, Liferay 6.0.x CE&EE and Liferay 5.2.x CE&EE


Features of Liferay
  • Liferay is ready to use web application
  • Liferay have many portlet to full fill dynamic web application functionality
  • Very Good Enterprise Web Content Management System
  • Sites, Organization and User Groups
  • Social Network Portlet
  • Document Library Management
  • Collaboration (Blogs, Wikis and Forums)
  •  Service Oriented Architecture Support.
  • Dynamic Look and Feel from Themes
  • Changing page layouts
  • Good Portal Administration User Interface.
  • Roles and Permission System
  • Easy Customization and Development
  • Support Many Integrations
  • Different Application Servers Support.
  • Device based Page View
  • Liferay Market Place

Liferay is ready to use web application

Liferay already is web application so that simple we can download and deploy in any machines. It’s ready to use application. Once we deploy we can directly.

The following tutorial for setup liferay


Liferay have many portlet to full fill dynamic web application functionality

Liferay have given many portlet to  build dynamic web application they have give more than 40 portlet in source code along with that we can also get many portlets from liferay market place.
Liferay market place is place where we get many real time portlets to use in our liferay web application. There we can get CE and EE portlet. Simple we can down lad and deploy in our liferay portal.

The following are links to get portlets



Very Good Enterprise Web Content Management System

 Web application consists of many web pages. Each web pages its own design and content. In real world application to manage content in application people came up with Web Content Management Systems. There are many web content management systems in market and liferay also have very good content management support. With this feature we can create web content, design content and publish content.

The WCM provide content management, content creation and content publishing.
Liferay have its own great feature that is called structures and templates from which we can design content without knowledge of CSS and html.

Admin will provide structures and templates by using that anyone can add web content without knowledge of CSS and HTML.

The following is information about liferay web content management


Sites, Organization and User Groups

Liferay has given sites, organization and User Groups. Based on our requirement we can take any one, so that we will get some generic feature to our application.
The following is link to get more about Sites and Organization


Social Network Portlet

Liferay have given many social networking portlet so that we can build social network web sites. These portlet have functionality to full fill basic needs for social network platforms.

The following is link to get more information


Document Library Management

Document Management system is for managed documents. Liferay have very good document management system winch implemented by Java Content Repository (JCR).
Liferay already integrated with Apache Jackrabbit JCR implementation and we can also integrate with other document management system like Alfresco.

The following is link to get more information



Collaboration (Blogs, Wikis and Forums)

Liferay have support for managing Blogs, Wikis and Forums. They have given portlet to meat wikis, blogs and forum functionality.

The following is link to get more information


Service Oriented Architecture (SOA) Support

Liferay have very good support for SOA. Liferay can support SOAP and REST web service. We can expose liferay services in either ways. In liferay creating web services and accessing web services very easy.

Because of these web services we can integrate liferay portal with other applications. We can also develop mobile application by using these web services. In recent days liferay have came up with mobile SDK to build mobile applications
.
The following are links to get more information.





Dynamic Look and Feel from Themes

Liferay Look and feel can be changes by themes. Themes are very easy way to change liferay look and feel. In liferay we can develop themes very easy.

The following is link to get more information about themes in liferay.


Page layouts

Layout is page template and its portlet arrangement in page. Liferay have many page layouts apart from that we can develop our own layouts.

The following is more information about layouts.


Good Portal Administration User Interface.

Liferay have very good User Interface to manage liferay portal. Manage liferay portal is nothing but manage users, manage sites, manage organization, manage role and permissions and server management.

Liferay have control panel there we can manage all the things

The following is more information about liferay administration control panel.


Roles and Permission System

Liferay have very good permission system which archives from user roles. In liferay each user has role and each role have permissions. Permissions will decide accessibility or scope of user in the website.

Liferay by default have default roles and permission apart from that we can create roles and assign permission to role.

The following links is from more information about Roles and Permissions


Easy Customization and Development

Liferay have its own mechanisms to customize or develop new thing for portal.

Liferay have Plugins SDK from which we can do customization and development.

Liferay have following Plugins SDK to customize and development in liferay portal


Portlets Hook, Themes, Ext and Layouts


The following is link to get more information about Plugins SDK


Support Many Integrations

Liferay support many integration like Service Oriented Integration, SSO Integration, DAP Integration and Learning Management Tools Integration.

The following are links to get more information about integrations



Different Application Servers Support

Liferay have support for many application servers. Liferay releases portal with different application server flavors

The followings is liferay portal available in different servers support


Device based Page View

Liferay can render pages based on devices this is very useful when we show application in mobiles and tablets.

Liferay have responsive theme mechanism based on the device the view will be rendered in browser.

Liferay have Bootstrap theme support and its having own administration panel there we can define device rules. Based on device rules page will be rendered.

The following is link to get more information about liferay view in mobiles


Liferay Market Place

Liferay market place is the liferay applications hub there we can get liferay applications. We can get CE and EE liferay applications. We can also place applications in market place. In market place liferay applications will be packaged and once we download the application we can deploy in portal this task is very easy.

The following is link to get more information about market place


Resources

Liferay official releases and downloads


Liferay CE Public SVN Repository (username: guest & password: guest)


Liferay CE Current working source code


Liferay Documentation

https://www.liferay.com/documentation/liferay-portal/6.2/user-guide

Author

Friday, December 13, 2013

Liferay Portal Development Introduction

Liferay is open source portal which follow JSR 168 and JSR 286 standards.

Liferay development can be achieved from Plugins SDK it is Standard Development Kit for liferay portal.

Liferay Portal already has more components apart form that if we want add anything to existed liferay portal we need to develop Plugins.

To develop Plugins liferay have given Standard Development Kit i.e. called Plugins SDK.
Liferay Portal can categorize into following  parts.

  • Portal Kernel
  • Portal Implementation
  • Portal Services


Portal Kernel:

Portal Kernel is set of java classes and interfaces which is core components of liferay portal. This kernel can available to outside of portal. From this we can add or develop new things to liferay portal, means out of box features we can develop. This kernel inherits from JSR 168 and JSR 286 features.

All classes and interfaces they are packaged in portal-keranl.jar in previous version of liferay, now it is available inside portal-service.jar

Portal Implementation

Portal Implementation is set of Implementation classes which are derived from Liferay kernel specific to liferay portal use. This component designed for liferay portal built in functionality. All these are packaged in portal-impl.jar


Portal Services

Portal services are is database services which interact with liferay database means lportal database. Whenever we want connect to portal database from Plugins we will use this service layer to connect to liferay database.

What is Liferay Portal?

Liferay implemented their own frameworks and component in Portal Implementation layer and database services packaged as portal service layer,  if we combine these two then it will be become Liferay Portal and portal kernel is common.

We can say like follows

Liferay Kernel +Liferay Implementation +Liferay Services=Liferay Portal

To add new components or  to modify exited competent we need liferay support to outside, for this they have given Portal Kernel and Portal services to outside availability means which is available to Plugins.

Liferay packaged Liferay Kernel and Liferay Services in portal-services.jar

What is meaning of outside availability?

It is nothing but make it accessible their jar files to other applications means these jar files available in application servers global class path

In tomcat tomcat/lib/ext this global class path if any jar available in this directory then any liferay plug-in can use this classes and interfaces.

In Jboss  jboss-7.1.1\modules\com\liferay\portal\main

When we look at these directories we can find portal-service.jar file. So we can say this jar can available to any application that is deployed in server.


Note:

These directories we can see only in liferay supported application servers, means we download liferay tomcat bundles or liferay jobs bundles with these servers only we can see above directories.

The following diagram shows portal-service.jar in tomcat/lib/ext




As of now we are talking about component and Plugins

What is Liferay Plugins?

Liferay Plugin is piece software or set of classes which follows the standard defined by liferay.
A plug-in is a component which can change or modify the behavior of liferay portal or it can add new behavior to portal.

We already said liferay is software which consist of many components and feature so that we can use directly.

It is huge web application have many features and can support many integration with other application.

Liferay have exposed entire their web application as ROOT.war. This is completely liferay developed application which can get from any bundles which we download form liferay web site.

ROOT.war can see in server’s deployment directory

In tomcat we can see ROOT.war file in Tomcat/webapp  directory as follows


In JBOSS we can see in deployments directory




Well now liferay is already a huge web application and liferay has exposed their core components in Global class path, so that we can start customize or add new feature to the liferay.

To customize or develop new feature to liferay portal we need Standard Development Kit that is called Plugins SDK.

Note:

Liferay portal is web application which contains java classes, XML files, velocity files, property files and JSP pages.

Plugins SDK consist of 5 main parts

  1. Portlet
  2. Hook
  3. Ext
  4. Theme
  5. Layout

When we open downloaded Plugins SDK then we can see 5 main plugins.




Plugin Portlet

Portlets are independent component which can add new behavior or new feature to liferay portal.

It is very flexible components we can add or remove very easy without effect the portal or server. We can develop portlet which can use their own database tables or existed tables. Portlet can also connect to other databases or liferay existed database.

As we discussed earlier portlet can use liferay kernel and liferay services.

We have different kinds of portlet like Liferay MVC portlet, Generic Portlet, Struts Portlet, JSF Portlet and Spring Portlet.

By default Liferay have own portlet frame work i.e. called Liferay MVC frame work which have lot of support in liferay.

Out of box to support other frame work liferay provide some bridges from which we can run any portlet like struts, spring and JSF portlet.

Plugins have well appreciated feature is hot deployment components, means when we deploy the portlet, we need not stop server and change can apply immediately.

If we use Liferay MVC portlet it is easy to create and very light weight.

Note:

In liferay development Liferay IDE supports only Liferay MVC portlet and JSF portlet development. If you want use out box portlets you need manually create portlet and need to add required jar files. Liferay has very good support to JSF frame work portlet.

Advantages:
  • Plug and play
  • Hot deployment feature
  • Can support any J2EE MVC frame work in out box.
  • Once we developed in liferay we can run in other portals with minimum changes.
  • These are very easy to migrate when we upgrade portal from one version to other versions.

Limitations
  • From Plug-in portlet we can’t access portal implementation layer and we can’t change the existed behavior of liferay portal.


Hook

In liferay Hooks are special purpose plugin we can change or modify the existed behavior of liferay portal. Hook can customize the portal but some set of limitations.

Hook can modify the some of the things like properties files, jsp, events and portal services.

Hooks can change the existed portal properties so that we can see the change in portal behavior.

We can change existed portlet jsp pages so that we can add or remove some code in JSP pages.

This is also hot deployment like portlet we need not to stop server we can see the changes.

Advantages
  • It can change the existed behavior of portal
  • It is hot deployment component.
  • Portal existed services also we can change
  • These are very easy to migrate when we upgrade portal from one version to other versions.

Limitation
  • We can’t modify or change the action classes or main core classes in liferay portal.

Ext

Ext is one of the plug-in in liferay portal which have lot of ability can change anything in existed liferay portal.

We can change the portal implementation through ext so that we can change existed behavior in lifery portal.

we can also create new features from ext. these are not hot deployment so every modification we need to stop server and these Ext’s are very tightly coupled component with  liferay portal means which is not much flexible when we add or remove .

Advantages
  • It can change any part of liferay portal

Limitations
  • These are not hot deployments components
  • Very tightly coupled with liferay core portal
  • Very tough when we migrate portal from one version to other version

Note:

 In future liferay may avoid ext completely.

Theme

Theme is the one of the plugin to change the look and feel of portal. Means we can change CSS and java script files from theme.

Liferay portal is using velocity template when portal is rendered in web page this velocity file have capability can accommodate dynamic content like JSP pages.

From themes we can create new look and feel to liferay portal and we can add new CSS and new velocity templates.

Themes also hot deployment component we can deploy theme without down or stop server.

Layout

Layout can decide the page design. It can divide the page into some section in that we can arrange the portlet to complete the web page. Layouts also hot deployment components.

The following is example screen for layouts




Important Points

  • Liferay have given Plugins SDK to develop liferay applications.
  • Liferay plug-in portlets are very flexible and we can migrate very easy when we upgrade portal.
  • We need to minimize development of  Ext
  • Liferay MVC frame work is very flexible to develop plug-in portlet and Liferay IDE has support to develop these portets.
  • Liferay also have rich support to JSF portlet we can use JSF portlet too.
  • Whe we use other frame work to develop portlet we need add some liferay bridges to support other frame work in liferay portal.
  • All Plugins are hot deployments except ext. So we don’t need to stop server when we deploy the Plugins.

Related Articles

Author
Meera Prince

Recent Posts

Recent Posts Widget

Popular Posts