Thursday, February 28, 2008

Flex Architecture

This morning was a long day of traveling. Ikram's bike was broken, so he couldn't catch up with my train at 8.17. Unfortunately, something was wrong in my train.. it stopped several times and ran very very slowly. I really got a good extended-sleep there hehehe :p
After about 1 hour in the train (30 minutes late), finally I arrived at Den Bosch Station... and of course my bus wasn't there... got to wait 20 minutes for that and ..... finally i'm here at the office at 10.15... !!!!! -_-!
while ikram probably is on his way coming here....

Okayy... anyway back to the PRIMA project....
Recently, we were busy with the architecture and implementing the architecture. There was not much picture that we could find to describe the architecture of Flex. So we just made up some pictures by ourselves and discussed it with our colleague, Michel. He helped us a lot defining the architecture using the terms layers and tiers.

Here's how he defined it:
- layers are a logical separation of code. For example the MVC pattern for presentation: you separate model, view and controller programmatically, but they all exist within the same (presentation) tier.
- tiers are a physical separation of application functionality. Most common tiers (from front-to-back) are: Client tier, Presentation/Web tier, Business tier, Integration tier and Resource tier.


For the presentation layer (Flex application), we use the MVCs pattern. There are two good guides from Adobe about implementing MVC in Flex: An Architectural Blueprint for Flex Applications and Architecting Flex Applications. And there's also the source code that can be downloaded: Phone Sample

Yesterday, we started to apply the MVCs pattern into our project. We were still in the progress of understanding how the model class (ActionScript class and ColdFusionComponent-CFC) and the view class (MXML file) relate to each other. We are not sure whether we need to have the AS class for the CFC mapping or not. Our AS class consists of the CFC mapping and that's all. What we understand is that using AS object we could easily modify the data without going through the SQL database. In the case of our project, it's about presenting data and not adding/modifying data, therefore probably we don't need the AS class at all. However we need to investigate more about the possibility of using only CFC as the Model class.

Anyway... we just found out that the Flex 3 was officially released last Monday with the price of €593.81 for the full version of Flex Builder 3 Professional.

I think I need to go back to my Flex Builder .... and ikram is here already... and maybe he wants to add something later....

we'll keep you update!

Monday, February 25, 2008

Monday morning

Typical Monday morning, woke up lazy... late, rushing, just in time.
Got in the office, Mischa greeted me and said: "Check your inbox, there is an important email!". I was a bit surprised, I thought I had messed up the office's network or something (I had this experience before, as there was some spam in my gmail that got circulated to some colleagues, even to my manager and some colleagues abroad! :O). Turned out I was the winner of last weeks Football pool! :) those were pure lucky guesses though. And apparently it is not something to be happy about, since I have to organize the next poule.. yet I know nothing about football! :P Wish I could start a basketball pool, they said i can organize anything I want. But I thought it wouldn't be wise as the others don't know anything about it, so I decided to stick with football (ehm soccer......:P). So next matches to bet: Tottenham vs PSV and Glasgow vs Bremen.

Back to the project, last week we have been working out some objectives for the second sprint. We have narrowed down the "to do" list we had with Eric before he went on holiday for his new house. Initially the list consists of 7 points, and we've done 6 so far (roughly), but the last one would take up to a week. The "to do" list is:
-Licenses
-Development environment Lisa
-CVS setup
-Investigate GUI(UID)
-Documenting the process (school): Start with the intro, Tooling choices (what?, why?)
*Original 4
*Why down to 2
*Why Flex
-Design documentation: Use cases (db location, access, display), Realizations (UCR) work up to design
-Build it!

On the previous post, I had mentioned that we contacted a guy from Adobe about the licenses, and so far we have no more problems with the watermark on our charts, but the official release date of Flex 3 builder is still undisclosed. We had asked him about it, and he simply replied: "Soon :-) Sorry, can't say more."
We have also set up the environment for Lisa. I myself have started over a clean installation of Apache and ColdFusion server. This time we did not include the installation of LifeCycle DS, since there is BlazeDS, which is open sourced.
We have also talked about how we struggled sychronizing our projects through the CVS. The solution we took was to just share the whole project on the CVS, but in developing, we will only check out and commit the .mxml files that we are working on. That gives us the freedom to test our changes locally on our own machines, and somebody else can still check out the whole project, fully working, without changing any configuration.
On Wednesday we further investigated about the ongoing projects and the desires of information from the project managers. We found out, that there are 3 main projects going on, and all the other projects fall under the big three. The tricky part is that some these subprojects within one main project are part of the other main project(s). And the difficulty for us is that there is no categorization within the databases of the tools they are using. I guess there will be no easy pizzy for us :P.
Other than that, we have completed our documentations so far. We've got a tool research document, an architectural design, a document of User Interface Design (draft). However, we still need our Scrum master substitute (Michel de Blok) to check them out.

Today I am working all by myself. Lisa is off today as her friend (*wink*) is coming over from Germany ;P, and Michel is apparently ill today. Guess i'll sneak out the office early today.. like.. after lunch!.. oops Eric is probably going to read this so I'd better keep it down ;P. Naah nah, we have so many things to get done in a week, so I'm going to be responsible ;)
Anyways, today I have listed down my own planning of the day:
1. Explore BlazeDS
2. Architecture OK? (I guess this is not possible today as Michel is not around)
3. Explore JiraDB and work out a possible query
4. Try to get another page for the application and get them cycling around (i'd prolly have to check out some Slideshow application tutorials)
We decided on Friday about exploring BlazeDS today, because I noticed that when I was still using the LifeCycle DS for the demo, the loading time was so much faster than what we have now (only using CF and Flex data services). BlazeDS uses binary data transfer format, allowing better performance in our data-driven application (hopefuly! ;) ).
Oh, by the way, eventhough it is not listed in our sprint list, but there is something that has been buggering me: the scalability of the application. So far we are just planning and building the application to view the current ongoing projects with certain components to show, but in fact it should not stop right there. We also have to think about the future projects and future desire of more/less components to show. I think we have to discuss this further with Eric when he's back, for now I'll just focus on our Sprint log.
Okkaay... back to work.........!

Tuesday, February 19, 2008

Synchronization

After the first sprint, we had our decision to go along with through the rest of the project: Flex 3.
So we started off the week by setting up the environment on Lisa's machine, as she was not working with Flex before. Besides installing the Flex 3 Builder and ColdFusion plugin on her Eclipse, we also installed Apache HTTP Server and ColdFusion application server. After that we deployed our code coverage demo on the new web server. Oh by the way, we emailed a guy from Adobe to ask how to at least get rid of the watermark on the charts of our demo (we cannot purchase a license for Flex 3 builder yet, because apparently it has not been commercially released yet :S. I wonder why they already have a trial version out). Anyway, the guy provided us with a license number which had manged to help us get rid of the watermark. However, the guy did not indicate when the builder will be released commercially.

Yesterday we had our own CVS and JIRA accounts set up. But so far we are still having difficulties trying to synchronize our work together. Everytime I try to test my changes, it always goes to the actual server (on Lisa's machine) which has not got my changes committed :(. This has been annoying us the whole day. Oh we also encountered a bug from ColdFusion wizard: every time we try to put our "to be created" project to a shared folder, it throws an error message saying that the project is overlapping with another one (which is not true, in fact, we deleted all the other projects in that same folder) . According to our research, many people have encountered the same problem, and it is considered as a bug. Eventually we decided to just go on with a local folder, and that solved the problem.

Today we were looking into coloring the barchart with gradients depending on the percentage of the code covered per project. Lisa, had created a patch that does this automation, so that if a code coverage of the project is above 60%, the bar will have short red, orange, and mostly green. If it is in between 30-60% it'll have red and orange, and if it is below 30% then it is a solid red.

As for the synchronization problem, it is still remain unresolved, but tomorrow we are going to try to create a clean new project for the CVS, forget about the shared settings that we configured earlier, and set up everything locally for the development machines. I am also planning to take a look into how to cycle the pages, and to extend more pages from the demo that we had.

Btw, just got some pics of my newly born niece from Jakarta.. Her name is Rania, she still pretty much only cries and sleeps... :)

