The Forms to XML conversion tool, Forms2XML
, can be invoked from
the command line or from a Java program. The command can be applied to FormsModule
(.fmb
), ObjectLibrary (.olb
), or MenuModule (.mmb
)
files. You can also use the convenience scripts that
are provided with the Forms installation.
The Forms2XML
tool 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 FormModule, MenuModule, or Object Library respectively.
The following table displays a few examples of the changes the tool makes to
the name of the file being converted:
To use the Forms to XML conversion tool from the command line:
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...]
where:
File name before conversion | File name after conversion |
---|---|
myForm.fmb | myForm_fmb.xml |
myMenu.mmb | myMenu_mmb.xml |
myLibrary.olb | myLibrary_olb.xml |
Option | 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. |
OVERWRITE=YES/NO |
if if
|
DUMP=ALL/OVERRIDEN |
If If |
To use the Forms to XML conversion tool from a Java program:
You can pass the Forms2XML
tool a JdapiModule
Java
object (class oracle.forms.jdapi.JdapiModule
) and 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(mod);
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 moreall programmatically.
If your form contains graphics objects of type "Image", the image
will be exported to file when the form is converted to XML. The filename is
constructed from the name of the module, canvas and graphics objects. For
example, if you have a Form Module "EMP" with Canvas "VIEW"
and graphics images object "LOGO" the following line will appear when
converting the form to XML:
Graphics LOGO image saved as EMP_VIEW_LOGO.tif.
The filename is stored in the XML as an attribute on the graphics object.
Forms to XML USE_PROPERTY_IDS Parameter
Understanding the Generated XML