Вы находитесь на странице: 1из 7

Webutil Configuration steps for Oracle Fusion Middleware Forms 11g R2

January 28, 2013 by oramax Leave a comment

Goal: How to Configure Webutil Library in Fusion Middleware Forms 11g (11.1.2.0). The Webutil utility is largely configured in your 11g Forms installation. However, there are some additional steps you will need to accomplish in order to make it work properly. Additional Webutil components maybe needed in order to configure Webutil for development purposes. These Components are: 1Jacob Package 1.14.3 for (11.1.2.0) You can found this package on mentioned below URL: Download In this package, there are three files: 123Jacob.jar jacob-1.14.3-x64.dll jacob-1.14.3-x86.dll

Before Using the Above mentioned files, Follow the steps mentioned below to create Webutil user in Database. 12345Run create_webutil_db.sql from/Weblogic/weblogic_10.3/Middleware/Oracle_FRH ome1/forms/ 678Create public synonym webutil_db for webutil.webutil_db; Connect sys as sysdba Grant execute on webutil_db to public; Login from SYS CREATE USER Webutil IDENTIFIED BY Webutil (Already Created in 11g) Grant connect, resource to Webutil Connect Webutil/Webutil

Now Place the Jacob.jar into /Weblogic/weblogic_10.3/Middleware/Oracle_FRHome1/forms/java Directory. Place Jacob-1.14.3x64.dll into/weblogic/weblogic_10.3/Middleware/Oracle_FRHome1/forms/webutil/win6 4 Directory. Place Jacob-1.14.3x86.dll into/weblogic/weblogic_10.3/Middleware/Oracle_FRHome1/forms/webutil/win3 2 Directory. Create a backup of sign_webutil.sh with different name, this file can be found in /Weblogic/weblogic_10.3/Middleware/asinst_1/bin Directory
Page | 1

Open sign_webutil.sh file in notepad and search for <Your KEYSTORE password> line. Replace it with welcome1. Similarly search for < Your private key password > line and replace it with welcome1. Save the file to the same directory after Editing. Now run the Following command to sign both files with Jacob.jar and frmwebutil.jar files [oracle@earth bin] $ ./sign_webutil.sh /Weblogic/weblogic_10.3/Middleware/Oracle_FRHome1/forms/jav a/Jacob.jar [oracle@earth bin] $ ./sign_webutil.sh /Weblogic/weblogic_10.3/Middleware/Oracle_FRHome1/forms/jav a/frmwebutil.jar After Jar Signing, Go to Browser and type the following command to open Oracle Fusion Middleware Console. http://userid=username/password@sid:7001/em Add /Weblogic/weblogic_10.3/Middleware/Oracle_FRHome1/forms/java/frmall.jar path into CLASSPATH Variable Default.env Or Add Manually By using following command: [oracle@earth bin] $ vi .bash_profile Add /Weblogic/weblogic_10.3/Middleware/Oracle_FRHome1/forms/java/frmall.jar path into CLASSPATH variable in bash_profile. Regenerate the webutil.pll using following command: [oracle@earth bin] $ Frmcmp.sh module=webutil.pll module_type=libraryuserid=username/password@sid compile_all=yes Open & Edit the Following Parameters in formsweb.cfg, it can be found in: /weblogic/weblogic_10.3/Middleware/user_projects/domains/webforms_domain/confi g/fmwconfig/servers/WLS_FORMS/ applications/formsapp_11.1.2/config Directory. Archive= frmall.jar, frmwebutil.jar Modification in [Webutil] Section: WebUtilArchive=frmwebutil.jar, jacob.jar Archive=frmall.jar, frmwebutil.jar, jacob.jar Save the formsweb.cfg after editing. Install a VNC Client on Windows to create Linux client session on Windows because linux do not support drag & Drop functions in Oracle Form 11g. Open Oracle forms builder 11g on Linux client, Create a new form,a new block & a canvas. after that attach webutil.pll on Navigator> Attached Libraries in Forms that you have compiled earlier.
Page | 2

Attach Webutil.olb in Object Libraries in oracle Forms. Open WebUtil.olb file Object group in builder and copy or subclass it into your form. Create a Button (B1) and a text field (P1) on Already created canvas. Copy & paste the following Code in When Button Pressed Trigger.

Declare v_file varchar2(500); Begin v_file := CLIENT_GET_FILE_NAME (directory_name => 'C:\Forms\Reports', file_name NULL, file_filter NULL, message 'Open a file', dialog_type OPEN_FILE); :P1:=v_file; => => => =>

