1 2 Previous Next 17 Replies Latest reply on Jun 25, 2007 2:05 PM by pmuir

    Porting Seam controls to A4J CDK

    pmuir

      [As Seam has no dev forum, we're best off doing this here]

      My efforts are aimed at moving the Seam components onto the A4J CDK (http://jira.jboss.com/jira/browse/JBSEAM-1013).

      I've got it mostly working (I still need to better integrate the maven build into our ant build). I'll work on that next, then once it's working, commit to Seam CVS so you can take a look.

        • 1. Re: Porting Seam controls to A4J CDK
          pmuir

          An immediate stumbling block is that there is no way to create converters and validators (at least a way to add them into the autogenertated faces-config, taglib and tld), better still auto wiring of attributes and auto creation of JSP tag files

          • 2. Re: Porting Seam controls to A4J CDK
            pmuir

            So another problem I ran into is that we don't use maven, and so all our dependencies are not mavenised. So, to fix this, I'm declaring all the dependencies which are seam specific as system dependencies in the pom - I'll either pass in a path to jboss-seam directory, or use an ant filter to create the pom on the fly. Any better ideas?

            Oh, mavenising the seam build is not an option afaik ;)

            • 3. Re: Porting Seam controls to A4J CDK
              alexsmirnov

              Are you right, generating of converters and validators is a good extension for the CDK.
              For a first step I'm working for a made generator extensible. This is a done for a renderer templates generator.
              We use Maven as a build system, but it's is not nessesary. The Component generator and the Renderer template compiler have a own ant tasks. See CDK JavaDocs for supported configuration options.
              You can see for a sample build files in the branch 1_0_7 of ajax4jsf.

              • 4. Re: Porting Seam controls to A4J CDK
                pmuir

                I've made seam call out and run mvn install. What's better, to use the maven build or the ant build? Is the ant build going to be maintained? I'm quite happy to do a maven call out if that is recommended.

                Anyway, you can see what I've been doing if you want in the seam-ui-cdk directory of jboss-seam in CVS.

                http://jira.jboss.com/jira/browse/AJSF-12

                • 5. Re: Porting Seam controls to A4J CDK

                  We had no plan to support ant build. I suggest it would be better to keep the Maven based approach in the future also.

                  converters and validators to faces-config.xml is Ok. What do you want to put to tld over the already generated stuff ?

                  • 6. Re: Porting Seam controls to A4J CDK
                    pmuir

                    Ok, maven it is. We need tags (tld and taglib) for the converters and validators (so you can do s:convertEnum for example) - this needs to be put in the tld and the taglib (and for tld, the relevant Tag files created).

                    • 7. Re: Porting Seam controls to A4J CDK
                      pmuir

                      The dtd appears to have all the standard_ entities commented out - I'm using the one at https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd -it would be nice if these were available :)

                      • 8. Re: Porting Seam controls to A4J CDK
                        pmuir

                        Is there a way to instantiate a component inside a renderer - we have a couple of components that do UIAction action = new UIAction(); in their doEncodeBegin method - and, if UIAction is generated by the CDK it is abstract so cannot be instantitated and it's concrete implementation is not yet created. I guess some sort of Factory:

                        public class Factory{
                         public static UIComponent getComponent(String name) {
                         ...
                         }
                        }


                        called as

                        UIAction action = (UIAction) Factory.getComponent("action");


                        should work. Or am I missing something?

                        • 9. Re: Porting Seam controls to A4J CDK
                          pmuir

                          Alternatively we could provide a manual concrete impl of these classes ourselves which is fine I think.

                          Also, it seems that if I provide the abstract getter on UIFoo, I have to provide the abstract setter as well, even if I don't need it.

                          • 10. Re: Porting Seam controls to A4J CDK
                            pmuir

                            I've now done most of the Seam components (excluding tags for the validators and converters) and it seems to have gone pretty smoothly :) Lots of testing still to do - I'll keep using this thread to ask questions.

                            Nice work on the CDK - beats other component generation frameworks I've seen hands down :)

                            • 11. Re: Porting Seam controls to A4J CDK

                              Pete, I do not know how to ask correctly, so, I will ask directly - if you want to move some components to the RichFaces, why do not use the RichFaces repository for development?

                              • 12. Re: Porting Seam controls to A4J CDK
                                pmuir

                                :)

                                So, the "Seam specific" controls (e.g. s:conversationPropagation) really have to stay in Seam (otherwise RF will depend on Seam), but the others could move... I think over at Seam we felt that purely visual components (which is the date selector) should be in RF, but infrastructural ones (e.g. fileUpload, selectItems) should be in Seam.

                                We would prefer to keep seam ui within Seam I think and just make it depend on a4j. Do you want to discuss this more offline, if so, I'll send you my im addresses.

                                • 13. Re: Porting Seam controls to A4J CDK

                                  Yes, let's discuss offline.

                                  "Seam specific" controls should be with Seam. No doubt here. However, what about visual components like Calendar for example? Guys ask us about such component. So, we have a dilemma - to share Seam's calendar or implement one more.

                                  • 14. Re: Porting Seam controls to A4J CDK

                                    Could I make a request that the porting effort of something like the date selector be documented (steps to implemenet using CDK) so we have something to follow for building our own components on the CDK. This could be the basis for a tutorial doc on the CDK.

                                    Thanks.

                                    Mike.

                                    1 2 Previous Next