Professional Documents
Culture Documents
The Power of Webutil - Client - Ole
The Power of Webutil - Client - Ole
INTRODUCTION
This White Paper describes the installation, a demo application and my opinion about the
future of Oracles new Toolset WebUtil.
http://otn.oracle.com/products/forms/htdocs/webutil/webutil.htm
INSTALLATION
In this section only the installation which finds use on my notebook is explained. Further
information, as for example the complete installation for iAS, can be found in the
document WebUtil Familiarization Manual from Duncan Mills.
http://otn.oracle.com/products/forms/htdocs/webutil/webutil_manual.pdf
PRE-REQUISITES
Your environment has to be at minimum :
http://otn.oracle.com/software/products/ids/forms_content.html
JInitiator 1.3.1.8 +
http://otn.oracle.com/software/htdocs/devlic.html?/software/products/developer
/htdocs/jinit.htm
WebUtil 1.02
http://otn.oracle.com/software/products/forms/files/webutil/webutil_102.zip
If you want to use the JavaComBridge from Dan Adler (for OLE-stuff, etc) [optional]
Binary: http://danadler.com/jacob/jacobBin_17.zip
INSTALL WEBUTIL
Install WebUtil in the <ORAHOME Forms9i>\forms90 directory, e.g. for my installation:
Paper #
Track 36612
CHANGES
TO THE
CONFIG FILES
SIGNER.PROPERTIES
IN <WEBUTIL-UTILITIES>
#Propertiesfileforsigner.bat&makecert.bat
#DefinestheoverallsettingsforSigningPJCjars
#Linesprefixedwith#areignored
#DirectorySettings**changethesetosuityoursystem**
#donotincludetrailing"\"
#JDK_HOME=D:\tools\jdk1.3.1
#JINIT_HOME=d:\ProgramFiles\Oracle\JInitiator1.3.1.9
JDK_HOME=C:\oracle\oraForms9\jdk
JINIT_HOME=C:\Programme\Oracle\JInitiator1.3.1.8
#Certificatesettings:
#Theseareusedtogeneratetheinitialsigningcertificate
#Changethemtosuiteyourorganisation
#DN_O=Oracle
#DN_C=US
DN_CN=ProductManagement
DN_OU=DevelopmentTools
DN_O=OpitzConsulting
DN_C=DE
JAR_KEY=webutil
JAR_KEY_PASSWORD=webutil
CERTIFICATE
AND
SIGN
THE
JAR-FILES
Create certificate
makecert
Paper #
Track 36612
REGISTRY CHANGES
Append the following line to your FORMS90_BUILDER_CLASSPATH
C:\oracle\oraForms9\forms90\WEBUTIL\lib\webutil.jar
<ORAHOME FORMS9I>\FORMS90\SERVER
<ORAHOME FORMS9I>\FORMS90\SERVER
Change parameters to
baseHTMLjinitiator=C:\oracle\oraForms9\forms90\WEBUTIL\server\webutiljini.htm
baseHTMLjpi=C:\oracle\oraForms9\forms90\WEBUTIL\server\webutiljpi.htm
baseHTML=C:\oracle\oraForms9\forms90\WEBUTIL\server\webutilbase.htm
DEFAULT.ENV IN
<ORAHOME FORMS9I>\FORMS90\SERVER
Paper #
Track 36612
ORACLE_HOME=C:\oracle\oraForms9
#WebutilSection
WEBUTIL_CONFIG=C:\oracle\oraForms9\forms90\WEBUTIL\server\webutil.cfg
At the end extend the classpath and the formspath as shown here
CLASSPATH=C:\oracle\oraForms9\jlib\debugger.jar;C:\oracle\oraForms9\jlib\ewt3.jar:C
:\oracle\oraForms9\jlib\share.jar;C:\oracle\oraForms9\jlib\utj90.jar;C:\oracle\oraF
orms9\forms90\WEBUTIL\lib\webutil.jar;C:\oracle\oraForms9\jdk\jre\lib\rt.jar;C:\ora
cle\oraForms9\forms90\WEBUTIL\lib\jacob.jar;C:\oracle\oraForms9\jdk\jre\bin\classic
\jvm.dll
FORMS90_PATH=C:\oracle\oraForms9\CGENF61\admin;C:\oracle\oraForms9\forms90\WEBUTIL\
forms;C:\oracle\oraForms9\forms90
CHANGES
IN
FORMS
Modify all your code as you can see in the next section
Run your form and have fun with the new functionality
DEMO APPLICATION
The following application is a little example for the easy use of the new WebUtil
functionalities
WEBUTIL-APPLICATION
Paper #
Track 36612
Screenshot of my WebUtil-Application
BUTTON TEXT_IO
declare
v_filetext_io.file_type;
v_stringvarchar2(2000);
begin
v_file:=text_io.fopen('C:\oracle\oraForms9\forms90\WEBUTIL\forms\cs.txt',
'r');
text_io.get_line(v_file,v_String);
message(v_String);
text_io.fclose(v_file);
end;
BUTTON OLE2
OLE_Aufruf_CS;
PROCEDUREOLE_Aufruf_CSIS
v_ole_excelole2.obj_type;
v_OLE_workbookole2.obj_type;
v_OLE_worksheetole2.obj_type;
v_OLE_Worksheetsole2.obj_type;
v_file_namevarchar2(2000):=
'C:\oracle\oraForms9\forms90\WEBUTIL\forms\spu.xls';
OBJ_HNDOLE2.OBJ_TYPE;
v_OLE_RangeOLE2.OBJ_TYPE;
arglistole2.list_type;
Paper #
Track 36612
v_OLE_WorkbooksOLE2.OBJ_TYPE;
BEGIN
v_ole_excel:=ole2.Create_obj('Excel.Application');
OLE2.SET_PROPERTY(v_ole_excel,'visible',1);
v_OLE_Workbooks:=OLE2.GET_OBJ_PROPERTY(v_ole_excel,'Workbooks');
arglist:=ole2.create_arglist;
ole2.add_arg(arglist,v_file_name);
v_OLE_workbook:=ole2.invoke_obj(v_OLE_workbooks,'open',arglist);
ole2.destroy_arglist(arglist);
v_OLE_Worksheets:=OLE2.GET_OBJ_PROPERTY(v_OLE_workbook,'Worksheets');
arglist:=ole2.create_arglist;
ole2.add_arg(arglist,1);
v_OLE_Worksheet:=OLE2.GET_OBJ_PROPERTY(v_OLE_Worksheets,'Item',arglist);
ole2.destroy_arglist(arglist);
arglist:=ole2.create_arglist;
ole2.add_arg(arglist,'B1');
v_OLE_Range:=OLE2.GET_OBJ_PROPERTY(v_OLE_Worksheet,'Range',arglist);
ole2.destroy_arglist(arglist);
OLE2.SET_PROPERTY(v_OLE_Range,'FormulaR1C1','ThisistheTestwiththeOLE2
package');
END;
BUTTON CLIENT_TEXT_IO
declare
v_fileclient_text_io.file_type;
v_stringvarchar2(2000);
begin
v_file:=client_text_io.fopen
('C:\oracle\oraForms9\forms90\WEBUTIL\forms\web.txt','r');
client_text_io.get_line(v_file,v_String);
message(v_String);
client_text_io.fclose(v_file);
end;
BUTTON FILE_EXISTS
begin
ifwebutil_file.file_exists('C:\oracle\oraForms9\forms90\WEBUTIL\forms\cs.txt')
then
message('fileexists');
else
message('filedon''texists');
endif;
end;
BUTTON CLIENT_OLE2
OLE_AUFRUF_Web;
PROCEDUREOLE_AUFRUF_WebIS
v_ole_excelclient_ole2.obj_type;
v_OLE_workbookclient_ole2.obj_type;
v_OLE_worksheetclient_ole2.obj_type;
Paper #
Track 36612
v_OLE_Worksheetsclient_ole2.obj_type;
v_file_namevarchar2(2000):=
'C:\oracle\oraForms9\forms90\WEBUTIL\forms\spu.xls';
OBJ_HNDclient_OLE2.OBJ_TYPE;
v_OLE_Rangeclient_OLE2.OBJ_TYPE;
arglistclient_ole2.list_type;
v_OLE_Workbooksclient_OLE2.OBJ_TYPE;
BEGIN
v_ole_excel:=client_ole2.create_obj('Excel.Application');
client_OLE2.SET_PROPERTY(v_ole_excel,'visible',1);
v_OLE_Workbooks:=client_OLE2.GET_OBJ_PROPERTY(v_ole_excel,'Workbooks');
arglist:=client_ole2.create_arglist;
client_ole2.add_arg(arglist,v_file_name);
v_OLE_workbook:=client_ole2.invoke_obj(v_OLE_workbooks,'open',arglist);
client_ole2.destroy_arglist(arglist);
v_OLE_Worksheets:=client_ole2.GET_OBJ_PROPERTY(v_OLE_workbook,'Worksheets');
arglist:=client_ole2.create_arglist;
client_ole2.add_arg(arglist,1);
v_OLE_Worksheet:=client_ole2.GET_OBJ_PROPERTY(v_OLE_Worksheets,'Item',
arglist);
client_ole2.destroy_arglist(arglist);
arglist:=client_ole2.create_arglist;
client_ole2.add_arg(arglist,'B1');
v_OLE_Range:=client_ole2.GET_OBJ_PROPERTY(v_OLE_Worksheet,'Range',arglist);
client_ole2.destroy_arglist(arglist);
client_ole2.SET_PROPERTY(v_OLE_Range,'FormulaR1C1','ThisistheTestwiththe
newclient_OLE2package');
END;
THE
FUTURE
The installation of WebUtil is a little bit complex. I hope, there will be a more automated
way to integrate and install the toolset.
WebUtil is the best toolset for web-developers in the forms-world. All the java-code
written by oneself is now obsolete and can be substituted by WebUtil.
My opinion is: Use WebUtil and dont write your own java beans. Its productiv, efficient
and the best way to get webenabled with Forms9i.
Just use it !
Gerd Volberg
Opitz Consulting
Paper #