Previous | Table of Contents | Next

Page 514

FIG. 19.5
Web Cartridge
Applications and
Objects Section.


Enter the following values:

FIG. 19.6
Creation of a virtual
directory for the
cartridge.


Page 515

Once these values are entered, select the Modify WRB Configuration button to update the Broker configuration. As before, success is indicated at the top of the Web page once the configuration is updated and the page refreshed by the broker.

Create a Base HTML FileFinally, the last step for a Cartridge implementation is to create the base HTML file. This file should be saved into the virtual directory created for HTML code earlier. Oracle includes a sample base HTML file if you load the Forms demos. This base HTML file is located in ORACLE_HOME\forms45\demos\webdemos and is called cartridg. I took this file and modified its content to get the following generic base HTML file in
Listing 19.1:

Listing 19.1 WEB_CART.HTM—Sample of a Base HTML File for the Web Forms Cartridge Implementation

<HTML>
<!-- FILE: Cartridge.html -->
<!-- Oracle Cartridge File Template (Windows NT) -->
<!-- Rename, and modify tags and parameter values as needed -->
<HEAD><TITLE>Developer/2000 for the Web</TITLE></HEAD>
<BODY><BR>Please wait while the Forms Client class files download and run.
      <BR>This will take a second or two...
<P>
<!-- applet definition (start) -->
<APPLET CODEBASE="^Codebase^"
        CODE="^Code^"
        ARCHIVE="/Web_jars/f45web.jar"
        HEIGHT=20
        WIDTH=20>
<PARAM NAME="serverPort" VALUE="9000">
<PARAM NAME="serverArgs" VALUE="module=^Module^">
</APPLET>
<!-- applet definition (end) -->
</BODY>
</HTML>

Note that the variables defined in the Cartridge are in place for Code and Codebase and they are delimited by the character defined as the HTML delimiter in our cartridge definition. There is one variable left in the HTML file that is not defined. The Module variable will be entered on the URL when the application is called. Leaving this variable for definition on the URL will allow this cartridge to be used for many different Web forms implementations. Any variables not defined in the cartridge but referenced in the base HTML file for the cartridge must be input on the URL as defined in the following section for running the forms.

Having completed this step, the cartridge is now fully configured and ready for use. Before calling the Web form, the Web server should be stopped and then restarted. This can usually be done from the Services applet on the Windows NT Control Panel.

Page 516

Non-Cartridge Implementation Requirements

The only setup requirement for the noncartridge implementation of the Oracle Web forms is that a static file be created for each Web application to be implemented. This file should be placed in the virtual directory created earlier for the HTML code. As with the Cartridge type implementation, Oracle includes a sample base HTML file if you load the Forms demos. This HTML file is located in ORACLE_HOME\forms45\demos\webdemos and is called static.html. I took this file and modified its contents to get the following static HTML file for my demo in Listing 19.2:

Listing 19.2 STATIC.HTM—A Static HTML File for Use with Oracle Web Forms Non-Cartridge Implementation

<HTML>
<!-- FILE: static.html -->
<!-- Oracle Static (Non-Cartridge) HTML File Template (Windows NT) -->
<!-- Rename, and modify tags and parameter values as needed -->
<HEAD><TITLE>Developer/2000 for the Web</TITLE></HEAD>
<BODY><BR>Please wait while the Forms Client class files download and run.
      <BR>This will take a second or two...
<P>
<!-- applet definition (start) -->
<APPLET CODEBASE="/Web_code/"
        CODE="oracle.forms.uiClient.v1_4.engine.Main"
        ARCHIVE="/Web_jars/f45web.jar"
        HEIGHT=20
        WIDTH=20>
<PARAM NAME="serverPort"
       VALUE="9000">
<PARAM NAME="serverArgs"
       VALUE="module=a:\Empch16a.fmx userid=system/manager">
<PARAM NAME="serverApp"
       VALUE="default">
</APPLET>
<!-- applet definition (end) -->
</BODY>
</HTML>

With a non-cartridge implementation, you cannot use variables in the HTML file so all values need to be hard-coded, thus the requirement for an HTML file for each application is implemented via the noncartridge method.

Running the Forms from the Web

Until Web browsers that support Java version 1.1.2 are available, the only option available to run the forms is the appletviewer from the Java development kit. The format of the URL that is entered depends on the Web forms implementation (cartridge or noncartridge).

Entering the URLFirst, we will cover the format of the URL for the Cartridge implementation. The cartridge URL must include the virtual directory that was created for the Web cartridge. Also included in the URL are any variables for the base HTML file that were not defined

Page 517

by the cartridge. These variables are entered in the URL following a question mark that is placed after the virtual directory. Below is the URL for my example cartridge Web forms implementation (note: the following command should be entered on one line):

appletviewer http://localhost/Web_html/static.htm

Because userid information was not specified in my example, a prompt to log in to the database will be displayed first, followed by the starting up of the form under Java.

The static version of the Web form implementation will require a call to the virtual directory that contains the static HTML file. Because no variables can be used with the static implementation, the URL is potentially much shorter and straightforward. Following is the URL for my example noncartridge Web forms implementation:

appletviewer http://localhost/Web_html/static.htm

Because the userid information was included in the static HTML file, the Web form is immediately displayed in the Java applet (see Figure 19.7).

FIG. 19.7
The Web form running
under Java.


Regardless of which implementation is used, the display of the form looks and behaves remarkably similar to the client/server version of the form.

Things to Watch Out ForThe first couple times I tried to get an Oracle form to work, I ran into problems with the system finding my form. I started out with a noncartridge implementation and, after double- and triple-checking my implementation, I finally called Oracle. After a few minutes on the phone, it was determined that a line break between the module and userid

Previous | Table of Contents | Next