Oracle Forms – Javabean

 

A Javabean to retrieve the Forms applet parameters

 

Home page

 

 

1.    Purpose

 

 

This is a Javabean component that allows to retrieve the Forms applet parameters.

 

 

 

 

 

2.    The Javabean

 

 

package oracle.forms.fd;

 

import oracle.forms.engine.Main;

import oracle.forms.handler.IHandler;

import oracle.forms.properties.ID;

import oracle.forms.ui.VBean;

import oracle.forms.engine.*;

import oracle.forms.handler.*;

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

 

/**

 * Javabean that displays the Forms applet parameters

 *

 * @author Francois Degrelle

 */

 

public class AppletProperties extends VBean

{

 

  protected static final ID pGetInfos = ID.registerProperty("GET_INFOS");

 

  /*

   * Variables

  */

  private IHandler mHandler     = null;   // Forms Handler

  private String   sInfos       = null;   // return string

 

  // default constructor

  public AppletProperties()

  {

  }

 

  public final void init(IHandler handler)

  {

    mHandler = handler;

    super.init(handler);

 

    sInfos ="[serverArgs]="+mHandler.getApplet().getParameter("serverArgs")+"\n";

    sInfos+="[pluginspage]="+mHandler.getApplet().getParameter("jinit_download_page")+"\n";

    sInfos+="[type]="+mHandler.getApplet().getParameter("jinit_mimetype")+"\n";

    sInfos+="[java_codebase]="+mHandler.getApplet().getParameter("codebase")+"\n";

    sInfos+="[java_archive]="+mHandler.getApplet().getParameter("archive_jini")+"\n";

    sInfos+="[width]="+mHandler.getApplet().getParameter("Width")+"\n";

    sInfos+="[height]="+mHandler.getApplet().getParameter("Height")+"\n";

    sInfos+="[serverURL]="+mHandler.getApplet().getParameter("serverURL")+"\n";

    sInfos+="[networkRetries]="+mHandler.getApplet().getParameter("networkRetries")+"\n";

    sInfos+="[separateFrame]="+mHandler.getApplet().getParameter("separateFrame")+"\n";

    sInfos+="[splashScreen]="+mHandler.getApplet().getParameter("splashScreen")+"\n";

    sInfos+="[background]="+mHandler.getApplet().getParameter("background")+"\n";

    sInfos+="[lookAndFeel]="+mHandler.getApplet().getParameter("lookAndFeel")+"\n";

    sInfos+="[colorScheme]="+mHandler.getApplet().getParameter("colorScheme")+"\n";

    sInfos+="[serverApp=]"+mHandler.getApplet().getParameter("serverApp")+"\n";

    sInfos+="[logo]="+mHandler.getApplet().getParameter("logo")+"\n";

    sInfos+="[imageBase]="+mHandler.getApplet().getParameter("imageBase")+"\n";

    sInfos+="[formsMessageListener]="+mHandler.getApplet().getParameter("formsMessageListener")+"\n";

    sInfos+="[recordFileName]="+mHandler.getApplet().getParameter("recordFileName");

 

  }

 

  /**

   * Get the result string from Forms

   **/

  public Object getProperty(ID pId)

  {

    if (pId == pGetInfos)

    {

      return "" + sInfos ;

    }

    else

    {

      return super.getProperty(pId);

    }

  }

 

}

 

 

 

3.    Forms configuration

 

Ø      Copy the appletproperties.jar file in the /forms/java directory

 

Ø      Edit the /forms/server/formsweb.cfg file to add the jar file to the archive_jini variable

 

archive_jini=f90all_jinit.jar,……,appletproperties.jar

 

 

 

4.    How to implement this bean in your own form

 

Ø      Open your form

 

Ø      Add a Javabean component to any block

 

Ø      Set its Implementation class property to : oracle.forms.fd.AppletProperties

 

 

 

5.    The properties that can be read from the bean

 

 

 

Ø      The string that contains the applet parameters

 

Get_Custom_Property( 'BLOC.BEAN', 1, 'GET_INFOS' );

 

 

 

6.    The sample dialog

 

Ø      Download the appletpropeties.zip file

 

Ø      Unzip the appletproperties.zip file

 

Ø      Copy the appletproperties.jar file in your /forms/java/ directory

 

Ø      Edit your /forms/server/formsweb.cfg file

 

Ø      Open the appletproperties.fmb module (Oracle Forms 9.0.2)

 

Ø      Compile all and run the module