Previous
Previous
 
Next
Next

Converting FormModules, ObjectLibraries, or MenuModules to XML

You can convert Oracle Forms FormModule, MenuModule, and ObjectLibrary files to Extensible Markup Language (XML) using the Oracle Forms to XML conversion tool, Forms2XML.

Topics


Note:

The Forms2XML utility must generate an XML file in English only. If the generated XML tags are not in English then the file will fail to load.

About the Forms2XML Conversion Tool

The Oracle Forms to XML conversion tool, Forms2XML was introduced in Oracle9i Oracle Developer Suite and is also available in Oracle Developer Suite 10g. This tool should also work on files from earlier releases of Oracle Forms. If the Oracle Forms to XML Conversion tool does not work for a specific file from an earlier version of Oracle Forms then that file will must be upgraded to Oracle Developer Suite 9i or 10g and then converted to XML

Forms2XML produces an XML file that has the same base name as the Forms file with a .xml extension. The extension _fmb, _mmb, or _olb is added to the base file name to indicate whether the original file was a Forms Modules, a MenuModule, or an Object Library. The following table displays a few examples of the changes the tool makes to the name of the file being converted:

File name before conversion File name after conversion
myForm.fmb myForm_fmb.xml
myMenu.mmb myMenu_mmb.xml
myLibrary.olb myLibrary_olb.xml

Using the Forms2XML Conversion Tool From a Command Line

The Forms2XML command takes one or more Forms Module files as an argument. The files can be FormsModule (.fmb), ObjectLibrary (.olb), or MenuModule (.mmb) files. The output is placed in the current folder. The command has the following syntax:

frmf2xml [options] file1 [file2...]
java oracle.forms.util.xmltools.Forms2XML [options] file1 [file2...]

Available options include:

Options Description
USE_PROPERTY_IDS=YES/NO Setting USE_PROPERTY_IDS to YES causes the Forms to XML conversion tool to write the internal ID for Real or Character into the XML file.

The default value (NO) generates property value names as before.

Note: The Forms2XML utility must be run with USE_PROPERTY_IDS=NO.

OVERWRITE=YES/NO Valid values are YES or NO.

If OVERWRITE=YES, the tool overwrites any XML files with the same name that already exist in the output directory.

If OVERWRITE=NO, (default) the tool does not overwrite any XML files with the same name that already exist in the output directory. The tool will stop processing and return the message:

If the file file already exists. Use argument OVERWRITE=YES to replace.

DUMP=ALL/OVERRIDEN If DUMP=ALL, the tool dumps all properties.

If DUMP=OVERRIDEN, the tool dumps only those properties that are overriden.


Using the Forms2XML Conversion Tool in a Java Program

You can pass the Forms2XML tool a JdapiModule Java object (class oracle.forms.jdapi.JdapiModule) and dump its objects and properties to an XMLDocument (class oracle.xml.parser.v2.XMLDocument). For example:

...
 // get the modules in the session
 JdapiIterator mods = Jdapi.getModules(); 
    // ... and iterate round them 
    while(mods.hasNext())
      {
        JdapiModule mod = (JdapiModule)mods.next();
        Forms2XML converter = new Forms2XML(
        XMLDocument doc = converter.dumpModule(false);
              ... 
       }

Note that the Boolean argument taken by the dumpModule() method instructs converter to dump all properties to the XMLDocument doc, not just those which are overridden.

Once you have the module as a XMLDocument object, you could then use the XDK classes to manipulate it. For example, you could traverse it, remove or add objects, change properties, copy objects into other modules that are also saved as XMLDocument objects, and more—all programmatically.

To learn more about Oracle Forms, see the following hosted Help file:

http://www.oracle.com/webapps/online-help/forms/