SlideShare a Scribd company logo
Oracle Forms 10J – Dynamic
Color Customization
$Q 2UDFOH )RUPV &RPPXQLW :KLWH 3DSHU
)UDQoRLV 'HJUHOOH
-XQH
 ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨8
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
 ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨9
Oracle Forms 10J – Dynamic Color Customization
,1752'87,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
x Tab canvas color
x Prompts (and tooltips) color
x Background buttons color
x Text buttons color
x Background current record color
x Text current record color
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.
 ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨A@
CREATE TABLE UTIL_PREFS
(
COD_UTIL NUMBER(5) PRIMARY KEY, -- User code
C_FOND VARCHAR2(20 BYTE), -- color of canvas
C_LIBELLE VARCHAR2(20 BYTE), -- color of prompts
C_CADRE VARCHAR2(20 BYTE), -- color of tab canvas
C_BOUTON VARCHAR2(20 BYTE), -- color of background buttons
C_TBOUTON VARCHAR2(20 BYTE), -- color of text buttons
C_CURREC VARCHAR2(20 BYTE), -- color of background current
-- record
C_TCURREC VARCHAR2(20 BYTE) -- 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 *53B2/256 group from the object library FRORUVROE
The *53B2/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
x A form level trigger KEY-ENTQRY for the colorization in ENTER-
QUERY mode
x A form level trigger KEY-EXEQRY to re-set the initial colors after
execute query
x 3 alert boxes
x A parameter 87,B,' for handling the ID that uniquely identifies the user
x Visual attributes for colorization of objects
The color.pll library contains 2 PLSQL procedures and 1 PLSQL package:
x 6WDUWBTXHU
- procedure to color queryable items in ENTER-QUERY
mode
 ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨B
x (QGBTXHU
- procedure to re-set the initial colors after EXECUTE-
QUERY
x 3.*B2/256 SDFNDJH
o Global variables for the colors read from the UTIL_PREFS table
o Global variables to translate Strings used in the COLORS.FMB
and COLORS_J.FMB screen
o Procedure “Paint”, which is the main procedure called during the
Forms instance startup
o 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 65((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.
x 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.
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
 ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨C
3/64/EDVHG GLDORJ
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
)LJXUH  RORUVIPE
 ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨D
-DYD %HDQEDVHG GLDORJ
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
x 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
...
1 http:/ / download.oracle.com/ otn/ other/ general/ forms10gdemos9_0_4_2.zip
)LJXUH  RORUVB-IPE UHTXLULQJ FRORUSLFNHUMDU
 ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨E
+$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.
The Test Forms module demonstrates the following functionality:
x Mandatory items have a bold prompt
x Display items have a grey background
x 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)
)LJXUH  7HVW )RUPV
 ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨F
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)
x Attach the colors.pll library
x Open the colors.olb object library
x Drag the grp_colors group in the object group of your form
x Compile all and generate
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.

More Related Content

What's hot (20)

dbms lab manual
dbms lab manualdbms lab manual
dbms lab manual
stalinjothi
 
Les10 Creating And Managing Tables
Les10 Creating And Managing TablesLes10 Creating And Managing Tables
Les10 Creating And Managing Tables
NETsolutions Asia: NSA – Thailand, Sripatum University: SPU
 
Lab
LabLab
Lab
neelam_rawat
 
Sql fundamentals group by part2
Sql fundamentals   group by part2Sql fundamentals   group by part2
Sql fundamentals group by part2
varunbhatt23
 
Sql
SqlSql
Sql
jyothislides
 
Boost performance with MySQL 5.1 partitions
Boost performance with MySQL 5.1 partitionsBoost performance with MySQL 5.1 partitions
Boost performance with MySQL 5.1 partitions
Giuseppe Maxia
 
Les11
Les11Les11
Les11
arnold 7490
 
Database Design Project-Oracle 11g
Database Design  Project-Oracle 11g Database Design  Project-Oracle 11g
Database Design Project-Oracle 11g
Sunny U Okoro
 
Les09
Les09Les09
Les09
arnold 7490
 
Avinash database
Avinash databaseAvinash database
Avinash database
avibmas
 
SQL Quick Reference Card
SQL Quick Reference CardSQL Quick Reference Card
SQL Quick Reference Card
Techcanvass
 
Sql practise for beginners
Sql practise for beginnersSql practise for beginners
Sql practise for beginners
ISsoft
 
Introduction to sql new
Introduction to sql newIntroduction to sql new
Introduction to sql new
SANTOSH RATH
 
SQL & PLSQL
SQL & PLSQLSQL & PLSQL
SQL & PLSQL
Prakash Poudel
 
Les10
Les10Les10
Les10
arnold 7490
 
Sql
SqlSql
Sql
Priyank Tewari
 
My Sql concepts
My Sql conceptsMy Sql concepts
My Sql concepts
Pragya Rastogi
 
MY SQL
MY SQLMY SQL
MY SQL
sundar
 
SQL Transactions - What they are good for and how they work
SQL Transactions - What they are good for and how they workSQL Transactions - What they are good for and how they work
SQL Transactions - What they are good for and how they work
Markus Winand
 
Best sql plsql material
Best sql plsql materialBest sql plsql material
Best sql plsql material
pitchaiah yechuri
 

Similar to Oracle forms 10 j – dynamic color customization 2udfoh community paper-colors-134273 (20)

Start your app the better way with Styled System
Start your app the better way with Styled SystemStart your app the better way with Styled System
Start your app the better way with Styled System
Hsin-Hao Tang
 
UI Realigning & Refactoring by Jina Bolton
UI Realigning & Refactoring by Jina BoltonUI Realigning & Refactoring by Jina Bolton
UI Realigning & Refactoring by Jina Bolton
Codemotion
 
I really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdfI really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdf
pasqualealvarez467
 
Developing for Plone using ArchGenXML / ArgoUML
Developing for Plone using ArchGenXML / ArgoUMLDeveloping for Plone using ArchGenXML / ArgoUML
Developing for Plone using ArchGenXML / ArgoUML
Jazkarta, Inc.
 
Color Palettes in R
Color Palettes in RColor Palettes in R
Color Palettes in R
Michel Alves
 
shiny_v1.pptx
shiny_v1.pptxshiny_v1.pptx
shiny_v1.pptx
DavidFranco899488
 
Surpac geological modelling 3
Surpac geological modelling 3Surpac geological modelling 3
Surpac geological modelling 3
Adi Handarbeni
 
Week 2 iLab TCO 2 — Given a simple problem, design a solutio.docx
Week 2 iLab TCO 2 — Given a simple problem, design a solutio.docxWeek 2 iLab TCO 2 — Given a simple problem, design a solutio.docx
Week 2 iLab TCO 2 — Given a simple problem, design a solutio.docx
melbruce90096
 
4 coding101 fewd_lesson4_j_query_and_buttons 20210105
4 coding101 fewd_lesson4_j_query_and_buttons 202101054 coding101 fewd_lesson4_j_query_and_buttons 20210105
4 coding101 fewd_lesson4_j_query_and_buttons 20210105
John Picasso
 
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Codemotion
 
Taller
TallerTaller
Taller
Mauricio Velez
 
Graphs made easy with SAS ODS Graphics Designer (PAPER)
Graphs made easy with SAS ODS Graphics Designer (PAPER)Graphs made easy with SAS ODS Graphics Designer (PAPER)
Graphs made easy with SAS ODS Graphics Designer (PAPER)
Kevin Lee
 
Dbms lab Manual
Dbms lab ManualDbms lab Manual
Dbms lab Manual
Vivek Kumar Sinha
 
Front-End Methodologies
Front-End MethodologiesFront-End Methodologies
Front-End Methodologies
Arash Manteghi
 
Assignment 2 lab 3 python gpa calculator
Assignment 2 lab 3  python gpa calculatorAssignment 2 lab 3  python gpa calculator
Assignment 2 lab 3 python gpa calculator
Nagiob Doma
 
CIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.comCIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.com
claric130
 
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Dhivyaa C.R
 
UNIT IV (4).pptx
UNIT IV (4).pptxUNIT IV (4).pptx
UNIT IV (4).pptx
DrDhivyaaCRAssistant
 
Introduction to java script Lecture 4.ppt
Introduction to java script Lecture 4.pptIntroduction to java script Lecture 4.ppt
Introduction to java script Lecture 4.ppt
dejen6
 
Describe and evaluate a company’s pricing and retail strategy. Inc.docx
Describe and evaluate a company’s pricing and retail strategy. Inc.docxDescribe and evaluate a company’s pricing and retail strategy. Inc.docx
Describe and evaluate a company’s pricing and retail strategy. Inc.docx
theodorelove43763
 
Start your app the better way with Styled System
Start your app the better way with Styled SystemStart your app the better way with Styled System
Start your app the better way with Styled System
Hsin-Hao Tang
 
UI Realigning & Refactoring by Jina Bolton
UI Realigning & Refactoring by Jina BoltonUI Realigning & Refactoring by Jina Bolton
UI Realigning & Refactoring by Jina Bolton
Codemotion
 
I really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdfI really need help with this Assignment Please in C programming not .pdf
I really need help with this Assignment Please in C programming not .pdf
pasqualealvarez467
 
Developing for Plone using ArchGenXML / ArgoUML
Developing for Plone using ArchGenXML / ArgoUMLDeveloping for Plone using ArchGenXML / ArgoUML
Developing for Plone using ArchGenXML / ArgoUML
Jazkarta, Inc.
 
Color Palettes in R
Color Palettes in RColor Palettes in R
Color Palettes in R
Michel Alves
 
Surpac geological modelling 3
Surpac geological modelling 3Surpac geological modelling 3
Surpac geological modelling 3
Adi Handarbeni
 
Week 2 iLab TCO 2 — Given a simple problem, design a solutio.docx
Week 2 iLab TCO 2 — Given a simple problem, design a solutio.docxWeek 2 iLab TCO 2 — Given a simple problem, design a solutio.docx
Week 2 iLab TCO 2 — Given a simple problem, design a solutio.docx
melbruce90096
 
4 coding101 fewd_lesson4_j_query_and_buttons 20210105
4 coding101 fewd_lesson4_j_query_and_buttons 202101054 coding101 fewd_lesson4_j_query_and_buttons 20210105
4 coding101 fewd_lesson4_j_query_and_buttons 20210105
John Picasso
 
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Building a theming system with React - Matteo Ronchi - Codemotion Amsterdam 2017
Codemotion
 
Graphs made easy with SAS ODS Graphics Designer (PAPER)
Graphs made easy with SAS ODS Graphics Designer (PAPER)Graphs made easy with SAS ODS Graphics Designer (PAPER)
Graphs made easy with SAS ODS Graphics Designer (PAPER)
Kevin Lee
 
Front-End Methodologies
Front-End MethodologiesFront-End Methodologies
Front-End Methodologies
Arash Manteghi
 
Assignment 2 lab 3 python gpa calculator
Assignment 2 lab 3  python gpa calculatorAssignment 2 lab 3  python gpa calculator
Assignment 2 lab 3 python gpa calculator
Nagiob Doma
 
CIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.comCIS 115 Become Exceptional--cis115.com
CIS 115 Become Exceptional--cis115.com
claric130
 
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Dhivyaa C.R
 
Introduction to java script Lecture 4.ppt
Introduction to java script Lecture 4.pptIntroduction to java script Lecture 4.ppt
Introduction to java script Lecture 4.ppt
dejen6
 
Describe and evaluate a company’s pricing and retail strategy. Inc.docx
Describe and evaluate a company’s pricing and retail strategy. Inc.docxDescribe and evaluate a company’s pricing and retail strategy. Inc.docx
Describe and evaluate a company’s pricing and retail strategy. Inc.docx
theodorelove43763
 

More from FITSFSd (18)

Personalize the forms how to oracle applications release 11.5.10 a technica...
Personalize the forms   how to oracle applications release 11.5.10 a technica...Personalize the forms   how to oracle applications release 11.5.10 a technica...
Personalize the forms how to oracle applications release 11.5.10 a technica...
FITSFSd
 
Data and database security and controls
Data and database security and controlsData and database security and controls
Data and database security and controls
FITSFSd
 
Oracle® application server
Oracle® application serverOracle® application server
Oracle® application server
FITSFSd
 
Oracle calendar-server-wp-1449649
Oracle calendar-server-wp-1449649Oracle calendar-server-wp-1449649
Oracle calendar-server-wp-1449649
FITSFSd
 
Top ten database_threats
Top ten database_threatsTop ten database_threats
Top ten database_threats
FITSFSd
 
Oracle® application server forms and reports services installation guide
Oracle® application server forms and reports services installation guideOracle® application server forms and reports services installation guide
Oracle® application server forms and reports services installation guide
FITSFSd
 
Otn 9ides-fut-130867
Otn 9ides-fut-130867Otn 9ides-fut-130867
Otn 9ides-fut-130867
FITSFSd
 
