Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Webutil Demo

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

WebUtil Demo - ReadMe

Introduction
This document provides the details for running the WebUtil Demo. The purpose of this demo is to show most of
the features included in Webutil. For more details on WebUtil please see the WebUtil launch page on the Forms
OTN page or in the Forms Builder Online Help.
For questions specifically related to this demo, please use the Oracle Technology Network Forms Forum.

Terms of Use
Disclaimer
Except where expressly provided otherwise, the site, and all content provided on or through the site, are provided
on an "as is" and "as available" basis. Oracle expressly disclaims all warranties of any kind, whether express or
implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose and
non-infringement with respect to the site and all content provided on or through the site. Oracle makes no
warranty that: (a) the site or content will meet your requirements; (b) the site will be available on an uninterrupted,
timely, secure, or error-free basis; (c) the results that may be obtained from the use of the site or any content
provided on or through the site will be accurate or reliable; or (d) the quality of any content purchased or obtained
by you on or through the site will meet your expectations.
Any content accessed, downloaded or otherwise obtained on or through the use of the site is used at your own
discretion and risk. Oracle shall have no responsibility for any damage to your computer system or loss of data
that results from the download or use of content.
Oracle reserves the right to make changes or updates to, and monitor the use of, the site and content provided on
or through the site at any time without notice.
Limitation of Liability
In no event shall oracle be liable for any direct, indirect, incidental, special or consequential damages, or
damages for loss of profits, revenue, data or use, incurred by you or any third party, whether in an action in
contract or tort, arising from your access to, or use of, the site or any content provided on or through the site.
Please carefully review the complete Terms of Use, which covers all software downloaded from the Oracle
Technology Network.
Complete Terms of Use

Set Up
It is assumed that you have a working installation of WebUtil. For details on how to set up WebUtil please see the
Forms Builder Online Help. You can also refer to My Oracle Support Note 566628.1 or 270940.1. 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 4 main files: An FMB (which is the Forms demo), a DLL (used as part of the C API
demo), a sql script needed to use the file upload/download to db feature, and a readme file (this file). This demo
has been written specifically and tested against the 10.1.2.3 release of WebUtil (Forms 10.1.2.3). It can, however
also be used in Forms versions 10.1.2.0.2 or newer.

Setting up the demo


As mentioned above, the full documentation for setting up WebUtil is available in the WebUtil manual, which can
be found in the Forms Builder Online Help. 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 webutil_demo.fmb to a directory which is currently on your FORMS_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. The C API demo is not supported for use in a 64bit
browser and/or 64bit JRE. In Forms version 11.1.2+, copy to

<ORACLE_HOME>\forms\webutil\win32
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
o transfer.appsrv.workAreaRoot=c:\temp
o transfer.appsrv.accessControl=TRUE
o transfer.database.enabled=TRUE
o transfer.appsrv.enabled=TRUE
6. Create a directory c:\temp and a file called c:\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 or the script
provided (wu_fileupload_db_demo.sql).
drop table wu_fileupdown_demo;
create table wu_fileupdown_demo (blob blob, id number(2));
insert into wu_fileupdown_demo values (NULL,1);
commit;
exit;
8. Compile/generate webutil_demo.fmb into an FMX. This can be done from within the Forms Builder or
the command line. It may be necessary to include the compile_all=yes option in order to ensure the form
runs properly. Run the form using the WebUtil config section. For example,
http://server:port/forms/frmservlet?form=webutil_demo&config=webutil

Running the Demo


The demo consists 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 (if set on the client machine) 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 from the client and display in the image field on the form.

NLS_LANG
Click the NLS_LANG button to read the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE NLS setting
from client registry. The value may also be reported from the system's environment settings if one
has been configured. Note that this call is a direct mapping to the client/server version. If you need
to read the NLS LANG variable you should consider another function call since you would probably
not have an Oracle registry branch installed on the client machine.

Text_IO
Enter 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
This test requires that Microsoft Word be installed on the client machine. 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 MS 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. The demo (both the form and sql script) has been designed to only permit one record to be stored.
This can be easily changed to accommodate the needs of a production deployment.
Be sure to check the permissions settings in webutil.cfg as mentioned in step 5 of the Setup instructions above.

Upload to DB
First, 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_FILEUPDOWN_DEMO, column name BLOB and an ID of 1. If successfully uploaded, the
cursor will be moved to the File Download tab.
If the Upload to DB button is disabled it means the required table used by this demo was not found.
The Create Table button should be visible and enabled. You can use this to create the needed
table by clicking the button. If you prefer to create the table manually, exit the form and run script
mentioned in step 7 of the Setup instructions above.
Upload to AS
Select 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 c:\temp\<filename> on the
application server. If successfully uploaded, the cursor will be moved to the File Download tab.

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, select a filename by pressing the ... button. This will define the client filename to which the file
is downloaded from the database. Now press the Download from DB button. This will download a
file from the WU_FILEUPDOWN_DEMO onto the client machine.
Download from AS
Select a filename 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 c:\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 the Get Applet Parameters 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.

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 run Notepad and block the processing of the current form OR 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
Be sure to review the following My Oracle Support document regarding calling C APIs:
Doc ID: 285331.1 - Exception When Calling PASCAL style Function Via WebUTIL_C_API
Call Demo C API
The C API demo is not supported when run in a 64bit browser and/or with a 64bit JRE.
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 Demo 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 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 then displays the new message and the length of the message.

Lock Workstation
The Lock Workstation test shows how some Windows APIs can be called to perform some
common Windows tasks. It should be noted that it is not recommended that Windows APIs which
require parameters to be passed in be used with this WebUtil function. It is also not recommended
that any APIs be called repeatedly (i.e. in a loop) as this may result in a memory leak or the
appearance of one. Simple calls such as locking the workstation or logging off do not require
parameters nor would they generally be called more than one time per Forms session. Special
care should be used when calling any Windows API as improper use can causes system
instability. Be sure to thoroughly test your application before moving to a production environment.
Press the Lock Workstation button to cause the computer to lock out the current user. The OS
user password will be required to regain access. This call may fail if the current OS user has not
previously set a password.

About
This tab will display information about WebUtil.

Note also, that when you exit the demo, you will be redirected to the Oracle Technology Network. This is again
showing a feature of the WebUtil.

Known Issues
1. File upload/download: Boiler plate text may change in size when entering text field or clicking on any
buttons of the Upload or Download tabs.

2. File upload/download: Bug 6050853 - No records found but error returned says, "WUT-113: Too many
rows". Problem resulting from error in create_webutil_db.sql script. Problem and solution discussed in bug
text.

10

You might also like