SlideShare uma empresa Scribd logo
1 de 55
Baixar para ler offline
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
Custom ADF Components Deep Dive

Mais conteúdo relacionado

Mais procurados

A Complete Tour of JSF 2
A Complete Tour of JSF 2A Complete Tour of JSF 2
A Complete Tour of JSF 2Jim Driscoll
 
Parallelminds.web partdemo
Parallelminds.web partdemoParallelminds.web partdemo
Parallelminds.web partdemoManishaChothe
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014Ran Wahle
 
Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Salesforce Developers
 
Academy PRO: React JS
Academy PRO: React JSAcademy PRO: React JS
Academy PRO: React JSBinary Studio
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs WorkshopRan Wahle
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component BehaviorsAndy Schwartz
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1Neeraj Mathur
 
Groovy in SOAP UI
Groovy in SOAP UIGroovy in SOAP UI
Groovy in SOAP UIravireddy76
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state managementpriya Nithya
 
Salesforce Lightning Components Workshop
Salesforce Lightning Components WorkshopSalesforce Lightning Components Workshop
Salesforce Lightning Components WorkshopChristophe Coenraets
 

Mais procurados (18)

Jsf
JsfJsf
Jsf
 
A Complete Tour of JSF 2
A Complete Tour of JSF 2A Complete Tour of JSF 2
A Complete Tour of JSF 2
 
Parallelminds.web partdemo
Parallelminds.web partdemoParallelminds.web partdemo
Parallelminds.web partdemo
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
 
Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2
 
Academy PRO: React JS
Academy PRO: React JSAcademy PRO: React JS
Academy PRO: React JS
 
React render props
React render propsReact render props
React render props
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs Workshop
 
2007 Zend Con Mvc
2007 Zend Con Mvc2007 Zend Con Mvc
2007 Zend Con Mvc
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component Behaviors
 
Controls
ControlsControls
Controls
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
 
Groovy in SOAP UI
Groovy in SOAP UIGroovy in SOAP UI
Groovy in SOAP UI
 
Continuous Quality
Continuous QualityContinuous Quality
Continuous Quality
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
 
Salesforce Lightning Components Workshop
Salesforce Lightning Components WorkshopSalesforce Lightning Components Workshop
Salesforce Lightning Components Workshop
 

Semelhante a Custom ADF Components Deep Dive

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
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptWalid Ashraf
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentRob Windsor
 
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
 
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
 
Architecting Alive Apps
Architecting Alive AppsArchitecting Alive Apps
Architecting Alive AppsJorge Ortiz
 

Semelhante a Custom ADF Components Deep Dive (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
 
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
 
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
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
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
 
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)
 
Architecting Alive Apps
Architecting Alive AppsArchitecting Alive Apps
Architecting Alive Apps
 

Último

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Último (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Custom ADF Components Deep Dive

  • 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