Dev @ Work

A day in the life of a developer

Securing your Liferay Service using PermissionChecker

May 3rd, 2010 by Bert Willems

Welcome to 3rd article in this series of articles showing you how you can develop custom Liferay services. In the previous article I showed you how you can implement a custom Liferay service and expose it as a web service. In this article I will show you how you can secure your service using Liferay’s build-in permission model.

The permission system in Liferay is pretty powerful: you configure permissions on roles or teams. Next you apply roles to either groups (communities, organizations) or individual users. In this article we will define a new permission: the permission to access our “very exiting business logic” sayHello. After all, we have invested countless hours in developing it; we don’t want everybody to use it without us knowing ;) .

I hope this article is useful to you. Please let me know if you have any questions or comments; just drop me a message and I will get back to you as soon as I can.
Read the rest of this entry »

Posted in Java | No Comments »

Expose a Liferay Service as a Web Service

April 26th, 2010 by Bert Willems

In my previous article I showed you how you can implement a reusable Liferay Service without using Ext or  the Service Builder utility. In this article we will take it one step further and expose the service we have created as web service again without using Ext or the Service Builder.

Liferay exposes the services based on Axis using a separate web application called tunnel-web. We will hook into tunnel-web so our service will be exposed in exactly the same way Liferay services are externalized. Let’s get started.
Read the rest of this entry »

Posted in Java | No Comments »

Implementing a reusable Liferay Service Without Ext or Service Builder

April 19th, 2010 by Bert Willems

In Liferay you can split your application logic vertically exposing each component as a separate independent service. This service can be consumed by your portlet applications and any other applications. Liferay itself exposes several services to you: GroupService (for managing communities) and UserService (for managing users) for example. In this article I will show you how you can create a reusable service yourself and host it in Liferay.

In this article we will build a simple hello world service, nothing to fancy (I want to leave something for you to do yourself ;) ). We will code the service from scratch without using tools like service builder.

The project will contain 3 modules:

  1. A library containing the service contract
  2. A web application implementing the service contract
  3. A web application consuming the service

I hope you like this article, please let me know if you have any questions or comments. Lets get started. I assume you have read my previous article about using Maven to build Liferay applications. If not please read it first.
Read the rest of this entry »

Posted in Java | 11 Comments »

Setting up Maven for Liferay Development

April 17th, 2010 by Bert Willems

Welcome to the third article in these series about Liferay usage, maintenance and development. In this post I will show you how to set up your Liferay development enviroment using Apaches Maven2 build tool. We will develop a really simple JSR-168 portlet which can be deployed into Liferay. I assume you have read my previous articles and that you are using Liferay 5.2.3 on JBoss 5.1. I hope you like this post as much as the previous ones, if you have any feedback feel free to contact me or post a response.

The next version of Liferay, release date end Q1 begin Q2, will have complete support for maven including custom archetypes. Some of the steps described in this article will be obsolete then, but lets get started. Read the rest of this entry »

Posted in Java | 1 Comment »

SEO Friendly URLs for Liferay Portlets

April 4th, 2010 by Bert Willems

In my previous article I showed you how you can optimize SEO from within a portlet. Today we will take it one step further: I will show you how you can optimize portlet URLs. By default the URLs generate by Liferay are quite messy; it contains the portlet ID, the state and several other options. This doesn’t really look nice for Google.

However, Liferay has a nice method of controlling the URL the portal generates for a portlet, the ‘FriendlyURLMapper‘. You can implement this interface, registerd it in the liferay-portlet.xml and you will have nice URLs. In the following example I will show how to implement it and what each individual method does.

Read the rest of this entry »

Posted in Java | 4 Comments »

SEO optimize a Liferay portlet – Title, Description, Keywords

March 31st, 2010 by Bert Willems

