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

JSF (ADF) Case Studies Presentation

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