Friday, January 10, 2014

Content Auto Update in Liferay Plugin Portlet

Objective:

Update the content in portlet for particular intervals in Liferay development.

Introduction:

Some time we may get requirement to update content in portlet for every particular intervals from server. To do this job we will use Ajax call to update content on portlet

What is Set Interval method?

Native java script has set interval method from this we can execute some task for each particular interval.

What is Ajax ?

Ajax is way of calling server side content without page refresh in the browser. This will help us to avoid whole page loading for a little content update.

Ajax will help us to update particular part of web page with server side content or dynamic content.

This Ajax mechanism is implemented in client side java script. We have rich Ajax implemented java script libraries in market

The following are popular


AUI, YUI, DOJO, Prototype  and ExtJS


Note:

 Liferay have inbuilt support for AUI script.

What is Serve Resource Method?

Server Resource method is meant for serving some resource or content from server in portlet technology. This method helps us to serve images, files, JSON data and XML data from server.
This method especially we will use with Ajax call to get content from server.

Implementation:

Assume we want update users data in page for every particular interval. We  will use Ajax and set interval methods to complete this job.

We can Implement Ajax in two ways in Liferay

jQuery Ajax Call

The following is tutorial for jQuery Ajax in Liferay


AUI Ajax Call

The following is tutorial for AUI Ajax in Liferay


Note:

AUI script is suitable in Liferay 

Author
Meera Prince

Popular Posts

Recent Posts

Recent Posts Widget