Developing Portlets with Apache Pluto
Portal Driver Tag Libraries
The Pluto Driver implements custom tag libraries as a means to invoke the portlet container and other portal services. These tag libraries make it easy for portlet developers to customize the portal without needing to know the portal and portlet API. All tags within the Pluto library accept both runtime expression values and expression language attributes.
|pluto:portlet||Used to include a specified portlet (including any portal decorations). This tag acts as a context for all other tags within the Pluto tag library. The tag accepts a single portletId attribute that identifies the portlet to be included.|
|pluto:title||Renders the currently included portlet's title. This tag may only be used within the context of the portlet tag.|
|pluto:window||Renders a window control URI. This tag allows the user to specify both a window state and a portlet mode to which the portal should modify the portlet whenever the rendered URI is invoked. This tag is valid only within the scope of a portlet tag invocation.|
|pluto:render||Used to render the content of the encapsulating portlet. The render tag outputs only the content directly retrieved from the portlet container and does not include any decorations. The tag must invoked from within the context of a portlet tag.|
The Pluto Driver Controller Servlet
org.apache.pluto.driver.PortalDriverServlet implements a simple controller that is the center piece of a the Pluto Portal Driver. The servlet translates HTTP requests into an invocation plan by matching the requested page and portlet invocations with the configuration components defined by the configuration service.
The Pluto Portal Resources
|WEB-INF/web.xml||Provides the Web application configuration needed to utilize the portal driver.|
|WEB-INF/pluto-portal-driver-config.xml||Provides the driver configuration as described above.|
|WEB-INF/pluto-portal-driver-services-config.xml||Provides the portal services configuration. This configuration allows for the inclusion of custom services such as an RDBMS portlet registry.|
|WEB-INF/fragments/template.jsp||The user interface component that provides the default look and feel for the portal.|
|WEB-INF/fragments/portlet-page.jsp||The user interface component that provides the page layout for portal pages.|
|WEB-INF/fragments/portlet-skin.jsp||The user interface component that provides the portlet decorations and layout for each portlet present on a page.|
In addition to the Container, Portal Driver, and Portal subprojects, Apache Pluto project has developed various utilities that can ease the development of portlets.
Reading and Writing Portlet Descriptors
Pluto's descriptors libraries are developed and published as separate modules to ease the development of code that must read and write the portlet descriptor (portlet.xml). The descriptor-api libraries provide domain objects representing the elements of the descriptor as well as standard service interfaces for reading and writing their contents. The descriptor-impl module provides a default implementation of the services. This implementation uses castor to read and write portlet.xml files.
The Pluto TestSuite is a compliant portlet that exercises many of the functions of the Pluto Portal and Pluto Portlet Container. Specifically, the TestSuite aims to provide as many end to end portlet tests that exercise specification requirements as possible. The purpose of the TestSuite is two-fold. Primarily, it provides a visual means for verifying that Pluto is conforming to the specification. Secondarily, it is a great source of reference by portlet developers. Because the portlet aims to be as comprehensive as possible, it is likely that any questions a portlet developer may have concerning standard portlet tags or APIs would be implemented within the portlets.
The Pluto Utilities Subproject
The Pluto utilities subproject contains utilities for building and installing the Pluto portal. It also contains the tools needed to deploy Pluto. These utilities are addressed in detail in the following sections.
Developing and Testing Portlets with Pluto
Pluto 1.1 is currently under development. It provides many enhancements over its predecessor (1.0) that allow for simplified installation of the portal and deployment of portlets. However, it has not yet been officially released. The first binary (alpha) release of Pluto 1.1 is expected in Q4 of 2005. In the meantime, individuals may build Pluto 1.1 from source.
Checking Out the Pluto Source Code
All Apache Software is readily available in the ASF Subversion repository. The following steps can be followedto check out the Pluto 1.1 source code.
- Install a Subversion Client.
- Check out the Pluto 1.1 repository from the following URL.
svn.apache.org/repos/asf/portals/pluto/branches/pluto-1.1/When using the command line interface client, this is done by executing:
svn checkout <target-url> <local-directory>
Investigating and Building Pluto
Apache Maven is used as Pluto's project management and build tool. (Click here to learn more about Maven 2). You must have Maven 2 installed to build Pluto 1.1 from source and to use the utilities subproject.
In addition to some licensing information and build files, the source distribution of Pluto 1.1 contains several directories. Each of these is a module of the Pluto project. The following listing describes each of the modules:
- maven-pluto-plugin—A maven plugin for Pluto. The plugin is used by the utilities subproject to install the Pluto portal and deploy portlets.
- pluto-container—The Pluto Portlet Container libraries
- pluto-deploy—Deployment libraries for the Pluto Portal Driver
- pluto-descriptor-api—The domain model and services interfaces for the Pluto descriptor library.
- pluto-descriptor-impl—The default implementation of the services interfaces of the Pluto descriptor library.
- pluto-portal—The user interface components of the Pluto Portal.
- pluto-portal-driver—The Pluto portal driver libraries.
- pluto-site—The Pluto Web site and documentation.
- pluto-testsuite—The Pluto Testsuite portlet application.
- pluto-util—The Pluto Utilities.
All modules of Pluto are built by executing the install Maven2 lifecycle.
cd <pluto-home> m2 install
This command will build a single artifact for each module and place it within the local Maven repository. Artifacts also may be found in <module-root>/target.
Page 2 of 3