In this post I will show you how you can SEO optimize your Liferay portlets. When you are building a portal which is (partially) available to the general public you want the search engines to rank your portal as high as possible in order to draw as much traffic to your portal as possible. Because of the nature of a portal (a ‘empty’ canvas filled with several unrelated portlets) it’s pages aren’t ideal for search engines because it hasn’t got a SEO description and keywords (or even a SEO friendly title).

In this post I will show you how you can in use build in features of Liferay to optimize SEO, First we will discus what you can do on a portal level and then I will show you how you can optimize SEO directly from a portlet itself.
Read the rest of this entry »

Posted in Java | 2 Comments »

Liferay Training @ Frankfurt, part 3

March 30th, 2010 by Bert Willems

Today is the second day of the Liferay development course in Frankfurt. Looking through the window gives me hope that the weather will be a bit better than yesterday. Yesterday we spend most of the day setting up Liferay for development and building a basic portlet.

Today we will cover how to use advanced portlet features like JSR-286 eventing, how to set up a portlet using struts and how to create a service using the service builder. I am particularly looking forward to that last part because it allows you to add additional services to Liferay.

Anyway, enough material to blog about so please stay tuned (while I get some breakfast ;) ).

Posted in Java | No Comments »

Liferay Training @ Frankfurt, part 2

March 29th, 2010 by Bert Willems

This morning was devoted to setting up a Liferay development environment. Not too much new stuff for me but I got the change to figure out some small things which will probably be useful in the future.

After a pleasant lunch we are ready to write some code!

The weather in Frankfurt is much like the weather in Holland: rainy.

Posted in Java | No Comments »

Liferay Training @ Frankfurt, part 1

March 29th, 2010 by Bert Willems

Today and the next 2 days I am going to increase my Liferay development skills in the city of Frankfurt. It is an official training by Liferay inc. I flew in Yesterday with my colleague Jeroen. I am writing this post from the class just like in the good old school days ;) . There are about 20 other developers in this 3 day training.

I am really looking forward to learn some new tricks. I will keep you posted!

Posted in Java | No Comments »

Reporting on Liferay and the Future of Portal Development

January 28th, 2010 by Bert Willems

From the comfort of my own home, this is Bert Willems reporting on the Liferay and the future of portal development. I haven’t dreamed it up: this is a report of a Liferay webinar I just attended. Paul Hinz, Chief Marketing Officer of Liferay, Inc hosted the webinar. He talked about the role of open source software in enterprise as well as the vision Liferay has about the future of web, portal and social collaboration technologies.

He explained why a lot of things which portals have promised are actually unmet by today’s portals. Most notably is that portal development using the portlet API is hard when compared to develop decentralized applications in for example PHP or Ruby. The learning curve of Java and it’s technology stack is considerably longer compared to other web application frameworks. Due to this fact other frameworks made their way into the enterprise.

He then elaborated on the evolved focus of portals and other web applications: providing a centralized platform for end user to create, share and develop knowledge. This is not something new because it is all around us already. Take a look at LinkedIn for example: I can add this very WordPress blog to my LinkedIn profile and the same goes for my Twitter account; LinkedIn acts as a portal.

Paul envisions that users will developing applications and share them in the same way the develop content together now in the Wikipedia. The focus of technology providers like Liferay will be on facilitating these user developers. A good example here is Apples iPhone with its countless available user build applications.

The focus of the Liferay development team for 2010 is:

  • Content Management Interoperability Services & integration of 3rd party content repositories
  • User defined workflow & business processes
  • Stronger personalization and enhanced collaboration tools
  • Faceted search & other search improvements

Notice to focus on facilitation and easy of extension rather then providing new features.

This is, in my humble opinion, a positive paradigm shift from classic wisdom owners (fortune 500 companies, patent holders, publishers, standards committees etc.) to wisdom of the crowd. Why shouldn’t we use the collective knowledge in all of our minds and combine it in a productive way so we can solve problems together? I see this shift in the software development world (see the microformats opposed to standardization committees like W3C and JCP) for example but also in the publishing industry (Wikipedia anyone?). There is a lot more to say about this subject but I will save that for a later post. Bye for now.