Gadgets and Widgets: Using Liferay as a Mashup Platform

The web has changed. You can call it Web 2.0, Web 3.0 or whatever you want but the truth is that websites are now more than ever interconected. Originally we had links, later came the ability to syndicate contents through feeds and some websites became an aggregation of many other sites, and now we are experiencing a proliferation of the so called mashups.

What is a mashup? It's a pretty generic word but we could define it as a page that combines data and functionality from other websites. As you can see this is a very similar definition of what can be said of a portal, so it was a natural fit for Liferay to end up providing the features need it to also use it as a Mashup Platform.

Converting a Liferay page into a mashup

There are many sites providing their contents as widgets/gadgets. Netvibes and iGoogle provides a lot of them, but there are others like sports newspapers, travel agencies, financial sites and others. You can now easily bring all those contents and applications to your Liferay-based portal.

Liferay includes two portlets to mashup content from iGoogle (google-gadget-portlet) and Netvibes (netvibes-widget-portlet). In the configuration tab you can browse all the widgets those platoforms offer. If you want to mashup content from other sites, you only need to choose the propper widget type and paste the URL. That's all.

portlet page with a widget and a gadget

Exporting portal functionality to allow for external mashups

So, let's say you want to gain visibility for your forums, or you want to make some documents publicly available, so you decide to publish them in iGoogle. May be you are the manager of a social website and want your news to be available from Facebook. Or you could have a corporative portal built using Liferay, and you want the CEO blog to be published in other, non-Liferay, internal sites. All those things are now possible.

The option to publish portlets in those platforms is available under the sharing tab in the configuration view of any portlet, and it is available out of the box to any portlet deployed in Liferay.

portlet shown in a facebook page

portlet shown in iGoogle pages

Tips for better mashup of your portlets

The portlet appearance and decoration is preserved when showing it as a widget. To maximize useful space, you may want to remove the portlet border from the look&feel option in Liferay.

When you publish a portlet as a gadget/widget you are not publishing a copy, but pointing to the application, so you always get the latest version. Due to this fact, the same security and visibility rules that apply for the portal, apply to widgets too. In certain scenarios is an advantage to doing RSS publishing, as you do not get a list of entries, but a fully functional application.

If you want to publish portlets, be aware that the target platform needs to reach the source machine, so if you are behind a router, you will need to propperly configure NAT or whatever other method you choose. If you select iGoogle, then you need to configure everything to run on port 80, as Google removes the port information in URLs when adding gadgets.

Conclusion

A portal platform is a perfect base for building a mashup platform and at Liferay we didn't want to loose this opportunity. In this post I've shown how you can use Liferay Portal to combine the power of both traditional portal techniques with the new ways of sharing data and functionality. By doing this it's possible to achieve a perfect combination of a controlled environment for things that need it while still leverage the external resources that the web (2.0) has to offer whenever it makes sense.

Have you started using this functionalities? If so, we'd love to hear more about how you are using it. Also, all your ideas and suggestions will be very welcome.

Several of the features that have been explained in this article have been developed as part of the Romulus project. You can get more information about this in the documents published in the Romulus (www.ict-romulus.eu) project website here (www.ict-romulus.eu/c/document_library/get_file?p_l_id=2266&folderId=29495&name=DLFE-4618.pdf)

Blogs
We are testing this here http://visionontv.org plan is to take the forums and videos out onto other sights, have 5 agreed up all ready.
Hello
I was wondering where the netvibes-widget-portlet actually live for install? Initial and cursory searches in our 5.2 install and this site don't show a location.
Thanks
Hello.

You can download it from the incubation plugins repository at

svn://svn.liferay.com/repos/public/plugins/incubation/portlets/netvibes-widget-portlet

Regards,
Hi - thanks.
Both
http://svn.liferay.com/repos/public/plugins/incubation/portlets/netvibes-widget-portlet and svn://svn.liferay.com/repos/public/plugins/incubation/portlets/netvibes-widget-portlet require authentication though.......
I had some problem with iGoogle integration, OpenId and SSO: I posted in the Forums: http://www.liferay.com/community/forums/-/message_boards/message/5426146
And what about doing the mashup in Liferay using Liferay portlets? Yes, I know that you can do it in a global way if you have update page permissions, but the idea is to have the same features as the iGoogle gadget, but adding "gadgets" from Liferay, instead of Google ones.