Book Image

Liferay Portal 5.2 Systems Development

By : Jonas X. Yuan
Book Image

Liferay Portal 5.2 Systems Development

By: Jonas X. Yuan

Overview of this book

<p>Liferay portal is one of the most mature portal frameworks in the market, offering many key business benefits that involve personalization, customization, and workflow. If you are a Java developer who wants to build custom web sites and intranet applications using Liferay portal, this is where your search ends.<br /><br />This book shows how Java developers can use Liferay as a framework to develop custom intranet systems, based on Liferay portal platform thus helping you to maximize your productivity gains. Get ready for a rich, friendly, intuitive and collaborative end-user experience!<br /><br />The author's experience customizing Liferay using Java enables him to explain in a clear and precise manner how to build custom systems on top of Liferay portal. <br /><br />Using this book you can customize Liferay into a single point of access to all an organization's data, content, web content, and other information from both existing in-house applications (HR, CRM) and external sources (such as Alfresco, FatWire, Magnolia, Vignette).</p>
Table of Contents (18 chapters)
Liferay Portal 5.2 Systems Development
Credits
About the author
Acknowledgement
About the reviewer
Preface

Preface

Liferay portal is one of the most mature portal frameworks in the market. It offers many key business benefits that involve personalization, customization, and workflow. If you are a Java developer who wants to build custom web sites and intranet applications using Liferay portal, this is where your search ends.

Liferay Portal provides within a secure, administrated framework, an ability to organize the potential chaos of an unfettered Web 2.0 environment. It empowers users with tools such as blogs, instant emails, message boards, instant messaging, shared calendar, social networking, social office, CMS, WCM, and so on.

This book shows how Java developers can use Liferay as a framework to develop custom intranet systems based on Liferay portal platform, thus, helping you to maximize your productivity gains. Get ready for a rich, friendly, intuitive, and collaborative end user experience.

Using this book, you can customize Liferay into a single point of access to all of an organization's data, content, web content, and other information from both the existing in-house applications (such as HR and CRM) and the external sources (such as Alfresco, FatWire, Magnolia, and Vignette).

What this book covers

In Chapter 1, we look at what Liferay portal is and why we should use it. Then we introduce the Liferay portal architecture and framework. Liferay portal can be extendible at three levels—Plugins SDK environment, Extension environment, and Liferay portal source code. Finally, we discuss portal development strategies in detail.

In Chapter 2, we cover the experience of Liferay portal and portlets, using JSR-286 portlets, employing portlet configuration, context, request, response, and preferences, extending JSR-286 portlets, serving resources, and coordinating portlets. It helps you to build larger applications and re-use portlets in different scenarios.

In Chapter 3, we look at how to set up, build, and deploy Ext by using ServiceBuilder, how to set up Plugins SDK, and how to use development environments in an efficient way.

In Chapter 4, we include experiencing Struts portlets in our discussion, where we first discuss how to develop a JSP portlet. Then we introduce how to develop a basic Struts portlet in Ext—defining the portlet, and specifying page action, and page layout. Accordingly, we also introduce how to develop an advanced Struts portlet in Ext—redirecting, adding more actions, setting up permissions, and so on. Finally, we address how to use Struts efficiently.

In Chapter 5, we first look at extending the Communities portlet, then we move on how to customize the Manage Pages portlet. We also look at how to customize page management with more features, and use communities and layout pages in an efficient way.

In Chapter 6, we focus on customizing the WYSIWYG editor. We first introduce how to configure the WYSIWYG editor, quickly deploy the updates, and upgrade it. Then we introduce how to customize FCKeditor to make images, links, videos, games, video queues, video lists, and playlists a part of web content. Finally, we introduce how to use the WYSIWYG editor FCKeditor.

In Chapter 7, we look at one of the most common parts of Liferay portal—CMS and WCM. We first discuss how to manage the terms of use dynamically with a journal article. Then, we present a way to build articles with multiple image icons, rating, comments, polls, related content, recently added content, and so on. Finally, we discuss how to use and extend CMS and WCM. We also discuss relationship among articles, structures, and article templates, CMS extension, and the Asset Publisher portlet extension.

In Chapter 8, we look at how to build My Community in general, and how to customize and extend this feature as well. First, we introduce how to share web site, pages, or portlets with friends. Then we introduce how to customize My Account and how to build My Street with personalized preferences. Finally, we address the best practices to use My Community efficiently, including dynamic query API, pop-up JavaScript, My Community settings, My Account Control Panel, user account extension, and user preferences.

In Chapter 9, we discuss how to develop layout templates in both Ext and Plugins SDK, and how to build themes in Plugins SDK. It introduces how to build layout templates in Ext first. Then it discusses how to build layout templates and themes in Plugins SDK and how to add Velocity services in themes. Finally, it addresses how to use Plugins SDK in an efficient way.

In Chapter 10, we focus on how to build My Social Office in general. We introduce Control Panel first—how it works and how to customize it. Then we address Inter-Portlet Communication (IPC)—how to build IPC portlets. Later, we discuss how to set up Social Office themes and portlets, and how to hook language properties, and portal properties. Finally, we discuss an efficient way to use hooking features.

In Chapter 11, we look at staging and publishing both locally and remotely, where we first discuss simple extension—how to build dynamic navigation and how to construct customized site map. Then, we address how to handle events and model listeners. Based on these features, we further introduce local staging and publishing, and staging workflow. A way to schedule pages and assets is also discussed. Finally, we address how to publish the web content remotely, where portlet-data-handler (for export and import via LAR) is addressed as well.

In Chapter 12, we first cover how to use custom attributes for both journal article templates and custom portlets. Then, we address how to build OpenSearch and how to employ search capabilities. Later, we focus on approaches on how to employ Spring services and how to construct web services. Finally, we discuss the best practices such as using JavaScript portlet URL, customizing the user and organization administration, speeding up portal, sharing UI Taglibs, producing and consuming WSRP, and integrating with SharePoint and Terracotta DSO.

What you need for this book

This book uses Liferay portal version 5.2.3 mainly with the following settings in Windows:

  • Eclipse IDE 3.4

  • MySQL 5.0

  • Java SE 6.0

  • Tomcat 6.0

Optionally, you can also work in Windows, MacOS, and Linux with the following settings:

  • Liferay portal version 5.2.3 or above

  • Eclipse IDE 3.4 or above

  • MySQL 5.0 or above

  • Java SE 5.0

  • Tomcat 5.5

You can use one of the following options for Servlet containers and full Java EE application servers to run the Liferay portal:

  • Geronimo + T0omcat

  • Glassfish 3

  • Glassfish 2 for AIX

  • Glassfish 2 for Linux

  • Glassfish 2 for OSX

  • Glassfish 2 for Solaris

  • Glassfish 2 for Solaris (x86)

  • Glassfish 2 for Windows

  • JBoss + Tomcat 4.2

  • JBoss + Tomcat 5.0

  • Jetty

  • JOnAS + Jetty

  • JOnAS + Tomcat

  • Resin

  • Tomcat 5.5 and 6.0

  • Borland ES 6.5

  • JRun 4 Updater 3

  • Oracle AS 10

  • Orion 2.0

  • Pramati 5.0

  • RexIP 2.5

  • SUN JSAS 9.1

  • WebLogic 8.1 SP4, 9.2, 10

  • WebSphere 5.1, 6.0, 6.1, 7.0

Databases that the Liferay portal can run on include:

  • Apache Derby

  • IBM DB2

  • Firebird

  • Hypersonic

  • Informix

  • InterBase

  • JDataStore

  • MySQL

  • Oracle

  • PostgresSQL

  • SAP

  • SQL Server

  • Sybase

Operating systems that the Liferay portal can run on include:

  • LINUX (Debian, RedHat, SUSE, Ubuntu, and so on)

  • UNIX (AIX, FreeBSD, HP-UX, OS X, Solaris, and so on)

  • WINDOWS

  • MAC OS X

Who this book is for

This book is for Java developers who want to build custom web sites, portals, and highly customized intranet applications using Liferay as a framework. Readers need to know the basics of Liferay and be competent Java developers. They should have some knowledge of the "standards" that Liferay adopts, but that's not so essential—we will try to explain the important ones in the book.

Although Liferay portal makes heavy use of open source frameworks such as Spring, Hibernate, Struts, and Lucene, no prior experience in using these is assumed.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The above code shows that the BookReportsPortlet portlet extends StrutsPortlet and the portlet mode VIEW is specified."

A block of code will be set as follows:

<portlet>
<portlet-name>book_reports</portlet-name>
<struts-path>ext/book_reports</struts-path>
<use-default-template>false</use-default-template>
</portlet>

When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be shown in bold:

PortletPreferences prefs = renderRequest.getPreferences();
String currentURL = PortalUtil.getCurrentURL(request);
%>

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "when the user enters an empty book title and clicks on the Add Book button, the error page depicts an error message: Error! The Book Title is null!".

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply drop an email to , and mention the book title in the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email .

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code for the book

Visit http://www.packtpub.com/files/code/4701_Code.zip to directly download the example code.

The downloadable files contain instructions on how to use them.

Errata

Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration, and help us to improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or web site name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.