The exception of the Search button is handled using the same logic as each drop-down list I did a few days ago.
Also I tried to print out the number of entries found, but the number was printed twice. I traced the code but didn't know why it was like that. If I added something to the subjectNamePanel widget within the onSuccess method, then that thing would be printed twice.
Monday, April 30, 2007
Friday, April 27, 2007
Handling Exceptions
There are times that the network connection between the client and the web server and between web server and database server were lost while users are using the application. In these situations, an error should be displayed to inform users that an error has occurred.
We need to display the error message because this is a Ajax application. If there is the network problem, the browser by default does not display any error messages. Thus, we have to have a logic that catches those exceptions and displays an error message.
I wrote some code to catch these exceptions today. I tested them and everything worked perfectly.
We need to display the error message because this is a Ajax application. If there is the network problem, the browser by default does not display any error messages. Thus, we have to have a logic that catches those exceptions and displays an error message.
I wrote some code to catch these exceptions today. I tested them and everything worked perfectly.
Thursday, April 26, 2007
Classpath in Junit Setup
I tried to figure out the problem why Junit test couldn't load the module. I searched on Google group and found that there was a person having the same problem. He got a lot of replies helping him to fix to problem. None of them worked for him. I tried to follow the solution but got no luck. This was a classpath problem. I added to the path of ClassAvailability.gwt.xml to the ....-hosted.cmd but it didn't work.
Wednesday, April 25, 2007
Database Exception Fixed
Today, I tried to do some unit tests but could not solve the problem "can't find the module". Then I stopped working on unit test and try to solve the database exception "The result set is closed".
Before I spent a lot of time on the database exception but couldn't solved it. I almost gave up. But because today Gary didn't finish the stored procedure, so I had nothing to do. I decided to look at the database exception again. I spent about one and a half hours searching on Google about the problem but couldn't find any solution. Finally, I did something that didn't make sense but it solved the problem.
In a DatabaseConnector class, I defined the connection, statement, and the resultSet as a global variable and set them to null. I used these variable in all methods that called the stored procedure. In each method I had an try, catch, finally blocks. In the finally block, it would closed the resultset, connection, statement if they were null.
What I did to solve the problem was to change those global variables to local variables. This made the code look so ugly since all method used that same variables which can be define as global. However, it fixed the problem (I hoped). I tested the application several times and it seemed like the problem got fixed. Because I didn't understand the root cause of the problem, I was sure if this solved the problem. Maybe I have to learn more about JDBC.
Before I spent a lot of time on the database exception but couldn't solved it. I almost gave up. But because today Gary didn't finish the stored procedure, so I had nothing to do. I decided to look at the database exception again. I spent about one and a half hours searching on Google about the problem but couldn't find any solution. Finally, I did something that didn't make sense but it solved the problem.
In a DatabaseConnector class, I defined the connection, statement, and the resultSet as a global variable and set them to null. I used these variable in all methods that called the stored procedure. In each method I had an try, catch, finally blocks. In the finally block, it would closed the resultset, connection, statement if they were null.
What I did to solve the problem was to change those global variables to local variables. This made the code look so ugly since all method used that same variables which can be define as global. However, it fixed the problem (I hoped). I tested the application several times and it seemed like the problem got fixed. Because I didn't understand the root cause of the problem, I was sure if this solved the problem. Maybe I have to learn more about JDBC.
Tuesday, April 24, 2007
Junit Test in GWT
While waiting for Gary to have to stored procedures ready, I tried to write some Junit test in GWT. I couldn't make it to work. I kept saying that it couldn't find the module and suggested that I should check the module name. I was very sure that the module name was correct.
Friday, April 20, 2007
Debugging Today.
I tried to figure out when the database exception was thrown. However, it happened randomly. I don't know if this problem is from the database driver or from my code. But the database driver that I use is the latest one from Microsoft.
The focus feature works now. However, it works only on Firefox but not on IE. GWT claims that its Ajax application works on all browsers, but it is not true. I think I will have to search on GWT discussion group to see of anyone has a solution for this.
The focus feature works now. However, it works only on Firefox but not on IE. GWT claims that its Ajax application works on all browsers, but it is not true. I think I will have to search on GWT discussion group to see of anyone has a solution for this.
Wednesday, April 18, 2007
Database Exception Thrown
The exception is thrown randomly when the users click the Search buttons. This was report in issue 51. Even though the exception is thrown, the application works fine. It shows the right data.
The application printed the right number of items as in the database. Basically, in my code, there are a try and a catch blocks. The exception is thrown from the catch block. I don't really know the source of the problem, but fortunately the program catches it and continues on with the right data.
I will ask Gary about this. He may have a lot of experience on this.
The application printed the right number of items as in the database. Basically, in my code, there are a try and a catch blocks. The exception is thrown from the catch block. I don't really know the source of the problem, but fortunately the program catches it and continues on with the right data.
I will ask Gary about this. He may have a lot of experience on this.
Sunday, April 15, 2007
History and Bookmark problem solved.
History and Bookmark work now. Basically the Back and Forward buttons work now and users are able to bookmark the page they like.
However, the Back and Forward buttons and the Bookmark only changes the state of the course table. It will not change the state of the drop-down lists. And I think it is not necessary to change the state of the drop-down lists because first it is hard to do. Second, it takes some CPU and network resources because to change the state of the drop-down lists, the client has to send requests to the server.
I think when the users click the Back and the Forward button, they just want to see the courses found. They don't care what is is the drop-down lists. This is an design issue. I will ask for feedback from the customer and the professor to see what I think is right.
However, the Back and Forward buttons and the Bookmark only changes the state of the course table. It will not change the state of the drop-down lists. And I think it is not necessary to change the state of the drop-down lists because first it is hard to do. Second, it takes some CPU and network resources because to change the state of the drop-down lists, the client has to send requests to the server.
I think when the users click the Back and the Forward button, they just want to see the courses found. They don't care what is is the drop-down lists. This is an design issue. I will ask for feedback from the customer and the professor to see what I think is right.
History and Bookmark in GWT
I did a search on history and bookmark management in GWT today. Because our data is getting from the database, when the back button or the forward button is clicked, a call to the database is needed. The same thing happens to the Bookmark.
Thus, I think a good way to do it is to refactor the onClick method. A new method should be created. This method does the RPC call and has the parameters that the stored procedure needs. The onClick method will call this method. Also each token for the History class should contains the parameters that the stored procedure needs so then a RPC call can be made when the onHistoryChange is fired.
Above are the ideas that I have now to solve the History problem. I don't know if the browser can cached pages so then when Back or Forward button is clicked, the cached pages are displayed and no database calls needed.
Thus, I think a good way to do it is to refactor the onClick method. A new method should be created. This method does the RPC call and has the parameters that the stored procedure needs. The onClick method will call this method. Also each token for the History class should contains the parameters that the stored procedure needs so then a RPC call can be made when the onHistoryChange is fired.
Above are the ideas that I have now to solve the History problem. I don't know if the browser can cached pages so then when Back or Forward button is clicked, the cached pages are displayed and no database calls needed.
Thursday, April 12, 2007
Meetings Today
Group meeting: Brandon and I got together and solved some bugs that Brandon figured out in our program. He noticed that if we kept changing focus (click on different items) in one drop down list fast, the contents of the affected drop-down list would be messed up. This was because the application didn't have enough time to clear the contents of the affected drop-down list before the new data was loaded in this list. Thus, we would end up with a drop-down list that had wrong data if we kept changing to different items in the list that caused the change.
We solved this disable the drop-down list that caused the change while new data was loading to the affected drop-down list. In this way, users were not able to choose different items when new data is loaded.
Meeting with customer was summarize in the CustomerMeeting page on the project home page.
We solved this disable the drop-down list that caused the change while new data was loading to the affected drop-down list. In this way, users were not able to choose different items when new data is loaded.
Meeting with customer was summarize in the CustomerMeeting page on the project home page.
Finished "Loading Status" feature
I finished the "loading Status" feature. It seemed hard, but was easy. I just created a Label. The text of the label is set to "loading" when we make a connection to the database and is clear within the onSuccess method which handles data returned from the database.
The "loading" widget was added to each drop-down list and on the search button.
I changed all of the status of the "Issues" listed on the Issues sections. Before we used the Issues section basically for task assignments. But now I think the Issues section is one the a good software engineering tool. In addition to assigning tasks, we can report issues, enhancements. After an issue is finished and new changes are committed, we change the issue's status to fixed. We then verify if the new changes work. If they are, then the status of the issue is change to "verify".
In this way, we can manage and keep track of issues more efficiently.
The "loading" widget was added to each drop-down list and on the search button.
I changed all of the status of the "Issues" listed on the Issues sections. Before we used the Issues section basically for task assignments. But now I think the Issues section is one the a good software engineering tool. In addition to assigning tasks, we can report issues, enhancements. After an issue is finished and new changes are committed, we change the issue's status to fixed. We then verify if the new changes work. If they are, then the status of the issue is change to "verify".
In this way, we can manage and keep track of issues more efficiently.
Wednesday, April 11, 2007
Semester drop-down list fixed
I modified the Semester_proc to return only semesters that are available for searching. I also created 4 new tasks (44, 45, 46, 47) in the issue lists and finished 44, 46.
I also removed the link on the project homepage to my web server because of security issues. Gary recommend that I should disable the Tomcat Manager. Because right now, any people can go to the manager page. Of course no one knows the password for the Tomcat Manager, except me. However, it is safer to disable the Manager page.
I also removed the link on the project homepage to my web server because of security issues. Gary recommend that I should disable the Tomcat Manager. Because right now, any people can go to the manager page. Of course no one knows the password for the Tomcat Manager, except me. However, it is safer to disable the Manager page.
Tuesday, April 10, 2007
Meeting with customer today
I talked to Gary today about how we would implement the Search By Attribute feature. We came up with an idea that we should place the attribute drop-down list before the subject drop-down list. This way the attributes can fillter the subjects.
He also said that I should have something to let the user know the the search is loading. This is necessary for an Ajax application because most items on the page don't change. We should prompt the user that new info is loaded.
Currently, my application can't search for courses from Spring 2007 or later. He said he will update the database to give me the current data.
Today, I didn't write any Java code, I just worked for while on the database stored procedures. From now on, most of the work will be on the stored procedures.
He also said that I should have something to let the user know the the search is loading. This is necessary for an Ajax application because most items on the page don't change. We should prompt the user that new info is loaded.
Currently, my application can't search for courses from Spring 2007 or later. He said he will update the database to give me the current data.
Today, I didn't write any Java code, I just worked for while on the database stored procedures. From now on, most of the work will be on the stored procedures.
Sunday, April 8, 2007
Fixed Database Problems
So far we don't have access to the Spring 2007 information. In version 2.0.405, there are invalid course names in the Subject drop-down list because of this reason. Today I modified the database and the project so that it will not display course names in the Spring 2007. If the users click on Spring 2007, it will prompt the users that the semester is not available.
I also uploaded the new version 2.0.407 to the Google project and changed all references to the 2.0.405 to 2.0.407 version.
I also uploaded the new version 2.0.407 to the Google project and changed all references to the 2.0.405 to 2.0.407 version.
Friday, April 6, 2007
Worked with Brandon today.
I worked with Brandon today, solving the parse string problem from the class that he wrote.
I also fixed the Search button problem and deployed the project into our development Tomcat server at UH. So now the web app can be accessed anywhere.
I also fixed the Search button problem and deployed the project into our development Tomcat server at UH. So now the web app can be accessed anywhere.
Thursday, April 5, 2007
Search button logic
I tried to figured out the logic when to enable and disable the search button. If we all the users to click the search button when one drop-down lists is not selected, the a null pointer exception error occur. So we have to make sure that all drop-down list have been clicked before the search button is enable. The logic for this is not so hard, but the problem is GWT widgets. Like the FlexTable problem yesterday I encountered. My logic for the FlexTable was right, but I the behavior of the FlexTable confused me (and lots of people). Hopefully, I can make it work tomorrow.
Wednesday, April 4, 2007
Bugs fixed.
The project is working fine now. Today, it took me 6 hours to fix only 2 bugs. The first one was the one that make the computer froze. The reason is that I forgot to implements the "IsSeriable" class in my Java Bean object. However, the debugger in GWT didn't prompt any errors. It just froze.
The second bug was the FlexTable widget. I tried to delete rows in the flex table using the method removeRow(int index). However, the GWT debugger kept giving "uncaught exception". I checked everything and all the logic was right. Finally, I gave up and got some rest and decided to do it tomorrow. However, I kept thinking about about it while lying on my bed. So I decided to give it some more time. I searched in GWT discussion group and found out that a lot of people got the same problem. Most of them though it was a bug in GWT flextable and tried to overwrite some method in the library. However, one person brought up an idea that FlexTable is the java.util.Vector, rows must be deleted from the last row. But the method removeRow(int index) says that index is the index of the row to be deleted. That confused a lot of people. GWT should get rid of the parameter and make it the default to delete from the last row.
At this point, I thought GWT is not a stable framework. It doesn't have good API and its debugger doesn't not give useful messages.
The second bug was the FlexTable widget. I tried to delete rows in the flex table using the method removeRow(int index). However, the GWT debugger kept giving "uncaught exception". I checked everything and all the logic was right. Finally, I gave up and got some rest and decided to do it tomorrow. However, I kept thinking about about it while lying on my bed. So I decided to give it some more time. I searched in GWT discussion group and found out that a lot of people got the same problem. Most of them though it was a bug in GWT flextable and tried to overwrite some method in the library. However, one person brought up an idea that FlexTable is the java.util.Vector, rows must be deleted from the last row. But the method removeRow(int index) says that index is the index of the row to be deleted. That confused a lot of people. GWT should get rid of the parameter and make it the default to delete from the last row.
At this point, I thought GWT is not a stable framework. It doesn't have good API and its debugger doesn't not give useful messages.
Monday, April 2, 2007
Computer still froze when running the application
I tried to call another stored procedure that I know it worked within the section of code I suspected that it froze the program. It worked fine. Then I tried to do the opposite but couldn't solve the problem. Right now I have no clue how to fix this. Yesterday, I thought the problem was that I created too many objects to save the results returned by the stored procedure. However, today I write a test class (not withing GWT) calling that stored procedure and run this without any problems.
So, I guess the problem is from the GWT compiler or from the code that connect the client and server together. Hopefully, I can fix this as soon as possible. Otherwise, the project will get stuck at this point.
So, I guess the problem is from the GWT compiler or from the code that connect the client and server together. Hopefully, I can fix this as soon as possible. Otherwise, the project will get stuck at this point.
Sunday, April 1, 2007
Computer froze when running to project
I created a new stored procedure that returns course names when a campus and a semester is selected. The procedure worked in the database application, but when I ran the project my computer froze. The database returned 150 records and my application created 150 java bean objects, one for each record. I guess that takes lots of memory.
Subscribe to:
Posts (Atom)