You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 7 Members of 6388 |
| Forum: Seam Users |
08. Mar 2008, 20:04 CET | Link |
Seam is great framework, and all of us love developing with it. We normally start with seam-gen and am continuing with manual development.
It is great for generation of a starter application, but its customization abilities are limited. If we try to customize code generated by seam-gen, we can no longer regenerate. Another problem that we have with seam-gen is that it generates forms with basic input components and does not offer any customization. For example, for properties of an enumerate type, seam-gen's form field is an input text field; however, what we want is a drop-down list of the enumerated type values.
To address these problems, I have developed a tool called FormBuilder that can fully generate view forms from entity beans and offers complete customization of input fields. My tool uses Hibernate-Validation (annotations). Developers can even define their own input components for form generation. When the input components are wrapped as facelet tag, it can offer even more!
Some features:
editableattribute.
freshforms are autogenerated to match.
More information is available here:
I have also built an example application showing new components and client side validation (tested on 5 main browsers!) It offers also comparison to forms generated by seam-gen.
Currently, you can download FormBuilder from
Later I am planning to put it on SourceForge.net.
I welcome any feedback on this work.
Tool does not require Seam! you can also use simple JSF and Facelets.
Tomas
Hi!
This idea seems very interesting, I have been making enhancements to my seam-gen templates (adding for example, recursive relationship support, ajax sorting of list, annotations to make relationships settable by combobox instead of datatable, etc)
I think this kind of enhancements have the potential to really boost software development, specially for typical financial applications with lots of crud screens.
Have you read about Naked objects and/or Direct2Web? I'd love to see this FormBuilder evolving into something like that...
Regards,
Francisco
P.D. I have been wondering... what is the license status of the seam-gen templates? are they LGPL? (I am thinking it might be so, since the freemarker templates are Seam source code... should I tell my employer that we should be sharing them? I would be good news for me... but others making similar modifications might get concerned )
I believe that imagination is stronger than knowledge -- myth is more potent than history -- dreams are more powerful than facts -- hope always triumphs over experience -- laughter is the cure for grief -- love is stronger than death.
Hi,
thank for the feedback and links. I agree with all you wrote. Code-generation is always great, mostly when the templates are accessible to developer and manageable. I am using FormBuilder for our project and have significant time decrease for frontend development which is often CRUD.
I will take a look on the links and thank you for them. I have many new ideas for code generation and tool extensions.
License is LGPL. Yes sharing would be great. I think the best think would be to have here on www.seamframework.org a repository for sharing templates and seam development tools.
Tomas
Many thanks for this tool.
I have skimmed the documentation and deployed the demo app. Very, very impresive. The only caveat is, that i can only evaluate further in my private time (not at job):-( Because of some strange requirements we are not allowed to generate UI.
I would like to see this as a SourceForge or other kind of project.
BTW:
When testing the demo app, do not forget to create a schema formbuilder in hsql. i was trapped by that. After finding in the JBoss Docs a way to start the hsql DBmanager i was able to create the schema.:-)
Ciao,
Carsten
Hi Carsten,
thank you for the feedback ;D. I will put it on SourceForge after they approve of my project, I already applied there, but unfortunately it takes 2-3 weeks to process it.
Anyway, thanks for noting the schema in hypersonic db so that the others will not have any problems ;D.
Tomas
Hi Tomas.
What do you think of updating Tools' section of this site with a reference to your project, so it can gain more visibility?
I'm going to evaluate FormBuilder very soon. I always wanted seam-gen had more customization possibilities, without have to touch source (I'm new to Seam and web dev. in general).
Thanks for the initiative!
Francisco Antônio.
The biggest weapon against stress is our ability to choose a thought instead of another one. (William James)
Hi Tomas (again :)
I've just downloaded the demo application.
Started HSQMDB Manager: a. http://localhost:8080/jmx-console/ b. database=localDB,service=Hypersonic c. Invoke button under void startDatabaseManager()
Created FormBuilder schema (CREATE SCHEMA FormBuilder AUTHORIZATION DBA). The new schema appears in the Schemas menu, so I think it's all right.
Copied and pasted file FormBuilderExample.ear (inside FormBuilder_all.zip) onto JBoss deploy directory.
But I had the following errors:
11:04:59,250 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/jboss-seam-pdf.jar!/META-INF/seam-pdf.taglib.xml 11:04:59,265 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/jboss-seam-ui.jar!/META-INF/s.taglib.xml 11:04:59,312 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-core.taglib.xml 11:04:59,328 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-html.taglib.xml 11:04:59,343 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jsf-ui.taglib.xml 11:04:59,359 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-core.taglib.xml 11:04:59,375 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/jsf-facelets.jar!/META-INF/jstl-fn.taglib.xml 11:04:59,421 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/a4j.taglib.xml 11:04:59,437 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/ajax4jsf.taglib.xml 11:04:59,484 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/rich.taglib.xml 11:04:59,484 ERROR [STDERR] 14/03/2008 11:04:59 com.sun.facelets.compiler.TagLibraryConfig loadImplicit INFO: Added Library from: jar:file:/C:/WebDev/JBoss/AppServer/server/default/tmp/deploy/tmp42167FormBuilderExample.ear-contents/FormBuilderExample-exp.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/richfaces.taglib.xml 11:05:05,625 INFO [STDOUT] Hibernate: select top ? person0_.id as id1_, person0_.countryId as countryId1_, person0_.password as password1_, person0_.link as link1_, person0_.username as username1_, person0_.firstName as firstName1_, person0_.lastName as lastName1_, person0_.email as email1_, person0_.gender as gender1_, person0_.wasBorn as wasBorn1_, person0_.salary as salary1_, person0_.married as married1_, person0_.notes as notes1_, person0_.employedFrom as employe13_1_, person0_.employedTo as employedTo1_, person0_.lastDealUpdate as lastDea15_1_, person0_.html as html1_, person0_.favoriteColor as favorit17_1_ from FormBuilder.Person person0_ 11:05:05,625 WARN [JDBCExceptionReporter] SQL Error: -227, SQLState: 3F000 11:05:05,625 ERROR [JDBCExceptionReporter] invalid schema name: FORMBUILDER in statement [select top ? person0_.id as id1_, person0_.countryId as countryId1_, person0_.password as password1_, person0_.link as link1_, person0_.username as username1_, person0_.firstName as firstName1_, person0_.lastName as lastName1_, person0_.email as email1_, person0_.gender as gender1_, person0_.wasBorn as wasBorn1_, person0_.salary as salary1_, person0_.married as married1_, person0_.notes as notes1_, person0_.employedFrom as employe13_1_, person0_.employedTo as employedTo1_, person0_.lastDealUpdate as lastDea15_1_, person0_.html as html1_, person0_.favoriteColor as favorit17_1_ from FormBuilder.Person person0_] 11:05:05,640 ERROR [STDERR] 14/03/2008 11:05:05 com.sun.facelets.FaceletViewHandler handleRenderException SEVERE: Error Rendering View[/PersonList.xhtml] javax.faces.FacesException: javax.el.ELException: /PersonList.xhtml @43,59 rendered="#{empty personList.resultList}": Error reading 'resultList' on type edu.baylor.icpc.formbuilder.example.PersonList_$$_javassist_1 at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:373) at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:276) at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262) at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:199) at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:194) at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892) at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592) at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108) at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83) at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141) at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281) at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58) at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69) at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) Caused by: javax.el.ELException: /PersonList.xhtml @43,59 rendered="#{empty personList.resultList}": Error reading 'resultList' on type edu.baylor.icpc.formbuilder.example.PersonList_$$_javassist_1 at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:76) at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:370) ... 50 more Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:629) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:73) at org.jboss.seam.framework.EntityQuery.initResultList(EntityQuery.java:74) at org.jboss.seam.framework.EntityQuery.getResultList(EntityQuery.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.jboss.seam.util.Reflections.invoke(Reflections.java:21) at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56) at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:31) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:38) at org.jboss.seam.util.Work.workInTransaction(Work.java:40) at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:32) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42) at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68) at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107) at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166) at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102) at edu.baylor.icpc.formbuilder.example.PersonList_$$_javassist_1.getResultList(PersonList_$$_javassist_1.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at javax.el.BeanELResolver.getValue(BeanELResolver.java:62) at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53) at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64) at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53) at org.jboss.el.parser.AstValue.getValue(AstValue.java:67) at org.jboss.el.parser.AstEmpty.getValue(AstEmpty.java:29) at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71) ... 51 moreWhen you have some time, please take a look at it.
Thanks a lot,
Francisco Antônio.
The biggest weapon against stress is our ability to choose a thought instead of another one. (William James)
Hi Francisco,
thank you for the feedback. My first guess is that Hypersonic DB is case sensitive and this line:
says that schema name must be instead of . Try that and let me know if it helped?
Tomas
Hi Francisco,
Thank you for your feedback.
I have updated the Tools section and now it is accessible from there too.
Tools - Controls - Browse.
Thank you for noting that.
I would like to point out that seam-gen will generate the whole project for you from database, it is great for beginning and for tutorial. But then you will find out that you want to modify your project and will start with manual development. Then seam-gen cannot help with standard manual steps. One of tedious manual steps is form generation or table generation. FormBuilder generates forms for you from entity bean. Even more you will not have any code duplication in your projects. It means once you want to change something in your project you will change it on one place and not on hundred places (Thank you Jacob Hookom for facelets). That is also the idea behind the FormBuilder. So form builder is not only for toy projects, but mostly for production applications. That was the main reason why I started to work on that because once you have 30 tables/entities in your database/backend you just do not like forms at all ;D.
If you will try to play with FormBuilder you will find out that form builder can generate also tables, but you need to define new component and template library for that. It will be scheduled as future task for me.
Tomas
The references you have provided to me are great!!! The naked objects has very similar idea in much larger scale. The other one seems to me similar to FileMaker, which I was using for 1 year. I think that with Seam there is a way to build similar tool as FileMaker for rich web applications.
Tomas
Hi Tomas.
You were right. It worked now.
Thank you very much.
Francisco Antônio.
The biggest weapon against stress is our ability to choose a thought instead of another one. (William James)
Demo would be a good idea.
Hi Tomas,
I will give this a go today itself and will get back with my feedback.
Best Regards,
Ashish.
Ashish Kulkarni
E-Business Software Solutions Ltd., UK
AshishKulkarni.com
Any news about the tool?
The human knowledge belongs to the world
Hello Adrian,
I have few news. I started to work on ICEfaces library so the latest version is here ICE formBuilder
client-side validation has one problem and it is a form submission. Because ICEfaces are rewriting javaScript for forms submission.
Another news is a research paper on the way. The paper describes background, ideas and the tool.
I wish I had more news for you but I unfortunately have to work also on my other projects.
As soon as I will have some news I will provide it here.
Thank you Tomas
We were making enhancements to our seam-gen to. You can see test application at Test App (you don't have to input username and password), it is completely generated with seam-gen. But it's not finished yet, some improvement are needed (and expected in future). maybe will some of you have some idea.
It has also read-only or editable model, depending on status, like form seam-gen builder.
seam-gen: My Seam-gen
Project: Project in JBoss Developer
We were making enhancements to our seam-gen to. You can see test application at Test App (you don't have to input username and password), it is completely generated with seam-gen. But it's not finished yet, some improvement are needed (and expected in future). maybe will some of you have some idea.
It has also read-only or editable model, depending on status, like form seam-gen builder.
seam-gen: My Seam-gen
Project: Project in JBoss Developer
Hello Uroš,
it looks very good!!! I think that you have made great improvements to seam-gen. I will be happy to help you with some stuff I made. The best think is probably if you can contact directly to my email that is available at the guide (link in the first record).
What would be the advantage in the integration (form extension):
Let me know
Tomas
Uros,
Your additions to seam-gen would help me a lot.
However I ran into issues after running it.
I am running 2.0.1 GA
I replaced the entire seam-gen folder with your seam-gen folder.
I am only running seam generate-ui because I generated entities separately.
After running seam generate-ui, it did not create EntityNameListFrm.xhtml view files.
It seems like listFrm.xhtml.ftl is never called anywhere in your seam-gen source. Can you help me figure out where the problem is ?
Thanks Franco
add this to your build.xml file
<hbmtemplate filepattern="{class-name}ListFrm.xhtml" template="view/listFrm.xhtml.ftl" destdir="${project.home}/view" foreach="entity"/>version 1.10 available
download
Finally sourceforge.net
see form builder at sourceforge
Tomas