Commit graph

11423 commits

Author SHA1 Message Date
Dan Stillman
93c2b8c2ee DROP TABLE IF EXISTS now available in mozStorage 2006-03-22 16:42:22 +00:00
Dan Stillman
6cad409813 Update to work with Gecko 1.8 branch (2.0a1) and trunk (1.6a1) with native mozStorage support
Disabled on 1.5, as hacks.atrus.org binaries will no longer work (the mozStorage API changed a bit)
2006-03-22 05:47:10 +00:00
Dan Stillman
c8f10f4b6d Missed some 2006-03-21 15:19:11 +00:00
David Norton
7448c8ce5d Object pane now shows creators= 2006-03-21 14:58:40 +00:00
David Norton
b50afbef24 Fixed the object pane. 2006-03-21 14:27:19 +00:00
Dan Stillman
9abad678fe Changed core, DB, and data access methods to create everything under a global Scholar object that can be shared across windows
Added include.js for use in non-browser.xul windows to bring in the SCHOLAR_CONFIG and Scholar objects

Adjusted sidebar to use shared object

Added test line (displayable by clicking "Hello, World" before and after sidebar load to demonstrate cross-window access
2006-03-20 21:47:22 +00:00
Dan Stillman
dc4f276297 Scholar_Object._loadObjectData() and _loadCreators() weren't setting the _objectDataLoaded and _creatorsLoaded flags if there were no rows, causing incessant trips to the DB 2006-03-18 23:46:50 +00:00
David Norton
749ef47bbd I got the basic object pane working, so that it displays all the metadata.
I also started implementing some of the localization. There is a lot to do still, and I am still learning a lot of the Firefox extension technologies (XUL, adv. Javascript, etc.) but things are going great.
2006-03-18 22:51:05 +00:00
David Norton
47d7525e80 There are now just two columns in the sidebar: creator and title. 2006-03-18 05:48:41 +00:00
Dan Stillman
3711023d9a Added firstCreator to primary field list
Fixed object retrieval queries to use orderIndex is 0 rather than 1, since that's the default now

Scholar_Objects.getAll() now uses loaded.push() rather than loaded[objectID], since _for (objectID in objects)_ isn't an option with treeview

Scholar_Object.getField() now returns an empty string rather than false for empty values
2006-03-17 05:11:03 +00:00
David Norton
4a493e5953 2006-03-17 03:45:42 +00:00
David Norton
4d4b7cf47e 2006-03-17 03:45:30 +00:00
Dan Stillman
3dd8351478 Including the file would probably help 2006-03-14 11:52:59 +00:00
Dan Stillman
396631cb30 Removed some screwy characters in XML-stylesheet declarations 2006-03-14 11:49:31 +00:00
Dan Stillman
d211159d74 Initial version of data access methods -- documentation will be provided on Basecamp
Surely buggy and incomplete, but a good start
2006-03-14 11:48:36 +00:00
Dan Stillman
b88b767b0b Renamed DB to scholar.sqlite, since that seems to be the current fashion
Added some new core functions:

- Scholar.varDump(), after PHP's var_dump()

- Scholar.flattenArguments(), to flatten mixed array/literal argument lists into a single array

- Scholar.join() -- a version of join() that operates externally, for use on, for example, the arguments object (safer than extending Object)

- Scholar.Hash, a slightly smarter associative array -- not perfect, but brings a proper length property and a few convenience methods (and allows for other additions) -- should probably be limited to places where the length property or other additional additions are needed, since its use is a little non-standard (e.g. you have to remember to do _for (i in arr.items)_ rather than just _for (i in arr)_, to use set(), etc.)
2006-03-14 11:45:19 +00:00
Dan Stillman
50eddb05ee Lots of DB-related updates:
Moved schema file out of chrome and removed XML tags, since it will no longer be accessed by XMLHTTP

Changed schema updater to use XPCOM components rather than XMLHTTP

Converted DB class to a singleton named Scholar_DB

Scholar_DB.query() now returns associative array similar to mysql_fetch_assoc() for SELECT statements rather than a mozIStorageStatementWrapper -- the mozStorage executeDataSet() function doesn't work yet, so we do it this way

Added DB functions:

   - beginTransaction(), commitTransaction(), rollbackTransaction()
   - columnQuery() -- one column, multiple rows, returned as array indexed by row
   - getColumns() and getColumnHash

DB query functions can now handle bind parameters passed as an array of object literals: e.g. [{'int':2},{'string':'foobar'}]

valueQuery() now returns an int for COUNT(*) queries, so the result can be tested without a "0" being true

Changed _initializeSchema to drop existing tables before creating new ones, hacked with try/catch until DROP TABLE IF EXISTS works with the mozStorage extension (it's already in the latest SQLite release)

Added DB_REBUILD config flag to manually trigger schema regeneration

Added debug logging at level 5 for all SQL queries

Updated sample data
2006-03-14 11:34:17 +00:00
Dan Stillman
2a866fe3cd Added some sample data to the schema file and other assorted additions and tweaks 2006-03-14 10:57:01 +00:00
David Norton
89949042c3 Forgot to add the sidebar.js file before. :-) 2006-02-24 17:51:16 +00:00
David Norton
b0e5715c17 updated sidebar with treeView interface. 2006-02-24 17:50:24 +00:00
David Norton
686389ced5 Basic sidebar added. 2006-02-24 14:41:15 +00:00
David Norton
000378b5af 2006-02-24 14:28:04 +00:00
Dan Stillman
9f38337ec7 Initial import of repository structure, basic extension layout, and functions for DB abstraction and schema maintenance 2006-02-21 17:01:06 +00:00