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.
Get your stuff!
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 to make sure that there’s no more development on the components we are about to use in our Conversion project. This is because we are now going to freeze our sources and new developments won’t be taken into the Conversion project at all. So there will be no changes in our project.
- Put all the source files in a safe place. In other words, copy the latest version of your files into a new directory to which only you, and perhaps your teammates, have access.
- If the development team of your organization is using Oracle Designer for the development of its applications, it would be a good idea to generate all the modules from scratch. You would like to use the source on which the runtime files were created only if there are post-generation adjustments to be made in the modules.
We need the following files for our Conversion project:
- Forms Modules: With the FMB extension
- Object Libraries: With the OLB extension
- Forms Menus: With the MMB extension
- PL/SQL Libraries: With the PLL extension
- Report Files: With the RDF, REX, or JSP extensions
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.
Creating XML files
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.
The Forms2XML conversion 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 first type frmf2xml.
- Alternatively, we give one of the options with it.
- We tell the command which file we want to convert, and we have the option to address more than one file for the conversion to XML.
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:
- formname.fmb will become formname_fmb.xml
- libraryname.olb will become libraryname_olb.xml
- menuname.mmb will become menuname_mmb.xml
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:
- We will change the working directory to the directory that has the FMB file. In my example, I have stored all the files in a directory called summit directly under the C drive, like this:
- Now, we can call the frmf2xml command to convert one of our Forms Modules to an XML file. In this example, we convert the orders.fmb module:
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:
- We first change the working directory to the directory that the OLB file is in. It’s done like this:
- Now we can call the frmf2xml command to convert one of our Object Libraries to an XML file. In this example, we convert the Form_Builder_II.olb library as follows:
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:
- We change the working directory to the directory that the .MMB file is in, like this:
- Now we can call the frmf2xml command to convert one of our Forms Menus to an XML file. In this example we convert the customers.mmb menu:
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:
- We need to open the Employees.rdf file with Reports Builder.
- Open Reports Builder from your Start menu. If Reports Builder is opened, we need to cancel the wizard that asks us if we want to create a new report.
- After this we use Ctrl+O to open the Report File (or in the menu, File | Open) which we want to convert to XML as we see in the following screenshot:
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:
- stype: This is the type of source file we need to convert. In our situation, this will be a .pll file and so the value we need to set is pllfile.
- source: This is the name of the source file, including the extension. In our case, it is wizard.pll.
- dtype: This is the file type we want to convert our source file to. In our case, it is a .pld file and so the value becomes pldfile.
- dest: This is the name, including the extension, of the destination file. In our case, it is wizard.pld.
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:
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.