Oracle Forms Community - Pluggable Java Components & Java Beans' library

To content | To menu | To search

Friday, March 27 2015

A partially conceal Text Item

Purpose

Here is a PJC that hide parts of a text item
. It is usefull to hide the begin or the end (or any part actually) of a phone number or a credit card.


Conceal Text Field



The implementation class of the PJC

     oracle.forms.fd.ConcealTextField


The methods you can call



  • Set the bounds

Set_Custom_Property( 'BL.TI', 1, 'SET_BOUNDS', '1,6' );
 
This method indicates what part of the text you want to obfusk. In this example, we want to obfusk the first six charaters.

 

 

  • Set the log

Set_Custom_Property('BLOCK.TEXT_ITEM', 1, 'SET_LOG', 'true'); 



The sample dialog

     . Download the concealtextfield.zip file
     .  Unzip the concealtextfield.zip.zip file
     .  Copy the concealtextfield.jar file in your /forms/java/ folder
     .  Add it to the archive and archive_jini tags of the /forms/server/formsweb.cfg file
        e.g.: archive_jini=frmall_jinit.jar,concealtextfield.jar
                archive=frmall.jar,concealtextfield.jar
     . Open the ConcealTextField.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module
 

A "File Dropper" Java Bean

Purpose

Here is a Java Bean from Gert Poel, to Drop an external file within the Forms applications.




The Java source
 

     FileDrop.java   FileDropBean.java



The implementation class of the Java Bean


     oracle.forms.gp.FileDropBean


The event fired by the Java Bean


 DROP


The full filemane is transmitted in the EVENT_MSG parameter.

DECLARE
 l_eventName varchar2(30) := :system.custom_item_event;
 l_eventValues ParamList;
 l_eventValueType number;
 l_event_msg VARCHAR2(255);
BEGIN
   IF l_eventName = 'DROP'
   THEN
      l_eventValues := get_parameter_list(:system.custom_item_event_parameters);
      get_parameter_attr(l_eventValues,'EVENT_MSG',l_eventValueType, l_event_msg);
      IF :system.record_status <> 'NEW'
      THEN
         create_record;
      END IF;
      :ctrl.file_location := l_event_msg;
   END IF;
END;



The sample dialog

     . Download the filedrop.zip file
     . Unzip the filedrop.zip file
     . Copy the FileDrop.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 FILEDROP.fmb module (Oracle Forms 10.1.2)
     . Compile all and run the module

A "CardItem" PJC

Purpose

Here is a Pluggable Java Component from Andreas Weiden, to have a "Card" item style within a single Text Item.

CardItem PJC



The Java source
 

     CardTextfield.java



The implementation class of the PJC (TextItem Item)


     forms.CardTextfield


The PJC initialisation


    
Read the content of the PK_CARDITEM package from the CARDITEM.fmb sample dialog





The sample dialog

     . Download the carditem.zip file
     . Unzip the carditem.zip file
     . Copy the carditem.jar file in your /forms/java/ folder
     . Add it to the archive and archive_jini tags of the /forms/server/formsweb.cfg file
     . Compile the PKG_READ_BLOB_IMAGE.sql script in your database schema
     . Open the CARDITEM.fmb module (Oracle Forms 10.1.2.0.2)
     . Compile all and run the module

 

java.lang.NoSuchMethodError: oracle.forms.handler.IHandler.getApplet()Ljava/applet/Applet

When you migrate to the latest Forms version (10.1.2.3 or 11) and try using a JavaBean created with an older Forms version, you can get the following error, at runtime, in the Java Console:

Exception in thread "thread applet-oracle.forms.engine.Main-1" java.lang.NoSuchMethodError: oracle.forms.handler.IHandler.getApplet()Ljava/applet/Applet

The reason is you try to use a Java Bean compiled with an older Forms JAR file, like f90all.jar.
So, to correct the issue, you have to change the Java code then re-create the JAR file:

private Main         formsMain = null;

Replace:

    formsMain  =  (Main) handler.getApplet();

by:

     // getting the Forms Main class
    try{
      Method method = handler.getClass()
                     .getMethod("getApplet", new Class[0]);

      Object applet = method.invoke(handler, new Object[0]);
      if (applet instanceof Main) {
         formsMain = (Main)applet;
      }    
    }catch(Exception ex) {;} 

Then create and deploy the new JAR file to your /forms/Java folder.


An "Expand/Collapse"-Canvas Java-Bean

Purpose

Here is a Pluggable Java Component from Andreas Weiden, to have expandable/collapsable canvas.

It allows a simple Push Button Item to expand/collapse the whole content of a canvas like a Tree item.

Accordion Java Bean



The Java source
 

     AccordionButton.java



The implementation class of the PJC (PushButton Item)


     forms.AccordionButton


The PJC initialisation

     Read the content of the PK_AKKORDION.txt file from the zip file




The sample dialog

     . Download the accordion.zip file
     . Unzip the accordion.zip file
     . Copy the accordion.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 ACCORDION.fmb and ACCORDION2.fmb modules (Oracle Forms 10.1.2.0.2)
     . Compile all and run the module

- page 2 of 13 -