Thursday, January 26, 2006

Developing Rich Internet Applications (RIA) with JDeveloper

If you're like me, you miss the days of developing client-server applications with thick clients where the user interfaces could interact better with the user. Those clients were feature rich and very intuitive. Then, along came the internet computing model. Maintainability is significantly easier with this model but user interfaces seemed to have taken a step backwards. Often times, as a consultant, I visit client sites where they complain about the dreaded refresh issue. The one where the entire page has to be refreshed. I currenly handle this issue myself using AJAX but I am constantly looking for other alternatives. I am now working with the rich internet technologies from Laszlo.

Installing this software is a snap. In about 10 minutes you should have the software downloaded, installed and you are up and running. Once this is completed all of the docs and examples are installed as well and assessible on the machine where you installed it. Laszlo by default will install using Tomcat.

As an application implementer, I am always writing applications that interact with a database. According to documentation on Laszlo's site, they state:

Laszlo was built from the ground up to facilitate the development of data-driven applications.

That statement alone has me intrigued, as that is exactly the type of apps I develop. The way Laszlo does interact with data is by using XML and XPATH.

Now, off to development using JDeveloper as my IDE. You can quickly create your first data-driven Laszlo application after you get your JDeveloper environment configured (see below for steps). Since Laszlo expects data to be in XML format, the two technologies I like to use are ADF and XSQL Servlet.

Following is a screenshot of a very basic Laszlo application. I modified one of the demos and changed from using a static XML dataset to using a dataset derived from an Oracle database. In this particular instance, I am using an XSQL Servlet to query the scott.emp table.

Clicking on the buttons with the names will automattically expand or collapse the contact information. (no refresh!)

I do feel there are some risks with using this technology. The biggest one is that this technology relies on Flash technology for the user interface. Now, you can use the built-in components for building UIs, but if you wanted to start adding your own custom components you are going to need a licensed version of Flash. The users of your applications will also need to have the Flash 6 plugin installed, although I have heard that 99% of all users already have this.

Steps to configuring JDeveloper to build Laszlo Applications:

1. Follow these Laszlo instructions and don't skip these.
2. Setup JDeveloper so that it recognizes the .LZX extension as an XML File
a. Tools > Preferences > File Types
b. Add a file type and associate it with XML Document.
3. Download a local copy of the lzx.dtd file. This will allow you to have code insight.
4. Add something similar to the following into your .lzx so that you can use code insight.
<!DOCTYPE canvas SYSTEM "lzx.dtd">

4 comments:

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Hello can you explain a little bit more on how you achieve this.
I'am using jdeveloper 10.1.3.1.
What i did is to convert the dtd file into xsd using jdeveloper tool and register this xsd in tools>preferences>XML schemas> and add a new user schema for xml editing.
I want to use xsql servlet to retrieve data and also to update insert delete.

Do you have an example for that?
Can you also explain how you make lzx files runable from jdeveloper?
And also is it possible to have a design view like in eclipse?

Thanks a lot for your help
Jean-Yves

Anonymous said...

Hello,

Do you perhaps know, if it is possible to use openlaszlo to update an external static xml document that contains the datasource... Because I am only able to see the update on the database but not on the original xml file, any explainations why?