• Save
Dont Reinvent the Wheel: Tips and Tricks for reuse in ADF
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Dont Reinvent the Wheel: Tips and Tricks for reuse in ADF

on

  • 1,648 views

Presentation for KScope13 on how to use the reuse capabilities in ADF

Presentation for KScope13 on how to use the reuse capabilities in ADF

Statistics

Views

Total Views
1,648
Views on SlideShare
1,648
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Dont Reinvent the Wheel: Tips and Tricks for reuse in ADF Presentation Transcript

  • 1. Luc Bors, june 2013, ODTUG KScope 2013 New Orleans Tips and Tricks for UI Reuse in Oracle ADF Don't Reinvent the Wheel
  • 2. Who Am I • Luc Bors • Principal Consultant • AMIS Nieuwegein Netherlands • Friends of Oracle & Java • 5 Oracle ACE(D) • Oracle Partner
  • 3. Topics • Reuse – ADF Controller and Faces – Page Templates – Declarative Components – Stylesheets – Task Flows
  • 4. The (somewhat ugly) Sample Application
  • 5. Page Templates • Specify the layout structure (of groups) of pages – For example: top bar, side bar, footer – Predefine placeholders for pages to inject their contents • Page can be based on template – It will provide the content for the placeholders (seen as facets) – It can pass parameters to the template – for example for the title of the page or the page bread crumb trail
  • 6. Page Templates • Centrally specifying the overall structure and some of the look & feel for all or specific types of pages • Can also be applied dynamically, depending on some context settings – This allows a single page to be presented in different ways to different users or under different conditions – Templates allow different structure and component ordering for the same page • Page Templates make maintenance of the overall layout structure much easier
  • 7. Page Templates • Create a Page Template – Embed one or more facetRef elements for the holes to be filled by the pages based on the template – Publish the template “API” – the input parameters it supports • Create pages based on the template – In these pages, provide content for the facets exposed by the template – Provide values for input parameters supported by template • At any point in time: – change the template (reusing same facetRefs and parameters) – change the facet contents in any page – change template ref in a page (to template with same facets) • Can be done dynamically
  • 8. Defining the template
  • 9. Building the Layout
  • 10. Using the Attributes
  • 11. The Template Definition
  • 12. The Template UI components
  • 13. Demo
  • 14. Custom Components • Compose reusable ‘packages’ for frequently occurring combinations of ADF Faces/JSF components – Declarative reuse for consistency and productivity – Better encapsulation than page fragments – Internally a declarative component is built out of a combination of JSF components • Declarative components can be used like normal JSF components – They expose a number of attributes (that are wired to attributes of the internal JSF components) – They may have facets (to embed other JSF components) • Examples: LOV/DropDown Switcher, InputTime, Selection components for static domains, Button bars
  • 15. Custom Components • Choose JSF Declarative Component in the New Gallery • Specify the properties for the component – Name, Package, TaglibName – The attributes exposed to consumers of the components • And default values for the attributes – Methods – name and signature – to use for method bindings – Names of the facets that are published (and that will be used to embed JSF content inside the declarative component) • Create the content of the Component by assembling JSF components – much like you do for a Page Template – Using facetRef components, #{attrs.<attrName>} and #{component.<methodName>}
  • 16. Create Custom Component
  • 17. Defining the Component
  • 18. Building the UI
  • 19. Demo
  • 20. Stylesheets
  • 21. Demo
  • 22. Overview • Reusable components – Bounded Task Flows – Multi page, isolated memory scope – Controller and flow logic, executing business logic – Interface with input parameters and output events – Dynamically switching between regions – Role based authorization – Transaction management – Savepoints and Rollback support • Unbounded Task Flow – Bookmarking, …
  • 23. Examples
  • 24. Create a Bounded Task Flow
  • 25. Taskflows
  • 26. Building a Reusable Task Flow Catalog • Organizations may create a catalog of task flows • Reusable services, encapsulated with clear interfaces – Input parameters – Result – Events published • Such task flows can also be published by – Third parties – ‘the community’
  • 27. Demo
  • 28. Reusing Reusables: ADF Libraries • Sharing reusable assets – Task Flows, Stylsheets, PageTemplates and Custom Components – can be deployed and distributed through ADF Libraries (JAR files, design time) – ADF Libraries are added to consuming applications – When added, components from library can be reused in consuming application
  • 29. ADF Libraries • ADF Library enables you to reuse components: – Package them into ADF Library JAR files – Add them to a reusable component repository – Add the library to a project to use its components
  • 30. How does it work • Deploy the project that contains the component(s) to an ADF Library JAR – JDeveloper automatically adds the required Tag library for the declarative component(s) • Add the Library in consuming projects – Via the Resource Palette • Declarative components will show up on the Component Palette – They are used like normal components with attributes, method bindings and facets
  • 31. Deployment Profile
  • 32. Library Deployment
  • 33. Using an ADF Library
  • 34. Libraries are added
  • 35. What do we have so far ? • ADF Page Template • ADF Custom Component • ADF Style sheet • ADF Taskflow
  • 36. Using the Template
  • 37. Setting attribute values
  • 38. Using the Stylesheet
  • 39. Using the Custom Component
  • 40. Using the Taskflow
  • 41. Setting up the region
  • 42. Refreshing the region
  • 43. Demo
  • 44. Lets make some Changes • All Reusable components can be changed • Will have immediate effect in the application – After redeployment of the library
  • 45. Other Topic : Reuse in ADF BC • Declarative Model Driven functionality – Most Recently Used, UI Hints – List of Values, Model Driven Query Form • Entity Object Business Logic Group • View Criteria – Multiple faces on the same ViewObject • Shared Application Module – Reuse data across sessions
  • 46. Summary • ADF Provides mechanisms for reuse • Initial investment • Payback time is later • Considerations: – Is it reusable ? – Will I reuse it ? • But also – Modularity – Maintainability – Increased Productivity
  • 47. Luc Bors, AMIS, The Netherlands Luc.Bors@amis.nl LucBors@gmail.com Follow me on : @lucb_