-
15. Re: Groovy + Facelets (Gracelets)
kito99.kmann.virtua.com Mar 6, 2008 3:13 AM (in response to elponderador.anayluis.gass.gmail.com)Lewis,
I see what you're saying about Seam. Regardless of where it ends up, I'd love to be able to show some of this next week at JSFDays. Have you posted it anywhere yet?
---
Kito D. Mann - JSF EG memeber, Author, JavaServer Faces in Action
http://www.virtua.com - JSF/Java EE consulting, training, and mentoring
http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info -
16. Re: Groovy + Facelets (Gracelets)
gavin.king Mar 7, 2008 3:42 AM (in response to elponderador.anayluis.gass.gmail.com)So can you get the following to work:
ui.composition { template: "template.xhtml"; @In(create=true) Person person; ui.define { name: "body"; h1 { "Change password" } h.form { "Enter new password:" h.inputText { value: Value { get: { return person.password; } set: { person.password = it; } } } h.commandButton { value: "Set password!", action: { person.setPassword(); } } } } }
If you can get the code above working, I think you should definitely productize this work, and I would be very happy to host it as a subproject of seamframework.org.
-
17. Re: Groovy + Facelets (Gracelets)
elponderador.anayluis.gass.gmail.com Mar 8, 2008 12:29 AM (in response to elponderador.anayluis.gass.gmail.com)Well, this looks a tad bit more difficult. I think I will definitely need the help of a groovy master. There is no indication at all that groovy will allow me to access any type of fields in normal scripts and/or closures.
The best I can do so far is this:
viewOnly = false person = seam.person ui.composition ( template: "template.xhtml" ) { ui.define (name: "body") { h1("Change password") h.form { print "Enter new password:" h.inputText("#{persona.name}") h.commandButton("Set password!", action: { person.setPassword(); } }) } } }
-
18. Re: Groovy + Facelets (Gracelets)
gavin.king Mar 8, 2008 3:17 AM (in response to elponderador.anayluis.gass.gmail.com)So, just to clarify, the problem is that you can't make the field injection work? 'cos this is not a class definition?
OK, I'll take a closer look at how this stuff works in Groovy and I bet I should be able to come up with some ideas.
-
19. Re: Groovy + Facelets (Gracelets)
elponderador.anayluis.gass.gmail.com Mar 9, 2008 3:06 AM (in response to elponderador.anayluis.gass.gmail.com)Yeah, field injection is the main thing that I cannot see how to make work. I am loading the groovy files with the GroovyClassLoader which is the most flexible for the scheme I currently have. I originally used the GroovyScriptEngine, but I could not control virtual package names (based on web context and page path) with that so I moved over to the class loader method for embedding. By any means it still compiles it as a Script class, and that script class does not reveal the field in any manner or form neither for the script itself nor for any closures/sub closures. I was thinking of seeing if there is any kind of runtime proxying or compile time techniques that might allow more insight on the structure of a groovy compiled class.
-
20. Re: Groovy + Facelets (Gracelets)
elponderador.anayluis.gass.gmail.com Mar 18, 2008 10:03 PM (in response to elponderador.anayluis.gass.gmail.com)Kito Mann,
I have it on sourceforge (gracelets) now. It is compatible at the moment and barely tested with the following jars:
jsf-facelets.jar (1.1.13)
el-ri.jar
el-impl.jar
jsf-api.jar (Sun JSF RI 1.2)
jsf-impl.jar
groovy-all-1.5.1.jar
log4j.jarI have converted the seam booking example over to gracelets for a proof of concept example, but I need to study up on the open source licenses to make sure I don't do anything wrong, ill post here when I have that example available to the public.
-
21. Re: Groovy + Facelets (Gracelets)
elponderador.anayluis.gass.gmail.com Mar 19, 2008 11:06 PM (in response to elponderador.anayluis.gass.gmail.com)On the source forge site I have a redone seam-booking example ear downloadable. Make sure you get the booking-ds.xml from the original example and put that in your deploy directory along with the ear, it should load up and you should be able to access it from the /seam-booking context.
-
22. Re: Groovy + Facelets (Gracelets)
elponderador.anayluis.gass.gmail.com Apr 4, 2008 7:40 PM (in response to elponderador.anayluis.gass.gmail.com)I have a new package and jboss 4.2.0 deployable war for a sort of documentation that is more of a documentation by example at the Source Forge Download Page. As long as you have jsf 1.2 and the el libs which is standard with jboss 4.2.0 available it should deploy fine.
In the beginning of this project it did not directly rely on seam, but after many changes and advances it is not heavily dependant on seam.
-
23. Re: Groovy + Facelets (Gracelets)
elponderador.anayluis.gass.gmail.com Apr 4, 2008 7:44 PM (in response to elponderador.anayluis.gass.gmail.com)CORRECTION: It is heavily dependant on seam.
-
24. Re: Groovy + Facelets (Gracelets)
elponderador.anayluis.gass.gmail.com May 19, 2008 7:05 PM (in response to elponderador.anayluis.gass.gmail.com)In reality the following, which is practically the same as your request works just fine in gracelets... the obvious differences is that instead of using annotation based injection, it uses groovy property resolution tied to the seam context. I was wondering if there was some reason why you would want the annotation to be used instead of property resolution. With annotations the users would have to always import the annotation classes and the domain classes into each script which would seam to make the scripts rely more on particular classes and also require more coding on the developers part... but just was curious what you think about the below example in relation to your requested example...
ui.composition(template: "template.xhtml") { ui.define(name: "body") { h1("Change password") h.form { print "Enter new password:" h.inputText ( value: Value { get: { return person.password; } set: { person.password = it; } } ) h.commandButton("Set password!", action: { person.setPassword(); } ) } } }
-
25. Re: Groovy + Facelets (Gracelets)
elponderador.anayluis.gass.gmail.com Jun 5, 2008 12:41 AM (in response to elponderador.anayluis.gass.gmail.com)There is some documentation available now, I will be adding more on a regular basis. The docs are found at:
-
26. Re: Groovy + Facelets (Gracelets)
misterloftcraft Dec 14, 2011 9:26 AM (in response to elponderador.anayluis.gass.gmail.com)I think that your coding sequence is quite good and it could prove to be a beneficial addition to the framework. The only I'm worried about is content security. Today that is the primary thing you should have taken care of.
-
27. Re: Groovy + Facelets (Gracelets)
elponderador.anayluis.gass.gmail.com Dec 14, 2011 10:50 PM (in response to elponderador.anayluis.gass.gmail.com)Can you please elaborate on exactly what you mean by
content security
. Of course this thread is pretty old, and Gracelets evolved alot since the original discussion started. But I am curious as to what you mean exactly bycontent security
.