Videos on LCDS 3
The weekend is closing in (well, I am Europe based), and what better way to spend some quality (family) time than watching your favorite movie? Just in case you’re out of good movies, or the sequels are not up to the original I have for you 9 movies featuring LiveCycle Data Services 3: Fiber overview, Flex 4 demo application, Data Model Annotations, Fiber Filters, Styles, Message Throttling, etc.
You can see the videos here.
Adobe TV segment: Generate a Flex/J2EE Database Application
Another segment has been released on Adobe TV, this time on how to generate a Flex and J2EE Database Application. I was a little bit sleepy and tired after three and a half days of MAX
. I show how to create such applications using the data wizard, or LiveCycle Data Services and SQL Assembler. Enjoy!
LiveCycle Data Services 2.6 – new features
As you probably know, LCDS 2.6 was released last month. If you are not sure what new features it brings, or you want a more detailed description of them, you can look to my friend, Cornel Creanga, Blog posts here and here.
LiveCycle Data Services ES Express and LiveCycle Data Services ES Single-CPU License
This spring at Flex360 in Milan, I presented a session about working with data in Flex Builder 3, and I was asked a lot about LCDS versus BlazeDS. When I asked questions about the use case, I found that most of the time the only reason to use BlazeDS instead of LCDS, was that BlazeDS is Open Source and thus free. Months later, I had a deja vu experience in Holland. It seems that very few people know that there used to be LiveCycle Data Services ES Express (for LCDS 2.5) and there is a LiveCycle Data Services ES Single-CPU License (for LCDS 2.51). This license, basically lets you use the full version of LCDS in production with this limitation: you have to deploy the LCDS on a machine with a single CPU (a multi-core CPU is counted as a single CPU) and a single application.
So, if you need the LCDS features and you can work within the license terms, then go and enjoy LCDS for free. I can think of a lot of applications built for small and medium intranets (CMS, mini ERPs and so on) that probably can be run successfully on a machine with a single CPU. And if the application grows over time, probably your client grew as well, and now they can afford to buy a license for multiple CPUs (they had the chance to test the technology and see its value gives and what problems it solves).
You can find more about the license here (click on “What happened to LiveCycle Data Services ES Express” for example) and this is a great post that explains the LCDS and BlazeDS products and licenses.
SQLAssembler: create a Flex and Java application with LCDS (LiveCycle Data Services) without server side code
LCDS 2.5 brought a new assembler, SQLAssembler. SQLAssembler lets you connect your Flex client to your database. Usually, when you read/write data with LCDS, you create your own Java adapter to handle these operations. With SQLAssembler, instead of writing the Java code for accessing the database, you configure access to the database and write the SQL for read/write/delete directly into the data-management-config.xml file (this is a configuration file used by Flex data services). Basically, you write some simple XML with some SQL for each operation, and you don’t need to write a single line of Java. But, you get a full CRUD application, with all the benefits of Flex Data Services: collaboration, conflict resolution, paging. If you need for some operations to use stored procedure instead of SQL statements, there is no problem as SQLAssemberl has support for them.
Why should you use SQLAssembler?
I will not try to fool you. Probably it isn’t good for complex applications, where you have a lot of business logic on your server. But, it could come in very handy when you need to create a simple application, maybe a quick prototype for example. And the best thing is that if, for some reason, you decide that you need a custom assembler or HibernateAssembler instead of SQLAssembler, there should be little to change in the Flex client code, if anything at all. And, as you will see in this article, I can use this assembler to create a full CRUD application for one-to-many relationship database setup.
Prerequisites
In order to be able to follow this article and to try the attached project, you need to have: Flex Builder 3, WTP (Web Tool Project) installed in Flex Builder, and LCDS 2.5 or newer. If you don’t have Flex Builder, you can download a trial from here; if you don’t have WTP installed, then check my article here; finally if you don’t have LCDS, you can download it from here. I use a combined Flex and Java project with LCDS. I have explained this kind of setup here. Finally you need to have Tomcat 5.5 installed (I created my project using Tomcat as a server for WTP deployment).
You can download the project from here (it is a pretty big download, so be patient) and you can import it in Flex Builder, using the Import Flex Builder wizard.
Finally, in the root of the project, there is a database.sql file you can use it to create the database. In my project, I used MySQL as a database server.
Database structure
The database structure is very simple: two tables, one for storing the authors and one for storing the books. One author can have as many books as needed:
Application description
I want to create a Flex application that lets me edit these two tables (full CRUD). I want to be able to choose an author, and see what books he wrote. This is the layout of the application (I know it isn’t a beautiful one, but that’s not the point of this article
).
Adding a Flex Nature to an existent Java (WTP) project
Sometimes you already have a J2EE project (made with WTP) and you want to be able to make it also a Flex project. Probably you don’t like the idea of creating a new Java/Flex project and copy the files. Neither do I
(If you want to create a new Java/Flex project then check my previous posts about creating a Java/Flex project and debugging this project).
Fortunately the solution is there in Flex Builder. You need to select the project in project explorer and right click to bring up the contextual menu for the project. Then you should select Flex Project Nature > Add Flex Project Nature:
Selecting this command will open a wizard that looks like the one for creating a new Flex project (the differences are that some options are disabled as the project already exists and you are just adding new things to it). So here is the first page and you can see you have the option to choose if you want to use LiveCycle Data Services / BlazeDS or not. On the second page you can enter the path for Flex WAR file (if you choose remote object access on first page). Click “Finish” and you got yourself a Java/Flex combined project.
![]() |
![]() |
Final words
I will not lie to you, these two features (combined Java/Flex project and Add Flex Nature) are very dear to me as I was the engineer who worked on them for Flex Builder 3
But besides the sweet memories and countless meetings to shape up these wizards and endless fights with my quality engineer on what should happen, I had another reason to write my first technical post on this subject: I talked in the last couple of months with Java developers who work with Flex and they didn’t know about these features yet
So, I am really curious if you guys find this helpful or not and if there are other things you still need (I have friends inside Flex Builder team so we can push our wishes
).
Debugging a combined Java/Flex project
In my previous post I described how you can install WTP in Flex Builder and how you can create a combined Java/Flex project and run it.
But what if you want to debug both the Flex and Java code from the project at the same time?
Actually, it is pretty simple. The steps are very similar with the ones described in the previous post for running the application.
Read more
Creating a combined Flex/Java project in Flex Builder w/o LCDS/BlazeDS
Whenever I work on a Flex project with Java backend I create a project in Flex Builder that combines Java and Flex. I find that this is the easiest way to work even if I don’t touch at all Java code and I just mess around with Flex/AS files. This is one piece of news brought by Flex Builder 3.
What advantages do you have using this setup? You can edit/run/debug both Java and Flex files in the same editor and same project; you can see the changes as soon as you save the modified files.
Let’s see what you need and how you can create a combined Flex/Java project with or without LiveCycle Data Services or BlazeDS.




