ADF On-Ramp: What You Need To Know To Use ADF

Transcription

SurveyADF On-Ramp:What You Need to Knowto Use ADF Job responsibilities?– DBA, developer Languages?– PL/SQL– Java– OtherPeter Koletzke Tools?Technical Director &Principal Instructor– Developer Forms/Reports– JDeveloper– Eclipse, NetBeans– Other2AgendaOn the Positive Side If we do not findanything pleasant, at leastwe shall find something new. What is ADF? ADF core technologiesSi nous ne trouvons pas des chosesagréables, nous trouverons dumoins des choses nouvelles. Required languagesSlides and awardwinning white paper willbe available on theNYOUG and Quoverawebsites.—Voltaire (1694-1778), Candide34

Oracle Application DevelopmentFramework (ADF)ADF ArchitectureView A framework is a prebuilt service for solving aparticular problem – like access to thedatabaseADFdi (Excel)Web ClientADF MobileJSFJSPADF JClient– Code libraries and standards support the framework– Implements code reuse and best practices– An architecture with code librariesADF Faces RCControllerJSFStruts ADF is a meta-framework– A wrapper for other frameworks– Available starting in JDeveloper 10g– Provides a consistent developer experienceADFControllerModelADF Bindings Pre-ADF available in OAFADF Data Controls– Oracle Application Framework (UIX/MVC) Based on Model-View-ControllerJava EE design patternBusiness ServicesEJB SessionBeansWebServicesADF BusinessComponentsJavaClassesEssbase5ADF EssentialsWhich ADF Technologies to Use? Fusion Applications: Oracle application suite Core technology stack used for Fusion Apps is: No-license-fee version of ADF– Runs on the public domain app server,Glassfish, not WebLogic Server–––– Works in JDeveloper Works in Eclipse– Through Oracle Enterprise Pack forEclipseADF Business ComponentsADF Faces Rich ClientADF ModelADF Controller Other high-level technologiesor strategies also used– SOA, ESB, Business Rules,WebCenter, BPM, BPA, BAM– Need to consider those, too,at the architectural level More information on OTN– df/overview/adfessentialsfaq-1837249.pdf7but OOS8

AgendaWhere Do The Core TechnologiesEnd Up? What is ADF?Database access& SOA endpointsADFFaces ADF core technologiesADFBCUI renderingDepartmentsADFControllerPage flow and task flowADFModelADF BCADF FacesADF ModelADF Controller Required languagesEmployeesBinding datato items910The World ViewADF Business ComponentsIn this best of allpossible worlds .everything is for the best. ADF BC: an option in the BusinessServices layer of ADF Persistence: storing data in a database O/R mapping: Translates relationaldatabase thingies to object-oriented (Java)whatsits Handles JDBC mechanicsDans ce meilleurdes mondes possibles .tout est au mieux.– Creates SQL and handles results—Voltaire (1694-1778), Candide Primarily declarative– XML source code to define theuse of framework classes1112

Sample ADF BC DevelopmentMore About ADF BC Various component types– View objects: define queries– Entity objects: define insert-updatedelete (“DML”)– View links: view object relationships– Associations: entity object links– Application modules: Define the datamodels and the database transaction It does not create user interfacesEntity object editors13View Object CodeView Object SELECT statementView Attribute Column in query ViewObjectxmlns "http://xmlns.oracle.com/bc4j"Name "AllEmployees"Version "11.1.1.53.41"SelectList "Employees.EMPLOYEE ID,Employees.FIRST NAME,Employees.LAST NAME,Employees.JOB ID,Employees.EMAIL,Employees.HIRE DATE,Departments.DEPARTMENT NAME,Departments.DEPARTMENT ID,Departments.LOCATION ID"FromList "DEPARTMENTS Departments,EMPLOYEES Employees"Where "Departments.MANAGER ID Employees.EMPLOYEE ID"BindingStyle "OracleName"CustomQuery "false"PageIterMode "Full"UseGlueCode "false" . AttributeName "EmployeeId"IsNotNull "true"Precision "6"Scale "0"ColumnName "EMPLOYEE ID"SQLType "NUMERIC"Type "oracle.jbo.domain.Number"ColumnType "NUMBER"TableName "EMPLOYEES"PrimaryKey "true" DesignTime Attr Name " DisplaySize"Value "22"/ /DesignTime /Attribute AttributeName "FirstName"Precision "20"ColumnName "FIRST NAME".1514Agenda What is ADF? ADF core technologiesADF BCADF FacesADF ModelADF Controller Required languages16

ADF Faces RC FeaturesADF Faces Rich Client Overview Solid development support in JDeveloper Changeable “skins” Fits into the View layer of ADF Evolution:– ADF UIX ADF Faces Apache Trinidad– ADF Faces ADF Faces RC – Common look-and-feel characteristics– Skin editor in JDev 11.1.2Built on top of JSF APIsDeployable on any 1.2 implementation of JSFSupport for pop-ups and dialogsADF model support out-of-the-box Reallyrich!Data Visualization Tools (DVT)components Layout management features Extensive set of properties– Declarative access to application metadata– Properties can referencedynamic values usingExpression Language– Charts, Gantt, Pivot, Maps, Hierarchy Template support17Some Componentsaf:inputTextaf:commandButton18AJAX in ADF Faces RC Asynchronous JavaScript and XML Partial Page Rendering (PPR) in ADF Facesaf:commandImageLink– “Declarative AJAX”af:inputListOfValues Much AJAX in ADF Faces is transparent– Built into the components– Nothing special needs to be doneaf:menuItem You can setup non-default AJAX behaviorusing propertiesaf:selectOneChoiceaf:inputDateAJAX providesa cleaner userinterface!– partialSubmit – used by command items– autoSubmit – used by input items/lists, etc.– partialTriggers – all components, sets upthe “viewer” (listener)af:selectBooleanCheckbox1920

ADF Faces JSF SnippetSample ADF Faces Development jsp:root xmlns:jsp "http://java.sun.com/JSP/Page" version "2.0"xmlns:f "http://java.sun.com/jsf/core"xmlns:af "http://xmlns.oracle.com/adf/faces/rich" . af:panelStretchLayout styleClass "AFVisualRoot" topHeight "105px"bottomHeight "20px" f:facet name "top" af:panelBorderLayout f:facet name "start" af:image source "/images/tuhra.gif" shortDesc "TUHRA Logo"/ /f:facet f:facet name "end" af:panelGroupLayout layout "horizontal" halign "right"valign "bottom" af:commandImageLink text "Logon" shortDesc "Logout from TUHRA"depressedIcon "/images/groupdisconnect dwn.png"disabledIcon "/images/groupdisconnect dis.png"hoverIcon "/images/groupdisconnect ovr.png"icon "/images/groupdisconnect ena.png"disabled "true"rendered "#{attrs.anonymous}"/ af:commandImageLink text "Logoff" shortDesc "Logout from TUHRA"depressedIcon "/images/groupdisconnect dwn.png"disabledIcon "/images/groupdisconnect dis.png"hoverIcon "/images/groupdisconnect ovr.png"icon "/images/groupdisconnect ena.png"disabled "true“rendered "#{!attrs.anonymous}"/ 21AgendaADF Model What is ADF? ADF core technologies22 ADF Data ControlsADF BCADF FacesADF ModelADF Controller– Provides list of componentsor groups of components fora node in the data model– “Drop as” options ADF Bindings Required languages– Prebuilt connection fromthe ADF BC to the UI– Drag and drop actionabove does the work2324

Data ControlsBindings Business Services abstraction– Makes Model components available toThe Good News:ViewControllerYou don’tnormally write– Automatically created with ADF BC data controls– Can be created for other business services– For non-ADF BC, defined in DataControls.cpx Provide list of “Drop as” options that createpre-bound components– Collection level (view object instance)– Attribute level (view attribute) Association of a business service dataelement or action with a UI component– Relatively automatic in Oracle Forms– Definitely not automatic in native Java EE Binding normally takes a lot of coding– One-off solution is not the answer– Need a framework to assistUser InterfaceDataBindingsADF Business ComponentsEmployees ID FirstName LastName25DatabaseEMPLOYEESSusan26Editing BindingsDrop As Examples: Form and TableLink toPageDef fileNote the bindingexpressions2728

Binding CodeAgendaIn the JSF page file What is ADF? af:inputText value "#{bindings.DepartmentId.inputValue}"label "#{bindings.DepartmentId.hints.label}"required "#{bindings.DepartmentId.hints.mandatory}"columns umLength c "#{bindings.DepartmentId.hints.tooltip}"id "it1" /af:inputText ADF core technologiesIn the bindings PageDef fileADF BCADF FacesADF ModelADF Controller Required languages bindings attributeValues IterBinding "DepartmentsView1Iterator"id "DepartmentId" AttrNames Item Value "DepartmentId"/ /AttrNames /attributeValues 2930Sample ADF ControllerDevelopmentADF Controller (ADFc) Extension to standard JSF Controller functionality Defines task flows– Logic and page fragment components– Embedded on the page in a region componentexception handlerroutercontrol flow case Benefits– Page fragment re-use– Executing code in a logic-defined flow “Task flow” not “page flow”– Security– Exception handling and transactionmanagement Defined in a diagramstart pointof the flow.– Like JSF but more components available3132

Sample ADF Controller CodeSummary: ADF Core Technologies task-flow-definition id "dept-flow" default-activity deptBrowse /default-activity view id "deptBrowse"

/deptBrowse.jspx /page /view view id "deptEdit"

/deptEdit.jspx /page /view control-flow-rule from-activity-id deptBrowse /from-activity-id control-flow-case From from-outcome toEdit /from-outcome to-activity-id deptEdit /to-activity-id To /control-flow-case /control-flow-rule router id "checkForExplicitID" case id " 6" expression #{!empty pageFlowScope.employeeId} /expression outcome byId /outcome /case default-outcome currentUser /default-outcome /router method-call id "queryEmployeeById" method #{bindings.queryEmployeeById.execute} /method outcome fixed-outcome queryEmployeeById /fixed-outcome /outcome /method-call Database access& SOA endpointsADFFacesADFBCUI renderingDepartmentsADFControllerPage flow and task flowADFModelEmployeesBinding datato items34AgendaWhich Languages Do You Use?1. Java– All important programmatic code– Think “trigger code” as in Forms What is ADF?2. XML– The components rely on XML ADF core technologies HTMLProperty editors create it for you3. JavaScript and Cascading Style Sheets– Add functionality to HTML pages– Usually the components do this work for you Required languages4. Expression Language– Used in JSF binding properties5. Groovy– ADF BC scripting3536

How Much of Each Do You Use?Final Voltaire WisdomLanguage (Use)LevelNeededPrimary UseJava(frameworks such asADF Faces)BasicBusiness components code for validation andspecial handling of model objects, as well as codingconditional page flow.Java(extending frameworkfeatures)ExpertSupplementing or replacing functionality supplied bythe framework. This requires research into theframework’s capabilities and architecture.XMLBasicThe JSF tags and the HTML renderer take care ofthe HTML for you. XML is used for JSF JSP filesJavaScriptBasic/NoneProviding customized user interaction functionality,for example, special handling of a checkboxselection.Cascading StyleSheetsBasic/NoneFor ensuring a consistent look and feel. If you useprebuilt look-and-feel templates, no CSS coding isneeded.Expression LanguageBasic/IntermediateSupplying data to components from properties ormethods in the application.GroovyBasicExpressions for ADF Business ComponentsThe secret of being a boreis to tell everything.Le secret d'ennuyerest celui de tout dire.—Voltaire (1694-1778), SeptDiscours en Vers sur l’Homme38SummaryDesignerHandbook Oracle is building Fusion Applications with anADF core technology stack ADF offers a consistent developerexperience regardless of the technologies ADF Business Components provide accessto the database and other data sources ADF Model connects ADF BC to ADF Faces ADF Faces provide 150 , feature-rich itemand container components for JSF pages ADF Controller manages page flowand task orms &ReportsJDeveloper 3Handbook Books co-authored with Dr. PaulDorsey, Avrom Roy-Faderman, &Duncan MillsORACLEJDeveloper 10gHandbookwww.quovera.com Founded in 1995 as Millennia VisionCorp. Profitable without outside funding Consultants each have 10 yearsindustry experience Strong High-Tech industry background 200 clients/300 projects JDeveloper Partner More technical white papers andpresentations on the web site40

Essbase ADF Controller View ADF Mobile ADF JClient ADFdi (Excel) Web Client JSP ADF Faces RC JSF 7 ADF Essentials No-license-fee version of ADF - Runs on the public domain app server, Glassfish, not WebLogic Server Works in JDeveloper Works in Eclipse - Through Oracle Enterprise Pack for Eclipse More information on OTN