Tuesday, May 26, 2009

Beginning Version 2 - Integrating SQLite

    I've decided to bite the bullet and learn to use SQLite; I figure it's easier to do this than dig through Mozilla's documentation for solutions to my data management problem. Suprisngly, SQLite isn't that complex to learn. The Mozilla wrapper functions to deal with SQLite, on the other hand, need a bit of cleaning up, in my opinion. Current references:

    My most valuable reference though is the source code for WebReview. Without this I would be completely stuck, as Mozilla documentation covers only the very basics. The biggest problem I'm running in to is how every error I receive in the Firefox Error Console is unlisted anywhere, except for a few sparse posts by people working on various Mozilla projects. At least I've been able to solve most of the problems by copying the WebReview source code and editing it line by line to suit my needs. 

    While looking through the WebReview source code I discovered a whole separate class dealing specifically with the thumbnails - over 5,000 lines of code. This just reinforces my belief that adding thumbnails to the graph is just too far beyond my skill level. Since a final version would lack some visual flare to it I'm really going to focus on integrating SQLite and then learning some Flash to use the Flare API, creating really nice and interactive graphs.

What I accomplished today:

  • Learned the basics of SQL, enough to create and manipulate tables.
  • Learned some of the Mozilla API to access databases, execute commands, and save data.
  • Managed to finally get Components.utils.import to work, after altering my chrome.manifest file.
  • Started version two of my basic Firefox extension: now URLs are logged into a database to solve the problem of sharing data between two windows.

To do tomorrow:

  • Test to make sure everything works appropriately.
  • Implement "Go to..." and "Remove" - Remove is now possible since I can manipulate the database.
  • Start thinking about how to implement "Start" and "Stop" so that the Firefox status bar icon doesn't have to be clicked to log a URL.
  • Figure out why this SQL trigger causes an error in the exectuteSimpleSQL method:

 CREATE TRIGGER insert_url_time AFTER INSERT ON url_log
 UPDATE url_log SET timeEnter = DATETIME('NOW')
  WHERE rowid = new.rowid;  

That's all for today.

No comments:

Post a Comment