Overblog Suivre ce blog
Editer l'article Administration Créer mon blog

Search

Free tool

Look and Feel Project

6 janvier 2007 6 06 /01 /janvier /2007 15:16
I Often see threads on forums about how to apply massive changes to a large number of forms.

One solution is to use the JDAPI tool provided by Oracle (download the JDAPI Documentation). It is a Java tool that allows to open the .FMB files, add/modify/remove anything you want, then save the new .FMB file.
It is a very great tool. Unfortunately for somebody, it requires to know the Java language.


Another solution, when you start developing a real application that must contains more than a few forms, is to think about the evolution phase.
Of course, you will think about reusable elements through object libraries, property classes and visual attributes.
But when you firstly think about the code, the first idea that comes to your mind is to build a pl/sql library that would store the code that can be applied to more than one module.
Because a change in this library will be executed in every form that uses it, it is a good place to store your reusable code.

If you think that you have big chances to execute generic code at start and end of execution, you’d probably need to use the PRE-FORM, WHEN-NEW-FORM-INSTANCE and POST-FORM form-level triggers in each module.

So, let’s add procedures in the new pl/sql Forms library to handle these events:

/*
* execute the generic Pre-Form trigger code
*/
Procedure My_App_Lib_Pre_Form
Is
Begin
   Null ;
End;

/*
* execute the generic Post-Form trigger code
*/
Procedure My_App_Lib_Post_Form
Is
Begin
   Null ;
End;

/*
* execute the generic When-New-Form-Instance trigger code
*/
Procedure My_App_Lib_When_New_Form_Instance
Is
Begin
   Null ;
End;

Then add the corresponding calls in your modules (a very good way is to use a template form):

Pre-Form trigger ->  My_App_Lib_Pre_Form ;
Post-Form trigger ->  My_App_Lib_Post_Form ;
When-New-Form-Instance trigger ->  My_App_Lib_When_New_Form_Instance ;

At this point, these procedures do exactly nothing !
Actually, they are just ready to handle the future extensions.
This sample is very basic, but you could imagine a more elaborated system where more triggers could be handled here.

Partager cet article

Repost 0
Francois Degrelle - dans Oracle Forms
commenter cet article

commentaires