24 Upgrading OHW-UIX

This chapter describes the process of upgrading OHW-UIX to OHW-RC.

This chapter includes the following sections:

24.1 Upgrading OHW-UIX to OHW-RC

When upgrading from OHW-UIX to OHW-RC, the helpsets contents may remain unchanged, however, there are two things you need to do to use OHW-RC:

  • Copy the OHW-RC jar files into the WEB-INF/lib directory.

  • Modify the web.xml file under the WEB-INF/ directory. The best way to do this is to get the web.xml from the OHW-RC demo bundle and copy the servlet and resource definitions and mappings.

There are three major parts required in a web.xml for OHW-RC:

  • Basic configuration for JSF Trinidad and ADF RC (Faces Servlet, Trinidad Servlet and Filter, etc.):

    <context-param>
      <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
      <param-value>client</param-value>
    </context-param>
     
    <filter>
      <filter-name>trinidad</filter-name>
      <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
    </filter>
     
    <filter-mapping>
      <filter-name>trinidad</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
     
    <servlet>
      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
    </servlet>
     
    <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
     
    <servlet>
      <servlet-name>resources</servlet-name>
      <servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
    </servlet>
     
    <servlet-mapping>
      <servlet-name>resources</servlet-name>
      <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
     
    <servlet-mapping>
      <servlet-name>resources</servlet-name>
      <url-pattern>/afr/*</url-pattern>
    </servlet-mapping>
    
  • Basic configuration for OHW-RC:

    You need to define an OHW-RC Filter and map it to the Faces servlet.

    <filter>
      <filter-name>OHWRCFRequestFilter</filter-name>
      <filter-class>oracle.help.web.rich.OHWFilter</filter-class>
    </filter>
     
    <filter-mapping>
      <filter-name>OHWRCFRequestFilter</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
    </filter-mapping>
    
  • OHW-UIX Servlet definition and servlet mapping:

    The existing OHW-UIX servlet definitions need to be changed to use the OHW-RC class oracle.help.web.rich.OHWServlet. The following steps describe how to change existing OHW servlet definitions:

    1. To specify the location of the ohw-config.xml for a OHW-UIX servlet instance, define OHW_UIX servlets with <init-param> named ohwConfigFileURL.

    2. Define the URL mapping for OHW-UIX servlets. You do not have to change the existing servlet mappings.

    3. Specify the <load-on-startup> parameter.

    OHW-RC supports multiple OHW-RC instances in one Web application. Here is an example which deploys two OHW-RC instances in a web.xml:

    <!-- configuration for product1 help front servlet -->
    <servlet>
      <servlet-name>product1</servlet-name>
      <servlet-class>oracle.help.web.rich.OHWServlet</servlet-class>
      <init-param>
        <param-name>ohwConfigFileURL</param-name>
        <param-value>/helpsets/product1/ohwconfig.xml</param-value>
      </init-param>
      <load-on-startup>2</load-on-startup>
    </servlet>
     
    <!-- configuration for product1 help front servlet -->
    <servlet>
      <servlet-name>product2</servlet-name>
      <servlet-class>oracle.help.web.rich.OHWServlet</servlet-class>
      <init-param>
        <param-name>ohwConfigFileURL</param-name>
        <param-value>/helpsets/product2/ohwconfig.xml</param-value>
      </init-param>
      <load-on-startup>3</load-on-startup>
    </servlet>
     
    <servlet-mapping>
      <servlet-name>product1</servlet-name>
      <url-pattern>/product1/*</url-pattern>
    </servlet-mapping>
     
    <servlet-mapping>
      <servlet-name>product2</servlet-name>
      <url-pattern>/product2/*</url-pattern>
    </servlet-mapping>