The Role of Jetspeed Deploy Tools

JetspeedDeploy and the DeploymentManager

The Jetpeed Deployment tool (JetspeedDeploy) prepares portlet applications for deployment within the Jetspeed Portal. Jetspeed requires that a servlet be added to all portlet application's web.xml declarations before the portlet application can be run with Jetpeed. Your portlet application can be prepared for deployment by you manually editing the web.xml and adding the required servlet, or the tool can be used standalone, from the command line. Or, you can also rely on Jetspeed to add the servlet itself, as the deploy tool is built into the Jetspeed Portal itself. Inside the portal, when a new portlet deployment event is registered, the DeployPortletAppEventListener invokes JetspeedDeploy tool to prepare the portlet application for deployment. When are new events registered? When you drop the portlet application WAR in the deploy directory, which is located by default in the Jetspeed WEB-INF/deploy directory. JetspeedDeploy copies the web application archives (.war) from the WEB-INF/deploy directory to the destination directory (for example, the Tomcat /webapps directory) and parses the web.xml, portlet.xml, and context.xml to ensure their compliance with the Jetspeed-2 portal engine.



The deploy tool then infuses the web.xml with the JetspeedContainer servlet if it does not already exist, which is necessary for any portlet application deployed to Jetpeed:

  <servlet>
    <servlet-name>JetspeedContainer</servlet-name>
    <display-name>Jetspeed Container</display-name>
    <description>MVC Servlet for Jetspeed Portlet Applications</description>
    <servlet-class>org.apache.jetspeed.container.JetspeedContainerServlet</servlet-class>
    <init-param>
      <param-name>contextName</param-name>
      <param-value>${portlet-application-name}</param-value>
    </init-param>
    <load-on-startup>0</load-on-startup>
  </servlet>
  ...
  <servlet-mapping>
    <servlet-name>JetspeedContainer</servlet-name>
    <url-pattern>/container/*</url-pattern>
  </servlet-mapping>
            

In the same fashion, the JetspeedDeploy invokes the JetspeedContextRewriter to manipulate a portlet application context.xml file. For more information about Tomcat context.xml, see tomcat's documentation.

JetspeedDeploy Standalone Usage

JetspeedDeploy can also be invoke through the command line:

    java -jar jetspeed-deploy-tools-<version>.jar -s inputWarPath outputWarPath
            
where:
  • -s: flag indicating whether or not to strip to loggers from the application. When the flag is present, the loggers available in the application will be removed.
  • inputWarPath: the path of the war to process.
  • outputWarPath: the path of the processed war.