THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Go to http://localhost:8080/pluto/ to verify that the portlets were added to the correct page. (You may need to refresh the browser if you deployed from the command line.)
Sample Extension
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>"); } } |
...