8 Replies Latest reply on Dec 22, 2006 7:23 AM by azerr

    How contribute to Freemarker plugin and add my Plugin eclips

    azerr

      Hi,
      I'm new JBOSS IDE user. I discover Freemarker plugin, and I updated it to manage :
      -> XML context
      -> add Preview Tab
      -> add customizable template features with completion (ex : you type list, and after it generate <#list .....></#list>

      My first question, is how can I contribute to the Freemarker Plugin? I wrote to Joe Hudson, but I have none answer?

      I'm developping Eclipse generator called Akrogen, that you can find at http://akrogen.sourceforge.net/.
      This plugin looks like EclipseWork, but it is able to generate any components (use XML Mapping Hibernate to generate DAO, Service,...)
      by describing into XML component your WizardPage. You can too describe XML Wizard to use several XML component. Today Akrogen support XSL end Freemarker template engine.

      Are you interest by this plugin (to add JBOSS Eclipse IDE)? If so, are you agree to help me?

      Thank you for your answer.

      Regards Angelo

        • 1. Re: How contribute to Freemarker plugin and add my Plugin ec
          maxandersen

          For FreeMarker enhancements just write to me or put the patches in our jira and we will look at it (and possible integrate it)

          Regarding akgrogen then it looks to overlap *greatly* with hibernate tools - any reason you did not build on top of/extended that ?

          • 2. Re: How contribute to Freemarker plugin and add my Plugin ec
            azerr

            Hi max,
            thank you for you answer. I will send you my Freemarker Plugin updated and I will explain you new features that I added.

            For Akrogen, I'm agree with you, at first you believe Akrogen is the same thing that hibernate tool, because it can generate Bean although Hibernate tool generate it.

            But Akrogen can generate any component of Web Application, like DAO, Service, Action Struts, JSP. With Hibernate mapping you can generate XML PageConfig (XML Akrogen description for describe a form (CRUD form, list form,...).

            It exist's a lot of Generator Plugin which generate code, BUT just for one technology and architecture (ex : EclipseWork which generate components just for Web Work). With Akrogen, I would like give several default template for My Architecture that I use (Service/DAO with Spring and Hibernate and Struts). But I want add wizzard to add easily your own template, because each project and people use their own architetecture.

            With Akrogen, you could generate components for PHP project.
            XML is the model of your template (XSL or freemarker), so you could use for instance WSDL XML model to generate other components, or XMI,...

            XML Akrogen component is the XML description for the component that you want generate (description, title, input parameters, template to use,...). Once you have create an XML component, you can register it to use with Wizard Eclipse.

            If you have another questions, tell me.

            Angelo

            • 3. Re: How contribute to Freemarker plugin and add my Plugin ec
              maxandersen

               

              "azerr" wrote:
              Hi max,
              thank you for you answer. I will send you my Freemarker Plugin updated and I will explain you new features that I added.


              Please send a *patch* and not just an updated plugin.


              For Akrogen, I'm agree with you, at first you believe Akrogen is the same thing that hibernate tool, because it can generate Bean although Hibernate tool generate it.

              But Akrogen can generate any component of Web Application, like DAO, Service, Action Struts, JSP. With Hibernate mapping you can generate XML PageConfig (XML Akrogen description for describe a form (CRUD form, list form,...).


              Hibernate tools can also generate different artifacts; nothing special about that.


              It exist's a lot of Generator Plugin which generate code, BUT just for one technology and architecture (ex : EclipseWork which generate components just for Web Work). With Akrogen, I would like give several default template for My Architecture that I use (Service/DAO with Spring and Hibernate and Struts). But I want add wizzard to add easily your own template, because each project and people use their own architetecture.


              ditto for Hibernate Tools.


              With Akrogen, you could generate components for PHP project.
              XML is the model of your template (XSL or freemarker), so you could use for instance WSDL XML model to generate other components, or XMI,...

              XML Akrogen component is the XML description for the component that you want generate (description, title, input parameters, template to use,...). Once you have create an XML component, you can register it to use with Wizard Eclipse.


              In Hibernate Tools these are called "Exporters"; we don't have a generic way of describing them but if someone wants to add it feel free ;)



              • 4. Re: How contribute to Freemarker plugin and add my Plugin ec
                azerr

                 

                Please send a *patch* and not just an updated plugin.


                I have sent you my Freemarker updated, because I would like that you see my new feature and that you validate it. I have change a lot of code like package name, so I'm waiting for your validation.


                Hibernate tools can also generate different artifacts; nothing special about that.

                I agree with you, but when you want generate any component, you must respect some rules, like have java classes bean in your project. Imagine you want generate components for PHP, Hibernate mapping is used to get metadata of your database (with Hibernate Tools), BUT you need not to have Bean classes when you want generate components like PHP page.

                If you want use others XML model, like XMI, WSDL, ... is it possible to use Hibernate Tool for generate component without XML mapping hibernate but with WSDL, XMI,... XML models?

                ditto for Hibernate Tools.

                I'm sorry, I don't understand what you mean? Is it possible with Hibernate Tools, to generate Bean, DTO and Assembleur (which transform Bean to DTO and DTO to Bean)?

                In Hibernate Tools these are called "Exporters"; we don't have a generic way of describing them but if someone wants to add it feel free ;)

                Akrogen is not bulk generator. When you develop a new CRUD Form, you want generate ONLY components for this form (just the ActionForm for instance, because others developpers has for instance already developped another components that you don't want generate), sometimes, you want update name of your CRUD form, sometimes you want update others parameters. Hibernate Tools is bulk generator, Akrogen is not bulk generator. It generate ONLY the component for a XML model that you need.

                If you take the functionnality Source/Generate getter/setter in the Eclipse, you can checked the getter/setter that you want generate and not all the getter/setter of your class. Akrogen have the same goal.

                Regards Angelo

                • 5. Re: How contribute to Freemarker plugin and add my Plugin ec
                  maxandersen

                   

                  "azerr" wrote:
                  Please send a *patch* and not just an updated plugin.


                  I have sent you my Freemarker updated, because I would like that you see my new feature and that you validate it. I have change a lot of code like package name, so I'm waiting for your validation.


                  Yes, I received it; but please send it as a *patch*.



                  Hibernate tools can also generate different artifacts; nothing special about that.

                  I agree with you, but when you want generate any component, you must respect some rules, like have java classes bean in your project. Imagine you want generate components for PHP, Hibernate mapping is used to get metadata of your database (with Hibernate Tools), BUT you need not to have Bean classes when you want generate components like PHP page.


                  You only need the java classes in your project if you haven't specified all the types of your mapping files. e.g. when you generate pojo's you just need the mapping files - no classes; otherwise hbm2java could not be possible.


                  If you want use others XML model, like XMI, WSDL, ... is it possible to use Hibernate Tool for generate component without XML mapping hibernate but with WSDL, XMI,... XML models?

                  ditto for Hibernate Tools.

                  I'm sorry, I don't understand what you mean? Is it possible with Hibernate Tools, to generate Bean, DTO and Assembleur (which transform Bean to DTO and DTO to Bean)?


                  We don't have those implemented (except "bean), but nothing in the tools prevents it.


                  In Hibernate Tools these are called "Exporters"; we don't have a generic way of describing them but if someone wants to add it feel free ;)

                  Akrogen is not bulk generator. When you develop a new CRUD Form, you want generate ONLY components for this form (just the ActionForm for instance, because others developpers has for instance already developped another components that you don't want generate), sometimes, you want update name of your CRUD form, sometimes you want update others parameters. Hibernate Tools is bulk generator, Akrogen is not bulk generator. It generate ONLY the component for a XML model that you need.

                  If you take the functionnality Source/Generate getter/setter in the Eclipse, you can checked the getter/setter that you want generate and not all the getter/setter of your class. Akrogen have the same goal.


                  I don't get your "bulk" argument here ? Hibernate tools defaults to generate for all entities and components but that can of course be controlled by the exporter if you want to.....and adding a "generate only *this* part" is of course possilbe....

                  If I understand your docs at http://akrogen.sourceforge.net/generation/wizard.html you have some nice wizard page generation which if I understand it correctly is something that would be nice to have for our Exporters (today we "just" have an table where you can set the property values)

                  This page http://akrogen.sourceforge.net/generation/component.html I
                  don't get ...the template looks waay more complex than what I would think is necessary....but maybe I just don't believe in too generic code generation ;)

                  tip: If you want users to understand Akrogen features you should try and document it with some better examples, the current page is very sparse on information.

                  • 6. Re: How contribute to Freemarker plugin and add my Plugin ec
                    azerr

                     

                    Yes, I received it; but please send it as a *patch*.

                    That's done.

                    You only need the java classes in your project if you haven't specified all the types of your mapping files. e.g. when you generate pojo's you just need the mapping files - no classes; otherwise hbm2java could not be possible.


                    Sorry, I have not seen.

                    We don't have those implemented (except "bean), but nothing in the tools prevents it.


                    Is it easy to change default architecture (bean) with another architecture? With Akrogen you can create your own Project (MyJ2EE project) and add it component, wizard, for your architecture.

                    I don't get your "bulk" argument here ? Hibernate tools defaults to generate for all entities and components but that can of course be controlled by the exporter if you want to.....and adding a "generate only *this* part" is of course possilbe....


                    My explanation was not enough good. Imagine you want create finder DAO
                    with specific criteria (findByCountryId). With Akrogen you can create XML component which generate this method. For this, you must create a template (XSL, Freemarker), and create a XML component MyComponent (parameters IN criteria => XML => display list of your hbm property into the list checkable).

                    When you select the hbm (menu AKROGE->Components->MyComponent) , the XML component will display a Wizard page, with all property of your hbm. you check Id property and click finish, your DAO findByCountryId will be generated.

                    tip: If you want users to understand Akrogen features you should try and document it with some better examples, the current page is very sparse on information.


                    I agree with you my documentation is very bad. I have a lot of development for Akrogen (ex : I work to export Freemarker Plugin context .freemarker-ide.xml and build auomaticly Akrogen XML component).
                    I'm searching people to help me to develop Akrogen and write documentation, but it's very difficult.

                    Thank you for your answer.

                    Angelo


                    • 7. Re: How contribute to Freemarker plugin and add my Plugin ec
                      maxandersen

                       

                      "azerr" wrote:
                      Yes, I received it; but please send it as a *patch*.

                      That's done.


                      I saw JBIDE-428, is that what you refer to ? It's not a patch it is the complete project...

                      We don't have those implemented (except "bean), but nothing in the tools prevents it.


                      Is it easy to change default architecture (bean) with another architecture? With Akrogen you can create your own Project (MyJ2EE project) and add it component, wizard, for your architecture.


                      What do you mean "another architecture" ? Have you even tried to use the tools and looked at the code to see how it works ?


                      I don't get your "bulk" argument here ? Hibernate tools defaults to generate for all entities and components but that can of course be controlled by the exporter if you want to.....and adding a "generate only *this* part" is of course possilbe....


                      My explanation was not enough good. Imagine you want create finder DAO
                      with specific criteria (findByCountryId). With Akrogen you can create XML component which generate this method. For this, you must create a template (XSL, Freemarker), and create a XML component MyComponent (parameters IN criteria => XML <Tree> => display list of your hbm property into the list checkable).

                      When you select the hbm (menu AKROGE->Components->MyComponent) , the XML component will display a Wizard page, with all property of your hbm. you check Id property and click finish, your DAO findByCountryId will be generated.


                      Maybe it is your vocabulary I just don't get; e.g. what is an "XML componeent" ? And if I need to write XML + a template what is saved here ?

                      I still think your work about "wizards" for the code generation is something we can/could use.


                      tip: If you want users to understand Akrogen features you should try and document it with some better examples, the current page is very sparse on information.


                      I agree with you my documentation is very bad. I have a lot of development for Akrogen (ex : I work to export Freemarker Plugin context .freemarker-ide.xml and build auomaticly Akrogen XML component).
                      I'm searching people to help me to develop Akrogen and write documentation, but it's very difficult.


                      • 8. Re: How contribute to Freemarker plugin and add my Plugin ec
                        azerr

                         

                        I saw JBIDE-428, is that what you refer to ? It's not a patch it is the complete project...

                        I have post a comment.

                        What do you mean "another architecture" ? Have you even tried to use the tools and looked at the code to see how it works ?


                        For me architecture is the pattern of your Application (Service, DAO)
                        each people have their own architecture and implementation :
                        Architecture example :
                        Architecture 1 : Service call DAO which returns Bean (from hibernate)
                        and Service returns the Bean (after detach it to session)
                        Architecture 2 : Service call DAO which returns Bean (from hibernate)
                        Servive build DTO by using Bean and it returns the DTO.

                        Implementation example
                        DAO can be implements with JDBC or Hibernate,....

                        According to the architecture the Eclipse WizradPage must be different (parameters (package name, import classes ...) of the template are different).

                        Plesae let me a little time to study Hibernate Tool.

                        Maybe it is your vocabulary I just don't get; e.g. what is an "XML componeent" ? And if I need to write XML + a template what is saved here ?


                        XML Components is XML desciption of the Eclipse WizardPage (which parameters must be displayed). When you click to Finish Buton, the generation is launched, by merging a template (set in the XML Component)
                        , the XML file selected (hbm, OR OTHER XML FILE), and the parameters (fileds of the WizardPage).

                        XML Wizard is composed with several XML Component. You can synchronize parameters of one XML component with another XMl Component. (eg : you have XML Component for generate Struts ActionForm, and XML Component for generate XML struts-config). You can create a XML Wizard composed with the two XML COmponents and you can synchronyze className parameter of XML Component struts-config with XML Component ActionForm. When you change the parameter className of the XML Component ActionForm, it will change to for struts-config.

                        Akrogen is not mature, and my documentation is very poor. But I search another people which will interest with Akrogen. I have a lot of idea, but I would like discuss with another people.

                        Please let me time to write Akrogen documentation. After I hope that Akrogen will please you.

                        Regards Angelo