|René Nyffenegger's collection of things on the web|
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
Taking a look at Laszlo (or how to build Laszlo from scratch)
Update October 18th 2004: Using the Laszlo framework with a standalone application.
Laszlo Systems, Inc has recently released Laszlo under an Open Source License. Laszlo creates Flash Applications out of XML (more exaclty: LXZ) files. This is reason enough to take a look at Laszlo.
As I am a developer myself, I decided to download the sources rather than the binary distribution. In order to build it, J2SE 1.4.2 SDK, Cygwin and Jython are additionally needed.
The sources for Laszlo can be downloaded from http://openlaszlo.org/download/. The file is called lps-2.2-src.tar.gz and is 104MB big.
Of course, the file needs to be unzipped after downloading it. In my case, these files were unzipped into C:\rene\laszlo.
Setting up the build environment
We need to create some environment variables. The variable LASZLO_ROOT is the only variable that you will have to set differently. LASZLO_ROOT is the directory in which Laszlo was unzipped
C:\> set LASZLO_ROOT=c:\test\laszlo C:\> set LPS_HOME=%LASZLO_ROOT%\lps-2.2-src\lps-2.2 C:\> set ANT_HOME=%LASZLO_ROOT%\lps-2.2-src\tools\jakarta-ant-1.5.1 C:\> set PATH=%ANT_HOME%\bin;%PATH%
Make sure you have a JDK version 1.4.2. Set the JAVA_HOME accordingly:
C:\> set JAVA_HOME=\j2sdk1.4.2_06 C:\> set PATH=%JAVA_HOME%\bin;%PATH%
The source distribution comes with JavaCC which needs to be installed:
C:\> set JAVACC_HOME=%LASZLO_ROOT%\lps-2.2-src\tools\ C:\> copy "%LPS_HOME%\3rd-party\jars\dev\JavaCC.zip" %LASZLO_ROOT%\lps-2.2-src\tools C:\> cd %JAVACC_HOME% C:\rene\laszlo\lps-2.2-src\tools> java -cp . JavaCC2_1
The installer asks for a directory in which JavaCC will be installed. Use %LASZLO_ROOT%\lps-2.2-src\tools\javacc2.1. Most probably, the installer will not try to expand %LASZLO_ROOT%, so insert your LASZLO_ROOT.
Get Python 2.2 and install it.
Python.exe must also be included in the PATH.
C:\> set PATH=c:\python22;%PATH%
Jython needs to be installed:
C:\> cd %LASZLO_ROOT%\lps-2.2-src\tools C:\rene\laszlo\lps-2.2-src\tools> java -cp . jython-21
The installer will ask for an installation directory. I chose c:\rene\tools. You will have to set JYTHON_HOME to this directory:
C:\> set JYTHON_HOME=c:\rene\tools\jython-2.1 C:\> set PATH=%JYTHON_HOME%;%PATH%
Just because it's so much fun, PyXML has to be installed as well:
We're not finished yet, a (modified?) version of Tomcat is going to be installed:
I have already a Tomcat on my System, so I overwrote the port (4321 instead of 8080). Also, remember the username and password you used.
Set TOMCAT_HOME to the directory in which Tomcat was installed:
C:\> set TOMCAT_HOME=\LaszloTomcat5.0
You need also to adjust %LPS_HOME%\build.properties to reflect username, password and port:
tom.url = http://localhost:4321/manager tom.username = laszlo tom.password = *******
Get and install Cygwin. The default options should do. Adjust the PATH so that it finds the bin directory of Cygwin:
C:\> set PATH=c:\Cygwin\bin;%PATH%
C:\> set PATH=%LPS_HOME%\WEB-INF\lps\server\bin;%PATH% C:\> cd %LPS_HOME% C:\rene\laszlo\lps-2.2-src\lps-2.2> ant build C:\rene\laszlo\lps-2.2-src\lps-2.2> ant start C:\rene\laszlo\lps-2.2-src\lps-2.2> ant install
Now, go to
A small examples
In order to create some small demonstration examples, I create a directory under %LPS_HOME%:
C:\rene\laszlo\lps-2.2-src\lps-2.2> mkdir %LPS_HOME%\test
In this directory, an lzx file (named first.lzx) is created:
<canvas> <text>This is a test-text.</text> <button>press me</button> <window> <view bgcolor='white' width='100' height='100'> <view bgcolor='black' width='50' height='50' x='50' /> <view bgcolor='black' width='50' height='50' y='50' /> </view> </window> </canvas>
After this file is created, it needs to be deployed. This can be done using ant:
C:\rene\laszlo\lps-2.2-src\lps-2.2> ant stop C:\rene\laszlo\lps-2.2-src\lps-2.2> ant install C:\rene\laszlo\lps-2.2-src\lps-2.2> ant start
Now, it can be looked at with
Berlin Laszlo User Group