20 Feb 2013

Steps Of 10g Webutil

Steps Of 10g Webutil

plz copy webutil object library and pll in forms folder of oracle developer home directory.

Webutil Steps
=========================

1. On drive C create a folder name Webutil.
Extract the jacob_18.zip file into C:\Webutil_Final Folder.

2. Switch to Command Prompt, and perform following:
C:\>cd webutil
C:\>cd webutil_final
C:\Webutil_Final>COPY JACOB.JAR D:\oracle\DevSuiteHome_1\forms\java
C:\Webutil_Final>COPY JACOB.DLL D:\oracle\DevSuiteHome_1\forms\webutil
C:\Webutil_Final>COPY calendar90.pll D:\oracle\DevSuiteHome_1\forms
C:\Webutil_Final>COPY stndrd20.OLB D:\oracle\DevSuiteHome_1\forms

3. On Dos Prompt Sign frmwebutil.jar and jacob.jar with following commands
C:\>set path=D:\oracle\DevSuiteHome_1\jdk\bin;%PATH%

Sign the files by using
C:\>D:\oracle\DevSuiteHome_1\forms\webutil\sign_webutil D:\oracle\DevSuiteHome_1\forms\java\frmwebutil.jar

Output
Generating a self signing certificate for key=webutil2...
...successfully done.

.
Backing up D:\oracle\DevSuiteHome_1\forms\java\frmwebutil.jar as D:\oracle\DevSu iteHome_1\forms\java\frmwebutil.jar.old...
1 file(s) copied.
Signing D:\oracle\DevSuiteHome_1\forms\java\frmwebutil.jar using key=webutil2...
...successfully done.

C:\>D:\oracle\DevSuiteHome_1\forms\webutil\sign_webutil D:\oracle\DevSuiteHome_1\forms\java\jacob.jar

Output
Generating a self signing certificate for key=webutil2...
keytool error: java.lang.Exception: Key pair not generated, alias already exists
.
There were warnings or errors while generating a self signing certificate. Please review them.
.
Backing up D:\oracle\DevSuiteHome_1\forms\java\jacob.jar as D:\oracle\DevSuiteHome_1\forms\java\jacob.jar.old...
1 file(s) copied.
Signing D:\oracle\DevSuiteHome_1\forms\java\jacob.jar using key=webutil2...
...successfully done.


4. Now open the SQL Session connecting with SYS user, and create a user named WEBUTIL and Password is ORACLE.
SQL> CREATE USER WEBUTIL IDENTIFIED BY ORACLE
2 DEFAULT TABLESPACE USERS
3 TEMPORARY TABLESPACE TEMP;

User created.

SQL> GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO WEBUTIL;

Grant succeeded.

SQL> CONN WEBUTIL/ORACLE
Connected.
USER is "WEBUTIL"
linesize 100
pagesize 100
long 80
SQL> @D:\Webutil_Final\create_webutil_db.sql

Package created.


Package body created.
SQL> CREATE PUBLIC SYNONYM WEBUTIL_DB FOR WEBUTIL.WEBUTIL_DB;

Synonym created.
SQL> CONN SYS/ORACLE AS SYSDBA
Connected.

SQL> GRANT EXECUTE ON WEBUTIL_DB TO PUBLIC;

Grant succeeded.

5.Modify the DEFAULT.ENV file, you can find default.env file at D:\oracle\DevSuiteHome_1\forms\server\Default.env
append the following path in CLASSPATH entry
;d:\oracle\DevSuiteHome_1\jdk\jre\lib\rt.jar
append the following path in FORMS_PATH
;D:\oracle\DevSuiteHome_1\forms\webutil

6.Modify the FORMSWEB.CFG file, you can find this file at D:\oracle\DevSuiteHome_1\forms\server\formsweb.cfg
add:
archive_jini=frmall_jinit.jar,frmwebutil.jar,jacob.jar
archive=frmall.jar
also add :
[webutil]
WebUtilArchive=frmwebutil.jar,jacob.jar,f90all.jar
WebUtilLogging=off
WebUtilLoggingDetail=normal
WebUtilErrorMode=Alert
WebUtilDispatchMonitorInterval=5
WebUtilTrustInternal=true
WebUtilMaxTransferSize=16384
baseHTMLjinitiator=webutiljini.htm
baseHTMLjpi=webutiljpi.htm
archive_jini=frmall_jinit.jar
archive=frmall.jar,f90all.jar
lookAndFeel=oracle
7.Modify the WEBUTIL.CFG file locate at the same place where you found the FORMSWEB.CFG file and change the
following
#transfer.database.enabled=FALSE (default value)
transfer.database.enabled=TRUE
#transfer.appsrv.enabled=FALSE (default value)
transfer.appsrv.enabled=TRUE

