SlideShare uma empresa Scribd logo
1 de 45
Apache MyFaces Planet
             Çağatay Çivici
About Me
•   Apache MyFaces PMC(Project Management Committee) member
•   Co-Author of “The Definitive Guide to Apache MyFaces and Facelets” from
    APRESS
•   Reference in “Core JavaServer Faces 2nd Edition”
•   Recognized speaker in international and local conferences
•   Oracle RCF(Rich Client Framework) member
•   Krank (CRUD Framework for JSF-Spring-JPA) member
•   Sourceforge jsf-comp member
•   Spring Security(Acegi) JSF Integration author
•   JSF Chart Creator project lead
•   FacesTrace project lead
•   YUI4JSF project lead
•   FC Barcelona Fan
•   Blog: http://www.prime.com.tr/cagataycivici
•   Prime Technology - 2008
RoadMap
• History
• Core
   – API
   – IMPL
• Tomahawk
• Tomahawk Sandbox
• Trinidad
• Tobago
• Portlet Bridge
• Orchestra
• Future
History
•   Founders: Thomas Spiegl and Manfred Geiler
•   2002 – sourceforge.net
•   2003 – first stable release
•   2004 – Moved to Apache Software Foundation
•   40+ committers
Core Implementation
•   JSF1.1 (JSR-127) – API&Implementation
•   JSF1.2 (JSR-252) – API&Implementation
•   JSF 2.0 – Coming soon…
•   Certified against the Sun TCK to ensure
    compliance
Tomahawk
• Extended versions of standard
  Components
  – <t:inputText />, <t:dataTable />, <t:selectItems />
    etc…
• Rich set of custom components
  – <t:schedule />, <t:inputDate />, <t:picklist /> etc…
• Tiles support via JSPTilesViewHandler
• Coolest sandbox project ever
• Famous Extensions Filter
Tomahawk Demo
Tomahawk Sandbox
• Test ground for promotion
• Many custom components
  – AccordionPanel
  – Captcha
  – passwordStrength
  – clientSideValidation
  – Exporter(ActionListener)
  – PPR
  – Much more…
Tomahawk Sandbox Demo
Trinidad
•   ADF Faces Donation by Oracle
•   Suite with various components
•   PageFlowScope
•   Dialog Framework
•   Partial Page Rendering
•   Skinning
•   Client Side Validation & Conversion
•   Optimized State Management
Trinidad Component Demo
Trinidad - PageFlowScope
•   Pass data between pages
•   Multiple windows support
•   EL support: #{pageFlowScope.something}
•   Not a valid managed-bean scope
•   Clear manually
     RequestContext requestContext = RequestContext.getCurrentInstance();
     requestContext.getPageFlowScope().put(quot;someKeyquot;, someValue);
Trinidad - PPR
• Built-in Ajax Support
Trinidad – PPR
• partialSubmit and partialTriggers
   <tr:commandButton id=“btn” text=“Incrementquot;
                            partialSubmit=quot;truequot;
                            actionListener=quot;#{backingBean.increment}quot;/>

    <tr:outputText value=quot;#{backingBean.number}quot; partialTriggers=“btnquot;/>




     public void increment(ActionEvent event) {
       number++;
     }
Trinidad - PPR
• tr:poll

   <tr:poll pollListener=quot;#{backingBean.onPoll}quot; interval=quot;2000quot; id=“pollquot; />

   <tr:outputText value=quot;#{backingBean.number}quot; partialTriggers=“pollquot;/>




      public void onPoll(PollEvent pollEvent) {
               number ++;
      }
Trinidad - PPR
• <tr:statusIndicator />
• PPR Javascript API
• PPR API for custom component development
Trinidad – Dialog Framework
 • Get data from a popup window(dialog)
                                  pageThatLaunchesDialog.xhtml
               <tr:commandButton text=“Select Employeequot;
                                    action=quot;dialog:selectEmployee“
                                    useWindow=“true”
                                    partialSubmit=“true”
                                    returnListener=quot;#{backingBean.handleReturn}” />


           Navigate to Dialog                               PageThatLaunchesDialog.java

