SlideShare ist ein Scribd-Unternehmen logo
1 von 55
Downloaden Sie, um offline zu lesen
Custom ADF 
Components 
Deep Dive
About Us 
Richard Olrichs 
MN 
www.olrichs.nl 
@richardolrichs 
Wilfred van der Deijl 
The Future Group 
www.redheap.com 
@wilfreddeijl
Agenda 
● Live Demo Custom ADF Component 
● How to use 
● Deep dive code roundtrip 
○ server side java, css, client side javascript 
○ client and server events 
● Lessons Learned
Live Demo 
Custom ADF Component
How to use
Setup Consuming Project
JSF Tag 
● Facelets Tag 
(or JSP Tag for 11.1.1 and backwards 
compatibility)
Let’s Build It 
Server Side 
https://github.com/wvanderdeijl/adfcomponent (=http://bit.ly/adfcomp)
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent 
Server Side 
Client Side
Facelets Tag Library - rh.taglib.xml 
Identifiers, not Java classes 
Component Attributes
faces-config.xml - Faces Component 
Maps Component-Type identifier to 
implementing Component Java Class
have ADF super classes 
do the heavy work 
holds all state 
key per attr 
returnType & 
defaultValue 
group of components that 
typically share a renderer
Getters & Setters 
for component 
properties
Component Class 
● Server side instance 
○ what MyBean gets via MyBean.setSelector() with 
binding=”#{myBean.selector}” 
● Setters and Getters for all properties 
● Internally keeps state in FacesBean with 
setProperty, getProperty 
○ gives automatic state saving of JSF component tree 
between requests and on failover in cluster
MultiSelect component 
setId, setValue, setItemSelectListener, 
setPartialTriggers 
Add custom rule to 
set from super class
Facelets Handler Class 
● Supplies rules to automap facelets tag 
attributes from XML file to component class 
properties 
● Needed custom rule to support our 
ItemSelectListener attribute as Oracle’s ADF 
version only works for listeners from oracle. 
adf.view.rich package
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent
faces-config.xml - Renderer 
ComponentFamily and RendererType from 
component used to lookup RendererClass
Which properties to expect 
from rendered component 
Find property keys once and 
describe client side props
Start of the HTML 
component 
Add ADF skin 
Encode the Item 
<input type=”hidden” 
value=”[0,1,2]”/>
render <li> for each item 
with <button> to select and <span> for delete
Component selector 
pseudo selector 
style subclassing 
http://myfaces.apache.org/trinidad/devguide/skinning.html
Apache Trinidad Content Compression 
On 
Off
Component Renderer 
● encodeAll method generates the HTML for 
the Component. 
● ADF Skin (including compression) 
○ more powerful than plain CSS 
○ skinning properties for Renderer like -tr-open-animation- 
duration 
○ relative colors: background-color: +#333333 
● Renderer lookup based on 
Family & RendererType from component 
● Taglib custom tag can override 
RendererType and thus re-use same 
component with different Renderer
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent
Let’s Build It 
Client Side
Client Side JavaScript Component 
Subclass from base ADF components 
Additional methods for client-side 
interaction with the component
Server-side Renderer determines 
Client JavaScript Component
ADF JavaScript Partitioning 
Dependency JS Client Constructor 
(defined by Renderer) 
ADF only downloads and runs needed JS 
core.js and any needed features
Component Peer Class 
Creates the 
RhMultiSelectPeer 
Use client side ADFLogger 
Register this Peer 
to ClickEvent 
Register this RhMultiSelectPeer 
for RhMultiSelect component
Best practice: assert for correct types 
Clicked delete icon 
DOM interaction 
Hidden input 
[0,1,2] ⇒ [0,2] 
Click button to select: Queue event to propagate to server
Client Side Select Event [1/2] 
Call superclass initializer 
with our event name 
getters and setters for client 
side interaction with event
Client Side Select Event [2/2] 
Queue event (called by Peer)
Client Component 
RhMultiSelect.js 
● Client-side representation of a server-side 
component 
● Public client-side API 
● Component state: Property container with 
support for event handling 
● All ADF Faces JavaScript classes are 
prefixed with Adf to avoid naming conflicts 
with other JavaScript libraries
Client Peer Object 
RhMultiSelectPeer.js 
Peer responsibilities: 
● DOM initialization and cleanup 
● DOM event handling 
● Geometry management 
● Partial page response handling 
● Child visibility change handling 
● Stateless private implementation
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent
Handle HTTP posts 
Server Side
Renderer Incoming HTTP Post 
Detect submitted value 
set Component’s 
SubmittedValue
Restore 
View 
Apply 
Request 
Values 
Process 
Validations 
Update 
Model 
Values 
Invoke 
Application 
Render 
Response 
JSF component’s “Local Value” 
written to ValueExpression 
eg. #{bindings.something.inputValue} 
SubmittedValue is converted to 
datatype of underlying model and 
stored in component’s “Local Value” 
Renderer invokes 
EditableValueHolder.setSubmittedValue() 
Invoke queued 
Listeners 
JSF Lifecycle 
Renderer uses 
SubmittedValue, 
“LocalValue” or 
“ModelValue”
Renderer Incoming HTTP Post 
Queue server-side 
ItemSelectEvent when receiving 
client itemSelect event
MultiSelect JSF Component Class
Managed Bean Event Listener
Renderer - Wrap up 
● Renderer decodeInternal() decodes the 
incoming http request 
○ check if component value is submitted in this 
request. If so, pass on to JSF component 
○ check for inbound events in the request
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent
Documentation
Starting point (11.1.2.4) 
http://docs.oracle.com/cd/E37975_01/web.111240/e16181/ad_custom.htm#CHDJIEDB
Documentation 
● Full Github sample - http://bit.ly/adfcomp 
● ADF Web User Interface Dev Guide 11.1.2.4 
○ 31 - Creating Custom ADF Faces Components 
● ADF Web User Interface Dev Guide 12.1.3 
○ 4 - ADF Faces Client Side Architecture 
○ Appendix A.2 - web.xml parameters 
○ Appendix F.1.1 - adf-js-partitions.xml 
● ADF Skin Editor Dev Guide 12.1.3 
● Apache Trinidad Skinning 
● JSF 2.1 Reference Documentation 
● ADF Source Code 
○ available from Oracle Support
Questions
Hidden Backup 
Slides
JavaScript 
● JavaScript libraries do not have 
namespaces, so prefix all JavaScript object 
names for the custom component using the 
same prefix. 
● Place each JavaScript object in its own 
separate source file for best practice and 
consistency.
Helpful stuff 
● web.xml parameters 
● Resource loading (zie: 
ImageResourceLoader) 
● Toevoegen <method-signature> in de taglib 
voor het snappen van methodExpression. 
●
view1.jsf 
Tag Lib 
Skin 
faces-config Component 
FacesBean 
Renderer 
Handler 
Component 
Peer 
Event 
ItemSelectEvent
Demo Shots 
Screen shots from the Demo
Building a custom Oracle ADF Component

Weitere ähnliche Inhalte

Was ist angesagt?

JSF (ADF) Case Studies Presentation
JSF (ADF) Case Studies PresentationJSF (ADF) Case Studies Presentation
JSF (ADF) Case Studies PresentationMichael Fons
 
A Complete Tour of JSF 2
A Complete Tour of JSF 2A Complete Tour of JSF 2
A Complete Tour of JSF 2Jim Driscoll
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentRob Windsor
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controlsRaed Aldahdooh
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewRob Windsor
 
Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchRob Windsor
 
Angular JS, steal the idea
Angular JS, steal the ideaAngular JS, steal the idea
Angular JS, steal the ideaScott Lee
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelPhil Wicklund
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1Neeraj Mathur
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Tech OneStop
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...SharePoint Saturday NY
 
ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningGeorge Estebe
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UITech OneStop
 
Advanced designs for reusable lightning components
Advanced designs for reusable lightning componentsAdvanced designs for reusable lightning components
Advanced designs for reusable lightning componentsthomaswaud
 
Groovy in SOAP UI
Groovy in SOAP UIGroovy in SOAP UI
Groovy in SOAP UIravireddy76
 
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...SPTechCon
 

Was ist angesagt? (20)

JSF (ADF) Case Studies Presentation
JSF (ADF) Case Studies PresentationJSF (ADF) Case Studies Presentation
JSF (ADF) Case Studies Presentation
 
A Complete Tour of JSF 2
A Complete Tour of JSF 2A Complete Tour of JSF 2
A Complete Tour of JSF 2
 