8. Logon scott user in sqlplusw.
SQL> DESC EMP
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)

SQL> CREATE TABLE EMP_IMAGE
2 (EMPNO NUMBER(04) PRIMARY KEY REFERENCES EMP(EMPNO),
3* IMAGE BLOB);

Table created.

SQL> INSERT INTO EMP_IMAGE
2 (EMPNO)
3* SELECT EMPNO FROM EMP;

SQL> COMMIT;

Commit complete.

9. Start OC4J instance,Open the Form Builder, and connect with WEBUTIL/ORACLE@orcl, Open the WEBUTIL.PLL file, located at
D:\oracle\DevSuiteHome_1\forms folder, compile all (Shift+Control+K), and genearte to PLX. Then Open the WEBUTIL.OLB, and
Subclass object to the form. Now attache the webutil.pll library and remove the path.


10.Create a new form module as Master&Detail using EMP and EMP_IMAGE data block.
After completing the wizard switch to Object naviagtor->Object Library->Open Webutil.olb which are located on
D:\oracle\DevSuiteHome_1\forms folder. Subclass the following, which are located in object library
WEBUTILCONFIG into Parameter Node.
WEBUTIL into Object Group Node.

11. Now attached the Pl Library WEBUTIL.PLL file, located at D:\oracle\DevSuiteHome_1\forms folder, and Press Yes button
when message appeared after pressing attach button.
PUSH_BUTTON1 PUSH_BUTTON2
NAME GET_FILE_NAME UPLOAD_DB


12. Now create One Text item, and Two Push buttons on WEBUTIL data block, and choose the Canvas where EMP Block are shown.

13. Apply following codes.

At form level
==================
WHEN NEW FORM INSTANCE
declare
fake_timer TIMER;
begin

--
-- Purpose of the fake timer is the we cannot call webutil in this trigger since the
-- beans have not yet been instantiated. If we put the code in a when-timer-expired-trigger
-- it means that this timer will not start running until Forms has focus (and so the webutil
-- beans will be instantiated and so call canbe made.
--
fake_timer:= CREATE_TIMER('webutil',100,NO_REPEAT);
end;

WHEN TIMER EXPIRED
:global.user_home := webutil_clientinfo.get_system_property('user.home');


At Program Unit Node
=====================
PROCEDURE UPLOAD_DB IS
l_success boolean;
BEGIN
l_success := webutil_file_transfer.Client_To_DB_with_progress
(clientFile => :file_name
,tableName => 'EMP_IMAGE'
,columnName => 'IMAGE'
,whereClause => 'EMPNO ='||:EMP.EMPNO
,progressTitle => 'Upload to Database in progress'
,progressSubTitle=> 'Please wait'
,asynchronous => false
,callbackTrigger => null
);
if l_success then
message('File uploaded successfully into the Database');
else
message('File upload to Database failed'||SQLERRM);
end if;

exception
when others then
message('File upload failed: '||sqlerrm);
END;

When Button Pressed Trigger
============================
On GET_FILE_NAME Push Button

declare
l_filename varchar2(200);
begin
l_filename := client_get_file_name(directory_name => :global.user_home
,file_name => null
,file_filter => null
,message => null
,dialog_type => null
,select_file => null
);
:file_name := l_filename;
end;

On UPLOAD_DB Push Button
begin
upload_db;
exception
when others then
message('File upload failed: '||sqlerrm);

end;


14.Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if the "Application Server URL" is empty.Then append "?config=webutil" at the end, so you end up with a URL of the form http://server:port/forms/frmservlet?config=webutil

6 comments:

  1. Superb brother, very much precise and informative matter on webutil issue

    ReplyDelete
  2. Thanks for great post, but its given the error, Error 201 at line 9, column 12
    identifier 'WEBUTIL_DB.OPENBLOB' must be declared

    Please help

    ReplyDelete
    Replies
    1. did you do all the steps in above method, becuase its run over quite easily

      Delete
  3. how to configure in application server 10g and fusion middleware 11g for clients.

    ReplyDelete
  4. Error 201 at line 1, column 22
    identifier 'webutil_clientinfo.get_system_property' must be declared
    Error 0 at line 1, column 1
    statement ignored

    ReplyDelete
  5. Assalam O ALaikum Sir,

    This post did program configuration.
    Thanks alot, Kindly continue this more.

    Regards,
    Salik Khan.

    ReplyDelete