Overblog
Suivre ce blog Administration + Créer mon blog
30 juillet 2009 4 30 /07 /juillet /2009 16:47
Purpose

Here is a Java Bean from Jesus Vallejo that
returns the date / time of major cities.
 
It run with JInitiator.
 
For get the time zone of any city, you can search on: http://www.timezoneconverter.com/cgi-bin/findzone



Time Zones Java Bean




The implementation class of the Bean Item

     oracle.forms.jvr.TimeZones

 

 

 


The Java code

 

 

     TimeZones.java

 

 

 

The methods you can call


  • set the country in which is the server

FBEAN.INVOKE ('BL.BEAN',1,'setPaisOrigen','ES');



  • Set the zone to get the date / time

FBEAN.INVOKE ('BL.BEAN',1,'setZona','America/Buenos_Aires');

  • Get the date and time

:BL.DATE := FBEAN.INVOKE_CHAR ('BL.BEAN',1,'fechaHora','');



The sample dialog

     .
Download the TimeZones.zip file
     .  Unzip the TimeZones.zip file
     .  Copy the TimeZone.jar file in your /forms/java/ folder

     .  Add it to the archive and archive_jini tags of the /forms/server/formsweb.cfg file
     . Open the TIMEZONES.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

     The jar file must be signed
     The jar file provided with the .zip file are already signed


For any question concerning this bean, send a mail to Jesus at vallejo.jesus@gmail.com.

Partager cet article
Repost0
1 juillet 2009 3 01 /07 /juillet /2009 08:45
Purpose

Here is a Java Bean from Jesus Vallejo that works as a translator,
based on the Google Translater project which can be found at "http://google-api-translate-java.googlecode.com/files/google-api-translate-java-0.53.jar".



Translator Bean




The implementation class of the Bean Item

     oracle.forms.jvr.demo.Translater


The methods you can call



  • Register the bean

fbean.register_bean(hBean, 1, 'oracle.forms.jvr.demo.Translater');

This is the very first operation you have to do.



  • Set the text to translate

fbean.invoke( hBean, 1, 'setText', 'Hello');

  • Set the language from

fbean.invoke (hBean,1,'setOrigen','en');


  • Set the language to

fbean.invoke (hBean,1,'setDestino','es');


  • Get the translated text

 translated_text  := fbean.invoke_char (hBean,1,'traducir','');




The sample dialog

     .
Download the gtranslator.zip file
     .  Unzip the gtranslator.zip file
     .  Copy the JAR files in your /forms/java/ folder

     .  Add them to the archive and archive_jini tags of the /forms/server/formsweb.cfg file
     . Open the Translater.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

     The jar files must be signed
     The jar files provided with the .zip file are already signed


For any question concerning this bean, send a mail to Jesus at vallejo.jesus@gmail.com.

Partager cet article
Repost0
26 février 2009 4 26 /02 /février /2009 14:13
Mark Striekwold has just released a new Java Bean allowing the developer to show a PDF document inside the Forms application.

Get it from here

Partager cet article
Repost0
26 février 2009 4 26 /02 /février /2009 14:11
Hafed Benteftifa has just released his FRITE - Forms Rich Text Editor - alowing the Oracle Forms application to edit HTML content.

Frite
This is just the kind of Java Bean, developers and end-users were waiting for years !
Don't waste any more time, run and get it !
Partager cet article
Repost0
29 janvier 2009 4 29 /01 /janvier /2009 09:16

To mark the third anniversary of the forms-pjc-bean site, I am pleased to launch a Forms Java Bean contest.

To take part, all you need to do is to show a developed Forms application that contains an interesting, innovative, or just plain "cool" use of a Java Bean or PJC.

You do not need to have created the Java Bean, but if you are not the creator, you have to use it in an original, innovative and exciting way.

The winner will be chosen by two principal product managers from the Oracle Forms team: Grant Ronald and Jan Carlin.

It is just for fun, so there is no prize, except your entry getting pride of place on OTN and the eternal admiration of your peers! ;o)

Send your entries in a zip file containing a screenshot or a flash video(*) and/or everything needed to install and run the application to the following address: forms.pjc.bean@free.fr  by the end of February.

  19 contributions sent 

Lionel Lasserre: Planning Bean
P
eter Valencic: Scanner Bean - Scanner Bean 2 - Scanner Bean 3 and a game!
Grant Ronald: Google Maps Bean
Vijaynath Nair: Autocad Integration Bean
Mark Striekwold: JFreeChart Integration and Chat Bean and PDF Viewer Bean
Andreas Weiden: Shuttle Bean and TreeTable-component Bean
Francois Degrelle: Carousel Bean and Wall-Brick Bean
Hafed Benteftifa: FRITE (Forms Rich Text HTML Editor)
Stephane Vinette Image handler Java Bean
Tobias Björnsson Forms wrapper for Oracle Data Visualization Components and Interacting with Forms from other systems
Md. Mehbub Islam Scanner Bean part 1 and Scanner Bean part 2
Oleg Tishchenko Generic Chart Builder


