Monday, April 14, 2014

Liferay Plugin Portlet Development Choices

Introduction:

Liferay is very good portal technology and its completely open source. Liferay have very good support to run other framework applications in portal with the help of little work.

Liferay already have inbuilt portlet framework to develop portlets and some are available for Plugin portlet development and some are not available for Plugin portlet environment.

In liferay we have two choices to create portlet one is  Plugin Portlet environment and other one is Plugins Ext.

We never use EXT for create new portlet and we use only Plugin portlet environment to create new portlet.

Liferay have few inbuilt portlet frameworks to create portlet and run into liferay portal.

The following are the Portlet frameworks which are inbuilt for Liferay Portal.
  1. Generic Portlet
  2. Liferay MVC Portlet
  3. Liferay Struts Portlet

Generic Portlet

This is very basic portlet and comes with javax.Portlet API. This is very default portlet in any portal and all portals have support to run Generic Portlet because Generic Portlet follows JSR Standards. We will implement javax.Portlet Interface for Generic Portlet.

 Liferay IDE have direct support to create Generic Portlet and we can deploy into Liferay Portal. We can use Generic Portlet in Plugin Portlet Development.

Liferay MVC Portlet

 It is inbuilt Liferay frame work and it is very simple to develop and use. Liferay IDE has support to create this portlet skeleton and we can deploy into liferay portal.

This is very easy to create and deploy into liferay portal apart form that we will use JSP for view technology and Liferay Service Builder for Service layer.

Liferay Struts Portlet

We cannot create this portlet in Plugin Portlet Environment we can create using EXT only but it’s not recommended. Liferay Struts Frame work  built it on top of Struts 1.x framework. All liferay portal portlet was developed in Liferay Struts Framework

Out of Box Portlets:

Liferay also support for other web application frame works and those will work in liferay portal. We have many popular frame works in web applications development and we can also use those frame works to create liferay Plugin portlets.

But these frame work won’t work directly in portals because general web application frame work flow is different from portlet flow.

Web application framework use servlets and servlet container to make the components and run the components. So here servlet life cycle is different from portlet lifecycle

To use other web application frame works such as struts, spring, jsf and vaadin in portals, the frame work vendor is responsible for create some bridges which will make web application frame work run in portals or which can run in portlet container.

These bridges are responsible to convert web application flow into portlet flow i.e. servlet lifecycle will be converted into portlet life cycle.

Example:
  • Struts have given Struts Bridges
  • Spring have Spring Portlet MVC library
  • JSF has JSF bridges.

The following is screen shot i.e. what kind of frame works supported by liferay portal


The following are popular frame portlets which supported by Liferay Portal.
  1. Struts 2.x Portlet
  2. Spring Portlet MVC Portlet
  3. JSF 2.x Portlet
  4. Vaadin Portlet
  5. PHP Portlet
  6. Perl and Groovy Portlet

Struts 2.x Portlet:

Struts 2.x portlet will use strut frame work and development is similar to normal struts web application development but we need to add some other configuration files such  as portlet.xml, liferay-portlet.xml and need to add frame work supported portal bridges.

View Technology:
  • We will use JSP for view technology.
  • JSP,JSTL, Struts Tag Library additional benefit to make RIA development and Struts already proven in the market as best web application framework. Struts will use tiles concept to aggregate page and we can also use free marker templates.

Strengths:
  • Struts frame work have very good front end controller to navigate and render views.
  • Rich Built in Struts Tags.

Limitations:
  • Struts have support and full fill only JSR 168 feature and not all JSR 286 standards (You can explore more on this).
  • Liferay have not direct support for struts 2.0. If any environmental problems then our self need to solve or need to approach struts fame work community.
  • Liferay IDE has not direct support to create Struts 2.x portlet we need to manually add configuration files and Libraries.

When it recommends?

If anybody who good at struts frame work and vast experience then we can choose this one.

Development Options:
  1. Struts 2.0+Liferay Service Builder+ JSP (Tiles,JSTL, Struts Tags)
  2. Strust 2.0+ Spring+Hibernate+ JSP (Tiles,JSTL, Struts Tags)

Reference Links:



Note:

Entire Liferay Portal Portlet has built it upon struts 1.x frame work and they have designed Liferay Struts Frame Work on top struts 1.x.

Unfortunately Liferay Struts Frame Work was not available to Plugin Portlet Environment.

Spring Portlet MVC Portlet

Spring Portlet MVC Portlet is another choice in liferay and its very good framework. Spring Portlet MVC Portlet API is a Portlet Bridge to make spring works in Portals and it also follows JSR standards.

Strengths:
  • It very good frame work and Very big Community for spring so definitely we have good support.
  • If we choose spring we have rich flexibility use other technologies because spring frame work already has many Plugins for integration.
  • We can use JSP, JSTL and Spring Tags for UI development.
  • We can use JQuery or Legacy JS for Java Script.
  • We can also use Struts 2.x or JSF 2.x as front Controller

