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
.
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. The conversion of synonym-based data blocks is not supported. Only data blocks based on tables or views is supported by the conversion process. Please ensure that the application you want to convert is based only on tables and views.
- About the Forms2XML Conversion Tool
- Using the Forms2XML Conversion Tool From a Command Line
- Using the Forms2XML Conversion Tool in a Java Program
Parent topic: Converting an Oracle Forms Application
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 you must upgrade the file to Oracle Developer Suite 9i or 10g and then convert to XML
Forms2XML
produces an XML file that has the same base name as the Forms file with an .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 |
---|---|
|
|
|
|
|
|
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...]
The following table describes available options.
Options | Description |
---|---|
|
Setting The default value ( Note: The Forms2XML utility must be run with |
|
Valid values are If If If the file |
|
If If |
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); ... }
The Boolean argument taken by the dumpModule()
method instructs the converter to dump all properties to the XMLDocument doc,
not just those which are overridden.
Once you have the module as an XMLDocument
object, you could then use the XDK classes to manipulate it programmatically. 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 so on.
See Also:
To learn more about Oracle Forms, "http://www.oracle.com/technetwork/developer-tools/forms/overview/index.html
"