Trifork Blog

Posts Tagged ‘liferay’

Liferay sdk development best practices

May 3rd, 2012 by
(http://blog.trifork.com/2012/05/03/liferay-sdk-development-best-practices/)

Liferay logo
With liferay in action and Portlets in action out and the development guide online there is a fair amount of information on developing portlets and other types of Liferay plugins available.

However none of these resources offer much guidance on the subject of organizing a large project that consists of multiple plugins. In this post i’ll try and document some (best ?) practices that I distilled from working on a Liferay project that uses the Liferay sdk.

Now before I start, let me first say that I definitely would not recommend using the Liferay sdk for all types of projects. In fact in many cases you will be better served by the liferay maven plugin

The liferay sdk has many deficiencies such as having no support for unit testing(!) and not supporting libraries that can be shared across different plugin modules. However currently the liferay sdk is more mature than the maven plugin is, has more functionality, and most if not all available documentation references the sdk.

As a rule of thumb : if your project integrates tightly with Liferay’s built in services and your plugins are not very complex, then using the standard liferay stack : Liferay sdk / MVCPortlet / servicebuilder is a viable option. If your application is more complex then you’ll be a lot happier with a more general purpose stack like maven / spring portlet mvc / jpa

But I digress. On with the best practices
Read the rest of this entry »

Vaadin portlets with add-ons in Liferay

March 27th, 2012 by
(http://blog.trifork.com/2012/03/27/vaadin-portlets-with-add-ons-in-liferay/)

The Vaadin web framework has been around for quite some time now, and for a couple of years it also supports portlet development. This is particularly the case for the Liferay portal, where some integration work has already been done for you. Using Vaadin to build Liferay portlets is rather nice, because until you actually become dependent on the Liferay API, your Vaadin project can still run stand-alone, giving you quick feedback during development without having to redeploy the portlet.

Working with Liferay is, like most things in Vaadin, well documented in the “Book of Vaadin”, in chapter 13, but there are some complications. As Vaadin uses GWT under the hood, an application needs a GWT widget set. If you just use standard Vaadin components, the widget set is prepackaged in the war file, but if you start using Vaadin add-ons or custom built components, you need to recompile the widget set. A limitation of running Vaadin portlets is that the widget set needs to be available centrally in the Liferay web application and is shared by all Vaadin portlets. This means that you’ll have to update this widget set in Liferay while your project grows.

The bits of information needed to put this all together are available on the web, but sadly scattered over reference manuals, wikis, blogs and forum posts. In this blog I’ll go through it incrementally. Probably you know most of the steps already, but then again, if you knew them all you wouldn’t be here 😉

Read the rest of this entry »