And the winner is Md. Mehbub Islam with his Scanner Bean



(*)Here is a link to a free online screen recorder : http://www.screentoaster.com/
Partager cet article
Repost0
2 janvier 2009 5 02 /01 /janvier /2009 09:42

Purpose


Here is a Java bean from Hafed Benteftifa (Québec - Canada) that allows the Forms module to display static Google maps with HTTP geocoding service.



Get the zip file here, that contains the documentation and all the necessary material, or go to his site to get the information.

Partager cet article
Repost0
30 décembre 2008 2 30 /12 /décembre /2008 10:25

Purpose

Here is a Java Bean from Mark Striekwold to have an enhanced Web Browser (2nd edition). It is a full Web browser that can handle Javascript. This bean is based on the idea of the Full Web Browser Java Bean and rewritten so it makes use of the fbean package to register the bean and to call the methods of the java bean. It also makes use of a newer version of the jdic.jar which makes it easier to use under windows.

The material comes from the JDICplus project (WIN32 only):
https://java.net/projects/jdic


 

Enhanced Web Browser

It can accept both http url and local machine html file names.

 

It needs, at least, a 1.6 JRE so the Sun Java plug-in, so that it won't run with the JInitiator and earlier version of the Sun Java plug-in.


The Java code

     ehb.java



The implementation class of the Bean Item

     oracle.forms.ms.ehb


The methods you can call

 

  • Register the bean

fbean.register_bean('BL.BEAN', 1, 'oracle.forms.ms.ehb');

This is the very first operation you have to do.

 

 

  • Get the Forms Window

fbean.invoke( 'BL.BEAN', 1, 'infoBean', '');

This must be used to retrieve the Forms window that handles the webBrowser, then synchronize its position when the windows is moved. This must be the first property set (in the When-New-Form-Instance trigger).

 

 

 

  • Set the URL/File

fbean.invoke( 'BL.BEAN', 1, 'setUrl', 'URL');


e.g. :

fbean.invoke( 'BL.BEAN', 1, 'setUrl', 'http://mark-oracle.blogspot.com');        



 

  • Set the border of the bean

fbean.invoke( 'BL.BEAN', 1, 'setBorder', 'false');


When you want to use this bean to display a Flash image (*.swf), you would probably prefer not to have any border bounding the image.
In this case, set the border to false.

 

  • Basic navigation

fbean.invoke( 'BL.BEAN', 1, 'setNavigation', 'back | forward | refresh' ) ;

e.g.:

fbean.invoke( 'BL.BEAN', 1, 'setNavigation', 'back');




The sample dialog

     .
Download the ehb.zip file

     .  Unzip the ehb.zip file
     .  Copy the ehb.jar file in your /forms/java/ folder

     . Download the JDICplus project zip file
     .  Unzip the JDICplus-0.2.2-bin-win32.zip file
     . copy the /lib/JDICplus.jar in your /forms/java/ folder
     . copy the /lib/bin/jdicArc.dll and /lib/bin/jdicWeb.dll in your /windows/system32 folder
     . Update your /forms/server/formsweb.cfg configuration file:
          . archive=frmall.jar,ehb.jar,JDICplus.jar
     . Notice that we update the archive tag and not the archive_jini tag because this bean needs the Sun Java plug-in 1.6 and won't run with any older version, including the Oracle JInitiator

     . Open the EHBROWSER.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module


     The .jar files must be signed
     The ehb.jar file provided with the .zip file are already signed

 

For any question concerning this bean, send a mail to Mark at mark.striekwold@gmail.com.

Partager cet article
Repost0
24 décembre 2008 3 24 /12 /décembre /2008 14:40

Purpose

This enhanced Java Bean is a "fast" open/save file chooser dialog, based on the AWT system, for those who think that the Swing JFileChooser available is too "slow".

It uses the FBean package.





The Java code

     AWTFileDialog.java



The methods you can set


Register the bean


The Implementation Class is : oracle.forms.fd.AWTFileDialog

FBean.Register_Bean('CTRL.BEAN', 1, 'oracle.forms.fd.AWTFileDialog');

 



Open file dialog box


var := FBean.Invoke_Char('CTRL.BEAN', 1, 'openFile' ,'Open a file...,C:\,*.java');