<navigation-rule>
                                                      public void handleReturn(ReturnEvent event) {
  <from-view-id>/*</from-view-id>
                                                                    Object returnedValue = event.getReturnValue();
  <navigation-case>
                                                      }
     <from-outcome>dialog:showDetail</from-outcome>
     <to-view-id>/showDetail.jspx</to-view-id>
  </navigation-case>
</navigation-rule>
Trinidad – Dialog Framework
• Dialog itself
                           SelectEmployee.xhtml
   …
   …
   …
    <tr:commandButton action=“#{selectEmployeeBean.handleSelect}” />
   …
   …
   …


                              SelectEmployee.java
     public void handleSelect() {
       Employee employee = getSelectEmployee();
       RequestContext.getCurrentInstance().returnFromDialog(employee, null);
     }
Trinidad – Dialog Framework
• Passing data
   <tr:commandButton text=“Select Employeequot;
                     action=quot;dialog:selectEmployee“
                     useWindow=“true”
                     partialSubmit=“true”
                     returnListener=quot;#{backingBean.handleReturn}”
                     launchListener=“#{backingBean.handleLaunch}”/>


    public void handleLaunch(LaunchEvent event) {
      event.getDialogParameters().put(“departmentquot;, getDepartment());
    }


• Use pageFlowScope to get the passed data
Trinidad – Dialog Framework
• <tr:inputListOfValues />

    <tr:inputListOfValues label=“…quot;
                  value=“#{backingBean.employee}quot;
                  action=quot;dialog:selectEmployeequot;
                  windowWidth=“400quot;
                  windowHeight=“300quot;/>
Trinidad - Skinning
• Each component is skinnable (selectors)
• Switch skins dynamically
• Not just CSS
Trinidad – Create a Skin
• Create trinidad-skins.xml
• Create the CSS itself
• Configure in trinidad-config.xml
Trinidad – Create a skin
• trinidad-skins.xml

   <?xml version=quot;1.0quot; encoding=quot;ISO-8859-1quot;?>
   <skins xmlns=quot;http://myfaces.apache.org/trinidad/skinquot;>
   <skin>
      <id>aqua.desktop</id>
      <family>aqua</family>
      <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
      <style-sheet-name>skins/aqua/aqua.css</style-sheet-name>
      <extends>xyz</extends>
      <bundle-name> org.apache.myfaces.trinidaddemo.resource.SkinBundle
   </bundle-name>
   </skin>
   </skins>
Trinidad – Create a skin
• aqua.css
     body { background-color: aqua }
     .AFDefaultFontFamily:alias { font-family: cursive; }
     .AFDefaultFont:alias { font-size: 14px }

     af|inputDate::launch-icon
     {
       content: url(/images/calendar/calendar_icon.gif);
     }

     af|inputNumberSpinbox::content {
              -tr-inhibit: all;
     }
Trinidad – Create a skin
• trinidad-config.xml

   <?xml version=quot;1.0quot;?>
   <trinidad-config xmlns=quot;http://myfaces.apache.org/trinidad/configquot;>
             <skin-family>aqua</skin-family>
   </trinidad-config>
Trinidad - Skinning
• Switch skin at runtime

   <?xml version=quot;1.0quot;?>
   <trinidad-config xmlns=quot;http://myfaces.apache.org/trinidad/configquot;>
             <skin-family>#{userPreferences.skinName}</skin-family>
   </trinidad-config>
Trinidad - Skinning
• Not just CSS
      @platform windows, linux
          {
            @agent ie, gecko
            {
              af|inputDate::title {
                   background-color: purple;
                                }
            }

               @agent mozilla
               {
                 af|inputDate::title {
                      background-color: yellow;
                      }
               }
           }
Trinidad – Client Side
Validation&Conversion
• Client side API for validation&conversion
  – function TrConverter() { }
  – TrConverter.prototype.getAsString = function(value, label){}
  – TrConverter.prototype.getAsObject = function(value, label){}
  – function TrValidator()
  – TrValidator.prototype.validate=function(value, label,
    converter){}
  – function TrFacesMessage( summary, detail, severity )
Trinidad – Create your own
• ClientValidator and ClientConverter interfaces
  –   getClientConversion(FacesContext facesContext, UIComponent component)
  –   getClientImportNames
  –   getClientLibraryResource
  –   getClientScript(FacesContext facesContext, UIComponent component)
Trinidad –
CreditCardValidator.js
   CreditCardValidator = function() {}

   CreditCardValidator.prototype = new TrValidator();

    CreditCardValidator.prototype.validate = function(value, label, converter) {
               …
        if(valueIsInvalid)        {
            var facesMessage = new TrFacesMessage
            (TrFacesMessage.SEVERITY_ERROR,quot;Validation Errorquot;,“CC is not validquot;);
                         throw new TrValidatorException(facesMessage);
               }
   }
Tobago
• Various components
• Layout Manager
• Skinning
Tobago Demo
Portlet Bridge
• Develop portlets with JSF
• RI of JSR-301(Portlet Bridge for JSF)
• Adresses Portlet-1.0 and Portlet-2.0 specs
Portlet Bridge Demo
•   Apache MyFaces 1.2.3
•   Pluto 1.1.6
•   Tomcat 6
•   MyFaces Portlet Bridge 1.0.0-alpha 2
Orchestra
• Spring based
• Long unit of work
• Conversation Scopes Access
    – Manual
• Conversation scoped persistence-contexts
    – No more Lazy exceptions
•   DynaForm
•   ViewController
•   Multiple window support
•   Persistence Context per Conversation
Orchestra Scopes
Manual Conversation




Access Conversation
Orchestra Scopes
• @Component(“customerController”)
  @Scope(“conversation.access” or “conversation.manual”)
  public class CustomerController {
       …
  }
• Reference as;
• <h:inputText value=“#{customerController.customer.name}” />
Persistence Support
Orchestra - ViewController
• @ViewController(viewIds={“createCustomer.jsp”})
       public class MultiViewController {
  }
• @initView – after RESTORE_VIEW
• @preProcess – after INVOKE_APPLICATION
• @preRenderView – before RENDER_RESPONSE
Orchestra Demo
IDE Support
• Eclipse Ganymede
  – Trinidad
• JDeveloper
  – Trinidad
• JBoss Tools (limited)
  – Trinidad, Tomahawk, Tobago
Help and Support
• Mailing List:
  – users@myfaces.apache.org
  – Archieved at nabble, mail-archieve
• Issue Tracking: JIRA
• Wiki
  – http://wiki.apache.org/myfaces/
Future of MyFaces
• MyFaces 2.0 (JSF 2.0 Implementation)
• Oracle RCF Donation
• Richer…
The Definitive Guide
The End
• cagatay@apache.org
• http://www.prime.com.tr/cagataycivici
• PlayStation3 online id: facescontext

Mais conteúdo relacionado

Mais procurados

JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)Roger Kitain
 
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces Skills Matter
 
Securing JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top TenSecuring JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top TenDavid Chandler
 
Primefaces Confess 2012
Primefaces Confess 2012Primefaces Confess 2012
Primefaces Confess 2012cagataycivici
 
JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)Alexander Casall
 
What You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFWhat You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFMax Katz
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedBG Java EE Course
 
Djangoアプリのデプロイに関するプラクティス / Deploy django application
Djangoアプリのデプロイに関するプラクティス / Deploy django applicationDjangoアプリのデプロイに関するプラクティス / Deploy django application
Djangoアプリのデプロイに関するプラクティス / Deploy django applicationMasashi Shibata
 
Enterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersEnterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersAndreCharland
 
JSF and Seam
JSF and SeamJSF and Seam
JSF and Seamyuvalb
 
Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Abhijeet Vaikar
 
The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014Tommie Gannert
 
PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事longfei.dong
 
Going Above JSF 2.0 with RichFaces and Seam
Going Above JSF 2.0 with RichFaces and SeamGoing Above JSF 2.0 with RichFaces and Seam
Going Above JSF 2.0 with RichFaces and SeamLincoln III
 
How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksCompare Infobase Limited
 

Mais procurados (20)

JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)JSF 2.0 (JavaEE Webinar)
JSF 2.0 (JavaEE Webinar)
 
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
 
Securing JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top TenSecuring JSF Applications Against the OWASP Top Ten
Securing JSF Applications Against the OWASP Top Ten
 
JavaFX Advanced
JavaFX AdvancedJavaFX Advanced
JavaFX Advanced
 
Primefaces Confess 2012
Primefaces Confess 2012Primefaces Confess 2012
Primefaces Confess 2012
 
JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)JavaFX in Action (devoxx'16)
JavaFX in Action (devoxx'16)
 
What You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSFWhat You Need To Build Cool Enterprise Applications With JSF
What You Need To Build Cool Enterprise Applications With JSF
 
Java Server Faces (JSF) - advanced
Java Server Faces (JSF) - advancedJava Server Faces (JSF) - advanced
Java Server Faces (JSF) - advanced
 
Unified Expression Language
Unified Expression LanguageUnified Expression Language
Unified Expression Language
 
Djangoアプリのデプロイに関するプラクティス / Deploy django application
Djangoアプリのデプロイに関するプラクティス / Deploy django applicationDjangoアプリのデプロイに関するプラクティス / Deploy django application
Djangoアプリのデプロイに関するプラクティス / Deploy django application
 
Enterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript DevelopersEnterprise AIR Development for JavaScript Developers
Enterprise AIR Development for JavaScript Developers
 
JSF and Seam
JSF and SeamJSF and Seam
JSF and Seam
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
 
Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...Breaking free from static abuse in test automation frameworks and using Sprin...
Breaking free from static abuse in test automation frameworks and using Sprin...
 
The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014The Structure of Web Code: A Case For Polymer, November 1, 2014
The Structure of Web Code: A Case For Polymer, November 1, 2014
 
Vaadin Components
Vaadin ComponentsVaadin Components
Vaadin Components
 
PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事PhoneGap:你应该知道的12件事
PhoneGap:你应该知道的12件事
 
Going Above JSF 2.0 with RichFaces and Seam
Going Above JSF 2.0 with RichFaces and SeamGoing Above JSF 2.0 with RichFaces and Seam
Going Above JSF 2.0 with RichFaces and Seam
 
How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML Tricks
 
Zend framework
Zend frameworkZend framework
Zend framework
 

Semelhante a Myfacesplanet

Ajax World Comet Talk
Ajax World Comet TalkAjax World Comet Talk
Ajax World Comet Talkrajivmordani
 
Introduction to AJAX and DWR
Introduction to AJAX and DWRIntroduction to AJAX and DWR
Introduction to AJAX and DWRSweNz FixEd
 
Devclub Servicemix Jevgeni Holodkov 23 04 09
Devclub Servicemix Jevgeni Holodkov 23 04 09Devclub Servicemix Jevgeni Holodkov 23 04 09
Devclub Servicemix Jevgeni Holodkov 23 04 09helggeist
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen LjuSkills Matter
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen LjuSkills Matter
 
And the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack SupportAnd the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack SupportBen Scofield
 
Orbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyOrbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyMark Meeker
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone InteractivityEric Steele
 
Ruslan Platonov - Transactions
Ruslan Platonov - TransactionsRuslan Platonov - Transactions
Ruslan Platonov - TransactionsDmitry Buzdin
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...goodfriday
 
Taking Apache Camel For A Ride
Taking Apache Camel For A RideTaking Apache Camel For A Ride
Taking Apache Camel For A RideBruce Snyder
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSCarol McDonald
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
 
Liferay Training Struts Portlet
Liferay Training Struts PortletLiferay Training Struts Portlet
Liferay Training Struts PortletSaikrishna Basetti
 
Application Layer in PHP
Application Layer in PHPApplication Layer in PHP
Application Layer in PHPPer Bernhardt
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Matt Raible
 
Real time web (Orbited) at BCNE3
Real time web (Orbited) at BCNE3Real time web (Orbited) at BCNE3
Real time web (Orbited) at BCNE3Alex Kavanagh
 

Semelhante a Myfacesplanet (20)

Ajax World Comet Talk
Ajax World Comet TalkAjax World Comet Talk
Ajax World Comet Talk
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
 
Introduction to AJAX and DWR
Introduction to AJAX and DWRIntroduction to AJAX and DWR
Introduction to AJAX and DWR
 
Devclub Servicemix Jevgeni Holodkov 23 04 09
Devclub Servicemix Jevgeni Holodkov 23 04 09Devclub Servicemix Jevgeni Holodkov 23 04 09
Devclub Servicemix Jevgeni Holodkov 23 04 09
 
Riding Apache Camel
Riding Apache CamelRiding Apache Camel
Riding Apache Camel
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen Lju
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen Lju
 
And the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack SupportAnd the Greatest of These Is ... Rack Support
And the Greatest of These Is ... Rack Support
 
Orbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case StudyOrbitz and Spring Webflow Case Study
Orbitz and Spring Webflow Case Study
 
Plone Interactivity
Plone InteractivityPlone Interactivity
Plone Interactivity
 
Ruslan Platonov - Transactions
Ruslan Platonov - TransactionsRuslan Platonov - Transactions
Ruslan Platonov - Transactions
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
Building AOL's High Performance, Enterprise Wide Mail Application With Silver...
 
Taking Apache Camel For A Ride
Taking Apache Camel For A RideTaking Apache Camel For A Ride
Taking Apache Camel For A Ride
 
Interoperable Web Services with JAX-WS
Interoperable Web Services with JAX-WSInteroperable Web Services with JAX-WS
Interoperable Web Services with JAX-WS
 
Open Source Ajax Solution @OSDC.tw 2009
Open Source Ajax  Solution @OSDC.tw 2009Open Source Ajax  Solution @OSDC.tw 2009
Open Source Ajax Solution @OSDC.tw 2009
 
Liferay Training Struts Portlet
Liferay Training Struts PortletLiferay Training Struts Portlet
Liferay Training Struts Portlet
 
Application Layer in PHP
Application Layer in PHPApplication Layer in PHP
Application Layer in PHP
 
Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2Migrating from Struts 1 to Struts 2
Migrating from Struts 1 to Struts 2
 
Real time web (Orbited) at BCNE3
Real time web (Orbited) at BCNE3Real time web (Orbited) at BCNE3
Real time web (Orbited) at BCNE3
 

Myfacesplanet

  • 1. Apache MyFaces Planet Çağatay Çivici
  • 2. About Me • Apache MyFaces PMC(Project Management Committee) member • Co-Author of “The Definitive Guide to Apache MyFaces and Facelets” from APRESS • Reference in “Core JavaServer Faces 2nd Edition” • Recognized speaker in international and local conferences • Oracle RCF(Rich Client Framework) member • Krank (CRUD Framework for JSF-Spring-JPA) member • Sourceforge jsf-comp member • Spring Security(Acegi) JSF Integration author • JSF Chart Creator project lead • FacesTrace project lead • YUI4JSF project lead • FC Barcelona Fan • Blog: http://www.prime.com.tr/cagataycivici • Prime Technology - 2008
  • 3. RoadMap • History • Core – API – IMPL • Tomahawk • Tomahawk Sandbox • Trinidad • Tobago • Portlet Bridge • Orchestra • Future
  • 4. History • Founders: Thomas Spiegl and Manfred Geiler • 2002 – sourceforge.net • 2003 – first stable release • 2004 – Moved to Apache Software Foundation • 40+ committers
  • 5. Core Implementation • JSF1.1 (JSR-127) – API&Implementation • JSF1.2 (JSR-252) – API&Implementation • JSF 2.0 – Coming soon… • Certified against the Sun TCK to ensure compliance
  • 6. Tomahawk • Extended versions of standard Components – <t:inputText />, <t:dataTable />, <t:selectItems /> etc… • Rich set of custom components – <t:schedule />, <t:inputDate />, <t:picklist /> etc… • Tiles support via JSPTilesViewHandler • Coolest sandbox project ever • Famous Extensions Filter
  • 8. Tomahawk Sandbox • Test ground for promotion • Many custom components – AccordionPanel – Captcha – passwordStrength – clientSideValidation – Exporter(ActionListener) – PPR – Much more…
  • 10. Trinidad • ADF Faces Donation by Oracle • Suite with various components • PageFlowScope • Dialog Framework • Partial Page Rendering • Skinning • Client Side Validation & Conversion • Optimized State Management
  • 12. Trinidad - PageFlowScope • Pass data between pages • Multiple windows support • EL support: #{pageFlowScope.something} • Not a valid managed-bean scope • Clear manually RequestContext requestContext = RequestContext.getCurrentInstance(); requestContext.getPageFlowScope().put(quot;someKeyquot;, someValue);
  • 13. Trinidad - PPR • Built-in Ajax Support
  • 14. Trinidad – PPR • partialSubmit and partialTriggers <tr:commandButton id=“btn” text=“Incrementquot; partialSubmit=quot;truequot; actionListener=quot;#{backingBean.increment}quot;/> <tr:outputText value=quot;#{backingBean.number}quot; partialTriggers=“btnquot;/> public void increment(ActionEvent event) { number++; }
  • 15. Trinidad - PPR • tr:poll <tr:poll pollListener=quot;#{backingBean.onPoll}quot; interval=quot;2000quot; id=“pollquot; /> <tr:outputText value=quot;#{backingBean.number}quot; partialTriggers=“pollquot;/> public void onPoll(PollEvent pollEvent) { number ++; }
  • 16. Trinidad - PPR • <tr:statusIndicator /> • PPR Javascript API • PPR API for custom component development
  • 17. Trinidad – Dialog Framework • Get data from a popup window(dialog) pageThatLaunchesDialog.xhtml <tr:commandButton text=“Select Employeequot; action=quot;dialog:selectEmployee“ useWindow=“true” partialSubmit=“true” returnListener=quot;#{backingBean.handleReturn}” /> Navigate to Dialog PageThatLaunchesDialog.java <navigation-rule> public void handleReturn(ReturnEvent event) { <from-view-id>/*</from-view-id> Object returnedValue = event.getReturnValue(); <navigation-case> } <from-outcome>dialog:showDetail</from-outcome> <to-view-id>/showDetail.jspx</to-view-id> </navigation-case> </navigation-rule>
  • 18. Trinidad – Dialog Framework • Dialog itself SelectEmployee.xhtml … … … <tr:commandButton action=“#{selectEmployeeBean.handleSelect}” /> … … … SelectEmployee.java public void handleSelect() { Employee employee = getSelectEmployee(); RequestContext.getCurrentInstance().returnFromDialog(employee, null); }
  • 19. Trinidad – Dialog Framework • Passing data <tr:commandButton text=“Select Employeequot; action=quot;dialog:selectEmployee“ useWindow=“true” partialSubmit=“true” returnListener=quot;#{backingBean.handleReturn}” launchListener=“#{backingBean.handleLaunch}”/> public void handleLaunch(LaunchEvent event) { event.getDialogParameters().put(“departmentquot;, getDepartment()); } • Use pageFlowScope to get the passed data
  • 20. Trinidad – Dialog Framework • <tr:inputListOfValues /> <tr:inputListOfValues label=“…quot; value=“#{backingBean.employee}quot; action=quot;dialog:selectEmployeequot; windowWidth=“400quot; windowHeight=“300quot;/>
  • 21. Trinidad - Skinning • Each component is skinnable (selectors) • Switch skins dynamically • Not just CSS
  • 22. Trinidad – Create a Skin • Create trinidad-skins.xml • Create the CSS itself • Configure in trinidad-config.xml
  • 23. Trinidad – Create a skin • trinidad-skins.xml <?xml version=quot;1.0quot; encoding=quot;ISO-8859-1quot;?> <skins xmlns=quot;http://myfaces.apache.org/trinidad/skinquot;> <skin> <id>aqua.desktop</id> <family>aqua</family> <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id> <style-sheet-name>skins/aqua/aqua.css</style-sheet-name> <extends>xyz</extends> <bundle-name> org.apache.myfaces.trinidaddemo.resource.SkinBundle </bundle-name> </skin> </skins>
  • 24. Trinidad – Create a skin • aqua.css body { background-color: aqua } .AFDefaultFontFamily:alias { font-family: cursive; } .AFDefaultFont:alias { font-size: 14px } af|inputDate::launch-icon { content: url(/images/calendar/calendar_icon.gif); } af|inputNumberSpinbox::content { -tr-inhibit: all; }
  • 25. Trinidad – Create a skin • trinidad-config.xml <?xml version=quot;1.0quot;?> <trinidad-config xmlns=quot;http://myfaces.apache.org/trinidad/configquot;> <skin-family>aqua</skin-family> </trinidad-config>
  • 26. Trinidad - Skinning • Switch skin at runtime <?xml version=quot;1.0quot;?> <trinidad-config xmlns=quot;http://myfaces.apache.org/trinidad/configquot;> <skin-family>#{userPreferences.skinName}</skin-family> </trinidad-config>
  • 27. Trinidad - Skinning • Not just CSS @platform windows, linux { @agent ie, gecko { af|inputDate::title { background-color: purple; } } @agent mozilla { af|inputDate::title { background-color: yellow; } } }
  • 28. Trinidad – Client Side Validation&Conversion • Client side API for validation&conversion – function TrConverter() { } – TrConverter.prototype.getAsString = function(value, label){} – TrConverter.prototype.getAsObject = function(value, label){} – function TrValidator() – TrValidator.prototype.validate=function(value, label, converter){} – function TrFacesMessage( summary, detail, severity )
  • 29. Trinidad – Create your own • ClientValidator and ClientConverter interfaces – getClientConversion(FacesContext facesContext, UIComponent component) – getClientImportNames – getClientLibraryResource – getClientScript(FacesContext facesContext, UIComponent component)
  • 30. Trinidad – CreditCardValidator.js CreditCardValidator = function() {} CreditCardValidator.prototype = new TrValidator(); CreditCardValidator.prototype.validate = function(value, label, converter) { … if(valueIsInvalid) { var facesMessage = new TrFacesMessage (TrFacesMessage.SEVERITY_ERROR,quot;Validation Errorquot;,“CC is not validquot;); throw new TrValidatorException(facesMessage); } }
  • 31. Tobago • Various components • Layout Manager • Skinning
  • 33. Portlet Bridge • Develop portlets with JSF • RI of JSR-301(Portlet Bridge for JSF) • Adresses Portlet-1.0 and Portlet-2.0 specs
  • 34. Portlet Bridge Demo • Apache MyFaces 1.2.3 • Pluto 1.1.6 • Tomcat 6 • MyFaces Portlet Bridge 1.0.0-alpha 2
  • 35. Orchestra • Spring based • Long unit of work • Conversation Scopes Access – Manual • Conversation scoped persistence-contexts – No more Lazy exceptions • DynaForm • ViewController • Multiple window support • Persistence Context per Conversation
  • 37. Orchestra Scopes • @Component(“customerController”) @Scope(“conversation.access” or “conversation.manual”) public class CustomerController { … } • Reference as; • <h:inputText value=“#{customerController.customer.name}” />
  • 39. Orchestra - ViewController • @ViewController(viewIds={“createCustomer.jsp”}) public class MultiViewController { } • @initView – after RESTORE_VIEW • @preProcess – after INVOKE_APPLICATION • @preRenderView – before RENDER_RESPONSE
  • 41. IDE Support • Eclipse Ganymede – Trinidad • JDeveloper – Trinidad • JBoss Tools (limited) – Trinidad, Tomahawk, Tobago
  • 42. Help and Support • Mailing List: – users@myfaces.apache.org – Archieved at nabble, mail-archieve • Issue Tracking: JIRA • Wiki – http://wiki.apache.org/myfaces/
  • 43. Future of MyFaces • MyFaces 2.0 (JSF 2.0 Implementation) • Oracle RCF Donation • Richer…
  • 45. The End • cagatay@apache.org • http://www.prime.com.tr/cagataycivici • PlayStation3 online id: facescontext