« Back

Liferay 6.0, OpenSocial and Gadgets - Part 1

Company Blogs August 12, 2010 By Barrie Selack

This is the first part of a series of blogs and wiki articles on using gadgets in Liferay. In this first part we'll discuss gadgets use and how to deploy a gadget. So, will gadgets replace portlets? Well, in some cases, they will be a quicker way to get information on your web site if you already have a web service available to pull the data from. There are some caveats thought, as a gadget is a client side application, any web service that needs to be secured would not be a good candidate for a gadget.

The contents of the gadget are sent to the browser as a whole, so that means any user/password information needed to call the web service would be viewable in the "view source" mode of the browser. If you are using the gadget in a secured Intranet (inside the firewall) then you could consider a gadget for your own internal use.

So what could be a good candidate for a gadget in a publicly available web site? 

Any information that you want available to customers. 

  • Company News
  • Press Releases
  • Upcoming Events

As a gadget can be put on other web site via a gadget container, your gadget xml could be used to be put on other sites. It would still be calling back to your site for information. This means you've exposed the web service making the data available to the public. This may or may not be a problem and is something you need to consider in building your application as a gadget.

So what could be a good candidate for a gadget in an Intranet web site? (behind the firewall)

This may actually where you can get the biggest bang for your gadget development. Since you are not allowing access outside the firewall, you can expose any information you would normally put on any web page on your Intranet. This could include the same information from the public list above, but could also include any company sensitive information. It could include calendar items, policies and procedures or employee  dashboard items. Just keep in mind that this information will need to be available as a web service for the gadget to retrieve it.

With all that in mind, let's see just how to get a gadget deployed in Liferay.

I've created a wiki post to walk through the deployment step by step.It shows everything from where you can put your gadget, deployment and how to configure user properties for your gadget.
In Part 2, we'll start building a gadget to deploy. Fell free to ask any questions!