The last argument is composed by a title, a starting directory and a file filter.
If you want to provide a file type list, separate them with a ; like the following:
var := FBean.Invoke_Char('CTRL.BEAN', 1, 'openFile' ,'Open a file...,C:\,*.jpg;*.jpeg;*.gif');

 


Save file dialog box


var := FBean.Invoke_Char('CTRL.BEAN', 1, 'saveFile' ,'Save file as......,C:\,filename.txt');



set debug ON/OFF


FBean.Invoke('CTRL.BEAN', 1, 'setLog' ,'true | false');






The sample dialog


     . Download the AWTFileDialog.jar file
     . Download the AWTFileDialog.fmb file
     . copy the AWTFileDialog.jar file in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file to add the AWTFileDialog.jar to both archive and archive_jini tags.
     . Open the AWTFileDialog.fmb module
     . Compile all and run the module

See also another File selection bean by Hafed Benteftifa

Partager cet article
Repost0
16 octobre 2008 4 16 /10 /octobre /2008 17:19

Purpose

Here is a Pluggable Java Component that allows to manage a FTP connection.

It is based on the Calvin Tai ftpbean.

simpleFTP bean


The Java source

     SimpleFTP.java



The implementation class of the Bean Area

     oracle.forms.fd.SimpleFTP


The methods you can set

  • managing connection


-- connect the FTP host --
Set_Custom_Property('BL.BEAN', 1, 'CONNECT', 'host_name,user[,password]' );

-- set the port number (if <> 21)
Set_Custom_Property('BL.BEAN', 1, 'SET_PORT', 'port_number' );

-- set the socket timeout number --
Set_Custom_Property('BL.BEAN', 1, 'SET_SOCKET_TIMEOUT', 'number' );

