I'm carving my way through. My notes on working with CDK4 will be here : https://docs.google.com/Doc?docid=0AU_Xm4aXKuUrZGZobndrZndfMTBkZjVweHdndw&hl=en&authkey=CI617aML
This will be updated day by day. Comments and questions are welcome in this thread.
This is a great start to a document we really need!
Our plan is to create several wiki pages follow a similar concept. Specifically "How to checkout & build RichFaces 4.0", "Development Guidelines for RichFaces 4.0", and "Component Development with RichFaces 4.0 & the CDK".
If you are interested, and it seems like you are ;-) I think it would be great to work together on this, and get an outside perspective on areas that need updates, or that are clumsy.
I'm going to be busy at JBoss World this week, but will try to contact later in the week, or next, and I'll review. In the mean time I think it would be good to have Alex write up more of the basics with CDK.
How do I set tag namespace without faces-config.xml?
Can I mix faces-config.xml and annotations?
Why do you name some classes AbstractXXX? I see that there is AbstractAjaxFunction and it generates UIFunction. Is there no longer anything like HtmlFunction?
Why do we have renderer attribute in @JsfComponent since we have it also in template?
I have @Attribute annotated method returning Boolean (not boolean) named getIsRTL, which allows null. CDK generates getters using "isIsRTL" prefix, which causes generated class not to override all methods and what is more, it can throw nullpointers:
If state helper evaluates isRTL attribute to null then there should be no toString call !
I know that as a workaround I could pass defaultValue, but that is not flexible.
Sorry for a long delay, but I only got the time to pay attention for documentation after 4.0.Final release.
There are my points:
- build instructiona are outdated, I think it's not a part for CDK document.
- Jboss moved Maven repositories to the Nexus, urls were changed. Same for java.net.
- bom and parent are not necessary, you can use it to omit versions of JSF/RichFaces dependencies and plugins configuration. See cdk/maven-cdk-plugin/src/it projects for example.
- cdk reads constants COMPONENT_TYPE and COMPONENT_FAMILY from class, so you can skip them in annotation.
- you can use Java keywords as attribute names, it was fixed before CR2
- you can add custom dependencies where you wish. CDK relays on the standard Maven plugin only, so you free to organize your project as you wish.
- <h:scripts> substituted as @ResouceDependencies annotation.
- all scripts rendered by JSF, according to their target ( HEAD,FORM,BODY)
- If you use the single template with base class, put renderer type and base class to template. You can use annotations to assign the same template to different base class ( supposed for components like UIMessage/UIMessages )
- source locations readed form Maven pom.
- TagHandler generated if you have attribute with MethodExpression.
- listener tags generated for all events marked as @JsfEvent
- taglib namespace can be defined it faces-config extention or by package-level @Taglib
- Servlet and JSF detect mime type by file extension.
- to generate TagHandler for non-default caes, explicitly define it by @Tag attribute inside @JsfComponent, @JsfBehavior etc.
- ecss issue should be already fixed.
- clientId evaluation in JSF 2 performed my framevork, see JSF documentation.
- viewLocale evaluated on createView call.
Second, CDK supposed to use with any build tool - core project has no dependencies from Maven or other system. Unfortunately, I had no time to implement ANT task or something like Groul.
Watch for the wiki and blog for description how to run CDK.
The only thing that I hope to finish is running CDK as the Annotation Processor, to use it inside IDE or any Java compiler.