• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Myfacesplanet
 

Myfacesplanet

on

  • 2,134 views

 

Statistics

Views

Total Views
2,134
Views on SlideShare
2,115
Embed Views
19

Actions

Likes
1
Downloads
0
Comments
0

3 Embeds 19

http://www.slideshare.net 14
http://www.linkedin.com 4
https://www.linkedin.com 1

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

    Myfacesplanet Myfacesplanet Presentation Transcript

    • 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