-- set the passive mode (default true) --
Set_Custom_Property('BL.BEAN', 1, 'SET_PASSIVE_MODE_TRANSFER, 'true|false');'

-- close the connection --
Set_Custom_Property('BL.BEAN', 1, 'CLOSE', '' );


  • managing content


-- change host directory --
Set_Custom_Property('BL.BEAN', 1, 'SET_DIRECTORY', 'remote_directory' );

-- get the host directory list --
Set_Custom_Property('BL.BEAN', 1, 'DIRECTORY_LIST', 'remote_directory' );

-- get a binary file --
Set_Custom_Property('BL.BEAN', 1, 'GET_BINARY_FILE', 'remote_filename,local_filename[,remote_file_size][,...]' );

You can provide multiple pairs of remote/local/file_size:
Set_Custom_Property('BL.BEAN',1,'GET_BINARY_FILE','file1.jpg,d:\file1.jpg,0,file2.jpg,d:\file2.jpg,0');

If the remote_file_size is not provided, the progress bar will not display the exact values.

-- get an ascii file --
Set_Custom_Property('BL.BEAN', 1, 'GET_ACSII_FILE', 'remote_filename,local_filename[,remote_file_size]' );

If the remote_file_size is not provided, the progress bar will not display the exact values.

-- put a binary file --
Set_Custom_Property('BL.BEAN', 1, 'PUT_BINARY_FILE', 'locale_filename,remote_filename[,...]' );

You can provide multiple pairs of remote/local/file_size:

Set_Custom_Property('BL.BEAN',1,'PUT_BINARY_FILE','d:\file1.jpg,file1.jpg,d:\file2.jpg,file2.jpg');


-- change to the parent host directory --
Set_Custom_Property('BL.BEAN', 1, 'TO_PARENT_DIR', '' );

-- create a host directory --
Set_Custom_Property('BL.BEAN', 1, 'MAKE_DIRECTORY', 'remote_directory' );

-- remove a host directory --
Set_Custom_Property('BL.BEAN', 1, 'REMOVE_DIRECTORY', 'remote_directory' );

-- delete a remote file --
Set_Custom_Property('BL.BEAN', 1, 'FILE_DELETE', 'remote_filename' );     

-- rename a remote file --
Set_Custom_Property('BL.BEAN', 1, 'FILE_RENAME', 'remote_filename' );

-- execute a command --
Set_Custom_Property('BL.BEAN', 1, 'EXECUTE', 'command' );


  • progress bar


To not just making the wrapper around the great Calvin work, I have added a nice progress bar you can display while transfering files.
The progress bar can be as simple as possible to include it in your existing design, but it can also have a titled border.
All the dimensions must be given in pixel.

-- display/hide the file transfer progress bar --
Set_Custom_Property('BL.BEAN', 1, 'SET_PROGRESS_BAR, 'true|false');'

-- set the progress bar location --
Set_Custom_Property('BL.BEAN', 1, 'SET_PROGRESS_BAR_LOCATION', 'X_POS,Y_POS' );

The coordinates are pixel based, and relative to the upper-left corner of the canvas.
If it is not provided or equals to -1,-1  the progress bar is centered to the canvas.

-- set the progress bar size --
Set_Custom_Property('BL.BEAN', 1, 'SET_PROGRESS_BAR_SIZE', 'width,height' );

If it is not provided, the default values are : 200,16

-- set the progress bar title --
Set_Custom_Property('BL.BEAN', 1, 'SET_PROGRESS_BAR_TITLE', 'title' );

If it is not provided, the progress bar is displayed without any titled border

-- switch on/off the Java console loggin --
Set_Custom_Property('BL.BEAN', 1, 'SET_LOG', 'true|false');


The methods you can get

-- get the message corresponding to the last FTP order --
var := Get_Custom_Property('BL.BEAN', 1, 'GET_MESSAGE');

Generally used after every FTP order to check the execution status.
Returns "OK" if the command succeeded, else returns the error message.

-- get the file list --
var := Get_Custom_Property('BL.BEAN', 1, 'GET_FILE_LIST');

Returns a delimited string of all records founds. The fields are separated by a CHR(9), and the records are separated by a CHR(10).

The record is composed by the following:
 - File type (DIR | FILE | LINK | OTHER)
 - File name
 - File size
 - File date

-- get the FTP reply string --
var := Get_Custom_Property('BL.BEAN', 1, 'GET_REPLY');

It is composed by the FTP code and the FTP message.

-- get the FTP port number --
var := Get_Custom_Property('BL.BEAN', 1, 'GET_PORT');

-- get the FTP socket timeout value --
var := Get_Custom_Property('BL.BEAN', 1, 'GET_SOCKET_TIMEOUT');

-- get the host server name --
var := Get_Custom_Property('BL.BEAN', 1, 'GET_SERVER_NAME');


The events raised by the bean

PROGRESS_MESSAGE
Is raised by the bean by the progress bar

PROGRESS_VALUE
is the current progress bar value

-- example of When-Custom-Item-Event trigger --
DECLARE
    eventName varchar2(30) := :system.custom_item_event;
    eventValues ParamList;
    eventValueType number;
    LC$Value  varchar2(1000);
BEGIN
   IF (eventName='PROGRESS_MESSAGE') THEN
      eventValues := get_parameter_list(:system.custom_item_event_parameters);
      get_parameter_attr(eventValues,'PROGRESS_VALUE',eventValueType, LC$Value);  
      -- display the current transfert percentage --
      :BL.PROGRESS := LC$Value || '%' ;
      Synchronize;
   END IF;
END;



The sample dialog


     . Download the simpleFTP.zip file
     . Unzip the file
     . copy the ftpbean.jar and simpleFTP.jar files in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file
     archive_jini=f90all_jinit.jar,ftpbean.jar,simpleFTP.jar
     archive=f90all.jar,ftpbean.jar,simpleFTP.jar

     . Open the simpleFTP.fmb module (Oracle Forms 9.0.2)
     . Compile all and run the module

In the sample dialog, when you are connected to the FTP server, double-clicking one line of the file content table-block will open and display the new folder if the file type is DIR, or download the underlying file on the c:/ folder if the file type is FILE.


The two JAR files have to be signed.
Those, shipped with the zip file are already signed.


Partager cet article
Repost0
13 mai 2008 2 13 /05 /mai /2008 10:03

Purpose

This PJC is a workaround to the issue defined in the bug 3867157 on Metalink.

It allows having the same behaviour on the Web that the one it has on the C/S version. The When-List-Changed trigger would fire only when the mouse is clicked or when the Enter key is pressed, but not when the end-user types a letter to filter the list.

It is a PJC so that you do not need any Bean Area. Just fill the Implementation Class of your existing List Item.



The Java code

     PopList.java



The implementation class of the List Item

     oracle.forms.fd.PopList


The methods you can set



SET_CASE_SENSITIVE

By default, the poplist is case sensitive, but you can set it not sensitive.

Set_Custom_Property( 'BL.BT', 1, 'SET_CASE_SENSITIVE','false');

 

 

  SET_LOG

Set_Custom_Property( 'BL.BT', 1, 'SET_LOG','true');




The sample dialog


     . Download the poplist.zip file
     . Unzip the file
     . copy the poplist.jar file in the <ORACLE_HOME>/forms/java directory
     . Edit your /forms/server/formsweb.cfg file to add the poplist.jar to both archive and archive_jini tags.
     . Open the poplist.fmb module (Oracle Forms 9.0.2) the first List-Item uses the PJC, so that you can compare with the second that is a standard List-Item.
     . Compile all and run the module

Partager cet article
Repost0