31,19 €
Enterprises need more than just basic services; they need value-creating entities, which are crucial for running a successful business. Portals offer tremendous value to enterprises, and JBoss Portal Server is a popular, feature-rich open-source server that provides a standards-compliant platform to host functionality that serves the diverse portal needs of an enterprise. Its primary strength lies in its ability to provide robust support for custom implementation of functionality using the JSR-168 portlet API.
This book is a practical guide for installing, configuring and building feature-rich portal applications using the latest JBoss Portal Server 2.7.0. It explains, with examples, how portals can be easily developed, personalized, secured and integrated with other external enterprise assets..
The book will equip you with everything you need to know about JBoss Portal Server to build a fully functional portal. Using it, you can quickly come up to speed with the features offered by the portal server and can start using it almost immediately to develop enterprise portal solutions such as corporate intranets, B2B, or B2C sites. The book will help you to quickly understand and build enterprise portals with rich features such as personalization, AJAX, single sign-on, Google widget integration, remote portlet integration, content management and more. Along with feature implementation, the book also provides enough details for developers to tune and customize the portal environment to best suit the platform needs.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 266
Veröffentlichungsjahr: 2009
Copyright © 2009 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2009
Production Reference: 1190109
Published by Packt Publishing Ltd.
32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-847194-10-7
www.packtpub.com
Cover Image by Vinayak Chittar (<[email protected]>)
Author
Ramanujam Rao
Reviewers
Prabhat Jha
Russ Olsen
Senior Acquisition Editor
Rashmi Phadnis
Development Editor
Dhiraj Chandiramani
Technical Editor
Aanchal Kumar
Copy Editor
Sumathi Sridhar
Editorial Team Leader
Akshara Aware
Production Editorial Manager
Abhijeet Deobhakta
Project Team Leader
Lata Basantani
Project Coordinator
Leena Purkait
Indexer
Monica Ajmera
Proofreader
Dirk Manuel
Production Coordinator
Shantanu Zagade
Cover Work
Shantanu Zagade
Ramanujam Rao is a software engineer, architect, and trainer specializing in building large-scale enterprise applications. He has over 13 years of experience in designing and developing complex web architectures, including portals, and helps enterprises in building scalable, distributed applications on the JEE platform.
He writes frequently on enterprise architecture, and actively consults in the field of information technology management, including technology platforms, technology strategy, and application delivery.
He has a B.S. in Electrical Engineering, an M.S. in Computer Science, and an MBA from Ohio State University. He currently lives and works in Columbus, OH, USA.
I'd like to thank my wife, Bharathi, and my daughter Gitanjali, for their constant support and for managing things during my long absences in the course of writing this book. I'd also like to acknowledge our parents, whose sacrifices and encouragement have always been part of everything I do.
I'd like to acknowledge the technology community in general, whose shoulders I stand on, including the folks at JBoss portal, and my colleagues at Nationwide Insurance.
Finally, a big thanks goes to the technical reviewers Russ and Prabhat, whose feedback was invaluable, and the entire Packt editorial team for their dilligence in getting the book out in a great shape.
Prabhat Jha works as Senior Engineer at JBoss, a division of Red Hat Inc. He has been working on JBoss Portal for the past two years, primarily on its integration aspects, performance, and scalability. He is also a contributor to PortletSwap (http://www.jboss.org/portletswap ). He holds a Masters degree in Mathematics from the University of Texas in Austin, and has been working with Java and JEE for the past five years. He evangelizes portal technology at different Java User Groups (JUG).
Russ Olsen has been writing programs for over 25 years. During that time Russ has built systems in such diverse areas as low-level hardware control, inventory management and GIS, using everything from assembly language to Ruby. Active in both the Java and Ruby communities, Russ is the author of Design Patterns In Ruby.
Dedicated to my parents, Narsingh and Bharathi Rao
Enterprises need more than just basic services; they need value-creating entities, which are crucial for running a successful business. Portals offer tremendous value to enterprises, and JBoss Portal Server is a popular, feature-rich open-source server that provides a standards-compliant platform for hosting functionality that serves the diverse portal needs of an enterprise. Its primary strength lies in its ability to provide robust support for custom implementation of functionality using the JSR-168 portlet API.
This book is a practical guide to installing, configuring, and using JBoss Portal Server. It explains, with examples, how to easily build feature-rich portals using JBoss. As you move further on, you will learn to personalize your portals and add new features to them. This book will equip you with everything you need to know about JBoss Portal Server to build a fully-functional portal. It will help you to quickly understand and build enterprise portals with rich features, such as personalization, AJAX, single sign-on, Google widget integration, remote portlet integration, content management, and more. Along with feature implementation, the book will also provide developers with enough detail to be able to tune and customize the portal environment to best suit the platform needs.
Chapter 1 reviews portals, their functions, and their values. It talks about portal servers and the specifications that govern the creation and management of portals on the J2EE platform. Portal servers go beyond serving custom content and provide a feature-rich set of robust pre-built functions that take away the need to create certain fundamental sets of features from scratch each time. This chapter shows that, by removing the development efforts behind creating such features, portal developers can now spend their time and money on developing business functions.
Chapter 2 talks in detail about the installation process of JBoss portal, with an emphasis on the differences and caveats for the various installation types offered, depending on the usage scenarios. A simplified installation and deployment process facilitates faster implementation and fewer problems, as demonstrated by almost immediate creation and management of pages on the platform.
Chapter 3 goes a bit deeper into JBoss portal server and explains portlets better by creating a simple portlet application. It goes through the complete life cycle from code creation to deployment. This overview tour gives you a good idea of the major components that are required to create a functional portlet.
Chapter 4 reviews the various options that are available to effectively manage the presentation of portlets using technologies such as JSP, JSF, and so on. It shows a few examples of each one of them. To understand the concepts better, a portal application is created from scratch and a custom portlet, created with JSP-based view is added to this new application.
Chapter 5 reviews how the power of portals can be extended by facilitating features such as customization and personalization. It further extendeds our example portal to include custom layouts, themes, and other personalization features. It also shows how we can personalize a page and offer the users options for controlling the contents on the page.
Chapter 6 shows how JBoss portal blends the dynamism and rich functionality offered by AJAX with its strong portal architecture, to provide users with choices for developing highly-functional portal applications. It also discusses the limitations of the current specification and walks through an example that shows how easy it is to develop and deploy AJAX-based portlets.
Chapter 7 talks about how Hibernate, a very popular ORM tool, is used internally by JBoss applications, and how applications can integrate database support into portlet applications by using Hibernate.
Chapter 8 elaborates upon a simple but robust content management system provided by the JBoss portal that is sufficient for most of the needs for a portal application. Using interceptors, CMSAdmin, and CMS Portlets, the user can develop a functionality that helps to effectively manage and deliver content. This chapter extends our example further, to add some new content, and then edit it. It also shows how easy it is to add, edit, and manage content in the portal.
Chapter 9 discusses the various aspects of security as they relate to JBoss portal server and its functional components — the portal objects. JBoss portal allows a fine-grained level of control over portal objects such as portal instances, pages, and portlets. Security is an important function of an application. JBoss portal offers a varied set of options that allow the building of highly secure enterprise applications on the portal server.
Chapter 10 discusses the basics of remoting portlets before it goes into a few implementations using some real-world examples. It talks about how easily the portlets can be exposed as remotely available services, and how remote services can be consumed relatively effortlessly.
Chapter 11 talks about some of the features specified by the new portlet specification, such as portlet co-ordination, and filters introduction. It tells us how Portlet 2.0 provides a comprehensive set of options for performing robust portlet coordination by using events, as well as public parameters that tremendously increases the capabilities of portals and portlets by opening up possibilities for integrating not only within the application, but also with other applications within the enterprise.
This book is for portal developers, administrators, designers and architects working on the Java platform, who want to build web portal solutions. The book doesn’t expect an expert knowledge of portal or JEE technologies, but does presume a basic understanding of web technologies and the Java/JEE platform. However, the concepts are lucid enough that any competent developer can easily find immediate value in the book, and start creating dynamic portals.
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: "We can include other contexts through the use of the include directive."
A block of code will be set as follows:
When we wish to draw your attention to a particular part of a code block, the relevant lines or items will be set in bold:
New terms and important words are introduced in a bold-type font. Words that you see on the screen, in menus or dialog boxes for example, appear in our text like this: "Clicking on the Configure Dashboard link will take us to the page which provides interface to design our dashboard".
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
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 send an email to<[email protected]>, making sure that you 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 via the SUGGEST A TITLE form on www.packtpub.com, or send an email to <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book on, see our author guide on www.packtpub.com/authors.
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.
Visit http://www.packtpub.com/files/code/4107_Code.zip to download the example code.
The downloadable files contain instructions on how to use them.
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 to improve subsequent versions of this book. If you find any errata, 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. Existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
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 the location address or website name immediately so we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with some aspect of the book, and we will do our best to address it.
A portal in the true sense of the word, is a common entrance to a destination. Portals on the Internet, also called web portals, are a single entry point to an application that provides varied features such as personalized and aggregated content, search capabilities, and customized applications.
Portals have gained significant popularity as a means for generating business values through efficient marketing, sales, and services, as well as being a channel for providing timely, useful, and accurate information and services to users.
In this chapter, we will review the basics of web portals, their types, differentiating characteristics, and uses.
Later in the chapter, we will also talk about portal servers, their types, applications architecture, and governing specifications. Portlets are independent pieces of functions that constitute a portal application. We will also briefly discuss how these basic building blocks help in providing the overall value for a portal application.
Today, information from web sites is not only served through static web sites, but also through focused and customized gateways targeted at a specific customer segment. Towards that goal, portals have gained significant popularity in the past few years as an efficient, convenient, and effective way of organizing, aggregating, and customizing information for users. Portals are particularly effective in enterprises, where the challenges of information management and delivery are overwhelming. They can offer an approach to leveraging existing IT investments and seamlessly integrating diverse functionality through a single, user-friendly channel.
Broadly, the features offered by portals are as follows:
Portals have gained acceptance in the enterprise due to their capability to streamline and organize diverse applications through a single channel. The productivity gains experienced by an employee, customer, or a partner clearly provide immense functional value to an enterprise, due to features such as easy access to a wide array of enterprise resources, consolidated search capability and content management. Similarly, enhanced user experience through customized content, persistent preferences, and single/seamless sign-on access result in satisfied users.
Due to the need to consolidate applications and content across the enterprise, portals provide subsidiary benefits of aligning business units in terms of the applications they create and the content they generate, with a single customer/user view.
Some of the benefits of having portals are listed here:
Portals can be categorized in many ways. However, the most logical way of classifying them is based on the functionality they provide, and the users they cater to. Function‑based categorization focuses on the former, while user-based categorization focuses on the latter.
Based on the functionality offered by portals, they can be classified as vertical portals or horizontal portals. These include both portals offered within the enterprise and portals that provide standalone applications on the Internet.
Vertical portals, also called Vortals are the types of portals that are built to provide a full-stack implementation of single business functionality. All of the sub-elements of a vertical portal are built to provide different features of a single business function. Vertical portals are very popular among electronic and web-based business web sites.
Web-based business application users prefer a feature-rich application with easy access to functionality and a productive user experience. Vertical portals try to provide all possible features to a user in the most efficient way, centered around the business function, thus making the experience of doing business mutually valuable to both the users and the business.
Web sites offered by brokerage houses, medical/health services, and so on, are almost always vertical portals, where their customers are provided with various services related to their businesses. As seen in the following example, the business uses a vertical portal to provide all the services related to its business to the user through a single channel. The various page segments are independent functionalities, but they all are a part of the offerings of the same business function.
Horizontal portals offer a broad set of functions that are not aligned to a single scope, function, or capability. The idea here is to provide users with a set of aggregated information from various disparate sources based on some loosely defined categories. Each individual portal segment is unrelated to the other, and each operates independently in terms of content, scope, and function. Horizontal portals are typically built to cater to a broader audience that has diverse interests and preferences. This is different from vertical portals, which are built for a specific audience with a focused scope.
Web sites such as iGoogle, Yahoo!, and so on, are prime examples of horizontal portals. As seen in the following screenshot, the horizontal portal provides functions from various unrelated sources, but together, they meet the diverse needs of the user.
User-based classification is a different way of looking at portals, and here, portals are categorized based on the type of users who use the portal. These users can be other businesses, customers, or employees. Hence, we have new sub-categories such as B2B(Business to Business), B2C(Business to Consumer), and B2E(Business to Employee).
This type of portal is built for interaction with other businesses, as opposed to direct customers. A B2B portal facilitates activities between businesses that are a part of their business workflow. Examples of these are verifications, transactions, approvals, reports, and so on, all without manual intervention. Some good examples are companies that offer EDI services to others businesses, who then retrieve the data as and when required. Logistics management in businesses leverages such B2B services for activities such as order processing, fulfillment, and so on. B2B portals are usually used by businesses as a method of servicing their customers, and are less reliant on personalization and user interface aspects, when compared to other portal types.
With the increasing popularity of the Internet-based transactions, improved reliability, higher bandwidth, and so on, more and more businesses are, today, looking at reducing construction costs and expanding B2B portals to serve their business customers, who in turn, are constantly looking for ways to optimize their processes through automation.
These are the most common type of portals, and encompass pretty much all e‑commerce web sites that deal with customers directly. Examples of these portals are amazon.com, walmart.com, and so on. Instead of software systems and businesses interacting with the portal, a B2C directly interacts with the end customers, and hence, personalization, user interface, and user experience are of significant importance if the business wants to attract and retain its customers.
This type of portal can also be termed as an intranet portal; a B2E portal is built by a company or a business as a source of information and services for the exclusive use of internal company employees. Unlike a corporate intranet static web site, which is very generic in terms of its content and audience, a B2E portal is built to offer tailored information to an employee depending, typically, on his or her position, role, and location in the organization. Examples of the information and services provided by a B2E portal are: vacation reporting, performance summary, time management, resource ordering, pay information, and any specific — possibly sensitive — notifications.
Portal servers are software implementations of portal functionalities. They come either as standalone applications, tightly integrated with the application server they are built on, or they come as separate applications that can be deployed on an application server of choice. In this book, we will use the word portal to indicate a portal server.
A typical enterprise portal architecture is depicted in the following figure:
Fundamentally, today's enterprise portals can be viewed as aggregators of structured and unstructured data, which provide a consistent view to the end user. In our case, the structured data is represented by the RDBMS, and the unstructured data is depicted as XML or RSS feeds. Apart from data, portals also integrate with enterprise services.
As seen in the previous figure, the major components of a modern portal architecture are as follows:
Portals provide their differentiating functions by leveraging their core components and integrating with other external entities, such as databases, services, search engines, and enterprise applications. There are many popular portal server implementations in the industry today, providing a diverse set of features and implementing specifications to varying degrees. Examples of these are IBM Websphere Portal Server, BEA Portal, LifeRay, and JBoss Portal Server.
Portals are implemented in various technologies. In this book, we will focus on J2EE technology and portal implementation on that platform.
As with any other API or feature in J2EE, portal and portal server implementations are governed by commonly-agreed industry standards and specifications. JSR-168 and JSR-286, also called the Portlet Specifications, govern the standards for portal technology on the J2EE platform. Before we go further into the portal server architecture, let us review some terminology.
The components of this figure are described here:
Let us look at an example of how these components are used. The following figure shows a high-level view of how a portal processes a request, and the specific role of the components of the portal:
