Tuesday, April 15, 2008

5th Sprint Summary

Last week we finished our 5th sprint.

In the last sprint Ikram was trying to build the GUI for the control panel. So it would be possible to add/remove projects without getting into the XML configuration file. It's also possible to modify the project information (project ID, name, etc) as well as the query to get data from the database.
The plan is also to enable add/remove existing components. It should be possible for the admin to choose which components to be displayed.



And last week I was struggling to adjust the design. The initial plan was to make ActionScript (Actionscipt) classses that mapped CFC objects (remote objects). The properties of the remote objects therefore can be easily accessed from the AS classes. I have read lots of information from Forta Blog, Jeffry Houser Blog, and this simple checklist.
But it didn't work... -_-!

I don't know why the mapping didn't work. It seems Flex recognize the AS object as a common object, and not a mapped object from CFC. The temporary solution is to use ActionScript class as a static object that can be shared within the MXML classes.
But later on, we need to tidy up and do some refactoring, because I believe this is not the best solution that we can do.

Another design issue is about the Project Overview page. This page should calculate and display the score of each project. We were trying to use a global actionscript class that hold all the data from various remote objects. But since the mapping doesn't work yet, and using the static object will make it worse, our Scrum master suggested KISS (Keep It Simple, St**id!) ^.^ by getting the data directly from remote objects. We were a little bit reluctant at the first time, since we need to call at least 3 remote calls to the database. But actually, we do the same thing for every page, so there would be no different! The data wouldn't show up immediately, there would be about 2-3 seconds loading time, which is quite reasonable for 30-40 seconds interval time per page.

Project Scoring
Yesterday, Ikram finished with the logic for the project scoring. He already passed the most challenging part -- getting the component data per project and convert it.
Last time, we were struggling to get the project info using remote calls. The remote call was successful and we place the value into a local variable. But strangely, if we call the variable in the init() method, it returns 0 or null. We have checked that the remote call is called before we use the variable, but it still returned 0.

Ikram came with the solution by moving the RemoteObject tags before the Script tags. We don't really know why it works, since the remote call is still called within the script tags. Probably, the RemoteObject tags have something to do with establishing remote connection. We are not quite sure .... but IT WORKS !! :p

Tuesday, April 8, 2008

Ruun!!

Today I finished the component tab of the configuration panel. I had the first tab (project) that has the add/remove project functions which are reading and writing to the rootProject.xml file (This file is a metadata for the project names on the display). the component tab at the moment is only showing the components information (dbname, query, projects and their services) retrieved from the catalog.xml file. Implementation of adding/removing a component is currently being postponed until we renewed our design of creating components. Tomorrow I will move on to implementing the algorithm for the projects scores.
Today, Lisa had finished extracting the data from the nightly builds database. Having this, we have actually completed our target for the components to display. Next step is to improve our design and implement the add/remove function to the configuration panel. We are running as fast as we can to get most of the sprint goals done before Friday. We'll keep you posted! ;)

Monday, April 7, 2008

Sprint #5

Its been quite a while since I last posted. I have been quite occupied working on an essay for my master's application. Its been taking my sleeping hours, but finally it was done last Friday.
As for the PRIMA project, the past week we have been busy working on separate tasks. Lisa was working on displaying data of an .xls (MS Excel) file, which is apparently our datasource for the "Hours: planned vs. actual" component. There was an access restriction that we could not get through from the database administrator for the actual (Artemis) database, therefore we were given an excel sheet that is updated daily, and posted on the sharepoint. However we have the following problems:
1. The Flex DataGrid component does not support excel file as data source.
2. Security (since we cannot automate the authentication&authorization process from sharepoint).
We had managed to solve the first point using a ColdFusion component developed by "www.bennadel.com" called the "POI to write and read Excel file" (http://www.bennadel.com/blog/474-ColdFusion-Component-Wrapper-For-POI-To-Read-And-Write-Excel-Files.htm)
The second problem has not been solved at the moment. We have tried to share a folder on the network for the responsible people to post in the excel file. However, it turned out that it, too, needs a login. It has been a few days since Lisa started working on that, so it is time to switch our focuses on to the next sprint goals (we are now in sprint #5 by the way). Lisa is now working on getting the nightly builds data.
I, on the other side, have been busy working on the "Control Panel", which will be the configuration point for the projects/components that will be shown on the screen. Since our metadata is written in 2 XML files, the idea was to create a GUI for the administrator, so when desiring a change, he/she would not have to go find the actual XML files and edit it, but instead changes will be done comfortably from the GUI.
In the beginning I had some difficulties trying to write the XML files from Flex. After being stuck with it for 2 days, I turned to look for other media to do the job. Turned out ColdFusion can do this EASILY.. I was quite embarrassed when I found out about this, because ColdFusion has been there as our data source connector since the beginning... anyways the following is a snippet of writing an XML file from flex application using ColdFusion class.
The XML file:

<?xml version="1.0" encoding="UTF-8"?>
<projects>
<project>PRIMA</project>
<project>Test1</project>
<project>Test2</project>
<project>Test3</project>
</projects>

in the ColdFusion file, I created a function something like the following:

<cffunction name="saveXML" output="false" access="remote">
<cfargument name="projectsXML" required="true" type="XML">
<cfset xmltext="TOSTRING(#projectsXML#)">
<cffile action="write" file="<yourXMLFileDirectory>\ds-testproject.xml"
output="XMLText">
</cffunction>

This function will basically take its parameter (an XML object) that I will pass from the .mxml file, and convert it to string, and then write that into your xml file.
And finally in your Flex .mxml file:

<!--create a remote object of the function you created in the ColdFusion file-->
<mx:RemoteObject
id="saveDataChange"
showBusyCursor="true"
destination="ColdFusion" source="TestProject.components.cfgenerated.TestPage">
<mx:method name="saveXML" fault="server_fault(event)">
</mx:RemoteObject>

<!--create an XML object-->
<mx:xml id="projectsXML" format="e4x" source="../src/ds-testproject.xml">

I also created an XMLListCollection and a DataGrid for displaying the data. A form for adding new projects (containing TextInput's for the attributes needed in the XML), and in an mx:Script block, I wrote the functions that are handling the events of buttons for removal and addition to the projects, and after I modify the XML object that I created with a new input or deletion, I send the modified XML object back to the saveXML() function. Here's how I implemented the action for delete button event:

private function deleteSelected():void{
delete projectsXML.project[myDataGrid.selectedIndex];
sendXMLChange(projectsXML);
myXMLListCol.refresh();

Thats it.. now I am expanding this for adding/removing components shown on the screen. We have talked about this, and we think we might need some changes on how the components are created before we can actually implement that feature (add/remove) for configuration. Since then, I will only start with displaying the information of the available components, and then I will move on to another sprint goal: implementing "Ronald's Magic Algorithm" for the project score ;).
Thats it for now, we'll keep you posted with our progress!

Tuesday, March 25, 2008

White Easter!

Just passed a long weekend of Easter holiday..!!! And it was a white Easter! Even this morning was snowing hard.. it was beautiful, I love it....love it love it!

Last week before the Easter holiday we were busy with the smileys! We supposed to put smileys beside the project score. We almost spent 4 days for this feature! And finally we succeeded with the help from our colleague, Yuri Vrancken.

Originally, we planned to put the smiley in the Bar Chart of our the project score, just beside the score. We have tried using the Grid, ItemRenderer, chart annotations, etc and it didn't work. After 4 days-struggle, we decided to have another data grid just showing the project name and smileys. We realized that customizing a chart is possible but require lots of work. And we don't want to waste lots of time in this feature since we have a long list of features to be implemented.

So, we decided to use a two-column datagrid, one column for projectname and the other for the corresponding smileys. To be able to insert an image into a datagrid, we need to use ItemRenderer. The trick is to specify in the datagrid that it would render an image.

Here is the snippet of our datagrid code:

mx:DataGrid id="dGrid1" dataProvider="{scores}" width="100%" height="100%"
mx:columns

mx:DataGridColumn headerText="Project Name" dataField="Project"
/mx:DataGridColumn

mx:DataGridColumn headerText="Well-being" dataField="ImagePath" itemRenderer="mx.controls.Image">
/mx:DataGridColumn

/mx:columns
/mx:DataGrid



And the datafield of ImagePath is a column of an ArrayCollection contains the path of where the image is located.


[Bindable]
private var pathString:String = "../src/images/Smiley_";

if(scores.getItemAt(f).Score<=30)
{
scores.getItemAt(f).ImagePath=pathString+"sad.JPG";
}

Monday, March 17, 2008

Flex builder 3 licenses

Last Friday we had our first presentation in front of the Java Domain department. Fortunately everything went quite alright, and our manager was happy. So it was a good day to end the week. At the end we also mentioned about the monitor which is still absent ;P Looking forward to seeing a big flat screen hanging (with our project on) at the office ;).
This morning, we got a surprise by Eclipse as we turned it on. It had given us the pop up message we never wanted to see.. it says: "Your trial of Flex Builder 3 has expired. Enter your serial number to continue using Flex Builder."...... oh, this is a breaking news: Just got a call from Mr. Scrum master, tomorrow we are getting the magic credit card from the big boss, Ronald for us to purchase the builder online :D

Today we have been writing our final report, and have sent a draft version to our school mentor, Theo. The sections covered till today are: 2. The Company, 3. The Assignment, and 5. Proof of Concept. At the moment, Lisa is writing section 4: "Scrum Methodology", and I am working on section 6: "First Iteration".

Last Friday, we have listed our next sprint goals, which is a HUGE one, including the following:
1. Smilies! (next to the BarChart of the overview page)
2. Nightly builds/test coverage
3. Hours Estimation (planned vs. actual)
4. Project realization percentage (the "score" for project overview based on Key Performance Indicators)
5. Responsible people
6. Employee presence
7. Happy rating
8. Domain plan realization percentage

*sigh* thats a long one. I hope we can sort out the licenses tomorrow and go back to our project soon.
Our primary objective after we get the licenses: embed the SMILIES! (looks like we are going to have to extend the BarSeries class)
busy busy busy!... i mean... GOOD BUSY! (the new word around the office) -- you wouldnt get this unless you know Dutch ;P
PS: Happy birthday to my sister, Alia! :D

Wednesday, March 12, 2008

Windy days

Flex/ColdFusion+windy days = not a very good combination.. but things are going great though. aint no wind cant take us down! ;)
Yesterday we successfully completed all of our sprint goals. Victory was ours when I fixed the CFC method invocation issue. The problem were the following:
-There should be no white lines within the xml file
-New object of the component Project_Info.cfc (the global CFC file) has to be instantiated first before invoking the method
-When parsing the xml, wrong hierarchy was called to retrieve the component name
-Probably other syntax errors
With that being fixed, the database queries as well as the metadata are all located in a single xml file (sweet! ;) )Lisa has been doing great as well as she had managed the components' cycle. So now the application is using only one xml (also means that services are now categorized per project), and application cycles between overview, and components per project (double sweet! :D)
So next goals:
-retrieve project names to be displayed on to each component
-figure out how to embed smilies into a barchart (for project overview)
-display test coverage (nightly builds)
By the way, my neighborhood is packed at the moment as PSV is playing against Tottenham Hotspur now. Apparently its an important match, and PSV is about to lose as we speak.. looks like there is going to be some vandalizing around here tonight ;P Hope the wind will still be as hard as earlier so they all would go home directly after the match :)

