





















































When we are participating in a Forms Conversion project, it means we take the source files of our application, turn them into XML files, and upload them into the Forms Conversion part of APEX. This article describes what we do before uploading the XML files and starting our actual Forms Conversion project.
When we talk about source files, it would come in very handy if we got all the right versions of these files. In order to do the Conversion project, we need the same components that are used in the production environment. For these components, we have to get the source files of the components we want to convert. This means we have no use of the runtime files (Oracle Forms runtime files have the FMX extension). In other words, for Forms components we don't need the FMX files, but the FMB source files.
These are a few ground rules we have to take into account:
We need the following files for our Conversion project:
When we take these source files, we will be able to create all the necessary XML files that we need for the Forms Conversion project.
To create XML files, we need three parts of the Oracle Developer Suite. All of these parts come with a normal 10g or 9i installation of the Developer Suite. These three parts are the Forms Builder, the Reports Builder, and the Forms2XML conversion tool. The Forms2XML conversion tool is the most extensive to understand and is used to create XML files from Form modules, Object Libraries, and Forms Menus. So, we will first discuss the possibilities of this tool.
This tool can be used both from the command line as well as a Java applet. As the command line gives us all the possibilities we need and is as easy as a Java applet, we will only use the command-line possibilities. The frmf2xml command comes with some options. The following syntax is used while converting the Forms Modules, the Object Libraries, and the Forms Menus to an XML structure:
frmf2xml [option] file [file]
In other words, we follow these steps:
We probably want to give the OVERWRITE=YES option with our command. This property ensures that the newly created XML file will overwrite the one with the same name in the directory where we are working. If another file with the same name already exists in this directory and we don't give the OVERWRITE option the value YES (the default is NO), the file will not be generated, as we see in the following screenshot:
If there are any images used in modules (Forms or Object Libraries), the Forms2XML tool will refer to the image in the XML file created, and that file will create a TIF file of the image in the directory.
The XML files that are created will be stored in the same directory from which we call the command. It will use the following syntax for the name of the XML file:
To convert the .FMB, OLB and, MMB files to XML, we need to do the following steps in the command prompt:
The following steps are done in order to convert the .FMB file to XML:
C:>cd C:summit
C:summit>frmf2xml OVERWRITE=YES orders.fmb
As we see in the following screenshot, this command creates an XML file called orders_fmb.xml in the working directory:
To convert the .OLB file to XML, the following steps are needed:
C:>cd C:summit
C:summit>frmf2xml OVERWRITE=YES Form_Builder_II.olb
As we see in the following screenshot, the command creates an XML file calledForm_Builder_II_olb.xml and two images as .tif files in the working directory:
To convert the MMB file to XML, we follow these steps:
C:>cd C:summit
C:summit>frmf2xml OVERWRITE=YES customers.mmb
As we can see in the following screenshot, the command creates an XML file called customers_mmb.xml in the working directory:
In our example, we will convert the Customers Report from a RDF file to an XML file. To do this, we follow the steps given here:
After this we use Shift+Ctrl+S (or in the File | Save As menu) to save the Report. We choose that we want to save the report as a Reports XML (*.xml) file and we click on the Save button as shown in the following screenshot:
To convert PL/SQL Libraries to an XML format, it's easiest to use the convert command that comes with the Report Builder. With this command called rwconverter, we define the source type, call the source, and define the destination type and the destination. In this way, we have control over the way we need to convert the original .pll file to a .pld flat file that we can upload into the APEX Forms converter. It is possible to convert the PL/SQL Libraries with the convert option in Forms Builder, but, personally, I think this option works better. The rwconverter command has a few parameters we give with it to execute. They are given as follows:
In our example, we use the wizard.pll file that's in our summit files directory. This PL/SQL Library that contains .pll files is normally used to create a PL/SQL Library in the Oracle Database. But this time, we will use it to create a .pld flat file that we will upload to APEX.
First, we change the directory to work directory which has the original .pll file. In our case, the summit directory directly under the C drive, shown as follows:
C:>cd C:summit
After this, we call rwconverter in the command prompt as shown here:
C:summit> rwconverter stype=pllfile source=wizard.pll dtype=pldfile dest=wizard.pld
When you press the Enter key, a screen will open that is used to do the conversion. We will see that the types and names of the files are the same as we entered them in the command line. We need to click on the OK button to convert the file from .pll to .pld.
The conversion may take a few seconds, but when the file has been converted we will see a confirmation that the conversion was successful. After this, we can look in the C:summit directory and we will see that a file wizard.pld is created.