0 Replies Latest reply on Feb 1, 2010 2:08 AM by Ilya Dyoshin

    Groovy support in SEAM

    Ilya Dyoshin Novice

      Good day,


      I've reached the need to integrate Groovy into my application. I'm using seam-gen from seam-2.2.0.GA. First of all the generated build.xml file doesn't correctly supports groovy compiling so I've made following changes:


           <target name="compile" depends="init"
                description="Compile the Java and Groovy code" unless="eclipse.running">
                <groovyc classpathref="build.classpath"
                     destdir="${jar.dir}">
                     <src path="${src.model.dir}"/>
                     <src path="${src.action.dir}"/>
                     <javac deprecation="${javac.deprecation}"
                          nowarn="off" debug="${javac.debug}"/>
                </groovyc>
                
           </target>
      
          <target name="compiletest"  unless="eclipse.running" description="Compile the Java source code for the tests">
              <mkdir dir="${test.dir}"/>
               <groovyc classpathref="build.classpath"
                     destdir="${test.dir}">
                     <src path="${src.model.dir}"/>
                     <src path="${src.action.dir}"/>
                    <src path="${src.test.dir}"/>
                     <javac deprecation="${javac.deprecation}"
                          nowarn="on" debug="${javac.debug}"/>
                </groovyc>
          </target>



      this allowed to me using .groovy files with .java files together. system compiles perfectly and some dummy testing is done correctly: dummyService is in groovy and SprFizLicList in the java:



      @Name("dummyService")
      public class DummyService implements Serializable{
      
           @In(create=true)
           SprFizLicList sprFizLicList;
           
           @Logger
           org.jboss.seam.log.Log log;
           
           public void sayHello() {
                log.info "some information called #0", "parametrized"
                sprFizLicList.clearWrappedData()
           }
      }



      but I can't get code-completion in the facelets editor for my groovy-defined services (beans - call it anyhow). Any ideas ??



      Regards,


      Ilya Dyoshin