JSF 2.0 – RichFaces integration plan.
It is important to use test-driven development for a new features. Because current Shale-test framework does not have JSF-2.0 versions of the mock objects, and due to often JSF API changes during development phase, we need to have a powerful test environment for the framework and components. New jsf-test project works like existing Shale tests, but uses “stub” webserver and a real JSF implementation.Tasks:
Create Mock webserver with JSF support. DONE: Test Driven JSF Development
Rewrite existing abstract test classes for a new framework.
- Setup Real World automated test project using Selenium test framework...
Component Development Kit is base for entire RichFaces components library, therefore rewriting it should be first stage of migration process.
RichFaces 4.0 Components Development Kit
Probably, it is hardest part of the transition.
- Properly divide api, implementation and component library. The library itself should depends from the 'api' only. Common components classes should be moved into the library.(https://jira.jboss.org/jira/browse/RF-7560)
- Use standard JSF 2.0 ExceptionHandler.
- DataModel classes - support new JSF 2.0 iterator() method.
- Use JSF 2.0 system events instead of custom listener/tree walkers.
- Move initialization code into JSF 2.0 system listener. Move all "lazy" loading into application startup. If necessary, use javax.nio locking instead of "syncronized" (https://jira.jboss.org/jira/browse/RFPL-12)
- Add support for hot redeployment, as JSF 2.0 does.
- Move all configuration parameter names into the ContextInitParameters utility class constants. Use that class instead of direct init parameters references. (https://jira.jboss.org/jira/browse/RFPL-13)
- Use Faces-config extentions instead of the init parameters for a complex cases ( two or more related parameters ). (https://jira.jboss.org/jira/browse/RFPL-14)
- Use single 'Configuration' class to access for all parameters by single point.(https://jira.jboss.org/jira/browse/RFPL-15)
- Reduce the number of the style classes. Merge internal names with public ones.
- Make skin style class names portal-compatible by passing them with ExternalContext.encodeNamespace() method. (https://jira.jboss.org/jira/browse/RF-7573)
- Transform RichFaces resources to use JSF 2.0 Resource Handling instead of Richfaces filter. The extended ResourceHandler should serve dynamic RichFaces resources and delegate other requests for default one.(https://jira.jboss.org/jira/browse/RF-7562)
- Transform RichFaces InternetResource interface into JSF 2.0 Resource abstract class. (https://jira.jboss.org/jira/browse/RF-7563)
- Move the Renderer dependend resources definitions from propietary interface to the JSF 2.0 annotations. (https://jira.jboss.org/jira/browse/RFPL-21) Implemented in JSF itself
- Inject resources by the JSF 2.0 UIViewRoot#addComponentResource instead of filter. It seems as JSF 2.0 bug what that API does not preserve scripts and styles order. (https://jira.jboss.org/jira/browse/RFPL-22) Implemented in JSF itself
- Dynamic Resources. Current JSF implementation supports a static files only. (https://jira.jboss.org/jira/browse/RF-7566)
- Proprietary "xcss" stylesheet-description language should be replaced by the native CSS with EL-expressions and conditional elements. Possible way - define custom PDL handler for CSS format, as it exists in the JSF 2.0 Facelets-based one for a XML. (https://jira.jboss.org/jira/browse/RF-7567)
- Replace runtime images rendering by pre-generated static images ( nice idea to use SVG and maven batic plugin to prepare them ), but only apply color transformation directly to PNG file content. For example, each skin color could be rendered into separate channel ( Red, Green or Blue, RichFaces skins do not use more than 3 colors for images ) and use channel value as intencity of actual color. That would eliminate AWT dependencies from runtime and solve compatibility problems.
- Use only one base library (JQuery is most preferable at this moment). (https://jira.jboss.org/jira/browse/RF-7569)
- Move duplicated code into the global library. (https://jira.jboss.org/jira/browse/RF-7570)
- Make code compatible with Portlet environment: use anonimous functions to hide internal code, pass all public methods names with ExternalContext.encodeNamespace(). (https://jira.jboss.org/jira/browse/RF-7571)
- If possible, insert all RichFaces libraries at the page end as Yahoo recommends (https://jira.jboss.org/jira/browse/RF-7572)
- Pluggable/Configurable effects for components.
- We should consider that during design. Current 3.3.x (and older) components designe does not allow to plug effects on changing state.
- Advanced keyboard and accessibility support
- The same as for 6). Default keyboards shortcuts should present on components (all menus, trees, selection on tables, rich inputs and so on), need to design points and api to be able to attach shortcuts usign hotkey.
Review a number of utility classes used. Remove obsolette packages :
- XML serializer. (https://jira.jboss.org/jira/browse/RF-7553)
- JTidy (https://jira.jboss.org/jira/browse/RF-7554)
- Gif image format SPI ( included in the JDK 5 and late ). (https://jira.jboss.org/jira/browse/RF-7555)
- Remove Apache common-collections dependencies. Use google-collections instead or create own project-specific classes. (https://jira.jboss.org/jira/browse/RF-7556)
- Remove Jakarta Digitester dependencies. (https://jira.jboss.org/jira/browse/RF-7557)
- Review BaseRenderer/RendererUtils etc. Remove obsolette code from them. (https://jira.jboss.org/jira/browse/RFPL-41)
- Remove commons-logging. Create logger supporting various logging contexts. (https://jira.jboss.org/jira/browse/RF-7559)
- Remove obsolette JSF extensions ( listeners, StateManager etc ). Replace Components Tree walk, used by the RichFaces paginator and some other components by the JSF 2.0 events.
- Code rewiew and optimization.
- ??? separate iteration components ( tables, repeater, tree ... ) from UIData. (https://jira.jboss.org/jira/browse/RFPL-39)
- Performance improvment.
- Redesign components with semantic markup. Avoid <table> tags where it is reasonable
- Use new JSF 2.0 features ( new System Events, methods etc ) to optimize components code. Use UIComponent#vistTree method to support virtual components inside iterables (e.g. support tabs inside ui:repeat etc.).
- Add built-in mouse hover effect where it is applicable
- Add built-in effects where it is applicable
- Add support for current component context inside rich:* functions.