Previous | Table of Contents | Next

Page 560

Logger This component automatically collects statistics regarding HTTP requests. You can also configure the Logger to trace the execution of other WebServer components.
Log Analyzer With this component, you can view HTTP-request log entries and run various reports that summarize the execution of Oracle WebServer.
Migration In addition to migrating from WebServer 2.0 to WebServer 3.0, this component enables you to configure the Netscape Server for use with the Oracle Web Broker.
DAD Administration This component enables you to create and modify Database Access Descriptors.
Web Request Broker This is a link to the Web Request Broker Administration page.
Default Configuration By selecting this link, you can install a set of default users and PL/SQL packages in an Oracle database.
Support This link enables you to fill out an Oracle Support form.
Cartridge Administration With this link, you can select a cartridge type such as PL/SQL, Java, or Perl. Once you've selected a cartridge type, you can view, create, reconfigure, or delete a Web Agent for that cartridge type.

The following sections present a closer look at some of these links.

Figure 21.4.
Choices for configur-
ing the Web Applica-
tion Server.

Page 561

Database Access Descriptor (DAD) Administration

Before you can create a new Web Agent based on a particular cartridge type (such as PL/SQL), you probably will want to create a new DAD. To do this, select the DAD Administration link from the Web Application Server Administration page. From the DAD Administration page, you will see another link titled Create New DAD. Select this link. Another page, titled Database Access Descriptor Creation will appear (see Figure 21.5). On this page, there are several fields for which you will enter information:

DAD Name The name of the new Database Access Descriptor (flugle).
Database user The name of the Oracle account that the new DAD should use when connecting to the Oracle database (flugle).
Database User Password The password for the database user (flugle).
Confirm Password A confirmation of the database user's password (flugle).
ORACLE_HOME The server directory that is defined as ORACLE_HOME for the ORACLE_SID (the next parameter in the form). Ask your DBA for the correct value for ORACLE_HOME.
ORACLE_SID The name of the Oracle database to which the new DAD should connect. This assumes that the Oracle database resides on the same machine as the Oracle WebServer. If this is not the case, you will need to enter a value in the field titled SQL*Net V2 Service.

Figure 21.5.
Creating a new
Database Access
Descriptor.

Page 562

When you have entered values for all of the required fields, click the Submit New DAD button at the bottom of the page.

Web Request Broker Administration

You'll want to reconfigure the Web Request Broker for at least one reason: to specify a virtual directory for your application.

  1. Select the Web Request Broker link from the Web Application Server Administration page.
  2. In the page that appears—Web Request Broker Administration—select Applications and Directories in the left-hand frame.
  3. In the right-hand frame, scroll down to the first empty entry in the table and enter these values (see Figure 21.6):
Virtual Directory /flugle/owa
Application PLSQL
Physical Path %ORACLE_HOME%/bin

Figure 21.6.
Specifying a virtual
directory for an
application for the
Web Request Broker.

  1. Scroll down until you see the Modify WRB Configuration button. Click it so that the changes will take effect.

For an actual application, you may want to modify other WRB parameters such as Protecting Applications.

Page 563

Cartridge Administration

You can select the Cartridge Administration link from the Web Application Server Administration page. As you can see in Figure 21.7, several cartridge types will be displayed, including:

Figure 21.7.
Selecting a cartridge
type.

Select the PLSQL cartridge type. Another page, titled PL/SQL Agent Administration, will be displayed (see Figure 21.8).

On this page, you can select the link named Create New PL/SQL Agent. In the next page that appears—PL/SQL Agent Creation—enter these values in the fields:

Name of PL/SQL Agent flugle
Name of DAD to be used flugle

Scroll down and click the button labeled Submit New PL/SQL Agent. Oracle WebServer should create the new PL/SQL Agent.

Page 564

Figure 21.8.
PL/SQL Agent
Adminstration.

Special PL/SQL Packages htp and htf

Included with Oracle WebServer are several PL/SQL packages that are installed by default. One package, htp, contains a large number of procedures that generate HTML tags. Another package, htf, includes a large number of functions that can be used as arguments to many of the procedures in the htp package.

Using a Stored Procedure to Generate Dynamic
HTML

As an example, let's look at a very elementary example of how a dynamic Web page is generated from a stored procedure. The following code is a stored procedure named StudentList that displays a subset of student information, one student per line, in a Web browser.

PROCEDURE StudentList IS
cursor GetStudents is
select Student_ID, Last_Name, First_Name
from Student
order by Student_ID;

Page 565

S_ID  Student.Student_ID%type;
LName Student.Last_Name%type;
FName Student.First_Name%type;

begin

open GetStudents;

htp.HTMLOpen;
htp.BodyOpen;

loop
  fetch GetStudents into S_ID, LName, FName;
  exit when GetStudents%NOTFOUND;

  htp.print (`Student ID: ` || S_ID);
  htp.print (`Last Name:  ` || LName);
  htp.print (`First Name: ` || FName);

  htp.para;

end loop;

htp.BodyClose;
htp.HTMLClose;

END;
ANALYSIS
A cursor, named GetStudents, is declared which selects the student ID, last name, and first name from the Student table. Three other variables are declared—S_ID, LName, and FName—which will contain the values from the cursor's columns as each row is fetched.

At the beginning of the procedure, the cursor is opened. Two procedures are invoked in the htp package: HTMLOpen and BodyOpen. These packages generate the <HTML> and <BODY> tags, respectively.

In the cursor loop, each row is fetched from the cursor. A procedure, named htp.print, is used to print each row's value for student ID, last name, and first name. A call to htp.para is used to generate the <P> tag, signifying a paragraph. Finally, when the loop is closed, htp.BodyClose and htp.HTMLClose are called, generating </BODY> and </HTML> tags,respectively.

Figure 21.9 displays the output of the StudentList stored procedure.

Previous | Table of Contents | Next

Используются технологии uCoz