Led & Sustained by

G2one Logo

Developed with

Intellij

Powered by

Spring

OpenLaszlo plugin

OpenLaszlo plugin

Abstract^

This plugin installs OpenLaszlo servlet for Grails into GRAILS_HOME directory and scaffolds artifacts of related OpenLaszlo included a Controller and Views.

Current plugin version: 0.6.2 ^

OpenLaszlo servlet version: 4.0.10

cf. http://www.openlaszlo.org

Command options list ^

option description usage
install-laszlo installs OpenLaszlo servlet and jar libraries, which are necessary for laszlo into GRAILS_HOME. Also it downloads openlaszlo servlet war file from OpenLaszlo remote site. grails install-laszlo
generate-laszlo generate scaffolding of views and controller related OpenLaszlo grails generate-laszlo [domain-class-name]
copy-laszlo simply copy laszlo libraries into grails_app. grails copy-laszlo
remove-laszlo uninstalls OpenLaszlo servlet and jar libraries from GRAILS_HOME and grails app. grails remove-laszlo

Requirements ^

  • Java j2sdk 1.4 or later
  • Grails 1.0.2 for laszlo plugin 0.6.2 (Grails 1.0.1 for laszlo plugin 0.6.1) (Grails 1.0-RC3 for laszlo plugin 0.5.3)
  • Flash Player 8.0 or later

Download site ^

If you use a command of 'grails install-plugin laszlo', you don't need to download at all.

This command will download a latest release zip file automatically from http://plugins.grails.org/grails-laszlo.

Installation ^

on Linux

  1. Set environment variables for Grails
    linux$ JAVA_HOME=/usr/java/jdk1.6
    linux$ GRAILS_HOME=${HOME}/grails-1.0.2
    linux$ PATH=${JAVA_HOME}/bin:${GRAILS_HOME}/bin:${PATH}
    linux$ export JAVA_HOME GRAILS_HOME PATH
  2. Create new Grails application
    linux$ grails create-app testapp

    NOTE: here "testapp" is the Grails application's name.

  3. Install this plugin into a Grails app
    linux$ cd testapp
    linux$ grails install-plugin laszlo
  4. Install OpenLaszlo servlet on GRAILS_HOME
    linux$ grails install-laszlo

on Windows

  1. Set environment variables for Grails
    > set JAVA_HOME=c:\Program Files\Java\jdk1.6
    > set GRAILS_HOME=c:\grails-1.0.2
    > set PATH=%JAVA_HOME%\bin;%GRAILS_HOME%\bin;%PATH%
  2. Create a new Grails application
    > grails create-app testapp

    NOTE: here "testapp" is the Grails application's name.

  3. Install this plugin into a Grails app
    > cd testapp
    > grails install-plugin laszlo
  4. Install OpenLaszlo Servlet on GRAILS_HOME
    > grails install-laszlo

    NOTE: When writing new applications (when you already executed the "grails install-laszlo") you can replace this command with:

    > grails copy-laszlo

How to use OpenLaszlo plugin ^

  1. Create a Domain class
    > grails create-domain-class Cat

    Then edit such as follows:

    /*** testapp/grails-app/domain/Cat.groovy ***/
    class Cat {
      String name
      Integer age
      String sex
      String color
    }
    /********************************************/
  2. Generate all of artifacts (a controller, views and a lzx)
    > grails generate-laszlo Cat
  3. Start a web application
    > grails run-app
  4. Access http://localhost:8080/testapp/cat/ to watch an example app

    Also http://localhost:8080/testapp/plugins/laszlo-0.6.2/charts/ for chart example

Tag library ^

OpenLaszloTagLib.groovy

tag attributes description usage
lpsJs src defines javascript for laszlo <g:lpsJs src="embed.js" /><g:lpsJs src="script.js" />
lzEmbed src,width,height,color embeds lzx file <g:lzEmbed src="cat/gridList.lzx" width="800" height="400" color="#d4d0c8"/>
pluginJs src define javascript for plugin at grails_app_root/plugins/laszlo-0.6.2/web-app/js/ <g:pluginJs src="swfobject.js" />

Screen shot ^

Q&A ^

  • Is is possible to use charts to update in realtime on this plugin?

Yes. This plugin includes OpenLaszlo charts components. So you can use them.

These components are located in GRAILS_APP/web-app/lps/components/charts.

For example please visit http://localhost:8080/GRAILS_APP/lps/components/charts/test/integral/ after running "grails run-app" on your grails application.

Also it's available to use Fusion Chart 2.3 on OpenLaszlo plugin.

Using withFusionChart.zip, it shows like this:



In this example there are two buttons. One is a button to update a chart inside on flash by OpenLaszlo.

Another is outside flash by HTML button, which calls Java script function to update same chart object by SWFObject.js.

requirements:

  • Fusion Chart 2.3
  • swfobject,js

references:

example zip: withFusionChart.zip


Plugin version history ^

  • Mar.27,2008
    • tested on Grails version 1.0.2
  • Mar.11,2008
    • tested on Grails version 1.0.1
    • upgraded to OpenLaszlo 4.0.10
  • Feb.12,2008
    • tested on Grails version 1.0
    • upgraded to OpenLaszlo 4.0.9
  • Dec.21,2007
    • tested on Grails version 1.0-RC3
  • Dec.2,2007
    • tested on Grails version 1.0-RC1
    • upgraded to OpenLaszlo 4.0.7
  • Sep.26,2007 (version 0.5.1)
    • upgraded OpenLaszlo from version 4.0.3 to 4.0.5.
  • Sep.9,2007 (version 0.5)
    • upgraded LZX with Ajax to paginate
    • added Gant script to compile LZX to SWF and to make a war file for LZX SOLO app without laszlo libraries
  • Sep.3,2007 (version 0.4.4)
    • tested on Grails verson 0.6
  • Aug.6,2007 (version 0.4.3)
    • upgraded OpenLaszlo from version 4.0.2 to 4.0.3.
  • Jun.18,2007 (version 0.4.2)
    • upgraded OpenLaszlo from version 4.0.0 to 4.0.2.
    • tested on Grails version 0.5.6
  • May 16,2007 (version 0.4.1)
    • changed to use templates for scaffoldings of related OpenLaszlo
  • May 8,2007 (version 0.4)
    • fixed for Grails version 0.5 upgraded.
  • Mar.29,2007 (version 0.3)
    • modifyed copyLaszlo.groovy to add java libs for OpenLaszlo 4.0.0 (thanx > Chanwit-san, Mar.30,2007)
    • tested on Grails 0.4.2.
    • upgraded OpenLaszlo from version 3.3.3 to 4.0.0.
    • upgraded to generate Flash swf version over 8.0.
  • Feb.12,2007 (version 0.2)
    • tested on Grails 0.4.2.
    • tested on Grails 0.4.1 and fixed problems on this release.
    • changed scaffolded distination directory into grails_app_root/plugins/Laszlo-0.2/grails-app/.
  • Feb.6,2007 (version 0.2)
    • tested on Grails 0.4 and fixed a problem of scaffolding with "generate-laszlo" option on this stable release.
  • Jan.19,2007 (version 0.2)
    • added swfobject.js to access from outside flash by Javascript.
    • added "grails copy-laszlo" option for only copy laszlo libraries into grails_app without "grails generate-laszlo".
    • fixed a bug for deployment to jakarta tomcat.

      (Note:When deploying into tomcat, if it requires 'webAppRootKey' context-param in your web.xml files, please add it appropriately)
    • added a chart example using FusionCharts.
  • Dec.14,2006 (version 0.1)
    • install OpenLaszlo Servlet into GRAILS_HOME.
    • generate scaffoldings for OpenLaszlo on Grails.
    • remove OpenLaszlo libraries from GRAILS_HOME.
</