Tuesday, March 11, 2008

it's time to go deeper.....

Hello again...
It has been almost a week, we couldn't get time writing the blog. Recently, we were busy with all the documentations about the technical design.
We found it very helpful that we made the design after having Proof of Concepts and implementing some simple functionalities. By doing this, we know exactly how the flow is going and how to apply our project into that system. We also already discovered some possibilities (and impossibilities) Flex/ColdFusion application.

I like this method of working (implement some proof of concepts before start designing), it made the design much easier because I already got something in mind how this really works! It's pretty cool and it works for me...

Anyway, here are some major things we did:

1. GUI
We decided to have two states in the GUI, which refers to 2 MXML files. The first state is for the Project Overview and the other one is for the Single Project screen. The states will change from State 1 to State 2 according to the timer. In the state 2 itself, different data will be pulled for one certain project for each timer tick. When all single projects are shown, it goes back to the state 1, Project Overview and then go cycle.

2. Class Diagram
Each GUI Component (MXML file) has a remote object to handle the communication with the database. The remote object is a CFC file (coldfusion component). In this CFC file, all the queries from database are handled. The CFC file returns a query to be displayed.
There would be one global CFC that handle configuration from XML file (as already discussed in the last posts).

We also plan to have some ActionScript files that map particular CFCs when necessary. Having ActionScript files would be helpful when we need to get/set and process some data from the database without touching any remote objects (CFC files).

3. Sequence Diagram
We also made the sequence diagram for the general flow of the application as well as more specific sequence diagrams that define the flow per class/component of the application. At least we have two flows of the application. First, it's the initialization of all components. And once it's started, the pages will cycle according to the timer for infinite time.

Today, Ikram is still fixing the XML errors. I am going to implement the code for page cycling and later we will talk about the presentation. Next Friday we need to present our projects in our department meeting. It would be a short one, only 10 minutes. And probably we will show lots of screenshots to get the whole department excited!