Download your favorite Linux distribution at LQ ISO.
Go Back > Blogs > sam_o_rogers
User Name


Rate this Entry

OpenLaszlo Newbie

Posted 11-29-2008 at 08:45 PM by sam_o_rogers


Took a look at the OpenLaszlo video, and was very impressed that you can add drag and drop to web pages, using either Flash or DHTML. I am interested in the second because I want to be able to generate pages that can be run on Firefox from any platform. I could give a...
well, I'll try to keep this post civil, lets just say Internet Explorer is not my favorite browser.

The other thing I like, is it looks like you can get very creative, and only need the ISP to host normal web pages.

First step was to get OpenLaszlo installed. I must admit, I've been struggling a bit with this one.

I am running Ubuntu 6.06. Yes, I know that's about three or four releases behind the times. But I don't want to mess with a working system and take a chance on breaking something.

I did get the files downloaded and safely tucked away in another partition.

The first challenge was getting JAVA_PATH correctly specified. Went searching for the SDK, with find, but with little luck. Did a which java, and it ended pointing to my JRE, not my JDK.

Downloaded the latest JDK got the environment variable defined and exported in a terminal window, then executed the and low and behold, I can now run http://localhost:8080/lps-4.1.1/examples/hello.lzx and see the Hello Laszlo web page.

OK, I say to myself, how about adding a panel button for starting Tomcat.

Now a word of explanation. I'm running everything on this laptop. For development work, I run as a normal user with a user id dedicated for that purpose. I don't want root privilege for this, and worse case scenario, I can save my data and blow away the user if anything un-nice happens. Likewise, I don't want to start Tomcat as part of the normal system services. Yes, I know it would be fun, but it is also a potential vector for bad things, and I want to limit it to when I really need it.

However the long and the short of it is, I can create a bash shell script to set the environment variable and start Tomcat, and that works fine. Tomcat remains running even after I shut down the terminal window.

However if I launch the script as a button from a panel, it doesn't work.

The command is ./Start_Tomcat/

It is set to run in a terminal.

Here is the script:

# Begin Script.
# Display a simple menue.
echo "Simple menu to Start or Stop Tomcat."
echo "Enter 1 to Start Tomcat."
echo "Enter 2 to Stop Tomcat."

# Get a selection.

read start_stop

#probably should make the following simpler, don't really need the case.

case $start_stop in
echo ""
echo "Please enter '1' or '2'."

# That third case is useless, because I don't loop.

#set the JAVA_HOME environment variable.

export JAVA_HOME
export PATH

# Don't pay any attention to the partition name. At one point I was thinking of installing different versions of Linux, but this Ubuntu does everything I need. The kubuntu is just a leftover partition name.

if [ $okToProceed = "1" ] ; then

# Selection 1 will start Tomcat.

echo "Starting Tomcat"
echo "Tomcat Started"


# I know I said enter 2 to stop Tomcat, but in reality, anything other than a 1 will stop Tomcat.

echo "Stopping Tomcat"
echo "Tomcat Stopped"


# This final read will force the terminal window to remain open until there is an input.

read cont < /dev/tty

# End of Script.

So what this means is that as long as the window remains open, Tomcat will continue to run.

The question I have is why is it that when this terminal window closes, my Tomcat stops, but when I launch a normal terminal window and run the script, Tomcat continues to run until I run the, even if I close the terminal window I used to start Tomcat?

Yeah, I've a bad habit with run on sentences.

By the way, the works just fine from the panel button, as I would expect. It's just the start that has got me puzzled.

If I ever figure out what I need to do to keep it running from the panel, I'll post the answer.

Meanwhile, I will post what I learn as I explore OpenLaszlo.
Posted in Uncategorized
Views 3253 Comments 2
« Prev     Main     Next »
Total Comments 2


  1. Old Comment
    Well, Tomcat is running on my laptop. I can disconnect from the internet, and the OpenLaszlo web pages are still being served.

    All right. I mentioned that one of the things that attracted me to OpenLaszlo is that it allowed you to create a .DHTML document, and you didn't need to have flash installed on your machine.

    Well this is true to a point. Minor detail I didn't realize, call me ignorant, is the dhtml refers to the
    OpenLaszlo service that is running. What this means is you have something like this:

    <script type="text/javascript">
    lz.embed.dhtml({url: 'hello_world.lzx?lzt=object&lzr=dhtml',
    bgcolor: '#ffffff', width: '100%', height: '100%', id: 'lzapp'});
    lz.embed.lzapp.onload = function loaded()
    {var s = document.getElementById('lzsplash');
    if (s) LzSprite.prototype.__discardElement(s);

    Which means a whole bunch of OpenLaszlo needs to be installed on the server which services the web pages, as opposed to the SOLO application. When I attempted to select SOLO, even though I specified .dhtml, the resultant web page still contained only .swf files.

    Another minor detail, it generates pages for flash seven and flash 8, but I know there were some serious problems with flash that were fixed with flash 10, and I don't know what will happen if you try to run the resultant .swf with flash 10. I know I should install flash 10 before I start commenting, but the point of this exercise is to learn about OpenLaszlo, and if installing Flash 10 breaks something, I'm up a creek.

    Taking a look at some of the javascript files, I have to admit that I am impressed with the work the OpenLaszlo team has done. There is really a lot of stuff there.
    Posted 12-08-2008 at 06:25 AM by sam_o_rogers sam_o_rogers is offline
  2. Old Comment
    It has been a couple of years since my last post.

    Open Laszlo, while it did what I wanted, I ran into a problem when they did an update, forget the versions, I switched from and two, but was running into a problem.

    Well, I did get an updated copy installed on Fedora 10, but the machine had a tendency to shut down. Suspect it was a bios issue with a machine designed for home entertainment, and not as a server. So it would decide to shutdown on it's own if it wasn't being used. Not something a server should do. Picked up a netbook and installed Ubuntu 9.04, and got Open Laszlo installed, and working, then installed it on a different machine running XP.

    One thing that you need to be aware of is the Tomcat that is delivered with Open Laszlo, is an older version. You have trouble the current Vanilla Tomcat, and the Tomcat for Open Laszlo, because the value of the environment variable CATALINA_HOME needs to be changed depending on the version you use. This needs to be done from Control Panel, system environment variables. Unquestionably inconvenient for XP. No problem on Linux.
    Posted 03-23-2010 at 11:16 PM by sam_o_rogers sam_o_rogers is offline


All times are GMT -5. The time now is 01:05 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration