Apache Trinidad - First class JSF components and more

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

2 comments

Comments 1 - 2 of 2 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

Notes on slide 1

Bring up on stage two customers to tell the audience about their experiences. Manpower Associates is a $14.9B global company with 27,000 employees in the temporary staffing business. Manpower runs a combined PeopleSoft Enterprise and JD Edwards EnterpriseOne shop. These experts in human resources use Enterprise HCM for their own staffing and EnterpriseOne Payroll and Service Billing for handling the large volumes of US-based temporary staff. Manpower is very happy with Oracle’s support since purchasing PeopleSoft and is looking forward to a long relationship with Oracle. Spokesperson will be Jay Schaudies, Vice President, Global eCommerce. Welch Foods is the food processing and marketing arm of National Grape Cooperative Association. Organized in 1945, National Grape is a grower-owned agricultural cooperative with 1,461 members. The company, headquartered in Concord, Massachusetts, operates six plants located in Michigan, New York, Pennsylvania and Washington. The company was running a mix of legacy, home grown, and manual systems that failed to provide senior management with accurate and timely cost and production information. Welch’s required a centralized manufacturing and financial information system to improve management decision making. The solution had to be hot-pluggable with existing technologies, for example, Welch’s Plumtree portal. Welch Foods chose Oracle over SAP for this business-critical application. The key to the customer’s business problem was their ability to manage costs. The company’s costs are driven by fruit solid content in each of their products, and they use a specialized technique called BRIX for measuring and calculating the cost of materials. Welch’s compared SAP and Oracle SAP’s software was too rigid and, therefore, unable to include the BRIX calculation in their manufacturing solution. Only Oracle’s OPM could bind this custom cost method into the Quality Management Process. Technology customer yet to be determined. Current possibilities include eBay and FTD Florists.

7 Favorites

Apache Trinidad - First class JSF components and more - Presentation Transcript

  1.  
  2. Apache Trinidad – First class JSF components and more! Matthias Wessendorf | <matzew AT apache DOT org> - Software Developer -
  3. Matthias Wessendorf
    • Works for Oracle Corp.
    • Apache MyFaces (the free JSF impl.)
      • Committer and PMC
    • Apache Shale (Framework on top of JSF)
      • Committer and PMC
    • Apache Jakarta Commons (bunch of goodies)
      • Committer
    • Author
      • German Struts Book,
      • Mini-Book on mobile WebServices with Apache Axis, J2ME and WML
      • German JavaMagazine and Eclipse-Magazine
    • Speaker on international conferences
      • JAX, WJAX, ApacheCon, Oracle Open World
  4. Disclaimer
      • Apache Trinidad is an effort undergoing incubation at The
      • Apache Software Foundation (ASF), sponsored by the Apache
      • MyFaces PMC. Incubation is required of all newly accepted
      • projects until a further review indicates that the infrastructure,
      • communications, and decision making process have stabilized
      • in a manner consistent with other successful ASF projects.
      • While incubation status is not necessarily a reflection of the
      • completeness or stability of the code, it does indicate that the
      • project has yet to be fully endorsed by the ASF
  5. Overall Presentation Goal
      • Learn about the technical sides of the Apache Trinidad project.
  6. Agenda
    • The Trinidad Project
    • The component show
      • Which components are in?
      • Demo of some…
    • The Framework
      • HTML Ajax RenderKit
      • Dialog Framework
      • Optimized Component Storage
      • Menu Model Abstraction
      • Maven 2 Faces plugin
      • Personalization Framework
      • RenderKit Skinning Architecture
  7. The Apache Trinidad Project
    • A donation by Oracle
    • Sponsored by Apache MyFaces PMC
      • Mentor Craig McClanahan (Mr. Struts)
    • Apache Incubator
      • 7 committers (three from Oracle)
      • Growing community
    • Apache 2.0 License (of course!)
  8. What has been donated? [1]
    • JSF Components
      • ~100 Components + Helpers
    • None Component Features
      • HTML AJAX RenderKit
      • Dialog Framework
      • Optimized Component Storage
      • Test Framework
  9. What has been donated? [2]
      • Menu Model Abstraction
      • Maven 2 Faces Plugin
          • Used to build Trinidad
          • Generates Components, Tags and XML files
      • Personalization Framework
      • RenderKit Skinning Architecture
      • Facelets support!
  10. The Component Show Take a seat and relax !
  11. Core Components [1]
    • <tr:breadCrumbs/>
    • <tr:chooseColor/>
    • <tr:chooseDate/>
    • <tr:column/>
    • <tr:commandButton />
    • <tr:commandLink />
  12. ChooseDate
    • The chooseDate component is used in conjunction with a inputDate
    • quick select for a date without secondary window.
    • < tr:chooseDate id=„ch1&quot; shortDesc=&quot;Choose Date&quot;/> < tr:inputDate id=&quot;df1a&quot; chooseId=„ch1„ shortDesc=&quot;Choose Date&quot;/>
  13. Core Components [2]
    • <tr:commandNavigationItem />
    • <tr:document/>
    • <tr:form/>
    • <tr:goButton />
    • <tr:goLink />
    • <tr:group />
    • <tr:icon />
  14. Document
    • creates these HTML elements:
      • <html>, <body>, and <head>,
    • can be used in non-HTML pages as well
    • < tr:document>  <f:facet name=&quot;metaContainer&quot;>    <f:verbatim><script...../></f:verbatim>  </f:facet> </tr:document>
  15. Core Components [3]
    • <tr:image />
    • <tr:importScript />
    • <tr:inputColor />
    • <tr:inputDate />
    • <tr:inputFile />
    • <tr:inputHidden />
    • <tr:inputListOfValues /> aka LOV 
  16. ListOfValues
    • special form of a text field component
    • with dialog support to select a value
      • Trinidad Dialog Framework (later!)
    • Code:
    • <tr:inputListOfValues label=„Country:&quot; value=„#{bean.value}&quot;
    • searchDesc=&quot;Pick your country&quot; action=&quot;dialog:periodicTable&quot; />
  17. Core Components [4]
    • <tr:inputNumberSpinbox />
    • <tr:inputText />
    • <tr:iterator />
    • <tr:ledgend />
    • <tr:media />
    • <tr:message />
    • <tr:messages />
  18. InputNumberSpinbox
    • special input component (for numbers)
    • input widget and up/down arrows
    • stepSize for increase or decrease
    • Code:
    • <tr:inputNumberSpinbox value=„#{bean.year}“ minimum=„1900“ maximum=„2050“/>
  19. Core Components [5]
    • <tr:navigationPane/>
    • <tr:navigationTree />
    • <tr:outputDocument />
    • <tr:outputFormatted />
    • <tr:outputLabel />
    • <tr:outputText />
    • <tr:page />
  20. NavigationPane / Tree
    • creates a series of navigation items
    • A node that is on the focus path will be rendered as &quot;selected&quot;.
    • Code:
    • <tr:navigationPane hint=&quot;tabs&quot; >
    • <tr:commandNavigationItem text=&quot;Page 1&quot; partialSubmit=&quot;true&quot; actionListener=&quot;#{demoCommandNavigationItem.navigationItemAction}&quot;/>
    • ... </tr:navigationPane>
  21. Core Components [6]
    • <tr:panelAccordion />
    • <tr:panelBorderLayout />
    • <tr:panelBox />
    • <tr:panelButtonBar />
    • <tr:panelChoice />
    • <tr:panelFormLayout />
    • <tr:panelGroupLayout/>
  22. Core Components [7]
    • <tr:panelHeader />
    • <tr:panelHorizontalLayout />
    • <tr:panelLabelAndMessage />
    • <tr:panelList />
    • <tr:panelPage />
    • <tr:panelPageHeader />
    • <tr:panelPartialRoot />
  23. PanelLabelAndMessage
    • Layout component
    • Children mostly input components
    • Facet support (help / end)
    • Code:
    • <tr:panelLabelAndMessage for=&quot;selectDate&quot;>
    • <f:facet name=&quot;help&quot;>
    • <tr:outputText value=&quot;Pick a date&quot;/>
    • </f:facet>
    • <tr:inputDate id=&quot;selectDate&quot; simple=&quot;true&quot;/>
    • </tr:panelLabelAndMessage>
  24. Core Components [8]
    • <tr:panelRadio />
    • <tr:panelSideBar />
    • <tr:panelTabbed />
    • <tr:panelTip />
    • <tr:poll/>
    • <tr:processChoiceBar />
    • <tr:progessIndicator />
  25. Poll / ProgressIndicator
    • Poll sends PPR request (in mil. seconds)
    • ProgressIndicator has special Model clazz
      • BoundedRangeModel (abstract) and impl DefaultBoundedRangeModel
    • Code
    • <tr:poll id=“poll” interval=“2000” />
    • <tr:progressIndicator action=“end” partialTriggers=“poll” value=“#{bean.model}”>
    • … ..
  26. Core Components [9]
    • <tr:resetButton />
    • <tr:selectBooleanCheckbox />
    • <tr:selectBooleanRadio />
    • <tr:selectItem />
    • <tr:selectManyCheckbox />
    • <tr:selectManyListbox />
  27. SelectManyCheckbox
    • Creates a series of checkbox fields
    • Code:
    • <tr:selectManyCheckbox label=&quot;Label&quot; value=&quot;#{list.intArray}&quot;>
    • <tr:selectItem label=&quot;First&quot; value=&quot;1&quot;/> <tr:selectItem label=&quot;Second&quot; value=&quot;2&quot;/> <tr:selectItem label=&quot;Third&quot; value=&quot;3&quot;/>
    • </tr:selectManyCheckbox>
  28. Core Components [10]
    • <tr:selectManyShuttle />
    • <tr:selectOneChoice />
    • <tr:selectOneListbox />
    • <tr:selectOneRadio />
    • <tr:selectOrderShuttle />
    • <tr:selectRangeChoiceBar />
    • <tr:separator />
  29. ShuttleManyShuttle SelectOrderShuttle
    • Component for moving values from a leading side to a trailing side (“pick list”)
    • Code:
    • <tr:selectManyShuttle value=“#{bean.value}”>
    • <f:selectItems value=“#{bean.items}” />
    • </tr:selectManyShuttle>
    • <tr:selectOrderShuttle reorderOnly=“true”> ...
  30. Core Components [11]
    • <tr:showDetail />
    • <tr:showDetailHeader />
    • <tr:showDetailItem />
    • <tr:singleStepButtonBar />
    • <tr:spacer />
    • <tr:subform />
    • <tr:switcher />
  31. SingleStepButtonBar
    • Renders two buttons
      • Previous
      • Next
      • Text for the current “state”
    • Code:
    • <tr:singleStepButtonBar id=&quot;singleStep1&quot; selectedStep=&quot;2&quot; maxStep=&quot;5&quot; text=&quot;Stage&quot; previousAction=&quot;#{action.app1}&quot; nextAction=&quot;#{action.app2}&quot; />
  32. Core Components [12]
    • <tr:table />
    • <tr:train />
    • <tr:tree />
    • <tr:treeTable />
  33. Train (Navigation)
    • Navigation Component
    • Renders “train stations”
    • Works with abstract MenuModel clazz
    • Code:
      • <tr:train var=&quot;node&quot; value=&quot;#{processMenuModel}&quot;>
      • <f:facet name=&quot;nodeStamp&quot;>
      • <tr:commandNavigationItem text=&quot;#{node.label}&quot;
      • action=&quot;#{node.getOutcome}“ immediate= “#{processMenuModel.immediate}“ /> </f:facet>
      • </tr:train>
  34. HTML Components [1]
    • <tr:body />
    • <tr:cellFormat />
    • <tr:frame />
    • <tr:frameBorderLayout />
    • <tr:head />
  35. HTML Components [2]
    • <tr:html />
    • <tr:rowLayout />
    • <tr:script />
    • <tr:styleSheet />
    • <tr:tableLayout />
  36. Helper Objects [1]
    • <tr:attribute /> (not in JSF 1.2 branch)
    • <tr:forEach /> (not in JSF 1.2 branch)
    • <tr:validator /> (not in JSF 1.2 branch)
    • <tr:colorConverter />
    • <tr:dateTimeConverter />
    • <tr:numberConverter />
  37. Helper Objects [2]
    • <tr:resetActionListener />
    • <tr:returnActionListener />
    • <tr:setActionListener /> (JSF 1.2 *)
    • <tr:byteLengthValidator />
    • <tr:dateTimeRangeValidator />
    • <tr:regExpValidator />
  38. Benefit of <tr:xxx />
  39. Trinidad JSF Tags …
    • No need for the usage of all Trinidad tags
      • unlike Tobago does...
        • Tobago is an Apache MyFaces subproject
    • Tags can be mix with standard tags!
    • Trinidad tags more powerful:
      • Often more features
      • Usable inside <tr:forEach /> (standard not)
      • More efficient client side state saving
        • reduced per component size
  40. Standard vs Trinidad
    • accesskey - accessKey
    • readonly - readOnly
    • alt and/or title - shortDesc
    • Style - inlineStyle
    • dir , lang , tabindex - n/a (dir by skinning)
  41. Standard vs Trinidad ...
    • commandButton
      • value vs. text
    • form
      • Not a NamingContainer (in Trinidad ;))
        • Supports better legacy JS
    • inputSecret
      • Not in Trinidad, use secret attr. on inputText
    • And more… (see http://incubator.apache.org/adffaces/spec-diff.html )
  42. Only that few components? What‘s more in there?
  43. HTML AJAX RenderKit
    • aka PPR (Partial Page Rendering)
    • Incremental DOM update service
    • <iframe> communication channel (no XmlHttpRequest …)
      • Supports file upload
    • Client-side validation (don’t call form.submit())
    • Built-in support for all components
      • Advanced support e.g. Table data paging
  44. PPR usage inside the components
    • Three important attributes
      • autoSubmit
        • For input components to fire an action
      • partialSubmit
        • For command components (link/button)
      • partialTriggers
        • For “listeners”
          • Refers to a partial/auto Submit component
          • “ repainting” this component
  45. Code for PPR usages
    • <tr:selectOneRadio value=&quot;#{partialBean.selectOne}&quot; autoSubmit=&quot;true&quot; id=&quot;select1&quot; >
    • <tr:selectItem label=&quot;First&quot; value=&quot;Beer&quot;/>
    • <tr:selectItem label=&quot;Second&quot; value=&quot;more beer&quot;/>
    • <tr:selectItem label=&quot;Third&quot; value=&quot;sold out!&quot;/>
    • </tr:selectOneRadio>
    • <tr:outputText value=&quot;#{partialBean.selectOne}&quot;
    • partialTriggers=&quot;select1&quot; />
  46. Poll component
    • Implement a stocks ticker
    • Implement a “heartbeat” for enforcing a logout.
    • Code:
    • <tr:poll pollListener=&quot;#{stocksBean.onPoll}&quot; interval=&quot;2000&quot; id=&quot;pollid&quot; />
    • <tr:table id=&quot;data&quot; binding=&quot;#{stocksBean.table}&quot; border=&quot;2&quot; partialTriggers=&quot;pollid&quot; var=&quot;stock&quot;>
    • ...
    • </tr:table>
  47. Poll component (The Bean)
    • PollEvent / PollListener
    • public void onPoll(PollEvent event)
    • {
    • initStocks();
    • }
  48. Dialog Framework
    • Nested temporary page flows
      • wizards
    • Enhanced Faces navigation outcome
      • action=“ dialog: wizard” (configurable)
    • Isolated dialog/process scope
      • #{ processScope. wizardBean}
    • LaunchEvent and ReturnEvent
  49. Dialog Framework
    • A possible button:
    • <tr:commandButton id=&quot;button2&quot; text=&quot;No Account?&quot; action=&quot;#{dialogBean.createAccount}&quot; launchListener=&quot;#{dialogBean.launch}&quot;
    • returnListener=&quot;#{dialogBean.returned}&quot; immediate=&quot;true&quot; useWindow=&quot;true&quot; windowWidth=&quot;250&quot; windowHeight=&quot;250&quot; />
  50. Dialog Framework (Bean)
    • public String createAccount()
    • {
    • RequestContext rCtx = RequestContext.getCurrentInstance();
    • Map<String, Object> process = rCtx.getPageFlowScope();
    • process.put(&quot;tmpUser&quot;, new User());
    • return &quot;dialog:newAccount&quot;;
    • }
    • public void returned(ReturnEvent event)
    • {
    • User u = (User) event.getReturnValue();
    • ...
    • RequestContext.getCurrentInstance().getPageFlowScope().clear()
    • }
  51. Optimized Component Storage
    • UIComponentBase is JavaBean-major
      • uses reflection for Map-access
    • New UIXComponentBase is Map-major
      • JavaBean property methods delegate to Map
      • Map uses PropertyKeys for optimized performance
    • Eliminate the need to write saveState() and restoreState() component methods
  52. “ classic” JavaServer Faces comp.
    • “ normal” setter methods / “funny” getter methods
    • public String getFoo()
    • {
    • if (_foo != null)
    • return _foo;
    • ValueBinding vb = getValueBinding(“foo&quot;);
    • return vb != null ? (String)vb.getValue(getFacesContext()) : null; }
  53. Trinidad component
    • Generated Components… (later)
    • Using getProperty() / setProperty()
      • UIXComponentBase
    • final public String getFoo()
    • { return ComponentUtils.resolveString(getProperty(FOO_KEY));
    • }
  54. Menu Model Abstraction
    • Many application share the same menus
    • MenuModel makes it easy to share
    • Definition driven by faces-config.xml
    • Automatically manages the currently selected menu item
    • Page component displays up to 4 levels of hierarchical menus
  55. Maven 2 Faces Plugin
    • JavaCC Plugin
      • legacy
    • TagDoc Plugin
      • generates tag documentation for JSF (see here)
      • faces-config.xml metadata based
      • documentation of facets / events
    • i18n Plugin
    • JavaScript Plugin
      • Obfuscator, …
    • Jdev Plugin
    • XTRS Plugin
  56. Maven 2 Faces Plugin
    • Writing custom components is repetitive
      • UIComponent, faces-config.xml, UIComponentTag, tag-library.tld
    • Use faces-config.xml as single source of truth to generate all the relevant artifacts
    • Automatically merge in hand-written code, if necessary
  57. Components with Trinidad
    • 2 xml files in “trinidad-build” project
      • component
      • renderer
    • Renderer clazz in “trinidad-impl” project
    • DONE!
  58. Maven 2 Archetype
    • Getting started with Trinidad
    • Simple Hello World project
      • your project template … ?
    • don’t worry with all the details…
    • combined with Jetty (OS Servlet Container)
      • mvn clean jetty:run
  59. Personalization Framework
    • One web application is shared by many end-users
      • they each want to customize the appearance
      • e.g. swapping the order of components
    • ChangeManager is notified when customizations are made by end-users
      • supports session-based customization
  60. RenderKit Extension
    • Send JavaScript to client
    • Code:
    • FacesContext facesContext = FacesContext.getCurrentInstance();
    • ExtendedRenderKitService service = (ExtendedRenderKitService)
    • Service.getRenderKitService(facesContext, ExtendedRenderKitService.class);
    • service.addScript(facesContext, &quot;alert('Script added by ExtendedRenderKitService')&quot;);
  61. RenderKit Skinning Architecture
    • Customizable look and feel
      • portable across applications
      • portable across RenderKits
      • zero code
    • CSS 3.0 syntax
    • Component-centric, not DOM-centric
    • Pseudo-elements
      • af|inputDate::launch-icon { … }
  62. RenderKit Skinning Architecture
    • Create a CSS File
      • Pseudo-elements
        • af|inputDate::launch-icon { … }
    • Register it at trinidad-config.xml and trinidad-skins.xml
  63. If You Only Remember One Thing…
    • Apache Trinidad has some added values…
    • How will you contribute?
    • Apache Wiki for informations:
    • http://wiki.apache.org/myfaces/ADF_Faces
  64. Related Sessions Today!
    • Security in JSF (S281850) 11:15 -> 12:15
      • Frank Nimphius / Ric Smith
    • Open Source Practices (S283655) 01:15 -> 02:15
      • Brian Behlendorf (Apache Software Foundation)
    • Rich UIs w/ JSF (S281861) 03:45 -> 04:45
      • Frank Nimphius
  65. Q & A

+ mwessendorfmwessendorf, 4 years ago

custom

23870 views, 7 favs, 5 embeds more stats

Session which covers Apache Trinidad and its featur more

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 23870
    • 23864 on SlideShare
    • 6 from embeds
  • Comments 2
  • Favorites 7
  • Downloads 0
Most viewed embeds
  • 2 views on http://www.filescon.com
  • 1 views on http://www.3tools.de
  • 1 views on http://gmodules.com
  • 1 views on http://s3.amazonaws.com
  • 1 views on http://www.rapidsharego.com

more

All embeds
  • 2 views on http://www.filescon.com
  • 1 views on http://www.3tools.de
  • 1 views on http://gmodules.com
  • 1 views on http://s3.amazonaws.com
  • 1 views on http://www.rapidsharego.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories