ebook img

Liferay in action : the official guide to Liferay Portal development PDF

378 Pages·2012·19.147 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Liferay in action : the official guide to Liferay Portal development

Official Guide IN ACTION Richard Sezov, Jr. FOREWORD BY BRIAN KIM M A N N I N G Liferay in Action Liferay in Action The Official Guide to Liferay Portal Development RICH SEZOV, JR MANNING SHELTER ISLAND To my wife: Yo Deborah! I did it! For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. 20 Baldwin Road PO Box 261 Shelter Island, NY 11964 Email: [email protected] ©2012 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15 percent recycled and processed without elemental chlorine. Development editor: Lianna Wlasiuk Manning Publications Co. Copyeditor: Tiffany Taylor 20 Baldwin Road Proofreader: Melody Dolab PO Box 261 Typesetter: Marija Tudor Shelter Island, NY 11964 Cover designer: Marija Tudor ISBN: 9781935182825 Printed in the United States of America 1 2 3 4 5 6 7 8 9 10 – MAL – 17 16 15 14 13 12 11 brief contents PART 1 WORKING WITH LIFERAY AND PORTLETS....................... 1 1 ■ The Liferay difference 3 2 ■ Getting started with the Liferay development platform 30 PART 2 WRITING APPLICATIONS ON LIFERAY’S PLATFORM ....... 63 3 ■ A data-driven portlet made easy 65 4 ■ MVC the Liferay way 91 5 ■ Designing your site with themes and layout templates 128 6 ■ Making your site social 154 7 ■ Enabling user collaboration 176 PART 3 CUSTOMIZING LIFERAY............................................. 209 8 ■ Hooks 211 9 ■ Extending Liferay effectively 241 10 ■ A tour of Liferay APIs 263 v contents foreword xiii preface xv acknowledgments xvii about this book xx about the cover illustration xxiv PART 1 WORKING WITH LIFERAY AND PORTLETS ........... 1 1 The Liferay difference 3 1.1 The Java portal promise: from disappointment to fulfillment 4 The Java portal disappointment 6 ■ Liferay keeps the Java portal promises 8 1.2 Getting to know Liferay 9 Liferay is an application aggregator 10 ■ Liferay is a content manager 12 ■ Liferay is a collaboration tool 14 ■ Liferay is anything you want it to be and any way you want it to look 15 What has this little exercise accomplished? 17 1.3 How Liferay structures a portal 18 The high-level view 18 ■ Adding content to a collection with pages 20 ■ Configuring a portlet’s scope 20 vii viii CONTENTS 1.4 Getting around in Liferay 23 Pin icon 24 ■ Add menu 24 ■ Manage menu 24 Toggle Edit Controls 26 ■ Go To menu 26 ■ User Account 26 1.5 Imagining your site in Liferay 26 Asking the right questions 27 ■ Defining and categorizing collections 28 ■ Designing content 28 1.6 Summary 28 2 Getting started with the Liferay development platform 30 2.1 Installing Liferay and the Plugins SDK 31 Installing the Java SDK 32 ■ Installing a Liferay bundle 33 2.2 A crash course in Liferay server administration 35 Removing the sample web site 35 ■ Setting up a database 35 Connecting Liferay to the SQL database 37 2.3 Setting up the Plugins SDK 38 Installing Ant 38 ■ Installing the Plugins SDK 39 Configuring the Plugins SDK 39 ■ Configuring a non-Tomcat application server 41 2.4 Developing a portlet plugin 42 Creating a portlet plugin: Hello World 43 ■ Deploying the Hello World plugin 43 2.5 Making Hello World into Hello You 45 Anatomy of a portlet project 46 ■ Configuring Hello You 47 Portlet initialization and implementing View mode 49 ■ URLs in portals are different 52 ■ Implementing Edit mode 53 2.6 Deploying and testing your portlet 57 Changing the portlet’s category and name 58 ■ Telling Liferay about a renamed portlet 60 2.7 Summary 61 PART 2 WRITING APPLICATIONS ON LIFERAY’S PLATFORM ...................................... 63 3 A data-driven portlet made easy 65 3.1 Introducing Inkwell: a case study 65 Company profile: Inkwell 66 ■ What Inkwell needs in a web site 67 ■ Inkwell’s high-level portal design 67 ■ Inkwell portal phase 1 requirements 68 CONTENTS ix 3.2 Designing the Product Registration portlet 69 A blueprint of the portlet 69 ■ Designing the database tables 70 ■ Defining portlet modes and generating the project 72 3.3 Generating DB code with Service Builder 72 Filling a definite need 73 ■ Creating the service.xml file 75 Running Service Builder 77 3.4 Creating a buffer to the persistence layer 78 Why layering is important 78 ■ Using two layers for persistence 79 ■ Implementing the DTO layer 80 3.5 Service Builder in action 84 Defining table relationships 84 ■ Sharing services 87 Adding registered users and their products 88 3.6 Summary 90 4 MVC the Liferay way 91 4.1 Using Model-View-Controller 92 Edit mode? What Edit mode? 93 ■ MVC according to Liferay 95 4.2 Configuring the portlet project 96 Defining portlets in your deployment descriptors 97 ■ Having one location for JSP dependencies 99 4.3 Creating a form with AlloyUI taglibs 102 Getting started with AlloyUI tag libraries 102 ■ Providing feedback and messages 105 ■ Translating messages to multiple languages 108 ■ Validating user-submitted forms 109 Displaying data with the search container 111 ■ Using the search container to present your data 111 ■ Editing and deleting data 114 ■ Protecting data with Liferay permissions 116 ■ Pointing to the permissions configuration 116 ■ Configuring Liferay permissions 117 4.4 Generating different field types with AlloyUI taglibs 120 Generating date pickers 121 ■ Selecting data with AlloyUI taglibs 122 4.5 Using Liferay’s MVC makes your portlets simpler 124 4.6 Summary 126 5 Designing your site with themes and layout templates 128 5.1 Understanding themes and their structure 129 Generating a theme project 131 ■ Deconstructing a theme 131

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.