1 2 Previous Next 15 Replies Latest reply on Oct 9, 2007 12:35 PM by Pierre Raoul

    seam-gen : old issues

    Pierre Raoul Novice

      There is a bunch of feature requests for seam-gen that are awaiting now for quite a long time, e.g.:

      JBSEAM-994 seam-gen and mutiple foreign keys,
      JBSEAM-843 Generate application from existing entities,
      JBSEAM-1493 Seam-gen: allow return to original page,
      JBSEAM-1136 Support multiple projects in Seam Gen,
      JBSEAM-1206 improve i18n in seam-gen.

      Is there any schedule about them? Can we expect to see them in some release 2.0.x?

        • 1. Re: seam-gen : old issues
          Max Rydahl Andersen Master

          related is that we handle JBSEAM-843 and JBSEAM-1136 in jboss tools/rhds now...just fyi ;)

          The best way to fix the other issues is patches and testcases (note: that seam-gen does not try to be everything to everybody and simplicity will be preffered over complexity if it is not a *big* requirement)

          • 2. Re: seam-gen : old issues
            Pierre Raoul Novice

             


            related is that we handle JBSEAM-843 and JBSEAM-1136 in jboss tools/rhds now...just fyi ;)


            Good!


            The best way to fix the other issues is patches and testcases


            About 994, 1493 & 1206: a patch was proposed for each of them. So...


            seam-gen does not try to be everything to everybody and simplicity will be preffered over complexity if it is not a *big* requirement


            About 994 and 1493: imo, they are not new features but expected behaviors.

            About 1206: atm, all the messages are hard coded in english. If they are translated, as soon as you run again "seam generate-entities" all the translations are lost. It's not really i18n friendly.


            • 3. Re: seam-gen : old issues
              Dan Allen Master

              If I have any say in the matter, I would like to see these changes (or some variation of them) integrated. seam-gen had a lot of other areas where it needed attention, which was addressed for the 2.0 release. Once we are beyond 2.0, I think we can continue to make seam-gen produce better and more flexible applications.

              While seam-gen cannot be everything to everybody, I do feel that it can still do a better job. My personal goals for seam-gen is to trim down the code as much as possible while integrating a very rich set of features. It should be more than just a fun prototype, but an excellent place to start with new applications. Trust that we do want contributions such as yours.

              • 4. Re: seam-gen : old issues
                Max Rydahl Andersen Master

                multiforeignkeys are not trivial to solve but is probably worth the trouble IFF it can be done right (something that just compiles is not enough, it needs to also actually work);

                i18n probably is easy to fix but needs fixes to hibernatetools to not overwrite files that are changed etc.

                I'm not against all these I just think some of the templates are (unnecessarily) complex as is (same for the generated result)



                • 5. Re: seam-gen : old issues
                  Pierre Raoul Novice

                   


                  something that just compiles is not enough, it needs to also actually work


                  patch proposed with JSEAM-994 IS working here.


                  • 6. Re: seam-gen : old issues
                    Pierre Raoul Novice

                     


                    i18n probably is easy to fix but needs fixes to hibernatetools to not overwrite files that are changed etc.


                    The current version here of this feature deals with it through separation of properties files:
                    - one with constant messages provided by Seam: can be modified by developer, but to be avoided (see below);
                    - one with all the messages generated each time that generate-entities is executed: must not be modified by developer
                    - one with specific messages provided by the developer.

                    In this last one, developer can even put messages which will overwrite thoses of the 2 other files.

                    When new translations is provided by developer, a new run of generate-entities will automatically takes them in account.

                    So, no fixes of hibernatetools were needed.

                    • 7. Re: seam-gen : old issues
                      Pierre Raoul Novice

                       


                      I'm not against all these I just think some of the templates are (unnecessarily) complex as is (same for the generated result)


                      I guess that it's JBSEAM-1206 which is concerned here.

                      Mainly I replaced each hard coded message in templates by a "#{messages['...']".

                      I guess that what you are speaking about is:
                      - in a few cases I used messages with parameters
                      - some of the templates are quite rough and can be optimized.

                      But at least it works.

                      I'm ok to rework any unnecessarily complex cases...

                      • 8. Re: seam-gen : old issues
                        Pierre Raoul Novice

                         


                        related is that we handle JBSEAM-843 ... in jboss tools/rhds now...just fyi ;)


                        does rhds manage manytomany associations?

                        • 9. Re: seam-gen : old issues
                          Max Rydahl Andersen Master

                          ato: The patch might have been updated last time I saw it; but the first patch I looked at generated *alot* of additional files 1 per view artifcat...if that is not the case anymore then I rest my case ;)

                          about many-to-many then that is an issue with seam-gen's templates; and since RHDS does its best to work with the seam developed templates we don't have a "fix" for that.

                          • 10. Re: seam-gen : old issues
                            Max Rydahl Andersen Master

                            and yes #{messages...} for every reference makes the code hard to read for newbies IMO....but maybe I just need some more convincing ;)

                            • 11. Re: seam-gen : old issues
                              Pierre Raoul Novice

                              About i18n:

                              I agree with you, the #{messages...} are ugly, but it's the standard way to do i18n with Seam...
                              An other way is #{interpolator.interpolate...}, but imo it's worse and should be used only if necessary.

                              I think that seam-gen is not only for beginners, or "a fun prototype, but an excellent place to start with new applications" as said Dan Allen.

                              An option would be to be able to generate:
                              - either monolanguage application with hard coded messages, by default for beginners or if no multi languages is needed
                              - or fully i18n application if required

                              but then it adds a little more complexity in templates.

                              About i18n (2):


                              The patch might have been updated last time I saw it; but the first patch I looked at generated *alot* of additional files 1 per view artifcat...if that is not the case anymore then I rest my case ;)


                              I don't remember exactly what does the first patch. At least the second patch still uses a lot of properties files but not one per view artifact! And now the current version here uses by default 3 properties files by language, as stated before:
                              - one with constant messages provided by Seam
                              - one with all the messages generated
                              - one with specific messages provided by the developer

                              A lot of temp files are generated, but only the properties files above are to be know by the developer.

                              About many-to-many:


                              then that is an issue with seam-gen's templates; and since RHDS does its best to work with the seam developed templates we don't have a "fix" for that


                              If I understand, this issue has to be managed by seam-gen. Then the situation is:
                              - many-to-many can't be managed by target "generate-entities": I don't remember where but on the forum or in jira there is a discussion on this issue.
                              - I wrote a patch to add many-to-many above the patch for JBSEAM-843
                              - but JBSEAM-843 will not be added to seam-gen

                              So now I have no clear vision of the next step...

                              • 12. Re: seam-gen : old issues
                                Max Rydahl Andersen Master

                                JBSEAM-843 is about generate from existing entities; why shouldn't that make it into seam-gen ?


                                btw. "alot of temp files are generated" what does that mean ?

                                • 13. Re: seam-gen : old issues
                                  Pierre Raoul Novice

                                   

                                  JBSEAM-843 is about generate from existing entities; why shouldn't that make it into seam-gen ?


                                  If so I misunderstood you. I'll be very happy if seam-gen can generate from existing entities.

                                  alot of temp files are generated" what does that mean ?


                                  The patch:
                                  - starts by create one text file for each entity class, the "temp files", with the root name of each message key
                                  - then creates the final properties files from this "temp files"

                                  • 14. Re: seam-gen : old issues
                                    Max Rydahl Andersen Master

                                    Why does it need to create a temp file for each entity ?! should be enough to just iterate all the entities in one file, right ?

                                    1 2 Previous Next