Sunday, February 17, 2008

Flex 3 Builder with Charting.....

The last 2 weeks, we have been busy with the two prototypes using Flex 3 and JBoss Portal. We have been able to create a demo using Flex 3 with charting. In the demo, we are able to show the percentage of Code Coverage of the on-going projects in the Java Domein using pie charts, bar charts, and table which are connected to each other. Using Flex 3 Builder with charting, it's not that hard to make the page looks fancy, flashy, and colorful. The graphs and charts are generated by the Flex 3 Builder. Though we need to add some ActionScript by ourselves to interact smoothly with the users. We are very happy that everyone seem impressed with our demo :D

On the other hand, data visualization using portlet in JBoss Portal is not its strong point. We need to install some extra libraries and do some coding in order to generate charts. JBoss Portal is not specifically intended for fancy data visualization. Its strong point is in the diverse information that can be displayed in one page using several portlets and flexibility of user interactivity.

Since, the PRIMA project is focused on querying data and display it with an eye-catching GUI, we proposed to use Flex 3 for this project. Our mentor, Eric, is happy with our choice and encouraged us to keep going with the next sprint.

Last Friday, we were succeeded setting up a Web Server using Apache -- Coldfusion for our Flex 3 Demo. The webserver is installed in Lisa's virtual machine. You can check it out here: http://dbov1904.bank-o.o:8080/testColdFusionFlex/bin/main.html

We are on the investigation to buy the license for Flex 3 Builder with charting. From the Adobe store website, we only found the the previous version which is the Flex 2 Builder with charting. The Flex 3 demo we had was built using the trial version of Flex 3 Builder with charting which lasts for 90 days. Anyway, there is a watermark text saying "Flex Data Visualization Trial" in the demo that we couldn't get rid of it. We have contacted Adobe for the possibility to remove the watermark and also to buy the full version (license) of Flex 3 Builder with charting.

Anyway... last Friday, I "unconsciously" left my LG-Viewty phone in the bus... and miraculously was found by the bus driver whom later gave Ikram a call to pick it up! I would never wish that this kind of honesty ever happened in Indonesia... hehehe... Holland rocks! ^.^

cheers =)

Wednesday, February 13, 2008

Interests rising

