Monday, February 11, 2008

Finally.. some light...

After a week of struggling with Flex 3 data communication and creating JSR-168 portlets on JBoss platform, we finally see some light. Last week Thursday and Friday we had spent on researching on how to create a data connection in Flex 3 and in the JBoss platform. However both of us did not succeed yet, until today when I stumbled upon this presentation file during a research through Google (apparently from someone in Michigan State University). The presentation describes the various ways of data communication in Flex, which most of them were already discovered during my investigation last week, but they were not relevant to our project since they are all suggesting to connect to a data source via HTTP services. Anyhow, as I was reading through the presentation, it eventually went on explaining how to connect directly to a database using RDS from Adobe's ColdFusion. Soon as I got someone to download the ColdFusion 8 installer and the ColdFusion extension for Eclipse (which luckily are free) , I went on playing around creating a project. I was pleasantly surprised at how easy it is to create a data source to be included in a Flex 3 project (which had been my headache for the past 5 days). However, in order to have the data source visible on the data explorer feature, I had to enable first from the Eclipse side to recognize the ColdFusion Server that was just installed (which was easily done by setting up the RDS configuration within Eclipse). Next was to create a data source in the ColdFusion application server. Now there I had a problem, because for some reason it kept on giving me an SQL time out error when trying to validate the configuration. I consulted this to Michel de Blok, and he was able to find out the cause of this which was the database driver (derbyclient.jar) in the lib folder of the application server that was not valid to connect between the Sonar database (using Apache Derby Client) and the ColdFusion environment. The solution was to download the newest version of this driver class. After successfully connecting the datasource on the application server, I went back to Eclipse and started creating a ColdFusion/Flex application to display the code coverage of projects within the SNS Java Domain. First try was not really smooth, and I was getting irritated as it gets late, but the patient, Lisa advised me to take a step back on the SQL query to just do a simple one. It worked! So I re-do the query to match our formulated query that we had derived on Friday (which gives the project names and the latest code coverage values), and BAM! it worked! :D
On the other side, Lisa also came up with a good news as she managed to established a data source connection in JBoss and created her first database-driven portlet that is able to show data from the Sonar database!!. These findings are a huge step for us, because now that we can connect to the data source and show the data, its just a matter of beautifying the appearance before the first end of sprint.
At the end of the day, although we went home a little later than usual, it was worth it and we traveled back to Eindhoven SMILING :D :D

No comments: