WebUtil Demo - ReadMe

Introduction

This document provides the details for running the WebUtil Demo. The purpose of this demo is to show many of the features of Webutil. For more details on WebUtil please see the WebUtil launch page on the Forms OTN page.

Set Up

Its is assumed that you have a working install of WebUtil. For details on how to set up WebUtil please see the WebUtil Familiarization Manual available as part of the WebUtil download or on the WebUtil launch page on the Forms OTN page. You should also have a database connection and have run the appropriate database scripts if you wish to upload or download from/to the database.

Components of this demo

This demo comprises of 3 main files: An FMB (which is the Forms demo), a DLL (used as part of the C API demo) and a readme file (this file). This demo has been written specifically against the 1.0.6 Production of WebUtil and terms and conditions are outlined here.

Setting up the demo.

As mentioned above, the full documentation for setting up WebUtil is available in the WebUtil manual. However, in the context of this demo you need to do some minor configuration steps.

  1. Unzip the zip file into a temporary area on your machine.
  2. Copy wu_test_106.fmb to a directory which is currently on your FORMS_PATH / FORMS90_PATH.
  3. The demo uses a DLL to show the functionality of the C API. Copy ffisamp.dll to the <ORACLE_HOME>\forms\webutil directory. For 904, copy to <ORACLE_HOME>\forms90\webutil directory.
  4. Open your webutil.cfg file and add the following line install.syslib.0.user.1=ffisamp.dll|40960|1.0|true
  5. In the webutil.cfg file ensure you have the line
  6. Create a directory d:\temp and a file called d:\temp\downloaded_from_as.txt. Ensure you add text to this file. This is a test file which will be used to demonstrate loading files from the application server to the client. The Download test expects this file to exist in this location on the Application Server.
  7. To show the uploading to the database, a table needs to be created using the following SQL.
    drop table wu_test_table;
    create table wu_test_table (blob blob, id number(2));
    insert into wu_test_table values (NULL,1);
    commit;
    exit;
  8. Open wu_test_106.fmb in the Forms builder, compile all and run the form with the WebUtil config section.

Running the Demo

The demo exists of a simple form containing a number of tabs. Each tab exercises different areas of WebUtil

Client Info

Client Info will display information about the client machine; including Host Name, User Name, IP Address to name a few. Press the Get Client Info button to populate the fields.

BuiltIns

BuiltIns will exercise functions to show a file selection dialog, read a client side image file, display the NLS settings and to use client side Text_IO to write data out to a file.

Read Image File

Click the ... button to select a GIF file from the client machine hard drive and then press Read Image to load the image form the client and display in the image field.

NLS_LANG

Click the NLS_LANG button to read the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE NLS setting from client registry. Note that this call is a direct mapping to the client/server version. If you need to read the NLS LANG you should consider another function call since you would probably not have an Oracle registry branch installed on the client machine.

Text_IO

Write some text into the field at the bottom of the screen and press the Write button to write the file to the client side user.home\helloworld.txt file.

Files

The Files test will exercise many of the WebUtil features for file manipulation.

List Root Directories

Pressing List Root Directories will display a list of the all the current root directories on the client machine.

Files in user.home

Pressing Files in user.home will display the files in this directory. Note that the directory name is displayed at the top of the page.

Copy File

Pressing Copy File will copy a file called helloworld.txt in user.home to user.home\copy of helloworld.txt. Note that this file is created when you perform the Write test in the Builtins tab. If the file exists, the list of files in user.home will show the new file. If the file does not exists a message will displayed saying the copy failed.

Delete File

Pressing Delete File will delete a file user.home\copy of helloworld.txt. Note that this file is created when you perform a successful Copy File as indicated above. If the file exists, it is deleted and removed from the list of files. If the delete fails a message is displayed.

File Open

Pressing File Open will display a file selection dialog. Selecting a file and pressing Open will display the filename in the Results field.

Save As

Pressing File Save will display a file save dialog. Selecting a file and pressing Save will display the filename in the Results field.

Info on user.home\helloworld.txt

Pressing Info on user.home\helloworld.txt will display file information on the helloworld.txt file, including its size, and whether it is readable or writable.

OLE

The OLE test will perform some simple client side OLE manipulation. Enter some text in the main text area and select a filename by pressing the ... button. Now press the Write to Word button and WebUtil will write the text out to a file on the client machine as a Word document.

Upload

The Upload test shows how you can upload a file from the client machine to the application server or the database.

Upload to DB

First of all select a client side file by pressing the ... button. Once the file has been selected press the Upload to DB button. This will upload the selected file to the database in a table called WU_TEST_TABLE, column name BLOB and an ID of 1.

Upload to AS

Ensure that you have selected a client side file by pressing the ... button. Once the file has been selected press the Upload to AS button. This will upload the selected file to d:\temp\<filename> on the application server.

Download

Download will demonstrate how you can download a file from the application server or the database, onto the client machine.

Download from DB

First of all select a filename by pressing the ... button. This will define the client filename to which the file is download from the database. Now press the Download from DB button. This will download a file from the WU_TEST_TABLE onto the client machine.

Download from AS

Ensure that a filename has been selected by pressing the ... button. This will define the client filename to which the file is downloaded from the application sever. Now press the Download from AS button. This will download a file called d:\temp\downloaded_from_as.txt from the application server on the client.

Browser

Selecting the Browser tag will allow you to test various features of WebUtil related to the browser.

Set Browser Message

Pressing the Set Browser Message button will display information on the browser status line.

Set Separate Frame Title

The Set Separate Frame Title button is only available when the HTML parameter <separateFrame> is set to true. This will change the title of the separate window frame.

Get Applet Parameters

Press this button to display various parameters from the browser's applet tag. This current demo will show the values for <lookAndFeel>, <colorScheme>, <separateFrame> and applet width and height.

Note also, that when you exit the demo, you will be redirected to the Forms OTN page. This is again showing a feature of the WebUtil.

Host

The Host test will use Notepad on the client machine to show how client side Host commands can be run using WebUtil. This test includes a number of options. You can define that when Notepad is run it will open a file. Do this by checking the Ask for Filename checkbox. You can also define how the host command is run by checking one of the radio buttons. You can either run Notepad and block the processing of the current form; run Notepad and still allow access to the current form; or you can run notepad without blocking the form and also call a trigger when Notepad is closed. Choosing the final option will display a message on the Forms status line.

Press the Host to Notepad button to the run the test.

C API

The C API test shows how you can execute a client side DLL from a form using WebUtil. This test comprises of a DLL which WebUtil automatically downloads to the client and the code is executed on the client machine and the results passed back to Forms. Press the Call C API button. If run successfully, the form will display an alert with the message "The New value for String is: A Fixed string from within the C Program". Pressing OK will then display a message "New Length 40".

This test shows that a string passed to the C program on the client is being changed by the C program. The form is then displaying the new message and the length of the message.

About

This tab will display information about WebUtil.