You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Werner Punz <we...@gmail.com> on 2009/08/17 20:13:58 UTC

myfaces groovy bindings now checked in

Hello everyone
I just checked in the current state of the myfaces groovy/scripting
bindings.

First of all
the url is:

https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk
also you need to check out the latest myfaces 1.2 trunk, since
a plugin mechanism was added which allowed to enable this extension.

If you run the included "very rough so please do not hammer me it is a
testing ground" example, you can change the various jsf artefacts
located under WEB-INF/groovy/... on the fly either with a request reload
or with a regeneration of the component tree, depending on the artefact
you can see the change instantly.

Sort of like javarebel, but on scripting level.
Sorry for the huge delay for posting it, one year late, but as many know
my private situation I have become father a while ago, so my sparetime
currently is limited.


Werner


Re: myfaces groovy bindings now checked in

Posted by Werner Punz <we...@gmail.com>.
Werner Punz schrieb:
> Jan-Kees van Andel schrieb:
>> Can't wait to finish my Bean Validation stuff and try the Groovy example.
>>
>> I think Grant is right and it is indeed a very good thing for MyFaces
>> to have Goovy support.
>>
Yes indeed, while I personally think it is not suitable for big systems
due to Groovys speed problems, it definitely is heavens sent
if you want to program something small, or if you want to script parts
of your application, it really helps to be able
not to restart the server for every change.

The beauty of groovy more than other scripting languages is that it
delivers its own classloader therefore blends itself perfectly into
java. From what I have seen the other scripting languages either just
use JSR 233 or in case of jruby just can deliver objects, but not
classes you can instantiate (I have to do some testing to confirm that)

So in the end with good groovy bindings you can get seamless scripting
integration on the groovy side and you can blend it with java both ways
(calling java from groovy and calling groovy objects and classes from java)


>> Thanks for making the time!
>>
> Thanks a lot as I said i am not fully there yet, the code needs
> some overhaul which I will do the next weeks.
> 
> A lot of code will be dropped soon, because the original classloader
> stuff is not needed anymore.
> 
> So if you look into the code, it still is somewhat dirty and rough
> around the edges, my bigger priority was to get the codebase in a
> working condition into the repo, and then move on from then.
> 
Ok I did the code dump, now the code is clearer again.
I had checked in while I was in the middle of a refactoring process,
which basically was done to eliminate the custom classloader.
So there was a load of legacy code which now is removed and replaced
by the new plugin infrastructure added to myfaces 1.2
(Which is still not finished yet it is just for now hacked in to enable
the bindings)



Re: myfaces groovy bindings now checked in

Posted by Werner Punz <we...@gmail.com>.
Jan-Kees van Andel schrieb:
> Can't wait to finish my Bean Validation stuff and try the Groovy example.
> 
> I think Grant is right and it is indeed a very good thing for MyFaces
> to have Goovy support.
> 
> Thanks for making the time!
> 
Thanks a lot as I said i am not fully there yet, the code needs
some overhaul which I will do the next weeks.

A lot of code will be dropped soon, because the original classloader
stuff is not needed anymore.

So if you look into the code, it still is somewhat dirty and rough
around the edges, my bigger priority was to get the codebase in a
working condition into the repo, and then move on from then.

Wenrer


Re: myfaces groovy bindings now checked in

Posted by Jan-Kees van Andel <ja...@gmail.com>.
Can't wait to finish my Bean Validation stuff and try the Groovy example.

I think Grant is right and it is indeed a very good thing for MyFaces
to have Goovy support.

Thanks for making the time!

/Jan-Kees


2009/8/17 Grant Smith <wo...@gmail.com>:
> Werner, thank you very much for this. This is a huge deal for MyFaces!
>
> Sent from my iPhone
>
> On Aug 17, 2009, at 11:13 AM, Werner Punz <we...@gmail.com> wrote:
>
>> Hello everyone
>> I just checked in the current state of the myfaces groovy/scripting
>> bindings.
>>
>> First of all
>> the url is:
>>
>> https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk
>> also you need to check out the latest myfaces 1.2 trunk, since
>> a plugin mechanism was added which allowed to enable this extension.
>>
>> If you run the included "very rough so please do not hammer me it is a
>> testing ground" example, you can change the various jsf artefacts
>> located under WEB-INF/groovy/... on the fly either with a request reload
>> or with a regeneration of the component tree, depending on the artefact
>> you can see the change instantly.
>>
>> Sort of like javarebel, but on scripting level.
>> Sorry for the huge delay for posting it, one year late, but as many know
>> my private situation I have become father a while ago, so my sparetime
>> currently is limited.
>>
>>
>> Werner
>>
>

Re: myfaces groovy bindings now checked in

Posted by Werner Punz <we...@gmail.com>.
Its not quite there where I want it to be but it is a start.

The issues are I want more than groovy in, but for now as far as I could
see only groovy allows direct classloading. JRuby for instance only
allows object loading or jsr 223.
The same probably applies to jython.

We probably can work around the object only limitation in the long run.
But lets get the groovy stuff proper first :-)


Werner



Grant Smith schrieb:
> Werner, thank you very much for this. This is a huge deal for MyFaces!
> 
> Sent from my iPhone
> 
> On Aug 17, 2009, at 11:13 AM, Wernecr Punz <we...@gmail.com> wrote:
> 
>> Hello everyone
>> I just checked in the current state of the myfaces groovy/scripting
>> bindings.
>>

>> First of all
>> the url is:
>>
>> https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk
>> also you need to check out the latest myfaces 1.2 trunk, since
>> a plugin mechanism was added which allowed to enable this extension.
>>
>> If you run the included "very rough so please do not hammer me it is a
>> testing ground" example, you can change the various jsf artefacts
>> located under WEB-INF/groovy/... on the fly either with a request reload
>> or with a regeneration of the component tree, depending on the artefact
>> you can see the change instantly.
>>
>> Sort of like javarebel, but on scripting level.
>> Sorry for the huge delay for posting it, one year late, but as many know
>> my private situation I have become father a while ago, so my sparetime
>> currently is limited.
>>
>>
>> Werner
>>
> 


Re: myfaces groovy bindings now checked in

Posted by Matthias Wessendorf <ma...@apache.org>.
Werner,

thanks for all the great stuff. Good job!

-Matthias

On Wed, Aug 19, 2009 at 4:47 PM, Werner Punz<we...@gmail.com> wrote:
> Ok guys I was able to work on the stuff a little bit more.
> Here is what definitely is working now:
> a) Scripting of Renderers, Validators, Phase Listeners (should work but
> only partially tested)
>
> b) Scripting of managed beans, here comes the goody.
> This fully now works.
>
> Reloading works on all type of beans, request, session, and application
> scoped beans, with all properties as far as possible being kept intact,
> thanks to a custom el resolver doing the hard lifting
> Also I managed to pull of dependency resolution on the groovy side
> which means you now can simply drop a class into the sources and have it
> included from one of the beans and it automatically is picked up, same
> goes for the changes if a referencing bean also is changed.
> (this is a small limitation of the classloader hierarchy used here)
>
> I tried it with a custom utils class which does el resolving and it was
> properly picked up by the managed bean referenced in the view layer.
>
> My personal goal on this is to be able to write a mini blogging app
> without a single server restart (except for faces-config changes, where
> myfaces reloading should kick in)
>
> Also additionally you can now add a servlet context init parameter with
> search paths for your scripts so that you now be able to work directly
> with your scripts in your source directory and have the server picking
> it up. (and do an occasional recompile here and then)
>
>
>
>
>
>
>
>



-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf

Re: myfaces groovy bindings now checked in

Posted by Werner Punz <we...@gmail.com>.
Ok guys I was able to work on the stuff a little bit more.
Here is what definitely is working now:
a) Scripting of Renderers, Validators, Phase Listeners (should work but
only partially tested)

b) Scripting of managed beans, here comes the goody.
This fully now works.

Reloading works on all type of beans, request, session, and application
scoped beans, with all properties as far as possible being kept intact,
thanks to a custom el resolver doing the hard lifting
Also I managed to pull of dependency resolution on the groovy side
which means you now can simply drop a class into the sources and have it
included from one of the beans and it automatically is picked up, same
goes for the changes if a referencing bean also is changed.
(this is a small limitation of the classloader hierarchy used here)

I tried it with a custom utils class which does el resolving and it was
properly picked up by the managed bean referenced in the view layer.

My personal goal on this is to be able to write a mini blogging app
without a single server restart (except for faces-config changes, where
myfaces reloading should kick in)

Also additionally you can now add a servlet context init parameter with
search paths for your scripts so that you now be able to work directly
with your scripts in your source directory and have the server picking
it up. (and do an occasional recompile here and then)








Re: myfaces groovy bindings now checked in

Posted by Matthias Wessendorf <mw...@gmail.com>.
+1 thanks Werner! This is really à great thing!

Sent from my iPod.

On 17.08.2009, at 20:26, Grant Smith <wo...@gmail.com> wrote:

> Werner, thank you very much for this. This is a huge deal for MyFaces!
>
> Sent from my iPhone
>
> On Aug 17, 2009, at 11:13 AM, Werner Punz <we...@gmail.com>  
> wrote:
>
>> Hello everyone
>> I just checked in the current state of the myfaces groovy/scripting
>> bindings.
>>
>> First of all
>> the url is:
>>
>> https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk
>> also you need to check out the latest myfaces 1.2 trunk, since
>> a plugin mechanism was added which allowed to enable this extension.
>>
>> If you run the included "very rough so please do not hammer me it  
>> is a
>> testing ground" example, you can change the various jsf artefacts
>> located under WEB-INF/groovy/... on the fly either with a request  
>> reload
>> or with a regeneration of the component tree, depending on the  
>> artefact
>> you can see the change instantly.
>>
>> Sort of like javarebel, but on scripting level.
>> Sorry for the huge delay for posting it, one year late, but as many  
>> know
>> my private situation I have become father a while ago, so my  
>> sparetime
>> currently is limited.
>>
>>
>> Werner
>>

Re: myfaces groovy bindings now checked in

Posted by Grant Smith <wo...@gmail.com>.
Werner, thank you very much for this. This is a huge deal for MyFaces!

Sent from my iPhone

On Aug 17, 2009, at 11:13 AM, Werner Punz <we...@gmail.com> wrote:

> Hello everyone
> I just checked in the current state of the myfaces groovy/scripting
> bindings.
>
> First of all
> the url is:
>
> https://svn.apache.org/repos/asf/myfaces/extensions/scripting/trunk
> also you need to check out the latest myfaces 1.2 trunk, since
> a plugin mechanism was added which allowed to enable this extension.
>
> If you run the included "very rough so please do not hammer me it is a
> testing ground" example, you can change the various jsf artefacts
> located under WEB-INF/groovy/... on the fly either with a request  
> reload
> or with a regeneration of the component tree, depending on the  
> artefact
> you can see the change instantly.
>
> Sort of like javarebel, but on scripting level.
> Sorry for the huge delay for posting it, one year late, but as many  
> know
> my private situation I have become father a while ago, so my sparetime
> currently is limited.
>
>
> Werner
>