Using WebUtil in Your Applications
Using WebUtil in Your Applications
WebUtil provides a simple way call client side functions and packages. WebUtil is basically made up of three main components. The library WebUtil.pll and the object library webutil.olb. WebUtil.pll - Provides a set of PL !"L functions procedures# each of which maps to an e$uivalent %native% &orms built-in. '.g. Client_Host is the e$uivalent call to the Host built in. (f you want to host out to the operating system on the client you would change your code to call Client_Host instead ofHost. WebUtil.olb - Provides the )ava *eans which implement the functionality. (n &orms# the mechanism for calling out to )ava is through e+tending U( components. ,ence# this library provides some beans which are hidden since they are not providing %visual% features but purely functional. Frmwebutil.jar - -ontains the )ava classes which perform )ava %layer% of WebUtil. For each form that needs to use WebUtil functions,two actions need to be carried out.
In your form open the webutil.olb found in <ORACLE_HOME>\forms or in the version you downloaded from OTN if its a higher version. Subclass the WebUtil object group by simply dragging and dropping the WEBUTIL object group into the object group section of your Form. (Ignore the Webutil_Config item) The WebUtil object group contains everything needed to use WebUtil in your form including: a. All of the Portable Java Compoents (PJC's) that implement the WebUtil functionality. the WebUtil block that contains the PJCs is normally hidden but if your application navigates using the NEXT_BLOCK and PREVIOUS_BLOCK builtins your users may inadvertently navigate to the block.You should check your navigation logic to ensure that this does not happen. b. A Canvas and Window to hold them - Tthe WebUtil window is hidden and so its presence will not interfere with your user interface. c. The alert used for popup errors Errors that arise from Webutil
Please ensure that the webutil block, canvas and window are located after all other form items in the list.
Please Note
Attach the PLL before you subclass the webutil.olb object group. If not then please resubclass the objects.
If you subclass the object group before attaching the library then the triggers within the object group will be marked as uncompiled and WebUtil calls will fail with a WUC-15 error unless you do a RecompileAll (Control-shift-K) on your module. Once the WebUtil library has been attached to your form you can start to add calls to the various PL/SQL APIs defined by the utility. The developer would then simply do a search and replace to change any calls to &orms built-ins as follows. &or e+ample.
Calls to ..Change to
TEXT_I T -lient/Te+t/(0
!_E"# -lient/Tool/'nv
$ET_%I!E_"&'E -lient/1et/&ile/name ( )T -lient/,ost 2(3 on client. Client_Host('CMD /C DIR') !E* -lient/0L'4 - &or calls to 5icrosoft '+cel and Word 6Win74 -lients only8 +E&, - W+ITE_I'&$E_%I!E -lient/(mage 6(ncludes 3ead/(mage/&ile and Write (mage/&ile8
It is recommended that you perform a Compile All (ctrl+ ! before deploying the form.