Oracle portal 10g release 2 technical overview an oracle white paper august 2005
Oracle portal 10g release 2 technical overview an oracle white paper august 2005Oracle portal 10g release 2 technical overview an oracle white paper august 2005
Oracle portal 10g release 2 technical overview an oracle white paper august 2005
FITSFSd
 
Oracle database 12c security and compliance
Oracle database 12c security and complianceOracle database 12c security and compliance
Oracle database 12c security and compliance
FITSFSd
 
Oracle advance security transparent data encryption best practices
Oracle advance security transparent data encryption best practices Oracle advance security transparent data encryption best practices
Oracle advance security transparent data encryption best practices
FITSFSd
 
Oracle intro to designer abridged
Oracle intro to designer abridgedOracle intro to designer abridged
Oracle intro to designer abridged
FITSFSd
 
Oracle forms 11g release 2 (11.1.2) new
Oracle forms 11g release 2 (11.1.2) newOracle forms 11g release 2 (11.1.2) new
Oracle forms 11g release 2 (11.1.2) new
FITSFSd
 
Oracle9i reports developer
Oracle9i reports developerOracle9i reports developer
Oracle9i reports developer
FITSFSd
 
Oracle designer 6i web pl sql
Oracle designer 6i web pl sqlOracle designer 6i web pl sql
Oracle designer 6i web pl sql
FITSFSd
 
Oracle database administration technical services
Oracle database administration technical services Oracle database administration technical services
Oracle database administration technical services
FITSFSd
 
Oracle9i application server
Oracle9i application serverOracle9i application server
Oracle9i application server
FITSFSd
 
Oracle9i application server release 2
Oracle9i application server release 2 Oracle9i application server release 2
Oracle9i application server release 2
FITSFSd
 
Oracle9i application server oracle forms services
Oracle9i application server   oracle forms servicesOracle9i application server   oracle forms services
Oracle9i application server oracle forms services
FITSFSd
 
Personalize the forms how to oracle applications release 11.5.10 a technica...
Personalize the forms   how to oracle applications release 11.5.10 a technica...Personalize the forms   how to oracle applications release 11.5.10 a technica...
Personalize the forms how to oracle applications release 11.5.10 a technica...
FITSFSd
 
Data and database security and controls
Data and database security and controlsData and database security and controls
Data and database security and controls
FITSFSd
 
Oracle® application server
Oracle® application serverOracle® application server
Oracle® application server
FITSFSd
 
Oracle calendar-server-wp-1449649
Oracle calendar-server-wp-1449649Oracle calendar-server-wp-1449649
Oracle calendar-server-wp-1449649
FITSFSd
 
Top ten database_threats
Top ten database_threatsTop ten database_threats
Top ten database_threats
FITSFSd
 
Oracle® application server forms and reports services installation guide
Oracle® application server forms and reports services installation guideOracle® application server forms and reports services installation guide
Oracle® application server forms and reports services installation guide
FITSFSd
 
Otn 9ides-fut-130867
Otn 9ides-fut-130867Otn 9ides-fut-130867
Otn 9ides-fut-130867
FITSFSd
 
Oracle portal 10g release 2 technical overview an oracle white paper august 2005
Oracle portal 10g release 2 technical overview an oracle white paper august 2005Oracle portal 10g release 2 technical overview an oracle white paper august 2005
Oracle portal 10g release 2 technical overview an oracle white paper august 2005
FITSFSd
 
Oracle database 12c security and compliance
Oracle database 12c security and complianceOracle database 12c security and compliance
Oracle database 12c security and compliance
FITSFSd
 
Oracle advance security transparent data encryption best practices
Oracle advance security transparent data encryption best practices Oracle advance security transparent data encryption best practices
Oracle advance security transparent data encryption best practices
FITSFSd
 
Oracle intro to designer abridged
Oracle intro to designer abridgedOracle intro to designer abridged
Oracle intro to designer abridged
FITSFSd
 
Oracle forms 11g release 2 (11.1.2) new
Oracle forms 11g release 2 (11.1.2) newOracle forms 11g release 2 (11.1.2) new
Oracle forms 11g release 2 (11.1.2) new
FITSFSd
 
Oracle9i reports developer
Oracle9i reports developerOracle9i reports developer
Oracle9i reports developer
FITSFSd
 
Oracle designer 6i web pl sql
Oracle designer 6i web pl sqlOracle designer 6i web pl sql
Oracle designer 6i web pl sql
FITSFSd
 
Oracle database administration technical services
Oracle database administration technical services Oracle database administration technical services
Oracle database administration technical services
FITSFSd
 
