...
Plugin - An archive file (.car or .war) that can be installed into Geronimo to install a specific new service, such as ActiveMQ. For more about plugins, or to look at available plugins, check out geronimoplugins.com or geronimoplugincentral.org.
.CAR file (Configuration ARchive) - An archive file that stores Geronimo-specific configurations, as well as the classes, libraries, web pages, and other information associated with an application.
.WAR file (Web ARchive)- An archive file that contains a web application, including all of its classes, libraries, HTML and JSP pages, and other information. It can be deployed on any Java Enterprise compatible servlet container.
ACE (Administration Console Extension) - An archive file (either a .car or a .war), that includes Administration Console portlets. These portlets will be added to the Extensible Administration Console when the ACE is activated.
Extensible Administration console - A flexible version of Geronimo's original administration console. Once installed it is available at http://localhost:8080/console, and includes some portlets that correspond to the currently activated services in Geronimo.
Service - a component or set of functionality for Geronimo - it may be pre-installed, such as the Tomcat or Jetty web container, or it may be installed as a plugin.
Minimal console - The administration console as it is first installed - with only the services necessary for basic functionality.
Portlet - A web user interface component that can be assembled together with other similar components to create a web (portal) page. See the Portlet Specification JSR 286.
...
- Declare a dependency on the
pluto-porta
pluginCode Block XML XMLborderStyle solid <dependencies> ... <dependency> <groupId>org.apache.geronimo.plugins</groupId> <artifactId>pluto-support</artifactId> </dependency> </dependencies>
- Define an
AdminConsoleExtensionGBean
where the attributes are defined as follows: XMLCode Block XML borderStyle solid <gbean name="example" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean"> <attribute name="pageTitle">Testing</attribute> <attribute name="portletContext">/HelloWorldPortlet</attribute> <attribute name="portletList">[HelloWorldPortlet]</attribute> </gbean>
- pageTitle is the name of the page to add these portlets to (new or existing)
- portletContext is the context of where the portlets are installed.
- portletList is a comma-delimited list of the portlets to be added to this page.
Code Block | XML | XML | borderStyle | solid|
---|---|---|---|---|
| ||||
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.2"> <environment> <moduleId> <groupId>org.apache.geronimo.portals</groupId> <artifactId>pluto-example</artifactId> <version>1.0-SNAPSHOT</version> <type>war</type> </moduleId> <dependencies> <dependency> <!-- Put a dependancy on the hosting portal (pluto) --> <groupId>org.apache.geronimo.plugins</groupId> <artifactId>pluto-support</artifactId> </dependency> </dependencies> </environment> <!-- This is where the files are accessed from. (aka - portletContext) --> <context-root>/HelloWorldPortlet</context-root> <!-- Start off a ACEGBean, this is the lifecycle for the portlet --> <gbean name="PlutoTest" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean"> <attribute name="pageTitle">Hello</attribute> <attribute name="portletContext">/HelloWorldPortlet</attribute> <attribute name="portletList">[HelloWorldPortlet]</attribute> <reference name="PortalContainerServices"> <name>PlutoPortalServices</name> </reference> </gbean> </web-app> |
...
Verifying installation
Go to http://localhost:8080/console/ to verify that the portlets were added to the correct page. (You may need to refresh the browser if you deployed the application from the command line.)
...
This is a working simple example of an Administration Console Extension.
Download the example WAR
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
package org.apache.pluto.examples; import java.io.IOException; import java.io.PrintWriter; import javax.portlet.GenericPortlet; import javax.portlet.PortletException; import javax.portlet.RenderRequest; import javax.portlet.RenderResponse; /** * A very simple portlet example. * This portlet displays 'Hello World' to the end user */ public class HelloWorldPortlet extends GenericPortlet { // This function is called when a user requests to view this portlet (by // navigating to the webpage in Pluto) public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { // Set the response to read HTML response.setContentType("text/html;charset=UTF-8"); // Required call for use of getWriter() and getPortletOutputStream() PrintWriter out = response.getWriter(); // Write content to the portlet out.println("<h1>Hello World</h1>"); } } |