Grails Flex Scaffold 0.1.1 Released

GFSv0.1.1 realease!!!

The only goal of this realease is adding Grails-1.1 support, so there are no new features included. We are putting all our efforts on GFSv0.2 (for more information on GFSv0.2 ->GFS-Jira)

We fixed issues of configuration, improved the FlexTasks script and refactor the commands to support the nomenclature of the generated applications

Included Features:

Relations

Supports one-to-one, one-to-many and many-to-one.

In one-to-one there doesn’t work update (it doesn’t update the record ), we don’t know why. If someone kwons or wants to check it is going to be of grear help for us.

Validations

GFS supports validations in FrontEnd from Grails’ constraint

Code Generation

CRUD’s views are generated from Grails Domain Class definition.

Adobe Flex Builder Integration

Once, first compilation via FlexTasks done, it is possible to Import the project into FlexBuilder (or Eclipse + FlexBuilder Plugin to support Grails too), that’s because FlexTasks generates Eclipse/FlexBuilder configuration property files. Obviously, FlexTasks generates an index.gsp that wraps the swf too.
Tip: “In order to debug flex application from FlexBuilder, it is necessary to modify the access url –>Open Debug’s configuration Dialog –> uncheck “Use Defaults” and remove main.html of three configurations.
We could not find any file of configuration that contains these parameters, that’s why the tip.”

Resources

GFS in Action (screencast)

Project Source: http://plugins.grails.org/grails-flex-scaffold

For more information about the use of GFS visit Official Docs (User Guide, Examples)

Bug reporting and versions’ status http://jira.codehaus.org/browse/GFS

Comming Soon GFSv0.2, to see the roadmap

About these ads

Tags: , ,

22 Responses to “Grails Flex Scaffold 0.1.1 Released”

  1. Enrico Says:

    Hi, I was able to run the example on mac os x; I am now trying on a linux ubuntu box and everyting goes fine but when i try grails flex-tasks i get:

    enrico@enrico-laptop:~/gsf-test$ grails flex-tasks
    Welcome to Grails 1.1 – http://grails.org/
    Licensed under Apache Standard License 2.0
    Grails home is set to: /home/enrico/grails-1.1

    Base Directory: /home/enrico/gsf-test
    Running script /home/enrico/.grails/1.1/projects/gsf-test/plugins/flex-scaffold-0.1.1/scripts/FlexTasks.groovy
    Flex Home: /home/enrico/Desktop/flexsdk
    Loading configuration file /home/enrico/Desktop/flexsdk/frameworks/flex-config.xml
    /home/enrico/gsf-test/web-app/main.swf is up-to-date and does not have to be rebuilt.
    Error executing script FlexTasks: : java.lang.NullPointerException
    gant.TargetExecutionException: : java.lang.NullPointerException
    at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:331)
    at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
    at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
    at gant.Gant.withBuildListeners(Gant.groovy:344)
    at gant.Gant.this$2$withBuildListeners(Gant.groovy)
    at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
    at gant.Gant.dispatch(Gant.groovy:334)
    at gant.Gant.this$2$dispatch(Gant.groovy)
    at gant.Gant.invokeMethod(Gant.groovy)
    at gant.Gant.processTargets(Gant.groovy:495)
    at gant.Gant.processTargets(Gant.groovy:480)
    Caused by: : java.lang.NullPointerException
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:115)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at FlexTasks$_run_closure6.doCall(FlexTasks:136)
    at FlexTasks$_run_closure2.doCall(FlexTasks:88)
    at FlexTasks$_run_closure1.doCall(FlexTasks:67)
    at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
    … 10 more
    Caused by: java.lang.NullPointerException
    at java.io.Reader.(Reader.java:61)
    at java.io.InputStreamReader.(InputStreamReader.java:55)
    at flex.ant.HtmlWrapperTask.outputResources(Unknown Source)
    at flex.ant.HtmlWrapperTask.getInputStream(Unknown Source)
    at flex.ant.HtmlWrapperTask.execute(Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
    … 15 more
    Do you have an idea about what could be the reason for this failure?
    Thanks and great work with the plugin!
    Enrico

    • Ezequiel Apfel Says:

      Apparently the error happens when it tries to wrap swf into index.gsp.
      Check if you SDK support

      version-major=9
      version-minor=0
      version-revision=124

      These properties are in [youproject]/flex.properties

      If your SDK doesn’t support it, you must change “version-revision” into another version.

      You can check in FlexBuilder

      Project’s properties -> Flex Compiler (HTML wrapper)

      Regards

  2. worknet Says:

    Hi! Friend, how to search in fields? Return with parameters?

    • Ezequiel Apfel Says:

      Hi, You must be create a method in your service’s DomainClass , see CustomerService into gsf-test

  3. Eduardo Méndez Says:

    Hello,

    I’m trying to show the Customers a Company has in the Company screen inside a table.

    I can create correctly the Company. In the Customer screen, I got a company field with a dropdown for selecting the company I just created. When I select it, the customer is also created correctly but when I return to the Company screen to see if the customer is in the table, the table is empty.

    I tried to add it explicitly with this in Customer.groovy:

    void setCompany( Company c )
    {
    this.company = c
    if (!c.customers.contains( this ))
    c.customer.add( this )
    println “added”
    }

    “added” shows in the console but nothing shows in the screen.

    I know that this is more a general Groovy question but I run out of ideas. Would you lend me a hand?.

    Thanks in advance.

  4. worknet Says:

    Hello! Friend, Is possible use the JSON and JQUERY to assemble a list of values, return to the camps?

  5. Ezequiel Apfel Says:

    Hi, yes. see Grails documentation and plugin central

  6. worknet Says:

    Ok! Thanks. You can show me an example?

    • Ezequiel Apfel Says:

      Hi worknet, we are really sorry but your last comments are out of the scope of this blog. Flex doesn’t need JSON to work, (GFS used BlazeDS wich marshalles server side DomainObjects and Flex’s VO).
      Regards.

  7. worknet Says:

    I try modifiy the file “RelationOne.mxml” to get it, but not ok.

  8. worknet Says:

    Ok! Sorry. And sucess!

  9. Chris Norton Says:

    Hello, and congratulations on v1.1. !!!

    This is really a fantastic plugin and I wish you much success. Are you looking for volunteers? I would be happy to help out with i18n, documentation, testing, bug-fixing, etc. Email me if I can help.

    One question: It looks like one-to-one objects aren’t persisted properly: in the demo, the Phone object disappears after the Customer object is edited.

    Thanks,

    Chris

    • Ezequiel Apfel Says:

      Hi, thanks for your comment
      We’re going to release GFSv0.2 next days, from this milestone we’re going to syncronize our code to grails-plugin svn so we like you to help us with our backlog.
      (i18n support is released on GFSv0.2).
      Please send me an email with your personal data and experience in order to plan tasks distribution and give you all access (confluence, svn, jira)
      Regards to error, it ‘s resolved on GFSv0.2 (there is a bug on this item: updates doesn’t work for one-to-one, we don’t know why)
      Regards,
      Ezequiel

  10. Proteu Alcebidiano Says:

    Hello hermanos, congrats for your plug-in project, that a really nice plugin!

    My suggestions about Lazy Loading and One-to-one mapping problems:

    To lazy loading works with remoting, you may use this fragment on web.xml template file (after grails install-templates command):

    sessionView

    org.codehaus.groovy.grails.orm.hibernate.support.GrailsOpenSessionInViewFilter

    sessionView
    /*

    This works nice for me, and i do not need to declare lazy:false as you declare in your gfs-test. i dont know if this one is the best solution for production mode, but it works for me here in my pet project with your flex-scaffold.

    2. The relation one-to-one is really persisted, but just on the moment as you add it. In your example, if you add a customer, and after this you enter in customer’s edit window, edit the phone number, press Ok on phone number and you CANCEL the customer’s edit window, it will appears the phone number correctly edited, if you enter again on customers’s edit window.

    If you submit this customer after this scenario you got the phone value previously added. For me, this one-to-one problem is just a ‘cache failure’ between entities.

    See ya and congrats again!

  11. Proteu Alcebidiano Says:

    oops, maybe the web.xml fragment is broken. let me correct this changing the tag token to “?” symbol:

    ?filter?
    ?filter-name?sessionView?filter-name?
    ?filter-class? org.codehaus.groovy.grails.orm.hibernate.support.GrailsOpenSessionInViewFilter
    ?filter-class?
    ?filter?

    ?filter-mapping?
    ?filter-name?sessionView?filter-name?
    ?url-pattern?/*?url-pattern?
    ?filter-mapping?

    see ya

    • Ezequiel Apfel Says:

      Hi, thank you so much for the info. We will prove it and then we will give you feedback
      Regards,
      Ezequiel

  12. Proteu Alcebidiano Says:

    Alternatingly, as you do in gfs plugin, you can append this code in doWithWebdescriptor closure:

    def filters = xml.’filter’
    filters[filters.size() - 1 ] + {
    ‘filter’ {
    ‘filter-name’(“sessionView”)
    ‘filter-class’(“org.codehaus.groovy.grails.orm.hibernate.support.GrailsOpenSessionInViewFilter”)
    }
    }

    def filterMappings = xml.’filter-mapping’
    filterMappings[filterMappings.size() - 1] + {
    ‘filter-mapping’ {
    ‘filter-name’(“sessionView”)
    ‘url-pattern’(“/*”)
    }
    }

    cheers :D

  13. Proteu Alcebidiano Says:

    Hello guys,

    I fix the one-to-one problem on update. First i set the phone number as lazy:false, in the class Customer, after that i put the line customer.phone.save() on CustomerService.groovy:

    if (customer.id) {

    // saving phone before save customer
    customer.phone.save()

    def customerMerged = customer.merge()
    if(customerMerged)
    customer = customerMerged
    }

    So, in general, if you put these lines on templates, it will be works fine!

    cheers

  14. Proteu Alcebidiano Says:

    and unfortunately, the solution on GrailsOpenSessionInViewFilter only works on one-to-many. In other cases, the objects still remains null and don’t throw any exceptions =/

    see ya

  15. mlin Says:

    Great work .. there are very minor bugs … but works like a charm … I had been started using PureMVC, I found it cleaner that the original Cairngorm explained in Adobe’s site, but I liked your approach in creating model classes, and separeting the services. Excellent work …

  16. gkudos Says:

    great work
    congratulations…
    we will be following this product…
    it would be interesting to contribute to it with some code…
    greetings.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: