jdapi_laf tool

 

 

What is this tool

 

This tool uses the Oracle JDAPI api to integrate the Forms Look and Feel project into existing Forms modules through an XML file.

 

 

It is composed by two elements:

 

  1. jdapi_laf.jar
  2. jdapi_laf.xml

 

 

1. jdapi_laf.jar

 

Is a Java program, using the Oracle JDAPI api to open and modify existing Forms modules, in order to add L&F elements.

 

You can use it directly from the command line.

 

 

 

2. Jdapi_laf.xml

 

The XML file that contains all the setting needed to add the L&F features in the existing Forms module.

 

<file>

  <!-- --------------------------------- -->

  <!-- general configuration information -->

  <!-- --------------------------------- -->

  <configuration>

    <backup_directory>C:/temp/forms_bakup/</backup_directory>

    <target_directory></target_directory>

    <module_list>

       <name>C:/forms/test.fmb</name>

       <name>C:/forms/test2.fmb</name>

       <name>C:/forms/test</name>

    </module_list>

    <log_file_name>c:/jdapi_laf.log</log_file_name>

    <backup_ext>_bak</backup_ext>

    <new_ext>_new</new_ext>

    <connection_string>user/pwd@XE</connection_string>

    <compile_module>false</compile_module>

    <comment>module modified by JDAPI_LAF on :SYSDATE</comment>

    <libraries_case>to_lower_case</libraries_case>

    <sleep_instruction>dbms_lock.sleep(2/10);</sleep_instruction>
    <replace_check_box>false</replace_check_box>
    <replace_radio_button>false</replace_radio_button>
    <replace_textfield>false</replace_textfield>
    <replace_textarea>false</replace_textarea>
    <replace_list>false</replace_list>

  </configuration>

  <!-- ---------------------------- -->

  <!-- properties for every modules -->

  <!-- ---------------------------- -->

  <all_modules>

    <library>

      <action>ATTACH</action>

      <name>laf</name>

    </library>

    <!-- olb subclassing -->

    <subclass_olb>

      <lib_name>C:/forms/laf.olb</lib_name>

      <tab_name>GROUPS</tab_name>

      <object_num>1</object_num>

      <target_name>GRP_LAF_STND</target_name>

    </subclass_olb>   

    <!-- all blocks -->

    <blocks>

      <block>

        <property>setComment</property>

        <value>Block updated for the LAF project integration</value>

      </block>

    </blocks>  

    <!-- all canvases -->

    <canvases>

      <canvas>

        <property>setComment</property>

        <value>Canvas updated for the LAF project integration</value>

      </canvas>

    </canvases> 

    <!-- parameters -->

    <single_parameters>

      <parameter>

        <!-- CSS location -->

        <name>PM$CSS_FILENAME</name>

        <action>update</action>

        <value>c:\forms.css</value>

        <on_error>continue</on_error>

      </parameter>

      <parameter>

        <!-- block title CSS section name -->

        <name>PM$TITLE</name>

        <action>update</action>

        <value>.tableTitle1</value>

        <on_error>continue</on_error>

      </parameter>                             

      <parameter>

        <!-- block header CSS section name -->

        <name>PM$HEADER</name>

        <action>update</action>

        <value>.tableHeader1</value>

        <on_error>continue</on_error>

      </parameter>

      <parameter>

        <!-- block body CSS section name -->

        <name>PM$BODY</name>

        <action>update</action>

        <value>.tableBody1</value>

        <on_error>continue</on_error>

      </parameter>           

      <parameter>

        <!-- canvas CSS section name -->

        <name>PM$CANVAS</name>

        <action>update</action>

        <value>.canvas1</value>

        <on_error>continue</on_error>

      </parameter>           

      <parameter>

        <!-- general GUI settings -->

        <name>PM$GUI</name>

        <action>update</action>

        <value>.GUIProperties1</value>

        <on_error>continue</on_error>

      </parameter>

      <parameter>

        <!-- Visual Attribute setting -->

        <name>PM$VA</name>

        <action>update</action>

        <value>VA_LAF1</value>

        <on_error>continue</on_error>

      </parameter>     

    </single_parameters>          

  </all_modules>

  <!-- -------------------------------------- -->

  <!-- properties for single specified module -->

  <!-- -------------------------------------- -->

  <single_modules>

  </single_modules> 

</file>

 

 

<!-- --------------------------------- -->

<!-- general configuration information -->

<!-- --------------------------------- -->

<backup_directory> is the directory to save a backup of the modules

<target_directory> is the directory to put the new generated modules

   The modules are left at the same place if this tag is left empty

<module_list> is the list of the modules to process

       <name> can be a single file name or a directory

<log_file_name> is the full name of the log file created

<backup_ext> is the extension added to each module moved to the backup directory

<new_ext> is the extension added to each module created. If left blank, the module is overridden.

<connection_string> database connection string

<compile_module> indicates if the module has to be compiled.

    Possibles values are true or false

<comment> comment added to each module

<libraries_case> specifies if the pll names have to be renamed to lower or upper case

<sleep_instruction> is the instruction or pl/sql block to wait the required time before the Java Bean is instanced (see the When-New-Form-Instance trigger)
<replace_check_box> specifies if the CheckBox Items have to be overloaded by the LAF equivalent
<replace_radio_button> specifies if the RadioButton Items have to be overloaded by the LAF equivalent
<replace_textfield> specifies if the single-line Text Items have to be overloaded by the LAF equivalent
<replace_textarea> specifies if the multi-line Text Items have to be overloaded by the LAF equivalent
<replace_list> specifies if the List Items have to be overloaded by the LAF equivalent
 

 

<!-- ---------------------------- -->

<!-- properties for every modules -->

<!-- ---------------------------- -->

<library> use to attach the laf.pll library

<subclass_olb> used to attach the laf.olb object library

<single_parameters> is used to specify the initial value of each parameter

 

PM$CSS_FILENAME contains the full path to the CSS file

PM$CANVAS contains the CSS tag entry to decorate the canvases

PM$TITLE contains the CSS tag entry to decorate the block titles

PM$HEADER contains the CSS tag entry to decorate the block headers

PM$BODY contains the CSS tag entry to decorate the block bodies

PM$GUI contains the CSS tag entry to decorate the GUI elements

PM$VA indicates what Visual Attribute to use to colorize the records

 

 

 

How to use this tool

 

 

 

In a DOS command box, enter the following command:

 

In this example we assume the following:

 

 

 

"C:/Program Files/Java/j2re1.4.2_16/bin/java.exe" -classpath C:/Oracle/forms/java/jdapi_laf.jar;C:/Oracle/forms/java/frmjdapi.jar; oracle.forms.fd.JDAPI_LAF C:/jdapi_laf.xml

 

If you use Forms 9i, replace the frmjdapi.jar by f90jdapi.jar

 

 

Caution : The path to java.exe must point to, at least,  a JRE 1.4 environment, so do not try to use the Forms JInitiator environment.

 

 

If you let the configuration files as they are provided, you will give to your modules a purple look and feel, like the following image