Limitations:
  • It’s Also full filled JSR 168 stands still it need to full fill JSR 286 standards.
  • Liferay with spring have some environmental integration issues especially in Context loading problems. Liferay already used spring and hibernate for Service Layer.
  • Spring Portlet MVC with Liferay Service Builder has some context loading issues.
  • We can go with Spring DAO Implementation with Hibernate but we are missing sharing of services between portlets. So we need to handle differently when we want share portlet services with other portlet.
  • No Direct Liferay Community support but spring community and liferay forum people can support well.
  • Liferay IDE not have support to create Spring Portlet we need create simple MVC portlet and need to add configuration files and libraries manually.

Reference Links:



JSF 2.x Portlet:

JSF is also very popular frame work in web application development and its from Java Community.

JSF 2.x have very good new features and they have used XHTML as view technology it very good choice rather than JSP.

JSF 2.x frame work has very good component libraries for Rich Internet Application development.

We have very popular JSF component libraries such as Prime Faces, Rich Faces and ICE Faces.

JSF 2.x Specification has two different implementations JSF Mojarra and Apache Myfaces.

JSF Mojarra have jsf-api.jar and jsf-impl.jar is two libraries which implemented JSF frame work.

If we use JSF Mojarra we can use Prime faces, Rich Faces and ICE Faces as component libraries.

Apache Myfaces already have their own component libraries such as Trinidad, Tobago and Tomahawk.

We already know to make it work other frame works in liferay portal we need frame work support bridges so that we can use in portlet development.

Liferay have started special community to support JSF framework to run in liferay portals. The project name is Liferay Faces.

Before we have JSF portlet faces have separate community and they started to implemented libraries so that it was used to run JSF frame work in Liferay. Now Liferay Faces is part of Liferay now have rich support for JSF in Liferay.

Liferay Faces have chosen JSF Mojarra implementation, based on this they have implemented JSF portlet bridges that will make JSF works in Liferay Portal. Once we use JSF bridges we can develop portlet and run in liferay portal.

We can use any component libraries which will support by JSF frame work in JSF portlet development such as Prime Faces, ICE faces and Rich Faces. Apart from this Liferay Also stared develop their own component library i.e. Liferay Faces Alloy.

Alloy Faces is JSF component library which  used to Liferay JSF Portlet development as UI complements for RIA (Rich Internet Application) development.

It used Alloy UI Java Script to implement and we already know Alloy UI is one of the projects from Liferay and Entire Liferay Portal have used AUI java script.

So Liferay started developing JSF components with help of AUI i.e. Liferay Faces Alloy.

Liferay Faces have given 3 Libraries As Follows
  1. Liferay Bridge Faces
  2. Liferay Faces Portal
  3. Liferay Faces Alloy

Liferay Faces Bridge

Liferay Faces Bridge is core library which will make JSF work in Liferay Portal and its responsible for convert JSF life cycle into portlet lifecycle and it based on JSF Mojarra implementation.

Liferay Faces Portal

Liferay Portal Faces is library responsible for to use Liferay Portal API in JSF portlet development and have set of classes and interface which interact with Liferay Portal API.

Liferay Faces Alloy

Liferay Faces Alloy is Liferay component Library for JSF portlet development and it has many UI components for rapid application development.

Strengths:
  • Its part Liferay Project so more support when we start JSF portlet development.
  • JSF frame work has many choices for UI component libraries so we can develop portlet applications very fast.
  • JSF have Prime faces, Rich Faces and ICE faces these are very popular component libraries apart from these liferay also have Alloy Faces for JSF portlet development as UI components.
  • JSF Portlet uses XHTML as view technology so it is one of the good advantages.
  • Liferay Faces is already part of Liferay so defiantly they will improve a lot in future and also have very good support.
  • Liferay IDE has direct support to create JSF portlets and deploy into liferay portal.

Limitations:
  • Still its growing project so we may get few challenges.
  • Liferay Faces Alloy still it’s improving and has limited UI components when we compare with other component libraries such as Prime Faces, Rich Faces and ICE Faces.

Development Options:

Liferay Faces = (Liferay Faces Bridge + Liferay Faces Portal + Liferay Faces Alloy)

Any JSF Component Library = (ICE Faces/ Prime Faces/ Rich Faces/ Liferay Faces Alloy)


  1. Liferay Faces + ICE Faces
  2. Liferay Faces+ Prime Faces
  3. Liferay Faces+ Rich Faces
  4. Liferay Faces+ Liferay Faces Alloy
  5. Liferay Faces + (Any JSF Component Library) + Liferay Service Builder
  6. Liferay Faces + (Any JSF Component Library) + Spring DAO Implementation with Hibernate.

Reference Links



My Suggestion and Opinion Choosing Plugin Portlet for Development
  1. Liferay Portlet MVC Portlet with Liferay Service Builder
  2. Liferay JSF Portlet using Liferay Faces+ Liferay Faces Alloy
  3. Spring Portlet MVC with Spring DAO Implementation with Hibernate
  4. Struts 2.x Portlet with Liferay Service Builder

Note:

It’s my rank and it may be differed from other opinions.
Apart from above we have options like vaadin, php , perl, python and groovy portlet.

Author

0 comments :

Post a Comment

Recent Posts

Recent Posts Widget

Popular Posts