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!