SlideShare una empresa de Scribd logo
1 de 41
Creating Sub-zero
Dashboard Plug-In for
APEX with Google
VisualizationsRoel Hartman
October 2010
2
“Visualization
is daydreaming with a
purpose”
- Bo Bennett
Intro
© Logica 2010. All rights reserved
Who am I?
• Oracle since v5, Forms 2.3, Case*Designer etc
• Presenter at UKOUG (3x), OOW (3x), ODTUG (2x)
No. 6
item region dynamic
action
process
A
No. 12© Logica 2010. All rights reserved
• Contains other cool charts
• Extend your options
• (Most) not Flash:
http://apex.oracle.com/pls/apex/f?p=GVIS:STATIC
Why use Google Visualizations?
B
No. 13© Logica 2010. All rights reserved
What we are aiming for...
No. 14© Logica 2010. All rights reserved
End User
APEX Developer
Plug-in Developer
Three perspectives
Develop a
Plug-in
in 5 steps
© Logica 2010. All rights reserved
• 3 parameters
function render_chart
( p_region in apex_plugin.t_region
, p_plugin in apex_plugin.t_plugin
, p_is_printer_friendly in boolean )
return apex_plugin.t_region_render_result
• Read the custom parameters
l_width apex_application_page_regions.attribute_01%type := p_region.attribute_01;
• Switch on debug (apex_plugin_util.debug_region)
No. 18
Step 1 - Create a render function
C
No. 19
© Logica 2010. All rights reserved
• 3 parameters
function render_chart
( p_region in apex_plugin.t_region
, p_plugin in apex_plugin.t_plugin
, p_is_printer_friendly in boolean )
return apex_plugin.t_region_render_result
• Read the custom parameters
l_width apex_application_page_regions.attribute_01%type := p_region.attribute_01;
• Switch on debug (apex_plugin_util.debug_region)
• Render the HTML (javascript, css)
• Return null
type t_region_render_result is record
( dummy boolean /* not used yet */ );
No. 20
Step 1 - Create a render function
D
© Logica 2010. All rights reserved
• This is the ‘actual’ Plug-in code
• Render a placeholder DIV
No. 21
Step 1 – Render the HTML
sys.htp.p(‘
<input id="GVrowIndex'||p_region.static_id||'" type="hidden" size="10"/>
<div id="GV'||p_region.static_id||'"></div>');
© Logica 2010. All rights reserved
• This is the ‘actual’ Plug-in code
• Render a placeholder DIV
• Add the Google jsapi library
No. 22
Step 1 – Render the HTML
apex_javascript.add_library (
p_name => 'jsapi',
p_directory => 'http://www.google.com/',
p_version => null,
p_skip_extension => true );
© Logica 2010. All rights reserved
• This is the ‘actual’ Plug-in code
• Render a placeholder DIV
• Add the Google jsapi library
• Load the Google Visualization API
No. 23
Step 1 – Render the HTML
apex_javascript.add_inline_code (
p_code => 'google.load("visualization", "1",
{packages:["'||c_chart_type||'"]});',
p_key => 'visualization_'||c_chart_type );
© Logica 2010. All rights reserved
• This is the ‘actual’ Plug-in code
• Render a placeholder DIV
• Add the Google jsapi library
• Load the Google Visualization API
• Register your javascript library
No. 24
Step 1 – Render the HTML
apex_javascript.add_library (
p_name => 'com_logica_apex_googlevis_piechart',
p_directory => p_plugin.file_prefix,
p_version => null );
© Logica 2010. All rights reserved
• This is the ‘actual’ Plug-in code
• Render a placeholder DIV
• Add the Google jsapi library
• Load the Google Visualization API
• Register your javascript library
• Initialize the chart
No. 25
Step 1 – Render the HTML
sys.htp.p(‘
<input id="GVrowIndex'||p_region.static_id||'" type="hidden" size="10"/>
<div id="GV'||p_region.static_id||'"></div>');
apex_javascript.add_library (
p_name => 'jsapi',
p_directory => 'http://www.google.com/',
p_version => null,
p_skip_extension => true );
apex_javascript.add_inline_code (
p_code => 'google.load("visualization", "1",
{packages:["'||c_chart_type||'"]});',
p_key => 'visualization_'||c_chart_type );
apex_javascript.add_library (
p_name => 'com_logica_apex_googlevis_piechart',
p_directory => p_plugin.file_prefix,
p_version => null );
apex_javascript.add_onload_code (
p_code =>'GV'||p_region.id||' = '||
'new com_logica_apex_googlevis_piechart();'||
'GV'||p_region.id||'.render('||
apex_javascript.add_value(p_region.static_id)||
apex_javascript.add_value(c_chart_type)||
'{'|| -- add chart attributes
apex_javascript.add_attribute('width' , l_width )||
apex_javascript.add_attribute('height' , l_height )||
apex_javascript.add_attribute('is3D' , l_is3D )||
'},'||l_data|| '); '
);
E
© Logica 2010. All rights reserved
• Execute the query
• apex_plugin_util.get_data2 returns t_column_value_list2
table of (name, data_type, valuelist)
No. 26
Step 1 – Getting the data
-- Column 1 is a string, column2 a number.
l_data_type_list(1) := apex_plugin_util.c_data_type_varchar2;
l_data_type_list(2) := apex_plugin_util.c_data_type_number;
-- get the chart data
l_col_val_list := apex_plugin_util.get_data2 (
p_sql_statement => p_region.source,
p_min_columns => 2,
p_max_columns => 2,
p_data_type_list => l_data_type_list,
p_component_name => p_region.static_id,
p_max_rows => 1000 );
© Logica 2010. All rights reserved
• Execute the query
• apex_plugin_util.get_data2 returns t_column_value_list2
table of (name, data_type, valuelist)
• Google JSON Format
No. 27
Step 1 – Getting the data
{
cols: [{id: 'A', label: 'NEW A‘ , type: 'string'},
{id: 'B', label: 'B-label', type: 'number'},
{id: 'C', label: 'C-label', type: 'date‘ }
],
rows: [{c:[{v: 'a'}, {v: 1.0 , f: 'One'} ,{v: new Date(2008, 1, 28)}]},
{c:[{v: 'b'}, {v: 2.0, f: 'Two'} ,{v: new Date(2008, 2, 30)}]},
{c:[{v: 'c'}, {v: 3.0, f: 'Three'},{v: new Date(2008, 3, 30)}]}
]
}
F
© Logica 2010. All rights reserved
• Execute the query
• apex_plugin_util.get_data2 returns t_column_value_list2
table of (name, data_type, valuelist)
• Google JSON Format
• Constructing G-JSON
No. 28
Step 1 – Getting the data
loop
l_data := l_data|| '{'||
apex_javascript.add_attribute('id' , 'col'||l_column)||
apex_javascript.add_attribute('label', l_col_val_list(l_column).name)||
apex_javascript.add_attribute('type'
, case l_col_val_list(l_column).data_type
when c_data_type_varchar2 then 'string‘
when c_data_type_number then 'number'
end, false, false )||
'}';
end loop;
© Logica 2010. All rights reserved
loop
l_data := l_data|| '{'||
apex_javascript.add_attribute('id' , 'col'||l_column)||
apex_javascript.add_attribute('label', l_col_val_list(l_column).name)||
apex_javascript.add_attribute('type'
, case l_col_val_list(l_column).data_type
when c_data_type_varchar2 then 'string‘
when c_data_type_number then 'number'
end, false, false )||
'}';
end loop;
• Execute the query
• apex_plugin_util.get_data2 returns t_column_value_list2
table of (name, data_type, valuelist)
• Google JSON Format
• Constructing G-JSON
No. 29
Step 1 – Getting the data
G
© Logica 2010. All rights reserved
• Execute the query
• apex_plugin_util.get_data2 returns t_column_value_list2
table of (name, data_type, valuelist)
• Google JSON Format
• Constructing G-JSON
No. 30
Step 1 – Getting the data
loop
l_data := l_data|| '{'||
apex_javascript.add_attribute('id' , 'col'||l_column)||
apex_javascript.add_attribute('label', l_col_val_list(l_column).name)||
apex_javascript.add_attribute('type'
, case l_col_val_list(l_column).data_type
when c_data_type_varchar2 then 'string‘
when c_data_type_number then 'number'
end, false, false )||
'}';
end loop;
© Logica 2010. All rights reserved No. 31
Step 2 – Add standard attributes
H
© Logica 2010. All rights reserved No. 32
Step 3 – Add custom attributes
• Dependent on !
• Select List, but only Static
I
© Logica 2010. All rights reserved No. 33
Step 4 – Add files
apex_javascript.add_onload_code (
p_code =>'GV'||p_region.id||' = '||
'new com_logica_apex_googlevis_piechart();'||
'GV'||p_region.id||'.render('||
apex_javascript.add_value(p_region.static_id)||
apex_javascript.add_value(c_chart_type)||
'{'|| -- add chart attributes
apex_javascript.add_attribute('width' , l_width )||
apex_javascript.add_attribute('height' , l_height )||
apex_javascript.add_attribute('is3D' , l_is3D )||
'},'||l_data|| '); '
);
J
© Logica 2010. All rights reserved
• Propagate events to APEX
No. 34
Step 5 – Add events
K
No. 35© Logica 2010. All rights reserved
APEX Developer
L
No. 36© Logica 2010. All rights reserved
End User
M
No. 37© Logica 2010. All rights reserved
Question Break
That was quite cool
now the sub-zero stuff!
No. 39© Logica 2010. All rights reserved
Combine the power of:
• GV Plug-in
• Dynamic Action (Plug-ins)
• Google Visualizations
• Update (DA)
• Filter (DA)
Now the sub-zero stuff...
N
No. 40© Logica 2010. All rights reserved
Now the sub-zero stuff...
No. 41© Logica 2010. All rights reserved
•Plug-ins are sooo powerful
•Really extend APEX
•Need (some) R&D
•Get to know your building blocks
•Good Plug-ins are easy to use
•And fun too!
•Amaze your end users....
Summary and Conclusions
Logica is a business and technology service company, employing 39,000 people. It provides business consulting, systems integration and outsourcing to
clients around the world, including many of Europe's largest businesses. Logica creates value for clients by successfully integrating people, business and
technology. It is committed to long term collaboration, applying insight to create innovative answers to clients’ business needs. Logica is listed on both the
London Stock Exchange and Euronext (Amsterdam) (LSE: LOG; Euronext: LOG). More information is available at www.logica.com
Thank you
Roel Hartman
Logica | Meander 901 P.O. Box 7015 | 6801 HA Arnhem | The Netherlands | www.logica.com
Contact: Roel Hartman - Lead Technical Architect Oracle: +31 (0) 26 3765 000 M: +31 (0) 6 2954 3729 E: roel.hartman@logica.com

Más contenido relacionado

La actualidad más candente

exportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailboxexportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailbox
Daniel Gilhousen
 

La actualidad más candente (20)

Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11Angular js 2.0, ng poznań 20.11
Angular js 2.0, ng poznań 20.11
 
SPFx working with SharePoint data
SPFx working with SharePoint dataSPFx working with SharePoint data
SPFx working with SharePoint data
 
SPFx: Working with SharePoint Content
SPFx: Working with SharePoint ContentSPFx: Working with SharePoint Content
SPFx: Working with SharePoint Content
 
Using Task Queues and D3.js to build an analytics product on App Engine
Using Task Queues and D3.js to build an analytics product on App EngineUsing Task Queues and D3.js to build an analytics product on App Engine
Using Task Queues and D3.js to build an analytics product on App Engine
 
#ajn3.lt.marblejenka
#ajn3.lt.marblejenka#ajn3.lt.marblejenka
#ajn3.lt.marblejenka
 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll Structure
 
Angular 2 Architecture
Angular 2 ArchitectureAngular 2 Architecture
Angular 2 Architecture
 
Introduction to CQRS and Event Sourcing
Introduction to CQRS and Event SourcingIntroduction to CQRS and Event Sourcing
Introduction to CQRS and Event Sourcing
 
Higher-Order Components — Ilya Gelman
Higher-Order Components — Ilya GelmanHigher-Order Components — Ilya Gelman
Higher-Order Components — Ilya Gelman
 
exportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailboxexportDisabledUsersRemoveMailbox
exportDisabledUsersRemoveMailbox
 
CQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony applicationCQRS and Event Sourcing in a Symfony application
CQRS and Event Sourcing in a Symfony application
 
The Snake and the Butler
The Snake and the ButlerThe Snake and the Butler
The Snake and the Butler
 
ReactでGraphQLを使っている
ReactでGraphQLを使っているReactでGraphQLを使っている
ReactでGraphQLを使っている
 
Migrating from Flux to Redux. Why and how.
Migrating from Flux to Redux. Why and how.Migrating from Flux to Redux. Why and how.
Migrating from Flux to Redux. Why and how.
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
 
mobl
moblmobl
mobl
 
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapperSF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
 
Scala on Your Phone
Scala on Your PhoneScala on Your Phone
Scala on Your Phone
 
Decoupling the Ulabox.com monolith. From CRUD to DDD
Decoupling the Ulabox.com monolith. From CRUD to DDDDecoupling the Ulabox.com monolith. From CRUD to DDD
Decoupling the Ulabox.com monolith. From CRUD to DDD
 

Similar a Creating sub zero dashboard plugin for apex with google

Similar a Creating sub zero dashboard plugin for apex with google (20)

InterConnect2016: WebApp Architectures with Java and Node.js
InterConnect2016: WebApp Architectures with Java and Node.jsInterConnect2016: WebApp Architectures with Java and Node.js
InterConnect2016: WebApp Architectures with Java and Node.js
 
PyData Amsterdam 2018 – Building customer-visible data science dashboards wit...
PyData Amsterdam 2018 – Building customer-visible data science dashboards wit...PyData Amsterdam 2018 – Building customer-visible data science dashboards wit...
PyData Amsterdam 2018 – Building customer-visible data science dashboards wit...
 
What's New in Visual Studio 2008
What's New in Visual Studio 2008What's New in Visual Studio 2008
What's New in Visual Studio 2008
 
The Present and Future of the Web Platform
The Present and Future of the Web PlatformThe Present and Future of the Web Platform
The Present and Future of the Web Platform
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
Easy path to machine learning
Easy path to machine learningEasy path to machine learning
Easy path to machine learning
 
Full Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey DiagramFull Stack Visualization: Build A React App With A Sankey Diagram
Full Stack Visualization: Build A React App With A Sankey Diagram
 
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & morePower your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
Power your apps with Gmail, Google Drive, Calendar, Sheets, Slides & more
 
Introduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R ShinyIntroduction to interactive data visualisation using R Shiny
Introduction to interactive data visualisation using R Shiny
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinGuide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in Kotlin
 
Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014Rethinking metrics: metrics 2.0 @ Lisa 2014
Rethinking metrics: metrics 2.0 @ Lisa 2014
 
Sprint 54
Sprint 54Sprint 54
Sprint 54
 
Sprint 47
Sprint 47Sprint 47
Sprint 47
 
.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir Dresher.Net december 2017 updates - Tamir Dresher
.Net december 2017 updates - Tamir Dresher
 
Front end microservices - October 2019
Front end microservices - October 2019Front end microservices - October 2019
Front end microservices - October 2019
 
Platform agnostic information systems development
Platform agnostic information systems developmentPlatform agnostic information systems development
Platform agnostic information systems development
 
Architecture for scalable Angular applications
Architecture for scalable Angular applicationsArchitecture for scalable Angular applications
Architecture for scalable Angular applications
 
Get together on getting more out of typescript &amp; angular 2
Get together on getting more out of typescript &amp; angular 2Get together on getting more out of typescript &amp; angular 2
Get together on getting more out of typescript &amp; angular 2
 
C++ Programming
C++ ProgrammingC++ Programming
C++ Programming
 

Más de Roel Hartman

Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Roel Hartman
 

Más de Roel Hartman (17)

Wizard of ORDS
Wizard of ORDSWizard of ORDS
Wizard of ORDS
 
APEX Bad Practices
APEX Bad PracticesAPEX Bad Practices
APEX Bad Practices
 
Docker for Dummies
Docker for DummiesDocker for Dummies
Docker for Dummies
 
A deep dive into APEX JET charts
A deep dive into APEX JET chartsA deep dive into APEX JET charts
A deep dive into APEX JET charts
 
Mastering universal theme
Mastering universal themeMastering universal theme
Mastering universal theme
 
APEX Developers : Do More With LESS !
APEX Developers : Do More With LESS !APEX Developers : Do More With LESS !
APEX Developers : Do More With LESS !
 
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
Ten Tiny Things To Try Today - Hidden APEX5 Gems RevealedTen Tiny Things To Try Today - Hidden APEX5 Gems Revealed
Ten Tiny Things To Try Today - Hidden APEX5 Gems Revealed
 
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
Best of both worlds: Create hybrid mobile applications with Oracle Applicatio...
 
APEX printing with BI Publisher
APEX printing with BI PublisherAPEX printing with BI Publisher
APEX printing with BI Publisher
 
Troubleshooting APEX Performance Issues
Troubleshooting APEX Performance IssuesTroubleshooting APEX Performance Issues
Troubleshooting APEX Performance Issues
 
Automated testing APEX Applications
Automated testing APEX ApplicationsAutomated testing APEX Applications
Automated testing APEX Applications
 
5 Cool Things you can do with HTML5 and APEX
5 Cool Things you can do with HTML5 and APEX5 Cool Things you can do with HTML5 and APEX
5 Cool Things you can do with HTML5 and APEX
 
Striving for Perfection: The Ultimate APEX Application Architecture
Striving for Perfection: The Ultimate APEX Application ArchitectureStriving for Perfection: The Ultimate APEX Application Architecture
Striving for Perfection: The Ultimate APEX Application Architecture
 
XFILES, the APEX 4 version - The truth is in there
XFILES, the APEX 4 version - The truth is in thereXFILES, the APEX 4 version - The truth is in there
XFILES, the APEX 4 version - The truth is in there
 
Done in 60 seconds - Creating Web 2.0 applications made easy
Done in 60 seconds - Creating Web 2.0 applications made easyDone in 60 seconds - Creating Web 2.0 applications made easy
Done in 60 seconds - Creating Web 2.0 applications made easy
 
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
Tales from a Parallel Universe: Using Oracle 11gR2's Edition Based Redefiniti...
 
Integration of APEX and Oracle Forms
Integration of APEX and Oracle FormsIntegration of APEX and Oracle Forms
Integration of APEX and Oracle Forms
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 

Creating sub zero dashboard plugin for apex with google

  • 1. Creating Sub-zero Dashboard Plug-In for APEX with Google VisualizationsRoel Hartman October 2010
  • 2. 2 “Visualization is daydreaming with a purpose” - Bo Bennett
  • 4.
  • 5.
  • 6. © Logica 2010. All rights reserved Who am I? • Oracle since v5, Forms 2.3, Case*Designer etc • Presenter at UKOUG (3x), OOW (3x), ODTUG (2x) No. 6
  • 7.
  • 8.
  • 10.
  • 11. A
  • 12. No. 12© Logica 2010. All rights reserved • Contains other cool charts • Extend your options • (Most) not Flash: http://apex.oracle.com/pls/apex/f?p=GVIS:STATIC Why use Google Visualizations? B
  • 13. No. 13© Logica 2010. All rights reserved What we are aiming for...
  • 14. No. 14© Logica 2010. All rights reserved End User APEX Developer Plug-in Developer Three perspectives
  • 16.
  • 17. © Logica 2010. All rights reserved • 3 parameters function render_chart ( p_region in apex_plugin.t_region , p_plugin in apex_plugin.t_plugin , p_is_printer_friendly in boolean ) return apex_plugin.t_region_render_result • Read the custom parameters l_width apex_application_page_regions.attribute_01%type := p_region.attribute_01; • Switch on debug (apex_plugin_util.debug_region) No. 18 Step 1 - Create a render function C
  • 19. © Logica 2010. All rights reserved • 3 parameters function render_chart ( p_region in apex_plugin.t_region , p_plugin in apex_plugin.t_plugin , p_is_printer_friendly in boolean ) return apex_plugin.t_region_render_result • Read the custom parameters l_width apex_application_page_regions.attribute_01%type := p_region.attribute_01; • Switch on debug (apex_plugin_util.debug_region) • Render the HTML (javascript, css) • Return null type t_region_render_result is record ( dummy boolean /* not used yet */ ); No. 20 Step 1 - Create a render function D
  • 20. © Logica 2010. All rights reserved • This is the ‘actual’ Plug-in code • Render a placeholder DIV No. 21 Step 1 – Render the HTML sys.htp.p(‘ <input id="GVrowIndex'||p_region.static_id||'" type="hidden" size="10"/> <div id="GV'||p_region.static_id||'"></div>');
  • 21. © Logica 2010. All rights reserved • This is the ‘actual’ Plug-in code • Render a placeholder DIV • Add the Google jsapi library No. 22 Step 1 – Render the HTML apex_javascript.add_library ( p_name => 'jsapi', p_directory => 'http://www.google.com/', p_version => null, p_skip_extension => true );
  • 22. © Logica 2010. All rights reserved • This is the ‘actual’ Plug-in code • Render a placeholder DIV • Add the Google jsapi library • Load the Google Visualization API No. 23 Step 1 – Render the HTML apex_javascript.add_inline_code ( p_code => 'google.load("visualization", "1", {packages:["'||c_chart_type||'"]});', p_key => 'visualization_'||c_chart_type );
  • 23. © Logica 2010. All rights reserved • This is the ‘actual’ Plug-in code • Render a placeholder DIV • Add the Google jsapi library • Load the Google Visualization API • Register your javascript library No. 24 Step 1 – Render the HTML apex_javascript.add_library ( p_name => 'com_logica_apex_googlevis_piechart', p_directory => p_plugin.file_prefix, p_version => null );
  • 24. © Logica 2010. All rights reserved • This is the ‘actual’ Plug-in code • Render a placeholder DIV • Add the Google jsapi library • Load the Google Visualization API • Register your javascript library • Initialize the chart No. 25 Step 1 – Render the HTML sys.htp.p(‘ <input id="GVrowIndex'||p_region.static_id||'" type="hidden" size="10"/> <div id="GV'||p_region.static_id||'"></div>'); apex_javascript.add_library ( p_name => 'jsapi', p_directory => 'http://www.google.com/', p_version => null, p_skip_extension => true ); apex_javascript.add_inline_code ( p_code => 'google.load("visualization", "1", {packages:["'||c_chart_type||'"]});', p_key => 'visualization_'||c_chart_type ); apex_javascript.add_library ( p_name => 'com_logica_apex_googlevis_piechart', p_directory => p_plugin.file_prefix, p_version => null ); apex_javascript.add_onload_code ( p_code =>'GV'||p_region.id||' = '|| 'new com_logica_apex_googlevis_piechart();'|| 'GV'||p_region.id||'.render('|| apex_javascript.add_value(p_region.static_id)|| apex_javascript.add_value(c_chart_type)|| '{'|| -- add chart attributes apex_javascript.add_attribute('width' , l_width )|| apex_javascript.add_attribute('height' , l_height )|| apex_javascript.add_attribute('is3D' , l_is3D )|| '},'||l_data|| '); ' ); E
  • 25. © Logica 2010. All rights reserved • Execute the query • apex_plugin_util.get_data2 returns t_column_value_list2 table of (name, data_type, valuelist) No. 26 Step 1 – Getting the data -- Column 1 is a string, column2 a number. l_data_type_list(1) := apex_plugin_util.c_data_type_varchar2; l_data_type_list(2) := apex_plugin_util.c_data_type_number; -- get the chart data l_col_val_list := apex_plugin_util.get_data2 ( p_sql_statement => p_region.source, p_min_columns => 2, p_max_columns => 2, p_data_type_list => l_data_type_list, p_component_name => p_region.static_id, p_max_rows => 1000 );
  • 26. © Logica 2010. All rights reserved • Execute the query • apex_plugin_util.get_data2 returns t_column_value_list2 table of (name, data_type, valuelist) • Google JSON Format No. 27 Step 1 – Getting the data { cols: [{id: 'A', label: 'NEW A‘ , type: 'string'}, {id: 'B', label: 'B-label', type: 'number'}, {id: 'C', label: 'C-label', type: 'date‘ } ], rows: [{c:[{v: 'a'}, {v: 1.0 , f: 'One'} ,{v: new Date(2008, 1, 28)}]}, {c:[{v: 'b'}, {v: 2.0, f: 'Two'} ,{v: new Date(2008, 2, 30)}]}, {c:[{v: 'c'}, {v: 3.0, f: 'Three'},{v: new Date(2008, 3, 30)}]} ] } F
  • 27. © Logica 2010. All rights reserved • Execute the query • apex_plugin_util.get_data2 returns t_column_value_list2 table of (name, data_type, valuelist) • Google JSON Format • Constructing G-JSON No. 28 Step 1 – Getting the data loop l_data := l_data|| '{'|| apex_javascript.add_attribute('id' , 'col'||l_column)|| apex_javascript.add_attribute('label', l_col_val_list(l_column).name)|| apex_javascript.add_attribute('type' , case l_col_val_list(l_column).data_type when c_data_type_varchar2 then 'string‘ when c_data_type_number then 'number' end, false, false )|| '}'; end loop;
  • 28. © Logica 2010. All rights reserved loop l_data := l_data|| '{'|| apex_javascript.add_attribute('id' , 'col'||l_column)|| apex_javascript.add_attribute('label', l_col_val_list(l_column).name)|| apex_javascript.add_attribute('type' , case l_col_val_list(l_column).data_type when c_data_type_varchar2 then 'string‘ when c_data_type_number then 'number' end, false, false )|| '}'; end loop; • Execute the query • apex_plugin_util.get_data2 returns t_column_value_list2 table of (name, data_type, valuelist) • Google JSON Format • Constructing G-JSON No. 29 Step 1 – Getting the data G
  • 29. © Logica 2010. All rights reserved • Execute the query • apex_plugin_util.get_data2 returns t_column_value_list2 table of (name, data_type, valuelist) • Google JSON Format • Constructing G-JSON No. 30 Step 1 – Getting the data loop l_data := l_data|| '{'|| apex_javascript.add_attribute('id' , 'col'||l_column)|| apex_javascript.add_attribute('label', l_col_val_list(l_column).name)|| apex_javascript.add_attribute('type' , case l_col_val_list(l_column).data_type when c_data_type_varchar2 then 'string‘ when c_data_type_number then 'number' end, false, false )|| '}'; end loop;
  • 30. © Logica 2010. All rights reserved No. 31 Step 2 – Add standard attributes H
  • 31. © Logica 2010. All rights reserved No. 32 Step 3 – Add custom attributes • Dependent on ! • Select List, but only Static I
  • 32. © Logica 2010. All rights reserved No. 33 Step 4 – Add files apex_javascript.add_onload_code ( p_code =>'GV'||p_region.id||' = '|| 'new com_logica_apex_googlevis_piechart();'|| 'GV'||p_region.id||'.render('|| apex_javascript.add_value(p_region.static_id)|| apex_javascript.add_value(c_chart_type)|| '{'|| -- add chart attributes apex_javascript.add_attribute('width' , l_width )|| apex_javascript.add_attribute('height' , l_height )|| apex_javascript.add_attribute('is3D' , l_is3D )|| '},'||l_data|| '); ' ); J
  • 33. © Logica 2010. All rights reserved • Propagate events to APEX No. 34 Step 5 – Add events K
  • 34. No. 35© Logica 2010. All rights reserved APEX Developer L
  • 35. No. 36© Logica 2010. All rights reserved End User M
  • 36. No. 37© Logica 2010. All rights reserved Question Break
  • 37. That was quite cool now the sub-zero stuff!
  • 38. No. 39© Logica 2010. All rights reserved Combine the power of: • GV Plug-in • Dynamic Action (Plug-ins) • Google Visualizations • Update (DA) • Filter (DA) Now the sub-zero stuff... N
  • 39. No. 40© Logica 2010. All rights reserved Now the sub-zero stuff...
  • 40. No. 41© Logica 2010. All rights reserved •Plug-ins are sooo powerful •Really extend APEX •Need (some) R&D •Get to know your building blocks •Good Plug-ins are easy to use •And fun too! •Amaze your end users.... Summary and Conclusions
  • 41. Logica is a business and technology service company, employing 39,000 people. It provides business consulting, systems integration and outsourcing to clients around the world, including many of Europe's largest businesses. Logica creates value for clients by successfully integrating people, business and technology. It is committed to long term collaboration, applying insight to create innovative answers to clients’ business needs. Logica is listed on both the London Stock Exchange and Euronext (Amsterdam) (LSE: LOG; Euronext: LOG). More information is available at www.logica.com Thank you Roel Hartman Logica | Meander 901 P.O. Box 7015 | 6801 HA Arnhem | The Netherlands | www.logica.com Contact: Roel Hartman - Lead Technical Architect Oracle: +31 (0) 26 3765 000 M: +31 (0) 6 2954 3729 E: roel.hartman@logica.com

Notas del editor

  1. Sub-zero seems one of the characters from the video game series Mortal Kombat.
  2. More in Topgear terminology: Seriously uncool, uncool, cool, subzero...
  3. 0:02 / 0:04 Over 15 years experience in the Oracle field. Started with RDBMS v5, Oracle Case, Forms 2.3, RPT/RPF. All the way to the latest version of Designer, Developer, RDBMS (took part in the 11g beta test). Frequent contributor of Oracle APEX Forum – Not > 4000 posts, but I’ve got work to do. Blogger Working for Logica for over 13 years now as a Software Architect, NL-Lead Technical Architect Oracle I set op the model for our Factory for Automated Migration of Oracle (u) Software. A repeatable solution for the migrations of Oracle Designer and Oracle Forms from earlier version to the latest version. Not a native English speaker – as you might have noticed (or will notice) APEX Experience? Forms Experience? APEX 2 Forms conversion experience? APEX 3.2 Early Adopters Release: article in Ogh visie & Oracle Scene
  4. You look at the world around you, and you take it apart into all its components. Then you take some of those components, throw them away, and plug in different ones, start it up and see what happens.  Frederik Pohl 
  5. Enhance / Extend APEX with new stuff Re-use Widget style Included in Application Export Can be exported & shared with others
  6. http://code.google.com/apis/visualization/interactive_charts.html
  7. Google JSON Format : http://code.google.com/apis/visualization/documentation/reference.html#dataparam
  8. Apex_javascript.add_attribute is overloaded. Takes care of escaping. Parameters : name, value, omit_null, add_comma Same for apex_add_value (value, add_comma)