Monday, August 3, 2009

Phase 4: Rough Plan

The goal of phase 4 is to show other users with similar interest who are also online.
  1. I need to retrive the list of users with similar interest
  2. Then, check to see if they are online - this has to do with session tracking
Since it's the almost same list as Users with Similar Favorites, then I plan to color the ones online, then turn others gray.

Saturday, August 1, 2009

ToDo List August

  1. Prob 1. display reviews user submitted.
  2. Prob 2. add "Review for Game title" to review page.
  3. Prob 3. add a section to metadata page that display games in same category.
  4. Prob 4. apply alternating style to li
  5. Prob 5. User Profile page display problem in firefox (works in IE & Safari)
  6. Prob 6. work on Phase 4!
Prob 5. This problem is again a mistake resulting from syntax error. At div class="boxcontainer" should been div class="boxContainer". Apparently, Firefox is more strict than other browsers, whereas IE and Safari tolerated the difference in capital.

User Exception Error

Right now, if a user click on the user profile the first time, he will see an error message instead, since there isn't any information about this user in the database yet. I need to make it redirect to add user interface in this case. It took me a little while to think of using catch(Exception):
if (action.equals("view")){
try{
output = user.getUser(username);
md.searchGameByUserid(output, username);
md.searchAllFavorite(output, username);
user.searchSimilarUsers(output,username);
output.setAttribute("msgType", "view");
}catch(Exception ex){
output = user.getEmptyElement(username);
output.setAttribute("msgType", "saveNew");
}
}

Correct Time Stamp

The time stamp I used previously was from the template, and it doesn't show time very well. For example, 2009-07-21T13:06:44.670Z, a little hard to read. This is done using System.currentTimeMillis() from java.util.Date, which gives time to milliseconds, and was stored in mysql as a BIGINT.

To the left is screenshot of type datestamp from metadata table, stored in BIGINT and created by System.currentTimeMillis().

However, there's a smart way to do this: mysql have a build-in type: TIMESTAMP, which will be responsible to keep track of time and display it properly when called. It can be called using command NOW().

This screenshot is date from users table, stored in TIMESTAMP and created by NOW().

Update:
Although it looks much neater, with 2nd method. The TIMESTAMP is more like a String, and losses it's ability to sort metadata by time. On the other hand, I don't need it for that function.

Newly Added section on Index page

A new section is added on Index page - newly added. This will display the last 5 submitted games. So then, the Index page have following features:
  1. Featured Games: displays 3 randomly selected games
  2. Most Viewed: displays top 5 most viewed games
  3. Newly Added: displays last 5 submitted games
  4. Last Reviewed: displays last 5 reviewed games
  5. Last Accessed: display last 5 viewed games by this user (it will be blank at the beginning of session)
Should I put My Favorite on index as well? will it makes the page too busy?

Database table not updating

Earlier when I encountered this problem, I when into database directly and deleted the tables. However, when I uploaded it to the remote server, I realized that I don't have access to the remote server directly! This means I must delete the tables I want to change through java servlet. So, in the ConfigServlet.java file, under checkTables() method, which create tables if no table exist. I inserted the following code in the very beginning:
String sql1 = "drop table metadata";
DB.executeQuery(sql1);
These 2 lines of command tells the database to delete the metadata table. Then, when the servlet checks if there's a table to create, it will find none, and consequently create the new table with update.
Powered By Blogger