The Role of Jetspeed-2 Deploy Tools

JetspeedDeploy and the DeploymentManager

JetspeedDeploy prepares portlet applications for deployment within Jetspeed-2. When a new portlet deployment event is registered, the DeployPortletAppEventListener invokes JetspeedDeploy to prepare the portlet application for deployment.

    new JetspeedDeploy(event.getPath(), toFile.getAbsolutePath(), stripLoggers);
            

JetspeedDeploy copies the web application archives (.war) from the input directory to the output directory and parses the web.xml, portlet.xml, and context.xml to ensure their compliance with the Jetspeed-2 portal engine.





JetspeedDeploy invokes the JetspeedWebApplicationRewriter to infuse the web.xml with the JetspeedContainer servlet if it does not already exist:

  <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.