Webutil syntax for GET_FILE_NAME/CLIENT_GET_FILE_NAME function

[sql]FUNCTION GET_FILE_NAME (or CLIENT_GET_FILE_NAME)
(directory_name   VARCHAR2,
file_name        VARCHAR2,
file_filter      VARCHAR2,
message          VARCHAR2,
dialog_type      NUMBER,
select_file      BOOLEAN;[/sql]

Params descriptions

[text]directory_name = Specifies the name of the directory containing the file you want to open. The default value is NULL. If directory_name is NULL, subsequent invocations of the dialog may open the last directory visited.

file_name = Specifies the name of the file you want to open. The default value is NULL.

file_filter = Specifies that only particular files be shown. The default value is NULL. File filters take on different forms, and currently are ignored on the motif and character mode platforms. On Windows, they take the form of “Write Files (*.WRI)|*.WRI|” defaulting to “All Files (*.)|.*|” if NULL. On the Macintosh the attribute currently accepts a string such as “Text.”

message = Specifies the type of file that is being selected. The default value is NULL.

dialog_type = Specifies the intended dialog to OPEN_FILE or SAVE_FILE. The default value is OPEN_FILE.

select_file = Specifies whether the user is selecting files or directories. The default value is TRUE. If dialog_type is set to SAVE_FILE, select_file is internally set to TRUE.[/text]

 

How to use Webutil in Oracle Forms 11g to save a file on Oracle AS 11g

Before you go into any development download and try the Webutil Demo first and see how that works in your environment!

1. Add the Webutil library to the form

2. Create a Data Block “COMMAND_LINE”

3. Create a new layout with the following parameters:

[text]cmd = command-line parameters (data block only)
filename = filename to be entered
browse = browse for file destination
ok_btn = ok button
cancel_btn = cancel button[/text] (more…)

How to open Oracle Forms URL and then hide its IE started window

You need to open an Oracle Forms 11g url, which in turn will open a new IE window -but you want to somehow get rid of the first IE window.

1. Create a new html file i.e. “openWindow.html”, under %ORACLE_HOME%\forms\java\ as below:

[html]<html>
<body>
<script type=”text/javascript”>
window.open (“http://192.168.1.1:8090/forms/frmservlet?config=webutil”,”mywindow”,”height=1,width=1,toolbar=no,statusbar=no,scrollbars=no,top=5000″);
window.open(”,’_parent’,”);
setTimeout(‘self.close();’,3000);
</script>
</body>
</html>[/html]

Note: top = 5000 sets the window top position at +5000, which places it outside a typical windows screen size.

2. Open an IE window and enter the following URL into the address

[text]http://192.168.1.1:8090/forms/java/openWindow.html[/text]

3. Your Oracle Forms should fire and start working.

 

To close see post 1064

How to close the internet browser window after forms 11g is called

You will need to modify your main entry form procedure and place some javascript code to close the browser window.

1. Create a new html file i.e. “closeWindow.html”, under %ORACLE_HOME%\forms\java\ as below:

[html]<html>
<body onload=”closeWindow()”>
<script type=”text/javascript”>
function closeWindow() {
window.open(”,’_parent’,”);
window.close();
}
</script>
</body>
</html>[/html]

2. Modify the entry form’s POST-FORM Trigger

[sql]–Call the html file created
web.show_document(‘/forms/java/closeWindow.html’,’_self’);
EXIT_FORM(NO_VALIDATE)[/sql]

4. Add the following lines to your “formsweb.cfg” file under [your_cofiguration]
path = c:\Oracle\Middleware\user_projects\domains\<domain_name>\config\fmwconfig\servers\WLS_FORMS\applications\formsapp_11.1.1\config\formsweb.cfg

[text]<SCRIPT LANGUAGE=”JavaScript”>window.opener = top;</SCRIPT>
<HTMLbeforeForm=<SCRIPT LANGUAGE=”JavaScript”>window.opener = top;</SCRIPT>[/text]

 

To open see post 1071

 

How to check the java version of an Oracle Database

Create a function in the DB to retrive the java properties:

[sql]CREATE OR REPLACE FUNCTION get_java_property(prop IN VARCHAR2)
RETURN VARCHAR2 IS
LANGUAGE JAVA name ‘java.lang.System.getProperty(java.lang.String) return java.lang.String’;[/sql]

Then, run the following command to output the Java version:

[sql]SELECT get_java_property(‘java.version’) FROM dual;[/sql]

How to setup Webutil for forms 11g R1 (11.1.1.2.0)

Notes:
– frmwebutil.jar already exists/is signed on 11g
– tested with JRE version 1.6.0_25, webutil 1.0.6, jacob 1.10.1_b17
– windows 7, 32bit

1. Download webutil_1.0.6  (or from oracle’s index page) and jacob_1.10.1_b17 (or from project page) jar files.

2. Copy files:
=========
path = c:\Oracle\Middleware\as_1\forms\java
[text]d2kwut60.dll
ffisamp.dll
forms_base_ie.js
forms_ie.js
frmwebutil.jar
jacob.dll
jacob.jar
JNIsharedstubs.dll
sign_webutil.bat[\text]

*Create a folder “server” under forms\:
path = c:\Oracle\Middleware\as_1\forms\server\
[text]base.htm
basejpi.htm
forms.conf.backup
ftrace.cfg
webutil.cfg
webutilbase.htm
webutiljini.htm
webutiljpi.htm[/text]

*May also need the following folder:
path = c:\Oracle\Middleware\as_1\forms\webutil\
[text]d2kwut60.dll
ffisamp.dll
jacob.dll
JNIsharedstubs.dll
sign_webutil.bat[/text] (more…)