Oracle

Description

Oracle Forms 10J

Reviews
Oracle Forms 10J – Dynamic Color Customization $Q 2UDFOH )RUPV &RPPXQLW\ :KLWH 3DSHU )UDQoRLV 'HJUHOOH -XQH  Oracle Forms 10J – Dynamic Color Customization Introduction........................................................................................................3 Color definition table ........................................................................................3 Colors.pll.............................................................................................................4 Color selection screens .....................................................................................5 PL/ SQL-based dialog...................................................................................6 Java Bean-based dialog.................................................................................7 Changing Forms menu colors..........................................................................8 Forms test module.............................................................................................8 Setup Instructions .........................................................................................9 Summary .............................................................................................................9 8 ¨7 6¥£65 ' 3£ (  31 ) ¡ ¦ ) ( £'% # "   ¡ © ¦¤ ¡  ( !4  ¥¥2 0¤ §§§&$! §¨ §¥£ ¢  Oracle Forms 10J – Dynamic Color Customization ,1752'8&7,21 The solution introduced in this paper allows Oracle Forms application users to customize the colors used in a form. A color selection screen is available for the following Forms items: x Canvas color Tab canvas color Prompts (and tooltips) color Background buttons color Text buttons color Background current record color Text current record color x x x x x x Individual user preferences are stored in a database table which holds a table row for each user. The application user is identified by a unique value of type NUMBER. This value is read when loading the first screen and thereafter is sent as a parameter in each subsequent call to a screen (CALL_FORM, OPEN_FORM, NEW_FORM). The customized color defined for each item is applied during Forms startup by calling a PLSQL function in the WHEN-NEW-FORM-INSTANCE trigger The PLSQL function is located in a Forms library, FRORUVSOO, and loops through all visible items, setting the colors through visual attributes. Though this paper focuses on Oracle Forms 10g, the provided PL/ SQL code examples also work with earlier releases of Forms. All source examples are available at otn.oracle.com/ products/ forms. &2/25 '(),1,7,21 7$%/( The table that holds the customized colors for a user must contain at least one row, with COD_UTIL = 0, which contains the default values (RGB format) for users who don’t use a customized color scheme. 9 ¨7 6¥£65 ' 3£ (  31 ) ¡ ¦ ) ( £'% # "   ¡ © ¦¤ ¡  ( !4  ¥¥2 0¤ §§§&$! §¨ §¥£ ¢  CREATE TABLE ( COD_UTIL C_FOND C_LIBELLE C_CADRE C_BOUTON C_TBOUTON C_CURREC C_TCURREC ) ; UTIL_PREFS NUMBER(5) PRIMARY KEY, VARCHAR2(20 BYTE), VARCHAR2(20 BYTE), VARCHAR2(20 BYTE), VARCHAR2(20 BYTE), VARCHAR2(20 BYTE), VARCHAR2(20 BYTE), VARCHAR2(20 BYTE) ----------User code color of canvas color of prompts color of tab canvas color of background buttons color of text buttons color of background current record color of text current record INSERT INTO UTIL_PREFS ( COD_UTIL, C_FOND, C_LIBELLE, C_CADRE, C_BOUTON, C_TBOUTON, C_CURREC,C_TCURREC) VALUES ( 0, ’r128g128b192’, ’r255g255b64’, ’r64g128b255’, ’r255g192b255’, ’r64g64b192’, ’r128g255b255’, ’r128g128b255’); A Forms color selection dialog is provided in the sample code of this solution and handles the user specific table inserts and updates. &2/2563// The colors.pll library contains the PL/ SQL code to customize the color of visual objects in Forms at startup, at enter query (which color all queryable items with the color specified in the VA_QUERY visual attribute), and after execute query to recall previous colors. The colors.pll library needs to be attached to the Forms modules used in a Forms application. Copy the *53B&2/256 group from the object library FRORUVROE The *53B&2/256 group contains the following objects that need to be added to the Forms module: x A form level trigger WHEN-NEW-FORM-INSTANCE for the colorization function call A form level trigger KEY-ENTQRY for the colorization in ENTERQUERY mode A form level trigger KEY-EXEQRY to re-set the initial colors after execute query 3 alert boxes A parameter 87,B,' for handling the ID that uniquely identifies the user Visual attributes for colorization of objects x x x x x The color.pll library contains 2 PLSQL procedures and 1 PLSQL package: x 6WDUWBTXHU\ - procedure to color queryable items in ENTER-QUERY mode @ ¨7 A6¥£65 ' 3£ (  31 ) ¡ ¦ ) ( £'% # "   ¡ © ¦¤ ¡  ( !4  ¥¥2 0¤ §§§&$! §¨ §¥£ ¢  x (QGBTXHU\ - procedure to re-set the initial colors after EXECUTE- QUERY x 3.*B&2/256 SDFNDJH o o o o Global variables for the colors read from the UTIL_PREFS table Global variables to translate Strings used in the COLORS.FMB and COLORS_J.FMB screen Procedure “Paint”, which is the main procedure called during the Forms instance startup Procedure Set_colors Items that are not navigable are colored with a light gray background. All mandatory items are indicated by a bold prompt. You may want to customize the PLSQL package to use your preferred indicators. To preserve the initial colors of items, start the TOOLTIP_TEXT with the NCC (No Change Color) characters. These 3 characters are removed when the program is executed to insure a correct tooltip display &2/25 6(/(&7,21 6&5((16 Two Forms screens are provided with this whitepaper, as well as samples that allow the user to customize the application color for that instance: x PL/ SQL based dialog (COLORS.FMB) - This screen uses native Forms code to render the color selection dialog. Java Bean based dialog (COLORS_J.FMB) – This screen uses the Color Picker Java Bean sample from the Oracle Forms demos. Using the Java Bean does allows the user to choose from more colors than the PL/ SQL based screen, but requires the bean JAR files to be deployed with the application. x All screens can be accessed through a menu option or buttons. All that needs to be done is to pass the user code in the UTI_ID parameter. Never transmit the 0 code which is the pre-populated default code B ¨7 6¥£65 ' 3£ (  31 ) ¡ ¦ ) ( £'% # "   ¡ © ¦¤ ¡  ( !4  ¥¥2 0¤ §§§&$! §¨ §¥£ ¢  3/64/EDVHG GLDORJ )LJXUH  &RORUVIPE To customize the color of a visual component in Forms, click the corresponding button of the object to change the color of and click on one of the 64 color cells. Save the screen (Ctrl+ S) to store the new colors or just exit (F4) to cancel any modification C ¨7 6¥£65 ' 3£ (  31 ) ¡ ¦ ) ( £'% # "   ¡ © ¦¤ ¡  ( !4  ¥¥2 0¤ §§§&$! §¨ §¥£ ¢  -DYD %HDQEDVHG GLDORJ )LJXUH  &RORUVB-IPE UHTXLULQJ FRORUSLFNHUMDU To customize the color of a visual component in Forms, click the corresponding button of the object to change the color, then select the color from the Bean selection dialog. Save the screen (Ctrl+ S) to store the new colors or just exit (F4) to cancel any modification. In order to run the screen with the Java Bean component, you need to download the colorpicker.jar file, which is a part of the Oracle Forms 10g demos available on the Oracle Technology Network (OTN)1 x To configure the Bean, copy the file colorpicker.jar into the < ORACLE_HOME> / forms90/ java directory Edit the Forms formsweb.cfg configuration file located in < ORACLE_HOME> / forms90/ server/ and add the colorpicker.jar file to the JInitiator archive tag [myColorfulApp] form = myForm.fmx … DUFKLYHBMLQL IDOOBMLQLWMDUFRORUSLFNHUMDU x ... 1 http:/ / download.oracle.com/ otn/ other/ general/ forms10gdemos9_0_4_2.zip D ¨7 6¥£65 ' 3£ (  31 ) ¡ ¦ ) ( £'% # "   ¡ © ¦¤ ¡  ( !4  ¥¥2 0¤ §§§&$! §¨ §¥£ ¢  &+$1*,1* )2506 0(18 &2/256 The Forms menu module (MENU_COLORS.MMB), which is part of the associated example code, either calls the PLSQL based color selection screen, or the Java Beans-based screen. )2506 7(67 02'8/( The code sources for the solution introduced in this paper also contain a Forms test module for you to try. )LJXUH  7HVW )RUPV The Test Forms module demonstrates the following functionality: x Mandatory items have a bold prompt Display items have a grey background Items for which you don’t want to alter the color remain as defined by the design value (because the first three characters of the tooltip text are NCC) x x E ¨7 6¥£65 ' 3£ (  31 ) ¡ ¦ ) ( £'% # "   ¡ © ¦¤ ¡  ( !4  ¥¥2 0¤ §§§&$! §¨ §¥£ ¢  6HWXS ,QVWUXFWLRQV 1. Install the Forms sources, into a directory which is contained in the FORMS90_PATH path 2. To use the JavaBean color screen: Copy the file colorpicker.jar into your < ORACLE_HOME> / forms90/ java server directory Edit the formsweb.cfg configuration file in the < ORACLE_HOME> / forms90/ server/ directory and add archive_jini= f90all_jinit.jar,colorpicker.jar to the application configuration that uses this solution. 3. Create the UTIL_PREFS table in your own scheme and insert the default row 4. Launch the Forms Builder, log into the scheme in which the UTIL_PREFS table was created, and open the source files 5. Compile and generate executables for all sources files (colors.pll, colors.fmb, colors_j.fmb, test_colors.fmb, menu_colors.mmb) To use this solution in your own Forms modules: x Open your Form (use the template form) Attach the colors.pll library Open the colors.olb object library Drag the grp_colors group in the object group of your form Compile all and generate x x x x 6800$5< The solution described in this whitepaper allows Forms application users to apply a customized color scheme to their applications. The PL/ SQL and Forms source codes shipped with the paper are free to be used in your own Forms applications. F ¨7 6¥£65 ' 3£ (  31 ) ¡ ¦ ) ( £'% # "   ¡ © ¦¤ ¡  ( !4  ¥¥2 0¤ §§§&$! §¨ §¥£ ¢  $ERXW )RUPV &RPPXQLW\ :KLWHSDSHUV Oracle Forms Community White Papers is a new section on OTN and provides a forum for Oracle experts to share their product expertise with others by writing technical articles about Oracle Forms. $ERXW WKH DXWKRU François Degrelle works as a consultant for a French SSII company and is an Oracle specialist (PL/ SQL, Developer, Designer) who likes to share his Forms expertise, writing technical papers about Oracle DB, PLSQL and Forms. Francois is a native French speaker, as you may be able to tell from some of the variable names used in the source code of this solution. For questions regarding the sample code, please contact Francois at f.degrelle@free.fr.  ¨7 6¥£65 ' 3£ (  31 ) ¡ ¦ ) ( £'% # "   ¡ © ¦¤ ¡  ( !4  ¥¥2 0¤ §§§&$! §¨ §¥£ ¢  YR ¡§§§¨¥ (‚ !¤¥RHR!¨ ¡&¡ §§S 3§Pd §P§¨6`¥£ ¡ ARP!P!P§§&§§S I!R!¨ ! (¦(£ X £ ¨' p 3 ¨  (¨ X ¡£  3 ¨c %£ ¨ £' ¡¨ 3  Y 3 X  3 (&¡ §§§P ( 3!£ ¡RH 0¨ §¤¥£ ¡¢ &§Ad §P§6¥£ ¡ 3¥¨ §¨ ¥ ¥¨ PP P¨ §¤¥£ ¢  ‡`'£ '  ¡ ) ¦ X ¡£ ¨` ` ¡ 3 ( 7 ¡ £ ( ¦ ¡ Y' ( ( ¡¨H ' ¡ ¡ ¡ ¡1  31 R R¥  §R§¨ 3 (3 pR ( 6H&R¥§S 3 (¥§RRH R6HP¥'§ X pW¨ ¡1 % £¡ W ¦§£¥¤ R§§§¤¥P&¤ R' ¡ 3!¥¨ §¨¥§¥§£¥PP%¥§§c&†  X¢¥'§P' $¥¨ 3 3 (R¥§£ ¡ 3 ('£S ¨ ¡ ( ¤ ¦ W ' ¨  '£ % ¡  ¡ % £ ( ` ' ¡`¥¨¥§`6 6H§¨ PRc&R§P%!P&3¥§PR§¤66P RS ƒ Y ¥§PR§66P RS 3A§c  ¤1 ¡ ¡ ¨ 3' £ '¨ 1 ` ( 3'¨ 1¤` ( % 3 (` ¡ 3 ( ¡¨ ( ¨ ¦% !¤¥¨ ¡ §' (& ¦% !¤¥¨ ¡ `§§S 3 §¨`¥P ¡ X¢¨ §P¥ ( !6 (7 6!§§1 !¥£ ¡ ¥'¥¤ ¡£ ' 3£ ¦c ¦£ 3¤ 3  ' `' '¨ 1¤ ` 3 3 ¨H ¡ ( §$§§£3¥§PR§66P (RS  63!¤¥RR!¨ S 3 p¢% ¦(3 6§ (£ P¥§† §£ §§ ` (c ¦ %'£ ( ¦¤ ( ¦% ¦§£¥ (¤ X §¤¥RHRA¨ g §§RRH R6H&§£ R§ (¤ 3 §RP£ A¥!§' (3 R% ¦(3 6§£ ¥§£§§¤ §P ( ¨  Y¨ ¡1 ¡ ¦1 ¡£H ¡ X ¨ X¡ (c 3' S ¡¨ X§P¥' ( 3 `§¥§§P! (¨ 3¥§£ ¡ §AP`¥ (¨ ¦6 $§' §1 §§' §WA£ ¦' $¥ (¨ 6 & ( ' ¤ `'£ ' ¡£ p H ( 7 ( ` ¦¤ ( p ( ` ¦H ( ¡ ¦  ¨ ¦% §£ ¡`¥§¥!¨ ¡6Rx!§§S 3!§§¥' ( 3 §'¥P! (¨ ¥§£ ¡ ¡§AR¡§§S R¥§£ H ¨¡¨ ¨S pW (` ¤ ¡  3' £ p ¨ 3 %'  63!¤¥¨ „RR6§§W¥¨¥¨ ¡ …X ¡ ¡ §Rc$ `¥¨ 3¥§£ ¡ §ARR§' &¥§PR§66P RS ƒ 3 c1 ¡' ¡¨ ¨ 3 ' ¡£ p3 ( 3'¨ 1¤` ( Y§¨¥ (¤ 3R§'&3¥§S 3 ¢67§§§§ 63!¤¥¨ „RRA¨ §&§¥¨ §¨§ ¥§¨ ¥¥¤§S §§£  1 ( p ¨ '£S¤ 3 c1 ¡£ X ¡ S 3' 3'  ¨ 3 `' % ¦RP!§RRH R16 ( 3!P ¡ X!' (& P¥6` §R 6H &¥§PR§66P RS ƒ ' ¨ ¡ H ' £ ¡ X `¨ (‚ ¡ ( 3'¨ 1¤` ( Y ¡¨ ¡ S `¥¨¥‚ §§!¨  3¥ (7 ¡¥¦ ¦Iq§¨ §¥£ ¡¢¥W§!¥¥R¥ (7 §§H0) GY ¦¤   @8 €3S ¡%    Y ¦¤ ¡ ¥¤ §¨ §¥£  Ypyyp p 8 YC B YwTx£ ¥¥¥D §¥¥B Y§¥¥C !6¥!§© ¥¥¥D §¥¥B §¥¥C !6¥6¨§§5  YC YB YwT 'S T  (1 i v ¨ p ¡ ! (¨ ¡ R§' P6` (§ ¦`  g YIG V Ys u Y B¥C¥§@!FtV¥§!¨ §V66A§¥¨ r G )W ¡ S s ` p` %£ p ¡£5 ¦¤ ¡    !Aqd §6¨ §¥£ ¢¥¥B  §¨ 3 §§6¥¥Vb ¦`  g ¡ ¡£1 i`£¨ h ¡ ' 3 ¡  ¡ ) ¦ ¡  ( !£ RH 0¨ §¤¥£ ¢  ¨ §¤¥£ ¢ ¥§¥1 RS6 fPR§£ RR §S ¥IP§ (' ¥6 (c ¡ 3¥'0) ¦ ¡ W ( H ( e d' ¡©T ¡  31 G 7 31  ¡ X §¨¥¨ ¡ ba¥ ¦¨ ¦§¨ ¡¥¨6 Y` X¥ ¦¨ §¨ ¥V# ¥§§£ RRT §S ¥1IG Y X 7 W ¦ ¡ 7¨ ( U' ¡© ¡  3 !¥¥8§R1 Q @ ¨' ' ( 3!4  3¥¥2) ¦0P ( !£¥ (¤ 6H6IG¢¤ §§§&$! §¨ §¤¥£ ¢  £ ( 1 ¡  ) ' 3 ¦ H ( £'% # "  ¡ © ¦ ¡

Related docs
ORACLE
Views: 299  |  Downloads: 34
Oracle
Views: 828  |  Downloads: 99
Basic Oracle Architecture
Views: 1797  |  Downloads: 318
oracle
Views: 22  |  Downloads: 2
Oracle
Views: 263  |  Downloads: 23
Oracle
Views: 241  |  Downloads: 36
Oracle
Views: 299  |  Downloads: 33
oracle at delphi
Views: 222  |  Downloads: 23
oracle bacon
Views: 185  |  Downloads: 7
Oracle/SQL Tutorial
Views: 283  |  Downloads: 48
time navigator for oracle
Views: 0  |  Downloads: 0
oracle university
Views: 461  |  Downloads: 35
oracle bones
Views: 70  |  Downloads: 0
oracle
Views: 23  |  Downloads: 2
oracle data sheet
Views: 1  |  Downloads: 0
premium docs
Other docs by N thushara San...
Easy to Follow and Quick Healthy Recipes
Views: 21  |  Downloads: 0
Latest car price report
Views: 33  |  Downloads: 0
Human rights guidance
Views: 34  |  Downloads: 0
B U S I N E S S P L A N
Views: 36  |  Downloads: 5
New Employee Handbook
Views: 43  |  Downloads: 5
Latest News
Views: 28  |  Downloads: 0
Christmas Packages 2009
Views: 39  |  Downloads: 3
Death in Camp Delta
Views: 33  |  Downloads: 0
The Christmas Song
Views: 40  |  Downloads: 2
FOREIGN LANGUAGE
Views: 40  |  Downloads: 0
Successful Promotions
Views: 34  |  Downloads: 2
Digital Music Distribution
Views: 54  |  Downloads: 6