As we figured out data connection to both Flex 3 and JBoss portlet, we proceed to visualizing the code coverage data we extracted from Sonar and gave it a try to transform that into graphs/charts. Yesterday I have managed to create a Flex application with horizontally parted grid. On the top a splitted grid with a pie chart on the left and a data grid column on the right. And at the bottom is a bar chart. All of them showing the code coverage data obtained from Sonar using data connection made possible by RDS. Creating the graphs and charts is quite a simple task in Flex. The only problem for me is that I have no experience programming mxml, and there are so many library classes I can use, but dont know what their properties are and how to use them. Anyways, soon as all three images with the data are shown, I went on looking for some tutorial on creating events so that I can communicate between the three and create some kind of highlight and click events that affect all of them once one part of them is clicked.Fortunately I found an example that shows a very similar idea, so I picked that up and put the events and their effects to be applied in my application. I had some struggles, but eventually I made them all working properly. Only there was a problem with the effect from the bar chart which was not highlighting the bars correspondingly to the others, but I immediately found the cause of this, which was the calculation of the action was pointing to a wrong order of array (my array starts from 0, and the calculation was pointing to 1), so that was solved pretty quickly. Another desire that I wasn't able to work out was to smoothen the animation of the pie chart when it is being clicked. I thought it was because I didn't have the correct library for the effect, or because I am using the trial version of Flex 3 builder. But today I discovered that it was just a misplace of property use in one of the pie chart series I had. I investigated some more evidence and solution, and solved that one out before going for lunch today. On the other side, Lisa, who had also successfully showed data to a portlet with text, was struggling creating her portlet that is showing the data represented by graphs and charts. She had imported a library for displaying charts and graphs, but every time she's building the project, she gets error messages saying that the library package could not be found. We have not been able to solve this problem until the end of the day :( .
By the way, we had our school mentor visiting us today from fontys: Theo Cats. The meeting went well, we discussed many things............ Anyways the funny thing was, when the meeting had ended, I was asking some people to get them anything to drink, and it turned out that Marco, was an ex-student of Fontys and he actually recognized Theo Cats! (Wow! Theo must have been working in fontys for EVER ;P). At the end of the day, as I was chatting with Yuri Vrancken and Jan Kees van Andel who were curious of how the project is going, I ended up showing them the application that I've developed till now. And relievingly they commented: "Oh...thats pretty coool!". (the picture below was taken by Eric, who was sneaking behind us to capture spontaneous reactions of Yuri and Jan Kees)
It is nice to know that the other people are actually interested in our project and are expecting good stuff out of it. Before we went back to Eindhoven, Jan Kees lended his Flex 2 book to me. I reckon that will be very useful for us as we go on.
So next: end of sprint #1 - TOMORROW! wonder whats gonna happen.......

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

Tuesday, February 5, 2008

deploy.. deploy...

There were two things I tried to do today:

