JSF (ADF) Case Studies Presentation


Published on

JSF Presentation I did for RMOUG training days conferenece 2008

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

JSF (ADF) Case Studies Presentation

  1. 1. ADF Case Studies By Michael A. Fons Graebel Companies, Inc. [email_address] February 2008
  2. 2. The Subjects <ul><li>Graebel Companies, Inc. </li></ul><ul><ul><li>E-Pages project </li></ul></ul><ul><ul><li>Branches coordinating resources of moves </li></ul></ul><ul><li>RMOUG </li></ul><ul><ul><li>website rebuild </li></ul></ul><ul><ul><li>IS Director wanted more features and a makeover </li></ul></ul>
  3. 3. Platforms <ul><li>G: </li></ul><ul><ul><li>JDev </li></ul></ul><ul><ul><ul><li>ADF/BC, JSF </li></ul></ul></ul><ul><ul><ul><li>Web Services </li></ul></ul></ul><ul><ul><li>OAS 10.1.3.x </li></ul></ul><ul><ul><ul><li>ADF, BPEL, APEX, BI Publisher, Forms, Reports, PL/SQL, .NET, … </li></ul></ul></ul><ul><li>R: </li></ul><ul><ul><li>JDev </li></ul></ul><ul><ul><ul><li>ADF/BC, JSF </li></ul></ul></ul><ul><ul><li>OC4J </li></ul></ul>
  4. 4. Why ADF? <ul><li>G: </li></ul><ul><ul><li>Oracle investing in it heavily </li></ul></ul><ul><ul><li>Touted as next step after Oracle Forms </li></ul></ul><ul><li>R: </li></ul><ul><ul><li>Something I wanted to learn </li></ul></ul><ul><ul><li>It would do the trick for IS Director </li></ul></ul><ul><ul><li>I was willing and able to volunteer </li></ul></ul>
  5. 5. Question from Design Phase <ul><li>G: </li></ul><ul><ul><li>Entities based on DB views </li></ul></ul><ul><ul><li>Navigation </li></ul></ul><ul><ul><li>Testing Options </li></ul></ul><ul><ul><li>Global Button bar </li></ul></ul><ul><ul><li>Database custom login (modules) </li></ul></ul><ul><ul><li>Doing CRUD on an af:table </li></ul></ul><ul><li>R: </li></ul><ul><ul><li>Self-change password reset </li></ul></ul>
  6. 6. Training (of Developers to do ADF) <ul><li>G: </li></ul><ul><ul><li>Presentations and papers like this </li></ul></ul><ul><ul><li>Management carved out several days </li></ul></ul><ul><ul><ul><li>Three days of lessons </li></ul></ul></ul><ul><ul><li>Oracle Developer Day </li></ul></ul><ul><ul><li>Doing actual assignments & proofs-of-concept </li></ul></ul><ul><ul><li>On-line end-user training </li></ul></ul><ul><li>R: </li></ul><ul><ul><li>So far: training through e-mail for IS Director </li></ul></ul>
  7. 7. Foundational Discoveries <ul><li>Good to be knowledgable/flexible with LOV’s </li></ul><ul><li>Way has been paved for Custom Login Module by Frank Nimphius. </li></ul><ul><li>Validating at the view level is rather complex </li></ul><ul><ul><li>Made easier by doing Creates/Updates on a single row page </li></ul></ul>
  8. 8. Web Services <ul><li>G: </li></ul><ul><ul><li>Prepared by calling .NET services </li></ul></ul><ul><ul><li>Could not use JDev’s Web Service Data Control Wizard (parameters did not implement Serializable) </li></ul></ul><ul><ul><li>Used JDev Web Service Proxy Wizard instead; worked fine </li></ul></ul>
  9. 9. Web Services <ul><li>G: </li></ul><ul><ul><li>Kicking off BPEL may require BPEL web service call from PL/SQL trigger </li></ul></ul><ul><ul><li>Web Service Security by getting .NET token </li></ul></ul><ul><ul><li>Web Services called from Forms also </li></ul></ul><ul><li>R: </li></ul><ul><ul><li>none </li></ul></ul>
  10. 10. Software Install Issues <ul><li>R: </li></ul><ul><ul><li>JDK 5.0 </li></ul></ul><ul><ul><li>OC4J </li></ul></ul><ul><ul><li>ADFInstaller </li></ul></ul><ul><ul><li>DB tables </li></ul></ul><ul><ul><li>ADF app deployment </li></ul></ul><ul><li>G: </li></ul><ul><ul><li>Talk to our DBA group </li></ul></ul><ul><ul><li>ADF app deployment </li></ul></ul>
  11. 11. Which JDev version to use? <ul><li>At second developers preview for 11g now (Jan 8, 2008). </li></ul><ul><li>JDev 11g has many needed features </li></ul><ul><li>Developers Previews will blunt the “bleeding edge” </li></ul><ul><li>Drag and drop </li></ul><ul><li>At Graebel: too much risk currently go to 11g </li></ul><ul><li>Staying at (for G and R) </li></ul><ul><li>Looking forward to new features like Drag and Drop hooks. </li></ul>
  12. 12. Hints <ul><li>Copy off your directory with JDev closed daily. </li></ul><ul><li>Get comfy with framework extensions, for ADF BC’s, FacesLifeCycles, SessionCookieFactories, or any standard class. </li></ul><ul><li>CVS sounds like a good idea </li></ul><ul><ul><li>Integrated with JDev </li></ul></ul><ul><ul><li>Teamwork </li></ul></ul><ul><ul><li>Suggests automated recompile/regression tests </li></ul></ul><ul><ul><li>Chapter in ADF Developer’s Guide </li></ul></ul><ul><li>Source control .zip file </li></ul>
  13. 13. Hints <ul><li>Skin changes </li></ul><ul><ul><li>Does your company’s marketing department have standard colors? </li></ul></ul><ul><ul><li>You can adapt some out-of-the-box skins to your needs. (We adapted SRDemo’s skin.) </li></ul></ul><ul><ul><li>Make your own images; pixels; artistic. </li></ul></ul><ul><ul><li>Disappearing skin: caching .css and other files </li></ul></ul><ul><ul><li>Panel form column alignment problematic </li></ul></ul>
  14. 14. Hints <ul><li>Page parameters </li></ul><ul><ul><li>Use Invoke Action on MethodAction which passes values like #{param.param1} for setting query bind variable values. </li></ul></ul><ul><ul><li>Using extension of ADFFacesLifeCycle works for non-query related coding (like storing page parameter values on the session scope) </li></ul></ul>
  15. 15. Calling ADF from Oracle Forms <ul><li>There is a solution which a Forms guru from the Forum offered me; free now. </li></ul><ul><li>SSO? </li></ul><ul><li>Instead, we built a home-grown solution. </li></ul><ul><ul><li>Call from forms contains un, pw (encrypted), and other parameters. </li></ul></ul><ul><ul><li>Called logout.jspx (ADF Faces page) </li></ul></ul><ul><ul><li>… which called unpwset.jsp to set HttpSession un and pw attributes… </li></ul></ul><ul><ul><li>… which called the final target page, which is protected in web.xml </li></ul></ul><ul><ul><li>Custom LoginModule decrypts pw before authenticating. </li></ul></ul>
  16. 16. More Hints <ul><li>Deployment issues </li></ul><ul><ul><li>G: </li></ul></ul><ul><ul><ul><li>Did initial proof of concept page in </li></ul></ul></ul><ul><ul><ul><li>Deployed to Solaris 8 and OAS 10.1.3.x…this did not work well at all. </li></ul></ul></ul><ul><ul><ul><li>Deployed to Solaris 10 worked fine however. </li></ul></ul></ul><ul><ul><li>R: </li></ul></ul><ul><ul><ul><li>Deployed to OC4J (Solaris 10): worked great. </li></ul></ul></ul>
  17. 17. Hints <ul><li>executeWithParams quirk </li></ul><ul><ul><li>G: </li></ul></ul><ul><ul><ul><li>Drop of executeWithParams method onto page manifests fine as ADF Parameter Form. </li></ul></ul></ul><ul><ul><ul><li>Subsequent dragged-and-dropped parameters from the same view are not connected right. </li></ul></ul></ul><ul><ul><ul><li>In the PageDef file for the page, add to list of parameters listed in executeWithParams Action within the bindings section. (Subsequent drag and drops on the page do not add this.) </li></ul></ul></ul>
  18. 18. Hints <ul><li>Creating an insert/update af:table can be complex, depending on user expectations. </li></ul><ul><ul><li>Data bound drop-down lists, must use af:forEach </li></ul></ul><ul><ul><li>LOV on af:ouputText works well </li></ul></ul><ul><ul><li>Doing view-level validation on af:table really threw me. </li></ul></ul><ul><ul><ul><li>Validates every row for every change; </li></ul></ul></ul><ul><ul><ul><li>value of #{row} changes while validating; </li></ul></ul></ul><ul><ul><ul><li>commit stopped working due to faulty EL expression somewhere </li></ul></ul></ul>
  19. 19. LOV Montage
  20. 20. Security <ul><li>Did not use ADF Security (on either G or R) </li></ul><ul><li>Used JAAS on both </li></ul><ul><li>G: </li></ul><ul><ul><li>Used custom LoginModule and Dynamic JDBC; to authenticate and connect to individual Oracle schemas. </li></ul></ul><ul><li>R: </li></ul><ul><ul><li>Used custom LoginModule to authenticate against user and role tables in database </li></ul></ul><ul><ul><li>Connected to single user. </li></ul></ul>
  21. 21. Security <ul><li>G: </li></ul><ul><ul><li>Dynamic JDBC </li></ul></ul><ul><ul><ul><li>Do not use BASIC authentication; need HttpSession </li></ul></ul></ul><ul><ul><ul><li>Overrode ApplicationModule implementation class’s afterLogon method so I could do set_role required for our user/role setup </li></ul></ul></ul><ul><ul><ul><li>Database/sid/port obtained from the default connection you set for application module. </li></ul></ul></ul>
  22. 22. Custom Exception Handling <ul><li>G: </li></ul><ul><ul><li>SRDemo app comes with implementation of custom exception handling. </li></ul></ul><ul><ul><li>ADF Dev Guide explains how to do the same thing. </li></ul></ul><ul><ul><li>When I copied the example code: it would disable the use of #{row.xxx}. </li></ul></ul><ul><ul><li>Exception handling worked great though… </li></ul></ul><ul><ul><li>I opened an Oracle SR; the solution: comment out the portion of the SRDemo FacesPageLifeCycle that checks for proper setup of SRDemo. (an “if” statement) </li></ul></ul>
  23. 23. Column Sorting <ul><li>G: </li></ul><ul><ul><li>Af:table column sorting </li></ul></ul><ul><ul><li>If you request column sorting when you drop a data control collection as a Table, all works well. </li></ul></ul><ul><ul><li>New columns added, though, need the Sortable property set to the ViewObject attribute on which that column is sorting. </li></ul></ul><ul><ul><li>Sortable value can be conditional, like #{bindings.Commit.enabled ? ‘theAttributeName’ : ‘’} </li></ul></ul>
  24. 24. LOV issues <ul><li>G and R: </li></ul><ul><ul><li>Calling dialog </li></ul></ul><ul><ul><li>Dialog page can have source iterator binding in it, or data can pass back </li></ul></ul><ul><ul><li>Commit/Rollback buttons: </li></ul></ul><ul><ul><ul><li>Af:setActionListener setting source iterator sets #{bindings.Commit.enabled} to true. </li></ul></ul></ul><ul><ul><ul><li>If you pass data back, use ViewObject Iterator binding, to get view object, then get current row, and set desired values. </li></ul></ul></ul>
  25. 25. af:table drop-down lists <ul><li>Should have dynamic, data-bound, drop-down list in an af:table, instead of LOV’s </li></ul><ul><ul><li>Ran into problems in many cases using the ListBinding. </li></ul></ul><ul><ul><ul><li>Blank List; could not find value in list </li></ul></ul></ul><ul><ul><ul><li>Used af:forEach component instead with nested af:??? “option” component. (Do not use backing bean components for these). </li></ul></ul></ul><ul><ul><ul><li>Need to enable row-level Java implementation class for the “forEach” view. </li></ul></ul></ul><ul><ul><ul><li>ViewObject row attributes start with lower-case </li></ul></ul></ul>
  26. 26. Hints <ul><li>You can use transient views like forms “control” blocks. </li></ul><ul><ul><li>Single “header” row that applies to af:table child rows </li></ul></ul><ul><ul><li>af:table below with row create capabilities </li></ul></ul><ul><li>FacesContext can get current page name </li></ul><ul><li>Managed bean (faces-config.xml) instances in your app are accessible with ValueBindings. </li></ul>
  27. 27. My Future Goals <ul><li>Create my own custom JSF components </li></ul><ul><li>Continue working with ADF. </li></ul><ul><li>Learn JDev (10g and 11g) ADF programming intricacies </li></ul><ul><li>In corporate more and more best practices for </li></ul><ul><ul><li>Java </li></ul></ul><ul><ul><li>ADF </li></ul></ul><ul><ul><li>CM </li></ul></ul><ul><ul><li>Code Sharing </li></ul></ul>
  28. 28. Questions? <ul><li>Have fun at Training Days!! </li></ul><ul><li>Read my paper (if you have not) </li></ul><ul><li>My email is [email_address] </li></ul><ul><li>See paper for bibliography/resources on RMOUG web page, events section (…to be available within the next couple of weeks.) </li></ul>