©Manning Publications Co. Please post comments or corrections to the Author Online forum:
http://www.manning-sandbox.com/forum.jspa?forumID=642
2
©Manning Publications Co. Please post comments or corrections to the Author Online forum:
http://www.manning-sandbox.com/forum.jspa?forumID=642
MEAP Edition
Manning Early Access Program
Copyright 2010 Manning Publications
For more information on this and other Manning titles go to
www.manning.com
Licensed to Pinel <bertrand.pinel@laposte.net>
3
©Manning Publications Co. Please post comments or corrections to the Author Online forum:
http://www.manning-sandbox.com/forum.jspa?forumID=642
Table of Contents
Preface
Acknowledgments
About this book
About the author
Part 1 Introduction to Liferay
1. Liferay is a different portal
2. Getting started with the Liferay development platform
Part 2 Adding features to Liferay with plugins
3. Portlets are easy
4. Inter-portlet communication using Portlet 2.0
5. A data-driven portlet made easy
6. MVC the Liferay way
7. Using themes to provide your own site design
8. Making your site social with Liferay's social network API
9. Enabling team collaboration with Liferay's collaboration API
Part 3 Customizing and extending Liferay
10. Hooks
11. Extending Liferay
12. Liferay architectural overview
Appendixes
A. How to contribute to Liferay
B. Portal design forms
Licensed to Pinel <bertrand.pinel@laposte.net>
4
©Manning Publications Co. Please post comments or corrections to the Author Online forum:
http://www.manning-sandbox.com/forum.jspa?forumID=642
1
Liferay is a different portal
This chapter covers
Understanding portals then and now
Exploring what Liferay is and how to work with it
Defining basic Portal concepts
Using Liferay to design a portal
Introducing the Inkwell case study
Everybody needs a web site these days. Whether you’re building one for a company, for a service
organization, or for personal reasons, you need one. And when trying to decide how to build it, you’ve
probably found a dizzying array of choices running on a dizzying array of platforms. So how do you go
about choosing which platform is best?
First of all, if Liferay Portal isn’t on your list, you should put it at the top right away. Liferay Portal is
a Java-based open source portal, containing an unprecedented number of features, which will help you
to implement your site in as little time as possible. And once you have Liferay on your list, let me
respectfully submit that your search can end with Liferay Portal, which is hands down the best platform
upon which to build a web site.
I can hear your objection now: “Of course you’ll say that—you work for Liferay!”
Ah, but I did not always work for Liferay. I was a Liferay user for some time before I wound up
working for them. So yes, I took the red pill,
1
1
From the 1999 film The Matrix.
so to speak, but I’ve also experienced Liferay from the
outside, and so I know what it’s like to be doing that search for a platform. I can tell you from
experience that you’re going to find working with Liferay to be a pleasure, and you’ll be happy to know
that using the platform that Liferay offers you will free you from limitations. Using Liferay as a platform
will speed up your development cycle and give you features that you likely wouldn’t have had time or
the inclination to build yourself. Most of the time, potential Liferay users focus on Liferay as a product—
because it boasts such a huge range of features—but they don’t stop to consider the rich development
Licensed to Pinel <bertrand.pinel@laposte.net>
5
©Manning Publications Co. Please post comments or corrections to the Author Online forum:
http://www.manning-sandbox.com/forum.jspa?forumID=642
platform it offers. Liferay as a development platform encourages you to take advantage of everything
Liferay has to offer. By the end of this green paper, you’ll have a good understanding of what Liferay is
all about and what it can do for your web site. And I have no doubt that you’ll find many reasons to
choose Liferay for your next development project.
Choosing Liferay is also safe: You’re putting yourself in a group with some of the largest
organizations (and the largest web sites) out there that have also chosen Liferay as the platform for
their web sites. So if I can give you any advice, it would be to end your search with Liferay and begin
learning how you can leverage the platform to build the site of your dreams.
This chapter will go over several several important topics. I’ll show why Liferay calls itself a “portal,”
what a portal used to be, and how Liferay pioneered getting past its early limitations—giving you the
freedom to use the platform for what it was meant to be: a robust fast track to implementation. We’ll
then take a helicopter ride over Liferay’s feature set to see what it can do at a high level. After this,
we’ll delve into how Liferay helps you structure a web site. You’ll also get to see what Liferay looks like
by default and how you can navigate around it. And finally, using all the information we’ve presented,
I’ll show you how you can begin to imagine how your site might be implemented using Liferay Portal.
But first, to get our bearings, let’s start by exploring why Liferay calls itself a portal and what that
term has come to mean in the industry historically.
1.1 The Java portal promise: from disappointment to fulfillment
Liferay calls itself a portal. What do you commonly think of when you hear the word portal? As a big fan
of sci-fi and fantasy, I tend to think of a doorway to another dimension or time like the portal that Kirk
and Spock went through, chasing after McCoy to stop him from doing whatever he did to change the
timeline. I’ll tell you right away: Liferay Portal isn’t that elaborate (but you’ve likely already figured that
out). So why do we call it a portal? Let’s start with the so-called official definition of a portal.
Portal
A portal is a web-based gateway that allows users to locate and create relevant content and use the
applications they commonly need to be productive.
That comes from a bullet on a slide I’ve used to teach Liferay to prospective users. I might even
have written that bullet, but I’m not sure. Generally, the reaction I get is a narrowing of the eyes, some
pursed lips, and then heads begin nodding up and down. This tells me that people want me to think that
what I’ve just said makes sense, but they’re being kind and reserving judgment on my teaching
abilities, because it actually made no sense at all.
The problem with definitions like that is that they try to say too much in one sentence. Liferay is
many, many things, and you can’t capture it all in one sentence. But just for fun, let’s try it again.
Portal
A portal is designed to be a single web-based environment from which all of a user’s applications can
run, and these applications are integrated together in a consistent and systematic way.
Licensed to Pinel <bertrand.pinel@laposte.net>