Using Java Pluggable Components (JPC)in Oracle Forms
Java pluggable components are java bean classes that can integrate to Oracle Forms environment and provide new functionality to the standard Forms build-in functionality. They are used in web-centric application that are deployed through Oracle Internet Application Server.
The JPC are standard components that can be created you, or can be downloaded through the internet.
The following shows how to add JPC component to a form module and how to configure the application server accordingly.
The example explains how to add File Upload component (Note the same can be done using WebUtil)
Using Java Pluggable component
File upload example
This document assumes that the Oracle Developer is installed as the following directory
C:\oracle\product\10.1.0\DevSuite_10g => $ORACLE_HOME
1) Create the following file in directory at the %ORACLE_HOME/forms/server and call it fileupload.env
ORACLE_HOME=C:\oracle\product\10.1.0\DevSuite_10g\
PATH=C:\oracle\product\10.1.0\DevSuite_10g\forms\jdk\jre\bin\classic;C:\oracle\product\10.1.0\DevSuite_10g\bin
CLASSPATH=C:\oracle\product\10.1.0\DevSuite_10g\forms\demos\jars\uploadserver.jar;C:\oracle\product\10.1.0\DevSuite_10g\jdk\jre\lib\rt.jar
FORMS_path=C:\oracle\product\10.1.0DevSuite_10g\forms\\demos\lib;C:\oracle\product\10.1.0\DevSuite_10g\forms\demos\fileupload\forms
Add the following to the end of the formsweb.cfg file
[FileUpload]
pageTitle=OracleAS Forms Services - FileUpload Sample
IE=jinitiator
baseHTMLJInitiator=demobasejini.html
archive_jini=frmall_jinit.jar,/forms/formsdemo/jars/demo.jar,/forms/formsdemo/jars/icons.jar
archive=frmall.jar,/forms/formsdemo/jars/demo.jar,/forms/formsdemo/jars/icons.jar
width=675
height=480
separateFrame=false
splashScreen=no
lookAndFeel=oracle
colorScheme=blue
form=dubai_police.fmx
background=/formsdemo/images/blue.gif
envFile=fileupload.env
Important: Please note that it is very important that you set the archive variable and the archive_jini variable correctly.
In our example, the java classes (components) are located inside the demo.jar (which is incorrectly document in the oracle documentation for the upload demo). Also note that the /formsdemo/ is a virtual directory and the actual directory is /forms/demos. This is configured when you deploy the application. Therefore make sure that the file demo.jar exists and located as indicated above
The variable envFile points to a the file fileupload.env, which is the file defined in step 1 above
This file defines the CLASS PATH, the FORMS path and the Oracle path.
Make sure that the form (FMX) file is located within the FORMS PATH. Note that the actual file name to be executed is defined by the variable
Form = Dubai.fmx
===================== CODING ======================================
You need to follow coding as document in the example and the demo
Reusing the FileUpload utility within your own applications requires the following steps.
begin
FileUploader.eventHandler(:system.custom_item_event,get_parameter_list(:system.custom_item_event_parameters));
end;
/*----------------------------------------------------*
* Sample Callback trigger for FileUploader
* You should always implement a check on the status
* to make sure that the upload has worked.
*
* This trigger will only be executed once the upload
* has finished or aborted
*---------------------------------------------------*/
Begin
if FileUploader.getStatus = FileUploader.FINISHED then
message(FileUploader.getSourceFile || 'was uploaded');
elsif FileUploader.getStatus = FileUploader.FAILED then
message('Upload Failed because: '||FileUploader.getError);
end if;
end;
FileUploader.init('UPLOAD.FILE_UPLOAD_BEAN','FILEUPLOADER_CALLBACK');
FileUploader.UploadFile('d:\temp\uploaded');
Warning: If you intend to use the FileUpload utility in your own applications, We recommend that you re-sign the UploadClient PJC with your own x509 certificate.
Please follow the documents
C:\oracle\product\10.1.0\DevSuite_10g\forms\demos\fileupload\doc\fileuploader.html
the entire document is downloaded from internet