Showing posts with label portal. Show all posts
Showing posts with label portal. Show all posts

Tuesday, April 8, 2014

Introduction to JSR 286/ Portlet Specification 2.0

Introduction:

JSR 286 is advanced portlet specification and it was added new features to JSR 168.
We can also call Portlet Specification 2.0. Java Community People was founf some of the limitations in JSR 168 and they are added new specifications to JSR 168 then they released as JSR 286 standards.

We already know JSR 168 standard and Portlet Specification 1.0


In JSR 168 covers the basic portlet technology need and its specification later Java Community People was added more features and specification in JSR 286.

The following are important Specification and Features
  • Inter Portlet Communication
  • Another State in Lifecycle
  • Ajax Support
  • Serving Resources
  • Portlet Filter and Listeners
  • Support Many Web Application Frame works in Portal Container
  • Improve Cache Mechanism
  • Support for WSRP 2.0

Inter Portlet Communication

The important feature in JSR 286 is Inter portlet communication. Inter portlet communication is mechanism to send or receive data between two portlets.

We can achieve IPC with different ways in portlets and we can make communication between portlet which are in same page or other pages too. We will use different ways based on our requirement.

In JSR 168 IPC works between portlets which are in same page using Portlet Session Mechanism.

In JSR 286 they made communication between portlet which are in different pages using other mechanism

The following are new IPC mechanism added in JSR 286
  1. Events
  2. Public Render Parameters

Events:

Event based mechanism way to communicate between portlet which are in same or in other page too.

Here one portlet will send the event and other portlet will listen the event. Here another method added in lifecycle so that it send or publish the events and when page render respective listener portlets receive the dada or events. Here before portlet execute render phase it can send events to other portlets


Public Render Parameters

Public render parameters are another way in IPC. We will use some public render parameters to each portlet so that it will carry the data between portlet and it will available to other portlets.
We will define some public render parameter such a way it will available to other portlet to get the data from that.

Another State in Portlet Lifecycle

New lifecycle phase added in portlet lifecycle. In JSR 168 the state of transition change from Action Phase to Direct Render Phase no more states in between that.

In JSR 286 to implement IPC they will add another Lifecycle state that is called Events Phase.
Before transition from Action Phase to Render Phase portlet can send events to other portlet in Events phase. So that another  lifecycle phase was added for portlet so that it will send some events to other portlet.



 Ajax Support

JSR 286 support Ajax mechanism to communicate with server. This is one of the good features. Generally if any portlet is have in action page other portlet need to render the portlet within the page.

With the help of Ajax we can avoid render all portlets in page. We simply send Ajax call from portlet so that we can communicate with server then get the response.

Serving Resources

In JSR 168 portlet specification will render only HTML content in render phase it can’t render some resources like pdf, images and other content type.

In JSR 286 was added another feature called serving resources with help of this we can serve the images, pdf and other content types to client.

In the portlet interface they added new method called serveResource(----)  method so that It will serve the other content types to client. This method also used specially for Ajax call in portlet, to call this method we will use different URL i.e. serve recourse URL.

Generally in the portlet transition state will always change from Action Phase to Render Phase when we perform actions.

But when we call serve Resource phase it will directly serve the content and it won’t go to render phase.

Portlet Filter and Listeners

We can portlet related filters and Listeners in portlet portlet.xml file. This will add advantage to perform some events or some actions before portlet is rendered.

Support Many Web Application Frame works in Portal Container

Generally Portal specification is different and we will use portlet container to manage portlets and its lifecycle. But we have many elegant web application frameworks.

In JSR 286 support other web frame works to run in portlet container so that developer can develop portlet in any web application frame work and run in the portlet container with help of small changes. It will support JSF, Struts, Spring, Vaadin and other MVC bases frameworks.

Support for WSRP 2.0

The Web Services for Remote Portlets specification defines a web service interface for accessing and interacting with interactive presentation-oriented web services.

This will help us access portlet from remote location other portals. We need to deploy portlet in portal we simply use this protocol we can access other portlet which are in other portlet container.


Author

Monday, April 7, 2014

Introduction to JSR 168/Portlet Specification 1.0

Introduction:

Sun micro system introduced Java Portlet technology to the world. In the Technology world each and every technology has some specifications based on this different people will implemented the software. The requirement specification is called Application Programming Interface.

Coming to portlet technology all requirement specifications comes under JSR 168 standards.
JSR 168 is portlet specification defined by java community people based on this many people implemented portlet technologies.JSR 168 is called portlet 1.0 specification.

Many vendors have implemented the Portlet Technology specification namely Liferay, uPortal, Web logic Portals, Webspear Portals and Apache Jetspeed.

JSR 168 is starting version of portlet technology and then people was added more specification in JSR 286.

This portlet technology specification was defined the portlet lifecycle and its management in the portlet container. Portlet lifecycle is similar to servlet lifecycle.

We already know to run or manage servlet lifecycle we need servlet containers similarly we have portlet container which is responsible for manage lifecycle of portlet.

All these specification and portlet lifecycle and management was specified in JSR 168 and JSR 286 standers all vendors who implemented the portlet technology should follow the portlet specification.

JSR 168 Portlet Important Specifications
  • Provide Run time environment to run portlet i.e. define portlet container
  • Implement API between Portlet Containers and Portlets
  • Implement Mechanism to store transient and persistence data for portlet.
  • Define Portlet Lifecycle
  • Provide methods for easy deployments of portlets
  • Allow portlets run in other vendor portals which follows JSR 168 standards.
  • Run JSR 168 portlets as remote portlets using the Web Services for Remote Portlets (WSRP) protocol
