Link to home
Start Free TrialLog in
Avatar of Moin
Moin

asked on

Reading form storage format?

Hi,
I am very new in oracle, this is my first day in dealing oracle.
I want to read the script that oracle generates to store the forms that are developed in Developer 2000. I mean as in VB the frm file contains all the information about controls, buttons etc.
And in VC the recource file contains this info.
How can I access it?
Thanx in advance
Waiting for reply...
Avatar of crsankar
crsankar
Flag of United States of America image

Here are the steps:

Start forms designer.

Choose FILE->ADMINISTRATION->CONVERT
from the menu

specify the type as form (default)
choose the file that you want to convert
this would be the .fmb file

eg.D:\orant\FORMS45\emp.fmb

specify direction as binary to text

click on convert

This will generate a file with .fmt extension which is a simple text file

eg.D:\orant\FORMS45\emp.fmt

your original .fmb file will be left untouched.

you can use notepad or any toher text editor to open you .fmt file


Avatar of Moin
Moin

ASKER

Please emphasize on my sentence "I want to read the script that oracle generates to store the forms "
This means that from the .fmt file how can I understand that this block of code doing what. In other words I want to understand the language of .fmt file
The .fmt file that oracle creates would be in normal ascii text. You can open it as any other text file and read it. Are you talking about the PL/SQL code?
Please try creating a .fmt file the way I have suggested, go through it and let me know.
Avatar of Moin

ASKER

As I stated in my question that this is my first day with Oracle. So I know this much that PL/SQL handles database and the .fmt file contains the information about controls placed on forms. So I need to understand this control related inofrmation. Just for example, I am pasting the following code here:
============CODE STARTS=========
DEFINE  F50T
BEGIN
   TP = 4
   TI = 2
   TN = 738
   TV = <<"US">>
END

DEFINE  FRM50_IDFO
BEGIN
   IDFOS_POI = 4
   IDFOS_OID = 5
   IDFOS_NAM = <<"">>
   IDFOS_TYP = 108
   IDFOS_OOI = 4
   IDFOS_OPN = 746
   IDFOS_CNT = 3
END

DEFINE  F50T
BEGIN
   TP = 5
   TI = 1
   TN = 745
   TV = <<"PUSH_BUTTON6">>
END

DEFINE  F50T
BEGIN
   TP = 5
   TI = 2
   TN = 745
   TV = <<"RADIO_BUTTON5">>
END

DEFINE  F50T
BEGIN
   TP = 5
   TI = 3
   TN = 745
   TV = <<"MODULE3">>
END

DEFINE  F50O
BEGIN
   OP = 4
   OI = 3
   ON = 746
   OO = 5
END

DEFINE  F50O
BEGIN
   OP = 3
   OI = 1
   ON = 741
   OO = 4
END



============ CODE ENDS ================

Please help...
Avatar of Moin

ASKER

As I stated in my question that this is my first day with Oracle. So I know this much that PL/SQL handles database and the .fmt file contains the information about controls placed on forms. So I need to understand this control related inofrmation. Just for example, I am pasting the following code here:
============CODE STARTS=========
DEFINE  F50T
BEGIN
   TP = 4
   TI = 2
   TN = 738
   TV = <<"US">>
END

DEFINE  FRM50_IDFO
BEGIN
   IDFOS_POI = 4
   IDFOS_OID = 5
   IDFOS_NAM = <<"">>
   IDFOS_TYP = 108
   IDFOS_OOI = 4
   IDFOS_OPN = 746
   IDFOS_CNT = 3
END

DEFINE  F50T
BEGIN
   TP = 5
   TI = 1
   TN = 745
   TV = <<"PUSH_BUTTON6">>
END

DEFINE  F50T
BEGIN
   TP = 5
   TI = 2
   TN = 745
   TV = <<"RADIO_BUTTON5">>
END

DEFINE  F50T
BEGIN
   TP = 5
   TI = 3
   TN = 745
   TV = <<"MODULE3">>
END

DEFINE  F50O
BEGIN
   OP = 4
   OI = 3
   ON = 746
   OO = 5
END

DEFINE  F50O
BEGIN
   OP = 3
   OI = 1
   ON = 741
   OO = 4
END



============ CODE ENDS ================

Please help...
In my view, there is no need for you to go and edit these text files. You should be setting the properties through your forms designer by setting properties of items. Anyways, I will withdraw my answer, since you may be looking forward for suggetions from others. If you want help on any of these properties and how it affects the behaviour and appearance of an item you can always use forms online help for your aid.

Rgds,
crs
Avatar of Moin

ASKER