Extensions in OAF
Extensions in OAF Extensions in OAF
Extensions in OAF
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
Asp.net server controls
Asp.net server controlsAsp.net server controls
Asp.net server controls
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
SharePoint 2010 Application Development Overview
SharePoint 2010 Application Development OverviewSharePoint 2010 Application Development Overview
SharePoint 2010 Application Development Overview
 
Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio Lightswitch
 
Angular JS, steal the idea
Angular JS, steal the ideaAngular JS, steal the idea
Angular JS, steal the idea
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object Model
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
 
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
Siebel Open UI Debugging (Siebel Open UI Training, Part 7)
 
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
Lyudmila Zharova: Developing Solutions for SharePoint 2010 Using the Client O...
 
ADF - Layout Managers and Skinning
ADF - Layout Managers and SkinningADF - Layout Managers and Skinning
ADF - Layout Managers and Skinning
 
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UICustomizing the Presentation Model and Physical Renderer in Siebel Open UI
Customizing the Presentation Model and Physical Renderer in Siebel Open UI
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Advanced designs for reusable lightning components
Advanced designs for reusable lightning componentsAdvanced designs for reusable lightning components
Advanced designs for reusable lightning components
 
Groovy in SOAP UI
Groovy in SOAP UIGroovy in SOAP UI
Groovy in SOAP UI
 
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 

Andere mochten auch

Oracle ADF Overview
Oracle ADF OverviewOracle ADF Overview
Oracle ADF OverviewBahaa Farouk
 
ADF Bindings & Data Controls
ADF Bindings & Data ControlsADF Bindings & Data Controls
ADF Bindings & Data ControlsRohan Walia
 
Guidelines for moving from Oracle Forms to Oracle ADF and SOA
Guidelines for moving from Oracle Forms to Oracle ADF and SOAGuidelines for moving from Oracle Forms to Oracle ADF and SOA
Guidelines for moving from Oracle Forms to Oracle ADF and SOASteven Davelaar
 
Talking Services with Oracle ADF and Oracle SOA Suite
Talking Services with Oracle ADF and Oracle SOA SuiteTalking Services with Oracle ADF and Oracle SOA Suite
Talking Services with Oracle ADF and Oracle SOA SuiteDataNext Solutions
 
Oracle ADF Task Flows for Beginners
Oracle ADF Task Flows for BeginnersOracle ADF Task Flows for Beginners
Oracle ADF Task Flows for BeginnersDataNext Solutions
 
ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)Lucas Jellema
 
DOAG 2011 - Upgrade Guide for Oracle ADF on WebLogic Server
DOAG 2011 - Upgrade Guide for Oracle ADF on WebLogic ServerDOAG 2011 - Upgrade Guide for Oracle ADF on WebLogic Server
DOAG 2011 - Upgrade Guide for Oracle ADF on WebLogic ServerAndreas Koop
 
ADF Worst Practices (UKOUG Tech2013)
ADF Worst Practices (UKOUG Tech2013)ADF Worst Practices (UKOUG Tech2013)
ADF Worst Practices (UKOUG Tech2013)Wilfred van der Deijl
 
Running ADF Faces on Tablets and Mobile Phones
Running ADF Faces on Tablets and Mobile PhonesRunning ADF Faces on Tablets and Mobile Phones
Running ADF Faces on Tablets and Mobile PhonesSteven Davelaar
 
The Five Ways of Building Oracle Applications
The Five Ways of Building Oracle ApplicationsThe Five Ways of Building Oracle Applications
The Five Ways of Building Oracle ApplicationsSten Vesterli
 
Introducing adf business components
Introducing adf business componentsIntroducing adf business components
Introducing adf business componentsPrabhat gangwar
 
ADF User Interface Design Best Pratices
ADF User Interface Design Best PraticesADF User Interface Design Best Pratices
ADF User Interface Design Best PraticesAndreas Koop
 
A guide to ADF fusion development
A guide to ADF fusion developmentA guide to ADF fusion development
A guide to ADF fusion developmentDataNext Solutions
 
Programming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionappsProgramming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionappsBerry Clemens
 
All the Java ADF beginners need to know - part1
All the Java ADF beginners need to know - part1All the Java ADF beginners need to know - part1
All the Java ADF beginners need to know - part1Markus Eisele
 
Oracle ADF Architecture TV - Development - Error Handling
Oracle ADF Architecture TV - Development - Error HandlingOracle ADF Architecture TV - Development - Error Handling
Oracle ADF Architecture TV - Development - Error HandlingChris Muir
 