End;
Compile & Save the form again. Run the Form and browse any file in your Client PC in order to check the Webutil proper functionality. Note: Browser will ask to certify these libraries first time Choose ALWAYS certify. Check Java Console icon on the task bar and see frmwebtul.jar and jacob.jar are loaded successfully.

Page | 3

How to use Webutil in Oracle Forms 11g to save a file on Oracle AS 11g
Stics Post in oracle, oracle formsTags: forms 11g, ora11g

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: ?

1 2 3 4 5

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

4. Create a Function that will populate the parameters retrieved (this is used later on) ?

1 2 3 4 5 6 7 8 9 10 11 12 13

FUNCTION build_parameter_list(p_user varchar2, p_report varchar2) RETURN varchar2 IS

v_res varchar2(5000);

cursor c1 is select * from report_parameters where user_code = p_user and report_code = p_report;

v_rec

c1%rowtype;

v_filename varchar2(400);

Page | 4

14 15 16 17 18 19

BEGIN v_filename := :command_line.filename; v_res := 'report=' || p_report || '.rdf';

v_res := v_res || ' userid=' || get_application_property(USERNAME) || '/' || get_application_property(PASSWORD) || '@' || get_application_property(CONNECT_STRING);

20 21 22 23 24 25
return v_res; v_res := v_res || ' server=ReportsServer_DOMAIN-NAME_asinst_1 destype=file desformat=RTF desname="' || v_filename || '" P_USER=''' || p_user || '''';

26
end;

27 28
5. Create a trigger on the Browse button (WHEN_BUTTON_PRESSED) ?

1 2 3 4 5 6 7 8 9

DECLARE Var_Filename VARCHAR2(256) ;

BEGIN :command_line.filename := client_GET_FILE_NAME('c:\temp',null,

'Microsoft Word Files (*.doc)|*.doc|' || 'Rich Text Format Files (*.rtf)|*.rtf|', 'Select a Destination',"SAVE_FILE", TRUE); message(:command_line.filename); End;

6. Create a trigger on the OK button (WHEN_BUTTON_PRESSED)

Page | 5

1 2 3 4 5

declare AppID PLS_INTEGER;

frm_name varchar2(300); vCopied l_success boolean; boolean;

l_bare_filename varchar2(50);

6 7 8 9 10 11 12 13 14 15 16 17 18 19
message('File can only be of type .RTF or .DOC'); if :command_line.filename is null then message('Please enter or specify a filename.'); elsif upper(:command_line.filename) not like '%.DOC' and upper(:command_line.filename) not like '%.RTF' then :parameter.p_user := get_application_property(username); if frm_name = 'TESTER_FORM_NAME' then :parameter.p_rep := 'TEST_REPORT_NAME'; end if; begin frm_name := get_application_property(calling_form);

20 21 22 23 24 25 26

else :command_line.cmd := build_parameter_list(:parameter.p_user, :parameter.p_rep);

AppID := DDE.App_Begin('rwclient.exe ' || :command_line.cmd, DDE.App_Mode_Normal);

Page | 6

27 28 29 30 31 32

l_success := webutil_file_transfer.AS_to_Client_with_progress( clientFile serverFile progressTitle => :command_line.filename, => 'c:\temp\downloaded_from_as.doc', => 'Download from Application Server in progress',

progressSubTitle => 'Please wait');

exit_form(no_validate);

33 34 35 36 37

end if; end;

7. Create a trigger on the Cancel button to exit the form

exit_form (no_validate);

NOTES: If you get the error: Exception in thread main java.lang.UnsatisfiedLinkError: no jacob-1.14.3-x86 in

java.library.path
1. Make sure the property file c:\Program Files\Java\jre6\webutil.DOMAIN_NAME.webutil.properties exists on the client (this is downloaded from the server automatically) and has the library entry of

jacob-1.14.3-x86.dll as follows: syslib.jacob-1.14.3-x86.dll=1.14.3

2. Also, it should exist in c:\Oracle\Middleware\as_1\forms\webutil\win32\jacob-1.14.3-x86.dll on the server but if you still get the error above, then also add it to c:\Oracle\Middleware\as_1\forms\webutil\jacob-1.14.3-x86.dll on the server 3. Try downloading the dll directly from the server if you having access problems: Delete the files (d2kwut60.dll, jacob.dll, JNIsharedstubs.dll) if they exist on the clients JRE dir, so they can be re-downloaded as needed from the server again. 4. Check the library entry in webutil.cfg (C:\Oracle\Middleware\as_1\forms\server\webutil.cfg) on the server (this should match with version on the client): *= dll filename | filesize | library version | true/false

install.syslib.0.7.1=jacob-1.14.3-x86.dll|102400|1.14.3|true

Page | 7

Вам также может понравиться