Oracle Web Publishing Assistant Getting Started
Release 2.0 for Windows NT

A55738-01

Library

Product

Contents

Index

Prev Next

2
Understanding Oracle Web Publishing Assistant

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:

Using Sample Templates

Oracle Web Publishing Assistant provides you with sample templates (located in ORANT\OWAST\SAMPLES). Use these templates to become familiar with creating web page queries.

The default template (.HTX) uses a Java applet to format the database query information into a spreadsheet-like web page. The new Java-enabled web page template:

Designing Templates

If you want to design your own templates, use the Oracle Web Publishing Assistant keywords in the HTML extension files (.HTX) to control how the web page is constructed. The Oracle Web Publishing Assistant keywords used in the .HTX files are:

The template syntax is supported by HTML editors like Microsoft Frontpage. Templates can be modified at any time. Oracle Web Publishing Assistant uses the modified template when generating your web page at the next scheduled generation time.

If you modify your original query after generating a web page, then Oracle Web Publishing Assistant prompts you to modify your template. Oracle Web Publishing Assistant launches your default template editor. You can then choose to use the original template, modify your existing template, or use a new template. See Chapter 3, "Administering Web Page Queries" and Oracle Web Publishing Assistant Online Help for more information.

Keyword <%begindetail%>, <%enddetail%>

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 data returned 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 omitted.

Conditional Logic Keyword <%if%>, <%else%>, <%endif%>

Your template 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 CurrentRecord, you can tailor the output so that the error message is displayed when no records are returned by the query.


Note:

Conditional logic statements must exist entirely before, inside, or after the <%begindetail%> and <%enddetail%> block.

Nested <%if%> statements are not allowed (you cannot nest an <%if%> statement within a <%if%> statement.

 

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 "Variable CurrentRecord" for more information.

Here is an example:

<HTML>
<BODY>
<%begindetail%>
<%if CurrentRecord 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%>

Variable CurrentRecord

The CurrentRecord 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 CurrentRecord changes every time another record is retrieved from the database.

Variable CurrentDate

The CurrentDate variable shows the date and time of the web page generation. This variable cannot be used inside <%if%> statements. If you do not specify a date format, the default format used is DD/MMM/YYYY (for example, 05/OCT/1997). The default time format is HH:MM:SS A.M./P.M. (for example, 10:01:15 A.M.). You can change the date and time format using these codes:

Format Code   Description  

%a  

Abbreviated weekday name  

%A  

Full weekday name  

%b  

Abbreviated month name  

%B  

Full month name  

%c  

Date and time representation appropriate for locale  

%d  

Day of month as decimal number (01 ? 31)  

%H  

Hour in 24-hour format (00 - 23)  

%I  

Hour in 12-hour format (01 - 12)  

%j  

Day of year as decimal number (001 - 366)  

%m  

Month as decimal number (01 - 12)  

%M  

Minute as decimal number (00 - 59)  

%p  

A.M./P.M. indicator for 12-hour clock in current locale  

%S  

Second as decimal number (00 - 59)  

%U  

Week of year as decimal number, with Sunday as first day of week (00 - 51)  

%w  

Weekday as decimal number (0 - 6; Sunday is 0)  

%W  

Week of year as decimal number, with Monday as first day of week (00 - 51)  

%x  

Date representation for current locale  

%X  

Time representation for current locale  

%y  

Year without century, as decimal number (00 - 99)  

%Y  

Year with century, as decimal number (for example, 1998)  

%z  

Time zone abbreviation; no characters if time zone is unknown  

%Z  

Time zone name; no characters if time zone is unknown  

The # flag may prefix any formatting code, and the meaning of the format code is changed as follows:

Format Code   Description  

%#c  

Long date and time representation, appropriate for current locale; for example: Tuesday, March 14, 1995, 12:41:29  

%#x  

Long date representation, appropriate to current locale; for example: Tuesday, March 14, 1995  

%#a, %#A, %#b, %#B, %#p, %#X, %#z, %#Z, %#%  

# flag is ignored  

%#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, %#w, %#W, %#y, %#Y  

Removes leading zeros (if any)  

Here is an example using the CurrentDate variable:

<%CurrentDate:Today is %A, day %d of %B in the year %Y %>

which translates into (depending upon what the actual date is when the web page is generated):

Today is Tuesday, day 8 of October in the year 1997

Variable MaxColumn

The MaxColumn variable <%MaxColumn%> specifies the number of columns returned by the query.

Variable QueryId

The QueryId variable <%QueryId%> provides a unique identifying number for the generated web page. You can use this number when troubleshooting Oracle Web Publishing Assistant. See Appendix B, "Troubleshooting" for more information.

Generated Web Page Queries

Web page queries 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:

Settings in the Windows NT Registry

Oracle Web Publishing Assistant registry values are located under the key HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE.

Value   Description  

OWASTDBS  

The default value is OFF. The possible values are ON or OFF.

The OFF setting disables database connection sharing.  

OWASTDBC  

The default value is 1000. The available range is 1...INFINITY.

The number of seconds between database polls, to discover if database information has changed since last poll. A lower number means a shorter amount of time between database data change and web page generation, but a lower number also increases CPU usage.

If this value is not present in the registry, then Oracle Web Publishing Assistant is using the default value of 1000.  

OWASTHOME  

The default value is OracleWebAssistant.

The name of the Oracle Web Publishing Assistant Windows NT service used in conjunction with multiple Oracle homes.

This value is not displayed in the registry. Do not change this value.  

OWAST  

The default value is ORACLE_HOME\OWAST.

The Oracle home directory where Oracle Web Publishing Assistant is installed. Do not change this value.  

To modify the settings of the repository values OWASTDBS and OWASTDBC:

  1. From the command prompt, type:

    C:\>regedit
    

    Registry Editor starts.

  1. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE:

  1. Double-click the value in the listing on the right side of the screen that you want to modify.

    The Edit String window appears.

  2. Type the new value in the Value Data field, and click OK.

  3. Choose Exit from the Registry menu to exit Registry Editor.




Prev

Next
Oracle
Copyright © 1997 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index