What Is a Portlet
Pages: 1, 2, 3, 4, 5, 6

Deploying HelloWorld Portlet on Pluto

Pluto is in the early stages of development, so it does not have a set of easy-to-use administrative tools. In order to use the Pluto server, you will have to download both the binary and source versions. Please note that these instructions are for Windows; Unix users can get similar results by changing slashes and using .sh shell scripts rather than .bat batch files.

  1. Create a folder, such as C:\PlutoInstallation.
  2. Download pluto-1.0.1-rc1.zip and pluto-src-1.0.1-rc1.zip from the Pluto website.
  3. Extract pluto-1.0.1-rc1.zip into C:\PlutoInstallation. It should get extracted in C:\PlutoInstallation\pluto-1.0.1-rc1.
  4. Start Pluto by calling C:\PlutoInstallation\pluto-1.0.1-rc1\bin\startup.bat.

    You are ready to access your Pluto server at http://localhost:8080/pluto/portal.

  5. Extract pluto-src-1.0.1-rc1.zip to C:\PlutoInstallation\PlutoSrc.
  6. Go to C:\PlutoInstallation\PlutoSrc and run maven distribute:all.. This should build and download necessary dependencies required for running common admin tasks.

    Now it is time to install our HelloWorldPortlet.war as a portlet.

  7. First, copy HelloWorldPortlet.war to the C:\PlutoInstallation\portlets directory, creating the directory if necessary.
  8. Rename C:\PlutoInstallation\plutosrc\build.properties.sample to build.properties.
  9. Open build.properties and change it so that maven.tomcat.home points to the Pluto binary installation. In our example, this will be maven.tomcat.home=C:/PlutoInstallation/pluto-1.0.1-rc1.
  10. To install your portlet, go to C:\plutoInstallation\plutosrc\deploy and run maven deploy -Ddeploy=c:\PlutoInstallation\portlets\HelloWorldPortlet.war. You should get a "build successful" message.
  11. In C:\PlutoInstallation\pluto-1.0.1-rc1\webapps, you should see a folder for HelloWorldPortlet.
  12. Now, open the web.xml file of your installed portlet by going to the C:\PlutoInstallation\pluto-1.0.1-rc1\webapps\HelloWorld\WEB-INF\ folder. You will see that a few lines are automatically added to this file, like this:
    <servlet>
      <servlet-name>HelloWorld</servlet-name>
         <display-name>HelloWorld Wrapper</display-name>
          <description>Automated generated
          Portlet Wrapper</description>
          <servlet-class>org.apache.pluto.core.PortletServlet
          </servlet-class>
          <init-param>
             <param-name>portlet-class</param-name>
             <param-value>com.test.HelloWorld
             </param-value>
          </init-param>
          <init-param>
             <param-name>portlet-guid</param-name>
             <param-value>HelloPluto.HelloWorld
             </param-value>
          </init-param>
    </servlet>
  13. Now it's time for us to add this portlet to the page. Go to C:\PlutoInstallation\pluto-1.0.1-rc1\webapps\pluto\WEB-INF\data. You will find two XML files there: pageregistry.xml and portletentityregistry.xml.
  14. portletentityregistry.xml contains the definition of the portlet. Add these lines to it:
     <application id="5">
       <definition-id>HelloWorld</definition-id>
         <portlet id="1">
           <definition-id>HelloWorld.HelloWorld</definition-id>
         </portlet>
        </application>

    The <definition-id> of the application should be the name of the web application folder. The portlet's <definition-id> should be equal to the generated portlet-guid in web.xml.

  15. pageregistry.xml defines which portlets to include on the page. Change it like this:
      <fragment name="p2" type="portlet">
        <property name="portlet" value="5.1"/>
      </fragment>
  16. Restart the Pluto server by first calling shutdown and then startup. Now go back to http://localhost:8080/pluto/portal and click on "Test Link"--it should show our HelloWorld portlet.
  17. The right side of Figure 3 shows what your HelloWorld portlet will look like.

    Thumbnail, click for full-size image.
    Figure 3. Screen shot of portlet screen (click for full-size image)

Pages: 1, 2, 3, 4, 5, 6

Next Pagearrow