Oracle
Web Publishing Assistant Getting Started for Windows NT Release 1.0 A53270_01 |
|
This chapter discusses how the different components of Oracle Web Publishing Assistant work together to deliver web-enabled Oracle database information. Specific topics discussed are:
This section describes the components of Oracle Web Publishing Assistant and the role of each component in the process of web page creation.
Oracle Web Publishing Assistant consists of these components:
The Page Generator is the most essential part of the Oracle Web Publishing Assistant architecture. The Page Generator produces the web page from data retrieved from the database. The Database Gateway passes the query to be executed and additional information to the Page Generator. The Page Generator submits the query to the database and receives the results. Then it creates a web page with the results based on additional information from the Database Gateway.
When the Page Generator creates a web page, it will read the template that you have chosen to use, and merge the database results into the page (using a parser). The web page is stored by the Page Generator into a file at a specified location.
The Database Gateway receives signals from the Windows NT Scheduler that a web page needs to be generated. Upon receiving the notification from the Windows NT Scheduler, the Database Gateway retrieves the necessary information about the query from the Oracle Web Assistant Repository.
Oracle Web Publishing Assistant
Oracle Web Publishing Assistant provides you with sample templates. These templates are located in the directory ORANT\OWAST\SAMPLES. Use these templates to get started creating web pages.
Note:
The default template WEB.HTX, found in ORANT\OWAST, contains a `down' table (the columns are below each other). If you want a different formatting, edit the template using an HTML editor. |
Additional Information:
See Chapter 4, "Using the Tutorials" for more information on the available templates. |
If you want to design your own templates, use the keywords described in this section in the HTML extension files (.HTX) to control how the output HTML document is constructed. The template syntax is supported by HTML editors like Microsoft Frontpage. Templates can be modified at any time. Oracle Web Publishing Assistant will use the modified template when generating your web page at the next scheduled generation time.
This keyword surrounds a section of the HTML extension file in which the data output from the Oracle database will be merged. Within the section, the column names are delimited with <% and %> which are used to mark the position of the returned data from the query.
For example:
<%begindetail%> <%ename%>: <%sal%> <%enddetail%>
lists the columns ENAME (employee name) and SAL (salary). You can refer to any column in this manner. You can refer to column names in other sections of the extension file. If no records are returned from the query, the <%begindetail%> section will be skipped.
HTML extension files can contain conditional logic with an if-then-else statement to control how the web page is constructed. One common usage of an if-then-else statement is to insert a condition to display the results from the query on the first row with a <%begindetail%> section. If no records are returned by the query, the following message appears in the resulting HTML file:
Sorry, no employees had salaries greater than 5000.
By using the <%if%> statement and a built-in variable CURRENT_RECORD, you can tailor the output so that the error message is displayed when no records are returned by the query.
The syntax is structured as:
<%if condition%> HTML text [<%else%> HTML text] <%endif%>
where condition is of the form:
value1 operator value2
and operator can be one of the following:
Operator | If... |
---|---|
EQ |
value1 equals value2 |
LT |
value1 is less than value2 |
GT |
value1 is greater than value2 |
CONTAINS |
any part of value1 contains the string value2 |
The operands value1 and value2 can be column names, a built-in variable, or a constant. See the section "CURRENT_RECORD" for more information.
Here is an example:
<HTML> <BODY> <%begindetail%> <%if Current_Record EQ 0 %> <B>Employee Name Salary<BR></B> <%endif%> <%ename%>:<%sal%> <%enddetail%> <P> <I> This web page was created by merging the results of the SQL query with the template file EXAMPLE2.HTX. <P> The merge was performed by Oracle Web Publishing Assistant and the results were stored in a web page. </I> </BODY> </HTML>
When used in an <%if%> statement, values are not delimited with <% and %>. For example, to process employee name Scott, use the condition:
<%begindetail%> <%if ename EQ "Scott"%> The employee is Scott. <%endif%> <%enddetail%>
The CURRENT_RECORD built-in variable contains the number of times the <%begindetail%> section has been processed. The first time through the <%begindetail%> section, the value is zero (0). The value of CURRENT_RECORD changes every time another record is fetched from the database.
Note:
CURRENT_RECORD can only be used in <%if%> statements. |
Web pages generated by Oracle Web Publishing Assistant consist of two types of information:
Information Type | Description |
---|---|
Static Information |
Stored in a template. |
Dynamic Information |
Retrieved from the database and merged with the static information from the template. |
This model of page generation has two benefits:
The template layout is compatible with popular HTML editors such as Microsoft Frontpage. You can modify the templates in any way you want, whenever you want.
The database does not need to be accessed every time a web page is viewed. The database only needs to return results from the query, therefore performance is not negatively impacted.
|
Copyright © 1997 Oracle Corporation. All Rights Reserved. |
|