Oracle9i application server
Oracle9i application serverOracle9i application server
Oracle9i application server
FITSFSd
 
Oracle9i application server release 2
Oracle9i application server release 2 Oracle9i application server release 2
Oracle9i application server release 2
FITSFSd
 
Oracle9i application server oracle forms services
Oracle9i application server   oracle forms servicesOracle9i application server   oracle forms services
Oracle9i application server oracle forms services
FITSFSd
 

Oracle forms 10 j – dynamic color customization 2udfoh community paper-colors-134273

  • 1. Oracle Forms 10J – Dynamic Color Customization $Q 2UDFOH )RUPV &RPPXQLW :KLWH 3DSHU )UDQoRLV 'HJUHOOH -XQH
  • 2.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨8 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
  • 3.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨9 Oracle Forms 10J – Dynamic Color Customization ,1752'87,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 x Tab canvas color x Prompts (and tooltips) color x Background buttons color x Text buttons color x Background current record color x Text current record color 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.
  • 4.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨A@ CREATE TABLE UTIL_PREFS ( COD_UTIL NUMBER(5) PRIMARY KEY, -- User code C_FOND VARCHAR2(20 BYTE), -- color of canvas C_LIBELLE VARCHAR2(20 BYTE), -- color of prompts C_CADRE VARCHAR2(20 BYTE), -- color of tab canvas C_BOUTON VARCHAR2(20 BYTE), -- color of background buttons C_TBOUTON VARCHAR2(20 BYTE), -- color of text buttons C_CURREC VARCHAR2(20 BYTE), -- color of background current -- record C_TCURREC VARCHAR2(20 BYTE) -- 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 *53B2/256 group from the object library FRORUVROE The *53B2/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 x A form level trigger KEY-ENTQRY for the colorization in ENTER- QUERY mode x A form level trigger KEY-EXEQRY to re-set the initial colors after execute query x 3 alert boxes x A parameter 87,B,' for handling the ID that uniquely identifies the user x Visual attributes for colorization of objects The color.pll library contains 2 PLSQL procedures and 1 PLSQL package: x 6WDUWBTXHU
  • 5. - procedure to color queryable items in ENTER-QUERY mode
  • 6.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨B x (QGBTXHU
  • 7. - procedure to re-set the initial colors after EXECUTE- QUERY x 3.*B2/256 SDFNDJH o Global variables for the colors read from the UTIL_PREFS table o Global variables to translate Strings used in the COLORS.FMB and COLORS_J.FMB screen o Procedure “Paint”, which is the main procedure called during the Forms instance startup o 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 65((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. x 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. 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
  • 8.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨C 3/64/EDVHG GLDORJ 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 )LJXUH RORUVIPE
  • 9.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨D -DYD %HDQEDVHG GLDORJ 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 x 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 ... 1 http:/ / download.oracle.com/ otn/ other/ general/ forms10gdemos9_0_4_2.zip )LJXUH RORUVB-IPE UHTXLULQJ FRORUSLFNHUMDU
  • 10.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨E +$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. The Test Forms module demonstrates the following functionality: x Mandatory items have a bold prompt x Display items have a grey background x 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) )LJXUH 7HVW )RUPV
  • 11.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 (4£!3 ( ' 56£¥76¨F 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) x Attach the colors.pll library x Open the colors.olb object library x Drag the grp_colors group in the object group of your form x Compile all and generate 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.
  • 12.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤)0¦ ¡)21¥¥3 ( 4£!3 ( ' 56£¥76¨ $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 [email protected].
  • 13.  ¢¡ £¥¤§¦ ¨©§¡ !$#%§'§£§( ¤¢GIH6H6¦ (¤ ¥£!3 ( 'P)0¦ ¡)21¥¥3 (4£!3 ( ' Q 1R'§¨8¥¥!@ GI1¥3 S§¡ TR©R¡ £§'§U¥(#V¨¥7¡ ¨§¦ ¦¨ ¥WX Y` 6¨¥7¡ ¨§¦ ¦¨ ¥abX ¡ ¨¥¨§YX ¡ )0'¥3 ¡ (c 61¥3 (' §7PGI1¥3 S§¡ TR©R¡ £§'RdPef( H6SR( 1¥§W¥ ¢¡ £¥¤§¦ ¨  ¢¡ £¥¤§¦ ¨)0¡ HR¡ £!3 ( ' g ¡ ¦` bhV¨¥£¥`6i1§£§¡ 3 ¨§¡ B¥¥ ¢¡ £¥¤§¦ ¨56£§¡ dqpA£!% r ¨¥`§pA66`sVS§¡ ¨!§W¥)VGtF!@§¥C¥B u Ys VYGIY g ¡ ¦` §p( `6¨Pv '§i1R( ¡ (¨ !T 5S§'§¨6T¥w6!Y C¥B¥§Y B¥¥C§Y D¥¥¥ ©§£!xT¥w6!Y C¥B¥§Y B¥¥C§Y D¥8¥¥ pypypY ¡ £¥¤§¦ ¨§Y ¤¥ )0H§%§¡ (7 S¥3R€8¥¥!@§W¥ ¢¡ £¥¤§¦ ¨§YqGI¦ ¦¥¡ (7 S¥3 ¡ ¨!§¨§¡ ‚¥¨¥`Y ƒ SR(P`66¤§1RP¨§'¥3( H6¡ R‚§( `6¨¥`PX ¡( '!X ¡ P£!3 ( 'H61R¡ HRR§¨!P'R¦% £§'§`3 S§¨¤¥'¥3 ¨§'¥3 S§¨§¡ ¨¥§X£§¡ ¨AR1Rc„ ¨¥¤!363 ¤§S§£§'§76¨¢p( 3 S§1¥3'§R3 (¤ ¥¨§Y ƒ SR(P`66¤§1RP¨§'¥3( '§R3RpA£§¡ ¡ £§'¥3 ¨¥`3 $cR¨¨§¡ ¡ ¡ …X ¡ ¨¥¨¥W§'§¡6R1Rc„ ¨¥¤!363 £§'¥%R3 S§¨§¡RpA£§¡ ¡ £§'¥3 (¨ !P¡¤¥'§`(3 ( '¥§WpS§¨!3 S§¨§¡¨!xRH6¡ ¨!¥§¨¥`¡ £§¦ ¦% ¡( H6¦ (¨ ¥`$( '¦ £pAW§( '§¤§¦ 1§`( '§7$( H6¦ (¨ ¥`PpA£§¡ ¡ £§'¥3 (¨ !P£§'§`¤¥'§`(3 ( '¥P§X P¨§¡ ¤§S§£§'¥3 £§c6( ¦(3 %¡RX (3 '§¨!¥AX ¡£PHR£§¡ 3 (¤ §1R¦ £§¡H61R¡ HRR§¨§Y g ¨ARHR¨¥¤§(X (¤ ¥£§¦ ¦% `(§¤§¦ £§( †£§'¥%P¦ (£ §c6( ¦(3 %¢p(3 S¡ ¨!RHR¨¥¤!363 3 SR(P`66¤§1RP¨§'¥3£§'§`$'§ ¤¥'¥3 ¡ £¥¤!3 1§£§¦!c6¦ (7 6£!3 ( '¥P£§¡ ¨¢X ¡ P¨¥`¨§(3 S§¨§¡`( ¡ ¨¥¤!3 ¦%¡( '§`( ¡ ¨¥¤!3 ¦% c§%A3 SR( P`66¤§1RP¨§'¥3 Y ƒ SR( P`66¤§1RP¨§'¥3P£!%P'§R3cR¨P¡ ¨§H6¡ 6`1§¤¥¨¥`¡ 3 ¡ £§'¥R(3 3 ¨¥`$( 'P£§'¥%¢X ¡ †¡c§%£§'¥%PP¨¥£§'¥§W¥¨§¦ ¨¥¤!3 ¡ 'R( ¤¡P¨¥¤§S§£§'R( ¤¥£§¦ W X ¡£§'¥%PH61R¡ HRR§¨¥Wp(3 S§1¥31R¡H6¡ ( ¡Rp¡ (3 3 ¨§'HR¨§¡ (¥R( 'RY  ¢¡ £¥¤§¦ ¨P(P£P¡ ¨¥7(¥3 ¨§¡ ¨¥`3 ¡ £¥`6¨§P£§¡ dA§X ¢¡ £¥¤§¦ ¨)0¡ HR¡ £!3 ( 'P£§'§`§‡ ¡(3 £X X (¦(£ !3 ¨!RY! I3 S§¨§¡'§£§P¨!P£!%PcR¨A3 ¡ £¥`6¨§P£§¡ dP§X3 S§¨§( ¡¡ ¨!RHR¨¥¤!3 (‚¥¨§p'§¨§¡ RY