As I stated in my question that this is my first day with Oracle. So I know this much that PL/SQL handles database and the .fmt file contains the information about controls placed on forms. So I need to understand this control related inofrmation. Just for example, I am pasting the following code here:
============CODE STARTS=========
DEFINE  F50T
BEGIN
   TP = 4
   TI = 2
   TN = 738
   TV = <<"US">>
END

DEFINE  FRM50_IDFO
BEGIN
   IDFOS_POI = 4
   IDFOS_OID = 5
   IDFOS_NAM = <<"">>
   IDFOS_TYP = 108
   IDFOS_OOI = 4
   IDFOS_OPN = 746
   IDFOS_CNT = 3
END

DEFINE  F50T
BEGIN
   TP = 5
   TI = 1
   TN = 745
   TV = <<"PUSH_BUTTON6">>
END

DEFINE  F50T
BEGIN
   TP = 5
   TI = 2
   TN = 745
   TV = <<"RADIO_BUTTON5">>
END

DEFINE  F50T
BEGIN
   TP = 5
   TI = 3
   TN = 745
   TV = <<"MODULE3">>
END

DEFINE  F50O
BEGIN
   OP = 4
   OI = 3
   ON = 746
   OO = 5
END

DEFINE  F50O
BEGIN
   OP = 3
   OI = 1
   ON = 741
   OO = 4
END



============ CODE ENDS ================

Please help...
Well Moin as Ram pointed out, you have to read the .fmt file to find out the information.

You have to use a built-in package UTL_FILE to read it. To find out what a particular trigger is doing say, when-button-pressed you have read line by line and then get to the excat location from the file and read from there. I don't know in what way it might help, but a i'm curious to know why do you have to read it.

In case you want another developer form to read from it, then you have to use anohter packaged in developer ie, TEXT_IO to read it.

Regards,
Sudhi.
Avatar of Moin

ASKER

But I need to understand this file format because I need to convert Developer/2000 forms to Java.
Can I do this without understanding this file format.
In case you have to read it from the pl/sql then either use the UTL_FILE at the database side or use TEXT_IO at the font end side.

But as u want to understand this file format, best way to start is, create a simple form then read open the .fmt file in notepad or any text editor, you should be able to follow that.

Regards,
Sudhi.
Avatar of Moin

ASKER

But i have read it and couldn't follow it because it is too complex.
Avatar of Mark Geerlings
I started working with Oracle Forms on version 2.3.  In those days the *.inp files were plain ASCII text.  They have since been replaced by the *.fmb and *.fmt files, but Oracle has changed the format of the text files significantly.

They used to be easy to read and understand.  In fact, I did much of my Forms programming then by working directly in the *.inp file with a text editor.  These days, that approach is strongly discouraged by Oracle and as you noticed the format of the text files is very difficult to understand.  I don't use that technique anymore, and don't expect that anyone else does either.

As crsankar pointed out in your other question, you don't need to manually convert the Forms code to Java to deploy an Oracle Forms application in a web-deployed situation.  If you have Forms6, this should be relatively easy.

I was involved in two web-deployed projects with Forms5, and there were some difficulties and a few Forms features that didn't work.  Forms6 is supposed to be much better for web-deployment, but I haven't tried.  We are using it in a client-server configuration only at present.
Avatar of Moin

ASKER

But this will not serve my purpose as I have to manually convert the code to JAVA code
perhaps the best way to convert oracle developer forms to java is to have the form canvesses printed out and use a java gui tool such jdeveloper to draw the screen.
Just curious, why is a web-deployed Oracle Forms system not an option for you?  I am not convinced either that Oracle's Web-deployed Forms are the best way to go in all cases, but I would like to know your reasons if you could share them.
The last version of forms I was involved with was 4.5 .

If you want to generate a "source" file of a form, then you can create an FMT, as discussed already. However, these files tend to be very large, and very hard to read and follow.

There is another option (at least there was in 4.5) to generate a documentation file which is much more readable (but can not be converted back to an FMB).

Regarding "understanding the FMT file": I guess almost anyone involved with developer trys cracking the mysteries of the FMT file at some point or another. However, when actually try to do this you find all sorts of binary encoded sections etc.

Anyway, I think that you have probably set a new guiness record, trying to crack FMT files on your first day of dealing with Oracle  :)
Moin,

It looks as though you are trying to reverse engineer the Forms programs into Java.

IMHO If you can't migrate the application using Oracle techniques into Web/Java, then Give up!

Get the specs and re-design and re-write as they need to be now. Business rules are bound to have changed anyway.

So - start again. It will be the best solution if not the cheapest.

Ken
ASKER CERTIFIED SOLUTION
Avatar of oavidov
oavidov

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial