In this lab-oriented beginner’s tutorial, the author explores OpenLaszlo technology and explains its basic features.
Rich Internet Applications(RIA)
RIA stands for Rich Internet Applications. RIA tries to create browser-based applications,which are as rich and as responsive as stand-alone desktop applications. AJAX, Flex2 and OpenLaszlo are the three important RIA technologies.
That much, for plain AJAX vs. AJAX in JAVA wrappers.(JSF coders can make use of ICEFaces, which provides one such wrapper to be used with JSF).
Flex 2.0 and OpenLaszlo
But, Flex 2.0 and OpenLaszlo, base themselves on the ubiquitous Flash player which comes bundled with all modern and popular browsers. OpenLaszlo also depends on the presence of Flash player in browser side .But unlike Flex 2.0 which is free but not open-source, ( the Flex-IDE comes at a cost but Eclipse plug-in can be used instead..that makes Flex 2.0 also ALMOST free) OpenLaszlo is both open-source and free. Thus,both in Flex 2.0 and OpenLaszlo, browser variation problems are disposed off effectively.(However, it seems that extensions are being created to access the user’s hard disk,by scripting, so as to mimic a regular desktop application! This is a grave danger.)
How OpenLaszlo works?
Just like Flex 2.0, OpenLaszlo also begins with a source in special type of XML file( demo.lzx) for creating the GUI . There is provision for scripting also.This is compiled into a flashplayer format as swf(shockwave) file. The server then sends the swf file to the browser. As all modern browsers are already bundled with flashplayer, this swf file is displayed in browser without any special arrangement. All this is exactly similar to Flex 2.0
When we compile the laszlo xml file, we get swf file and this file is displayed in the browser. This type of using the lzx file is known as ‘SOLO’ mode. This is quite simple but if we use this method, we forego advanced features like SOAP communication etc.It may be remembered that Flex2 also has similar facility.
The better method is to use the swf thus generated ALONG with the Laszlo Application Server( LAS). The LAS can do the automatic compilation by itself, just like Tomcat compiling our JSP files.Or we can compile the lzx file separately and then place the resultant swf file within the LAS folder and use it.
The Laszlo Application Server is a j2ee-compliant web application and can be placed in Tomcat5 webapps folder. If the correct procedure is followed, the lzx file is dynamically compiled by the Laszlo server sitting on top of Tomcat server.
However, the OpenLaszlo package is not specific to Java coders only. It can be used by PHP coders too. How? Though the Laszlo Presentation Server makes use of Tomcat5, it comes bundled with its own Tomcat5.
For PHP developers on Linux platforms, installing OpenLaszlo on Linux is just unzipping the ‘tar’ file.( read ‘jar file for Windows).
To get a directory as ‘server’ and within that lps-3.3.3. This folder contains the built-in Tomcat server, OpenLaszlo servlets, samples, documentation etc. One of the special features from PHP4 onwards has been the facility to use Java objects from within PHP…… A point to ponder!
If Flex2 and Laszlo are so much similar, what is the rationale for the open-source OpenLaszlo project? There are three reasons. The first reason is that SUN is collaborating with OpenLaszlo group to extend this technology to J2ME devices.As wireless and mobile devices are definitely emerging as dominant clients very fast,this factor alone makes OpenLaszlo ,the preferred choice for Java coders.
According to the OpenLaszlo website, “With more than 3.8 billion Java devices including 1.2 billion Java technology-powered phones in the world today, Sun has one of the most widely distributed client runtime environments.”
Another reason is that in OpenLaszlo-4 in beta stage now, the Laszlo compiler creates flashplayer file(swf) as well as DHTML file, which would make it independent of Flash player.As Flashplayer is a proprietory technology from Macromedia(Adobe), it would free the OpenLaszlo project from the ignomy of creating something ‘open’ and ‘free’ on the labours of another company’s intellectual property, though that might be free to a certian stage. Flex2 team criticizes the Laszlo project on this score and chides that Laszlo cannot utilise Flash, as efficiently as themselves , as Flash is their own brainchild.Without bias, it is not unreasonable to expect the FLOSS world to create its own ‘Flash’ and ‘Flashplayer’. (perhaps, there already are such projects?) .These are ‘political’ issues best skipped for the present.
The third reason is that Flex2 requires Flashplayer9 in the browser while Laszlo can do with even earlier versions of Flashplayer.