18 Invaluable Lessons About ADF-JSF Interaction
18 Invaluable Lessons About ADF-JSF Interaction18 Invaluable Lessons About ADF-JSF Interaction
18 Invaluable Lessons About ADF-JSF InteractionSteven Davelaar
 

Andere mochten auch (20)

Reporting solutions for ADF Applications
Reporting solutions for ADF ApplicationsReporting solutions for ADF Applications
Reporting solutions for ADF Applications
 
Oracle ADF Overview
Oracle ADF OverviewOracle ADF Overview
Oracle ADF Overview
 
ADF Bindings & Data Controls
ADF Bindings & Data ControlsADF Bindings & Data Controls
ADF Bindings & Data Controls
 
Guidelines for moving from Oracle Forms to Oracle ADF and SOA
Guidelines for moving from Oracle Forms to Oracle ADF and SOAGuidelines for moving from Oracle Forms to Oracle ADF and SOA
Guidelines for moving from Oracle Forms to Oracle ADF and SOA
 
Talking Services with Oracle ADF and Oracle SOA Suite
Talking Services with Oracle ADF and Oracle SOA SuiteTalking Services with Oracle ADF and Oracle SOA Suite
Talking Services with Oracle ADF and Oracle SOA Suite
 
Oracle ADF Task Flows for Beginners
Oracle ADF Task Flows for BeginnersOracle ADF Task Flows for Beginners
Oracle ADF Task Flows for Beginners
 
Soa
SoaSoa
Soa
 
ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)
 
so-aDF
so-aDFso-aDF
so-aDF
 
DOAG 2011 - Upgrade Guide for Oracle ADF on WebLogic Server
DOAG 2011 - Upgrade Guide for Oracle ADF on WebLogic ServerDOAG 2011 - Upgrade Guide for Oracle ADF on WebLogic Server
DOAG 2011 - Upgrade Guide for Oracle ADF on WebLogic Server
 
ADF Worst Practices (UKOUG Tech2013)
ADF Worst Practices (UKOUG Tech2013)ADF Worst Practices (UKOUG Tech2013)
ADF Worst Practices (UKOUG Tech2013)
 
Running ADF Faces on Tablets and Mobile Phones
Running ADF Faces on Tablets and Mobile PhonesRunning ADF Faces on Tablets and Mobile Phones
Running ADF Faces on Tablets and Mobile Phones
 
The Five Ways of Building Oracle Applications
The Five Ways of Building Oracle ApplicationsThe Five Ways of Building Oracle Applications
The Five Ways of Building Oracle Applications
 
Introducing adf business components
Introducing adf business componentsIntroducing adf business components
Introducing adf business components
 
ADF User Interface Design Best Pratices
ADF User Interface Design Best PraticesADF User Interface Design Best Pratices
ADF User Interface Design Best Pratices
 
A guide to ADF fusion development
A guide to ADF fusion developmentA guide to ADF fusion development
A guide to ADF fusion development
 
Programming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionappsProgramming-best practices( beginner) ADF_fusionapps
Programming-best practices( beginner) ADF_fusionapps
 
All the Java ADF beginners need to know - part1
All the Java ADF beginners need to know - part1All the Java ADF beginners need to know - part1
All the Java ADF beginners need to know - part1
 
Oracle ADF Architecture TV - Development - Error Handling
Oracle ADF Architecture TV - Development - Error HandlingOracle ADF Architecture TV - Development - Error Handling
Oracle ADF Architecture TV - Development - Error Handling
 
18 Invaluable Lessons About ADF-JSF Interaction
18 Invaluable Lessons About ADF-JSF Interaction18 Invaluable Lessons About ADF-JSF Interaction
18 Invaluable Lessons About ADF-JSF Interaction
 

Ähnlich wie Building a custom Oracle ADF Component

Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts NewLiquidHub
 
Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts NewLiquidHub
 
Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts NewLiquidHub
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)mircodotta
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Rightmircodotta
 
ADF and JavaScript - AMIS SIG, July 2017
ADF and JavaScript - AMIS SIG, July 2017ADF and JavaScript - AMIS SIG, July 2017
ADF and JavaScript - AMIS SIG, July 2017Lucas Jellema
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyPeter R. Egli
 
Specification Scala DSL for Mobile Application
Specification Scala DSL for Mobile ApplicationSpecification Scala DSL for Mobile Application
Specification Scala DSL for Mobile ApplicationAlexander Evseenko
 
Oracle ADF Quick Handy Reference
Oracle ADF Quick Handy ReferenceOracle ADF Quick Handy Reference
Oracle ADF Quick Handy ReferenceDeepak Bhagat
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React NativeEric Deng
 
Migrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UIMigrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UIGregor Zurowski
 
React Lifecycle and Reconciliation
React Lifecycle and ReconciliationReact Lifecycle and Reconciliation
React Lifecycle and ReconciliationZhihao Li
 
Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Salesforce Developers
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptWalid Ashraf
 
WinAppDriver Development
WinAppDriver DevelopmentWinAppDriver Development
WinAppDriver DevelopmentJeremy Kao
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today Nitin Tyagi
 
Architecting Alive Apps
Architecting Alive AppsArchitecting Alive Apps
Architecting Alive AppsJorge Ortiz
 

Ähnlich wie Building a custom Oracle ADF Component (20)

Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts New
 
Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts New
 
Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts New
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
 
ADF and JavaScript - AMIS SIG, July 2017
ADF and JavaScript - AMIS SIG, July 2017ADF and JavaScript - AMIS SIG, July 2017
ADF and JavaScript - AMIS SIG, July 2017
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technology
 
Specification Scala DSL for Mobile Application
Specification Scala DSL for Mobile ApplicationSpecification Scala DSL for Mobile Application
Specification Scala DSL for Mobile Application
 
Oracle ADF Quick Handy Reference
Oracle ADF Quick Handy ReferenceOracle ADF Quick Handy Reference
Oracle ADF Quick Handy Reference
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
Migrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UIMigrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UI
 
React Lifecycle and Reconciliation
React Lifecycle and ReconciliationReact Lifecycle and Reconciliation
React Lifecycle and Reconciliation
 
Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
Android dev
Android devAndroid dev
Android dev
 
WinAppDriver Development
WinAppDriver DevelopmentWinAppDriver Development
WinAppDriver Development
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 
Architecting Alive Apps
Architecting Alive AppsArchitecting Alive Apps
Architecting Alive Apps
 

Kürzlich hochgeladen

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Building a custom Oracle ADF Component

  • 2. About Us Richard Olrichs MN www.olrichs.nl @richardolrichs Wilfred van der Deijl The Future Group www.redheap.com @wilfreddeijl
  • 3. Agenda ● Live Demo Custom ADF Component ● How to use ● Deep dive code roundtrip ○ server side java, css, client side javascript ○ client and server events ● Lessons Learned
  • 4. Live Demo Custom ADF Component
  • 7. JSF Tag ● Facelets Tag (or JSP Tag for 11.1.1 and backwards compatibility)
  • 8. Let’s Build It Server Side https://github.com/wvanderdeijl/adfcomponent (=http://bit.ly/adfcomp)
  • 9. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent Server Side Client Side
  • 10.
  • 11. Facelets Tag Library - rh.taglib.xml Identifiers, not Java classes Component Attributes
  • 12. faces-config.xml - Faces Component Maps Component-Type identifier to implementing Component Java Class
  • 13. have ADF super classes do the heavy work holds all state key per attr returnType & defaultValue group of components that typically share a renderer
  • 14. Getters & Setters for component properties
  • 15. Component Class ● Server side instance ○ what MyBean gets via MyBean.setSelector() with binding=”#{myBean.selector}” ● Setters and Getters for all properties ● Internally keeps state in FacesBean with setProperty, getProperty ○ gives automatic state saving of JSF component tree between requests and on failover in cluster
  • 16. MultiSelect component setId, setValue, setItemSelectListener, setPartialTriggers Add custom rule to set from super class
  • 17. Facelets Handler Class ● Supplies rules to automap facelets tag attributes from XML file to component class properties ● Needed custom rule to support our ItemSelectListener attribute as Oracle’s ADF version only works for listeners from oracle. adf.view.rich package
  • 18. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent
  • 19. faces-config.xml - Renderer ComponentFamily and RendererType from component used to lookup RendererClass
  • 20. Which properties to expect from rendered component Find property keys once and describe client side props
  • 21. Start of the HTML component Add ADF skin Encode the Item <input type=”hidden” value=”[0,1,2]”/>
  • 22. render <li> for each item with <button> to select and <span> for delete
  • 23. Component selector pseudo selector style subclassing http://myfaces.apache.org/trinidad/devguide/skinning.html
  • 24. Apache Trinidad Content Compression On Off
  • 25. Component Renderer ● encodeAll method generates the HTML for the Component. ● ADF Skin (including compression) ○ more powerful than plain CSS ○ skinning properties for Renderer like -tr-open-animation- duration ○ relative colors: background-color: +#333333 ● Renderer lookup based on Family & RendererType from component ● Taglib custom tag can override RendererType and thus re-use same component with different Renderer
  • 26. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent
  • 27. Let’s Build It Client Side
  • 28. Client Side JavaScript Component Subclass from base ADF components Additional methods for client-side interaction with the component
  • 29. Server-side Renderer determines Client JavaScript Component
  • 30. ADF JavaScript Partitioning Dependency JS Client Constructor (defined by Renderer) ADF only downloads and runs needed JS core.js and any needed features
  • 31. Component Peer Class Creates the RhMultiSelectPeer Use client side ADFLogger Register this Peer to ClickEvent Register this RhMultiSelectPeer for RhMultiSelect component
  • 32. Best practice: assert for correct types Clicked delete icon DOM interaction Hidden input [0,1,2] ⇒ [0,2] Click button to select: Queue event to propagate to server
  • 33. Client Side Select Event [1/2] Call superclass initializer with our event name getters and setters for client side interaction with event
  • 34. Client Side Select Event [2/2] Queue event (called by Peer)
  • 35. Client Component RhMultiSelect.js ● Client-side representation of a server-side component ● Public client-side API ● Component state: Property container with support for event handling ● All ADF Faces JavaScript classes are prefixed with Adf to avoid naming conflicts with other JavaScript libraries
  • 36. Client Peer Object RhMultiSelectPeer.js Peer responsibilities: ● DOM initialization and cleanup ● DOM event handling ● Geometry management ● Partial page response handling ● Child visibility change handling ● Stateless private implementation
  • 37. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent
  • 38. Handle HTTP posts Server Side
  • 39. Renderer Incoming HTTP Post Detect submitted value set Component’s SubmittedValue
  • 40. Restore View Apply Request Values Process Validations Update Model Values Invoke Application Render Response JSF component’s “Local Value” written to ValueExpression eg. #{bindings.something.inputValue} SubmittedValue is converted to datatype of underlying model and stored in component’s “Local Value” Renderer invokes EditableValueHolder.setSubmittedValue() Invoke queued Listeners JSF Lifecycle Renderer uses SubmittedValue, “LocalValue” or “ModelValue”
  • 41. Renderer Incoming HTTP Post Queue server-side ItemSelectEvent when receiving client itemSelect event
  • 43. Managed Bean Event Listener
  • 44. Renderer - Wrap up ● Renderer decodeInternal() decodes the incoming http request ○ check if component value is submitted in this request. If so, pass on to JSF component ○ check for inbound events in the request
  • 45. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent
  • 47. Starting point (11.1.2.4) http://docs.oracle.com/cd/E37975_01/web.111240/e16181/ad_custom.htm#CHDJIEDB
  • 48. Documentation ● Full Github sample - http://bit.ly/adfcomp ● ADF Web User Interface Dev Guide 11.1.2.4 ○ 31 - Creating Custom ADF Faces Components ● ADF Web User Interface Dev Guide 12.1.3 ○ 4 - ADF Faces Client Side Architecture ○ Appendix A.2 - web.xml parameters ○ Appendix F.1.1 - adf-js-partitions.xml ● ADF Skin Editor Dev Guide 12.1.3 ● Apache Trinidad Skinning ● JSF 2.1 Reference Documentation ● ADF Source Code ○ available from Oracle Support
  • 51. JavaScript ● JavaScript libraries do not have namespaces, so prefix all JavaScript object names for the custom component using the same prefix. ● Place each JavaScript object in its own separate source file for best practice and consistency.
  • 52. Helpful stuff ● web.xml parameters ● Resource loading (zie: ImageResourceLoader) ● Toevoegen <method-signature> in de taglib voor het snappen van methodExpression. ●
  • 53. view1.jsf Tag Lib Skin faces-config Component FacesBean Renderer Handler Component Peer Event ItemSelectEvent
  • 54. Demo Shots Screen shots from the Demo