Important Artifacts in JSR 168 specification
  1. Portal
  2. Portlet
  3. Portlet Container
  4. Portal Page
Portal

Portal is web application which provides content aggregation, personalization and single sign of from different sources. Portal consists of web pages and each page has dynamic and static content.

Portal Page:

Portlet page is part of portal and its simple a web page. In general web application page consist of one dynamic application but coming to portal page it consist of multiple dynamic application and static content all together is called portal page.

A portal page is an aggregation of dynamic content and static content we can say portal page is fragments of dynamic and static content served by portlet container. Each portal page has specific layout there all portlet applications are reside.

Example Diagram For portal Page


Portlet Container

Portlet container is responsible for manage the portlet lifecycle. Portlet container is similar to server container.

Portlet container is integrated with web server/application so that it will use http protocol to communicate with client and serve the content. Generally some application server has provision to inbuilt with portlet container to support run time environment to portlet.

Portlet

Portlet is fragment of dynamic content which reside in portal page. Similar to servlet, portlets are web components that are deployed inside of a container and generate dynamic content. On the technical side, a portlet is a class that implements the javax.portlet.Portlet interface and is packaged and deployed as a .war file inside of a portlet container

Portlet properties

  • Portlets are managed by specialized containers called portlet containers.
  • Portlets are server side component which generate the dynamic content.
  • Portlet have its own lifecycle which will be manage by portlet container
  • Portlet will be used request/response mechanism to interact with web client using http protocol.

How portlets are differed from Servlet
  • Generally in servlet web application each servlet will be referred by URL to invoke or access and each web page content will be served by one servlet but in portlets each page will be served by different  portlet and each portlet will have its own lifecycle and own URL pattern to execute.
  • Servlet will generate dynamic content which send to browser and it’s in single web page but portlet will server fragment of dynamic content and portal page is responsible to aggregate content from different portlet to generate whole page.

Portlet life cycle

As we already know each portlet has it own lifecycle and which will be managed by portlet container. According to the JSR 168 standard portlet have three lifecycle stages.

init:

 Initialize the portlet and put the portlet into service

Handle requests:

Process different kinds of action- and render-requests

Destroy:

Put portlet out of service

Theoretically we have 3 lifecycle stages in portlets and these will be implemented via portlet interface. Portlet interface is implemented in jax.portlet package by Sun Microsystems.

Every portlet that should implement the portlet interface or it should extend the class that already implemented the portlet interface.

As we know portlet have three lifecycle staged and the following are interface methods which handle portlet lifecycle cycle in portlet implementation.

init(PortletConfig config):

This method is initialize the portlet and this will be called only once when portlet is instantiated, we can say when we drag and drop portlet in page.

If any necessary functionality required at initial time of portlet we will use this method and write code here. It is similar to servlet init method. This method can be used to create expensive objects/resources used by the portlet.

processAction(ActionRequest request, ActionResponse response):

When user is requested to server then portlet will execute process action method.
This method will notify the portlet that used has triggered an action this portlet. , a portlet can issue a redirect, change its portlet mode or window state, modify its persistent state, or set render parameters.

render(RenderRequest request, RenderResponse response):

Render method will generate content and that will be send to web client.
In the portal page we have many portlet we have triggered action in one portlet then all portlet will be executed render method to aggregate dynamic content. The portlet can produce markup that may depend on the portlet mode or window state, render parameters, request attributes, persistent state, session data, or backend data.

destroy ():

Indicate to the portlet the life cycle's end. This method allows the portlet to free up resources and update any persistent data that belongs to this portlet.

Note:

In the portlet lifecycle for each action or request the final method is render method. Render method will be called for every time to aggregate content or produce content.

Generally portlet have different URL to call these methods like Action URL and Render URL.
Action URL will execute portlet porcessAction(----) method and then it will be execute the render(----) method.

Render URL will execute the portlet render (---) method only.



Portlet Characteristics

Portlet have addition Characteristics when we compare with servlet.

Portlet Widow States:

Portlet has different window states. Window state specifies how portlet will look in the page .Window state decides how much space will be accommodated in portlet page.

The following are important window states as for JSR 168 Standards.

Maximized:

When portlet state is decided as Maximized then entire page only one portlet is visible.
Generally we will use this state after perform some action then we will make widow state is Maximized.

Normal:

Specified that is portlet may share the page with other portlets. This is the default window state.

Minimized:

Portlet should only render minimal output or no output at all.

Portlet Modes:

Portlet mode specifies that the function will be performed by portlet.
Generally following are the portlet modes that each portlet should support as for JSR 168 standards.

View:

 This view mode is when portlet is access or render then portlet is in view mode and this is default mode for portlet.

Edit:

Edit mode will be used to edit some portlet functionality and generally we wil use this mode for administrator to modify or edit something.

Help:

This will used to provide content to end user about portlet i.e how to use and access portlet like help information.

Persistent storage for preferences:

Portlets provide a PortletPreferences object for storing user preferences. These preferences are stored in a persistent data store, so they will be available across server restarts. As a developer, you don't have to worry about the actual implementation of how it is stored.

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

Recent Posts

Recent Posts Widget

Popular Posts