Home >Documents >Geronimo y Eclipse

Geronimo y Eclipse

Date post:07-Apr-2018
Category:
View:219 times
Download:0 times
Share this document with a friend
Transcript:
  • 8/6/2019 Geronimo y Eclipse

    1/31

    Build portlets with Apache Geronimo and EclipseManaging the Liferay portal with the Eclipse Web ToolsPlatform (WTP)

    Skill Level: Intermediate

    Matthew ScarpinoJava Developer

    Eclipse Engineering, LLC

    24 Apr 2007

    Web developers can build multifunctional portals by arranging simple, reusable,event-driven components called portlets. Eclipse makes this process even simpler.First, find out how the Eclipse Web Tools Platform (WTP) provides a completedevelopment environment for editing the code and configuration files needed forportlet projects. Then, by integrating the Apache Geronimo Eclipse plug-in, learn howyou can deploy and display these portlets inside a full portal by accessing theGeronimo application server.

    Section 1. Before you start

    About this tutorial

    With the right open source tools, you can build a Web portal just as capable and

    multifunctional as any huge corporate site. This tutorial explores a method ofcreating such a portal by using three tools:

    The Eclipse integrated development environment (IDE) to develop theproject

    An Apache Geronimo application server to deploy it

    Build portlets with Apache Geronimo and Eclipse Trademarks Copyright IBM Corporation 2007. All rights reserved. Page 1 of 31

    http://www.ibm.com/developerworks/ibm/trademarks/http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/developerworks/ibm/trademarks/
  • 8/6/2019 Geronimo y Eclipse

    2/31

    The Liferay portal to provide the overall structure

    It takes some effort to install these components and work out the versionincompatibilities. But after configuration, the process of building and deploying theportal is straightforward.

    Objectives

    This tutorial covers:

    Organizing and simplifying portal development with the Eclipse WTP.

    Structuring portlets within the Liferay portal.

    Deploying a servlet-based portlet application to a Geronimo application

    server. Deploying a JavaServer Pages (JSP)-based portlet application with a

    Geronimo application server.

    Prerequisites

    This tutorial is written for enterprise Java developers whose skills and experienceare at a beginning to intermediate level. You should have a general familiarity withJava technology, servlets, and JSP pages as well as a passing familiarity withEclipse and how it manages projects.

    System requirements

    To start this tutorial, you need a recent version of Eclipse 3.2 or later on yoursystem. You install the WTP, Geronimo server, Geronimo server run time, andLiferay portal platform during the course of the tutorial.

    Section 2. Portals, portlets, and Geronimo

    Learn the difference between portals and portlets, and discover the role that ApacheGeronimo plays in their creation.

    developerWorks ibm.com/developerWorks

    Build portlets with Apache Geronimo and Eclipse Trademarks Copyright IBM Corporation 2007. All rights reserved. Page 2 of 31

    http://www.eclipse.org/http://www.ibm.com/developerworks/ibm/trademarks/http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/developerworks/ibm/trademarks/http://www.eclipse.org/
  • 8/6/2019 Geronimo y Eclipse

    3/31

    Introduction to portals and portlets

    Java Specification Request (JSR) 168 defines a portalas "a Web application thatcommonly provides personalization, single sign-on, content aggregation from

    different sources and hosts the presentation layer of Information Systems." It definesa portletas a "Web component, managed by a portlet container, that processesrequests and generates dynamic content." Functionally speaking, portlets generatefragments of markup in response to requests, and portals manage these fragmentsand structure them into a framework.

    Large institutions commonly use portals to provide users with multiple capabilitiesfrom a single page. In many cases, these portals also serve as intranet applicationsfor institution-wide communication. Developing these pages would be unbearablewith monolithic servlets, so portlets were created as pluggable components that canbe dynamically added and modified. Thanks to the common JSR 168 standard,

    portal developers can mix and match portlets from different vendors withoutsignificant changes. So there's no need to rewrite registration applications, stocktickers, and Really Simple Syndication (RSS) feeds simply download and deploy,and you're done.

    Thankfully, many open source tools are available that make portal developmentavailable for everyone. The Apache Jetspeed project, released under the ApacheLicense, provides a large set of features that includes database access, role-basedsecurity, and support for the Wireless Markup Language (WML). Apache Pluto is thereference implementation of JSR 168, which means that it can manage and displayportlets according to the standard but doesn't provide the additional features that

    developers have come to expect. The JBoss portal is also very popular and isreleased under the Lesser GNU Public License (LGPL).

    This tutorial uses the Liferay portal platform to structure its content. (See the sidebarLiferay vs. Pluto for reasons why I chose this portal.) This platform is released underthe MIT License, which means you can use it for proprietary purposes withoutpaying royalties. In addition to providing a framework for displaying portlets, itintegrates a large number of capabilities, including:

    Web-based Distributed Authoring and Versioning (WebDAV).

    A complete Content Management System (CMS).

    Directory modification through the Lightweight Directory Access Protocol(LDAP).

    Language translation.

    Support for many different application servers, including Geronimo.

    ibm.com/developerWorks developerWorks

    Build portlets with Apache Geronimo and Eclipse Trademarks Copyright IBM Corporation 2007. All rights reserved. Page 3 of 31

    http://www.ibm.com/developerworks/ibm/trademarks/http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/developerworks/ibm/trademarks/
  • 8/6/2019 Geronimo y Eclipse

    4/31

    Many free example portlets, including chat clients, calendars, clocks, andRSS feeds.

    Liferay vs. PlutoPluto is included in Geronimo and is released by the Apache

    Software Foundation, so I feel compelled to explain why I choseLiferay as the portal framework for this tutorial. It comes down toease of deployment. Liferay provides a Web application that runsimmediately within Geronimo. But the Pluto artifact in the Geronimorepository isn't packaged as a Web application and isn't initializedwhen Geronimo starts. So it would have taken a lot of effort toconfigure a Pluto application for Geronimo and integrate it within theApache Tomcat container.

    Also, according to the documentation on the Pluto site, Maven is thepreferred application for accessing Pluto. Maven provides manyadvantages for large project management, but as I've learned frompainful experience, the Maven plug-in doesn't play well with Eclipseand the WTP. The Pluto site also mentions (in bright red letters!)that "to automate the deployment/installation of portlets, you mustutilize the source distribution of Pluto." This would mean creatingand modifying an Eclipse project with all the Pluto source code anddependent libraries. With Liferay, you never need to touch thesource code to deploy portlets.

    Finally, Liferay provides such a wealth of freely available portletsand functions that I'd feel compelled to mention it even if I'd chosenPluto as the portlet container. And not only is Liferay'sdocumentation vast compared to Pluto's, but it even provides videotutorials of how to perform common tasks. So far, I've been veryimpressed with Liferay in fact, my only complaint against it is thatit provides too muchcapability.

    In addition, Liferay contains a large-scale framework for deploying intranetapplications across dispersed locations. In this way, administrators in a largeinstitution can customize the portal for each branch, location, and community of theirinstitution.

    The Geronimo application server

    In this tutorial, you deploy the example portal and portlet application to a Geronimoapplication server. (Geronimo is released under the Apache License by the ApacheSoftware Foundation [ASF].) The Geronimo application server is a fully certified Java2 Platform, Enterprise Edition (J2EE) 1.4 application server, and despite its youth,stands head-to-head with commercial offerings with regard to features, reliability,and performance. IBM WebSphere Application Server Community Edition isbased on Geronimo.

    Geronimo is structured as a modular set of management objects called GeronimoBeans(GBeans). Every component is wrapped in a GBean and exposes its life cycle

    developerWorks ibm.com/developerWorks

    Build portlets with Apache Geronimo and Eclipse Trademarks Copyright IBM Corporation 2007. All rights reserved. Page 4 of 31

    http://www.ibm.com/developerworks/ibm/trademarks/http://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/legal/copytrade.shtmlhttp://www.ibm.com/developerworks/ibm/trademarks/
  • 8/6/2019 Geronimo y Eclipse

    5/31

    for other components to interact with. Some of the most important components inGeronimo include the following:

    ActiveMQ Message Broker

    OpenEJB Enterprise JavaBeans (EJB) container Tomcat or Jetty Web container

    Remote Method Invocation (RMI)-based naming service

    Apache Derby Relational Database Management System (RDBMS)

    Geronimo can use either the Tomcat or Jetty Web container to deploy itsapplications, but this tutorial relies on Geronimo with Tomcat installed. If you've usedTomcat al

Embed Size (px)
Recommended