1. Install Kosmos portlet to JBOSS Portal. This portlet can be used to visualize data from JIRA tool. 2. Create my own portlet by following the Portlet Tutorial (http://wiki.opensymphony.com/display/WW/Portlet+Tutorial#PortletTutorial-intro)


Unfortunately, I wasn't able to deploy them successfully (yet). Here are some problems I got:

1. Kosmos portlet
In the reference manual I have (http://labs.jboss.com/kosmos/reference-manual.html), there are some steps to deploy Kosmos into JBOSS AS and Portal.
The order of the deployment is:
install JBOSS AS --> deploy Jakarta slide (slide.war) --> install JBOSS Portal --> run server deploy script --> run portlet deploy script --> launch JBOSS As

But since, I already installed the JBOSS AS and Portal, I jumped into deploying the Jakarta slide (it seems this Jakarta project is already frozen since early 2007) by copying the slide.war file to pentaho\bi-server\jboss\server\default\deploy. I don't know if this different deploy order could lead to problem or not.

I got no idea about the next step of running deployment scripts. But later I found the description of the server and portlet deploy scripts. I put those scripts in the same folder as the slide.war.
then I built it using cmd, the build failed due to wrong reference of tag inside the xml file. And I can't figure it out yet what should be filled in inside the tag
** I still got to study about Java stuffs I'm not familiar with, like: ANT, WAR, XML (I only know a bit about XML) T _ T

2. Portlet Tutorial
I followed the tutorial carefully and got no problem with that. The problem arose when I need to make .war (Web ARchive) file. In the tutorial, it said I could just zip the WEB-INF folder, and name it as "MyPortlet.war"
I did make it and deploy it to the JBOSS server (
pentaho\bi-server\jboss\server\default\deploy).
When I start the server, I got the following error:

Error configuring application listener of class com.opensymphony.webwork.portlet.context.ServletContextHolderListener java.lang.ClassNotFoundException: com.opensymphony.webwork.portlet.context.ServletContextHolderListener

and also

Incomplete Deployment listing:

--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@af411f71 { url=file:/C:/java/pentaho/bi-server/jboss/server/default/deploy/MyPortlet.war }
deployer: MBeanProxyExt[jboss.web:service=WebServer]
status: Deployment FAILED reason: URL file:/C:/java/pentaho/bi-server/jboss/server/default/tmp/deploy/tmp48860MyPortlet-exp.war/ deployment failed
state: FAILED
watch: file:/C:/java/pentaho/bi-server/jboss/server/default/deploy/MyPortlet.war
altDD: null
lastDeployed: 1202220240918
lastModified: 1202220240902
mbeans:

--- MBeans waiting for other MBeans ---
ObjectName: jboss.web.deployment:war=MyPortlet.war,id=-1354686607
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/java/pentaho/bi-server/jboss/server/default/tmp/deploy/tmp48860MyPortlet-exp.war/ deployment failed

--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.web.deployment:war=MyPortlet.war,id=-1354686607
State: FAILED
Reason: org.jboss.deployment.DeploymentException: URL file:/C:/java/pentaho/bi-server/jboss/server/default/tmp/deploy/tmp48860MyPortlet-exp.war/ deployment failed

I thought that was because I didn't build the war file correctly. So I tried another way to build the war file by using ant script. I ran the ant file using Eclipse. And it gave the same kind of war file done using the previous method. I put it in the deployment folder and restart the server. And..... I get the same error ... T_T

arghhhh.... -_-!
i hate deploying for the first time.. ("adaaaaaaaa... aja masalahhh... haihhh capek deh" --> sorry Eric, this one is hard to say it in english hehhe).


cheerzzz
tot morgen

Monday, February 4, 2008

Hurdles

Today was the second day of our sprint. Lisa and I had decided on Friday that we were going to divide the task by experimenting with the two options we've had from our research. Lisa did the research on Pentaho BI suite, so she went on with it. Meanwhile I had started some research on Adobe Flex, and am trying to get a demo showing code coverage retrieved from the database. On Friday, we started installing the two tools/framework. Lisa had some troubles after the installation; the installation was a success, but when she had some errors when trying to log in to the admin console. The error message was complaining about not finding a repository, but in fact the database (mysql) was installed along with the full package, and the repository was indeed created. We were not sure what caused the error, but Lisa tried to overcome this problem by editing some of the files within the server directory (according to some troubleshooting research she did), but did not solve the problem, so she decided to start a clean slate by removing the whole suite all over again. Meanwhile, I had no problems with installation, so I went directly to follow some tutorials. After getting some insights of how Flex works, I started to create my own project for the demo. However, I'm having a problem connecting the Flex project to a datasource. Initially I imagined it would just a matter of setting up jdbc url on the project in Eclipse (based on my experience setting up a datasource on WebSphere Application Server and developing data services portlets). However, this is not the case with Flex. According to my research, Flex applications do not connect directly to a data source, but they communicate through several options:
mxml - Java Server Pages
mxml - PHP
mxml - ColdFusion
HTTP services in action script

Today, I was informed that I actually can try out Flex 3 builder. So I started the day by installing Flex 3 builder (I installed Flex 2 on Friday) and played around with some tutorials. I also did some try outs connecting to the datasource from Sonar (the dummy data created for our starting point), but so far the efforts have been fruitless. On the other side, Lisa had started the day by re-installing the Pentaho BI suite, this time just taking all the default installation values. And fortunately this had solved the previous problem and she was able to get into the first page and the admin console of Pentaho as well as the JBoss portal server that was included in the installation suit. So currently Lisa is researching how to create her own portlets and display the code coverage by connecting to the Sonar database. I reckon if we sort out the datasource connection problem, things are going to get back in track, even better, I reckon its gonna get exciting.. By the way.. i just had a good news from back home, Jakarta: my sister had just delivered her first baby a couple of hours ago :D Its both exciting and scary! 'cause besides the fact that I'm an uncle now, it got me realized that I'm an adult and am getting older and older each day!. Anyhow, despite all the stress facing dead ends and errors at work, it was a very happy day for me after all.