Commit graph

46 commits

Author SHA1 Message Date
Dan Stillman
73317162c9 Missing file from previous commit 2010-02-04 13:13:48 +00:00
Dan Stillman
a2d9dbba83 Closes #853, repository field should contain only data on actual archives, not online databases
- Renamed 'Repository' to 'Library Catalog' and added 'Archive'
- Moved 'Repository' data to 'Archive' for item types other than books, periodicals, and theses
- Mapped 'Archive' to CSL 'archive'
2010-02-03 04:50:45 +00:00
Dan Stillman
4c30e6738f - Use millisecond resolution for file sync timestamps (fixes problem with slow sync initialization on some systems)
- Fix errors syncing files with filenames containing extended characters

This will not sync with the server until a server update is pushed.
2010-02-03 04:43:20 +00:00
Dan Stillman
5c37be057b Schema updates:
- For "Book Section", added "Book Author" (needs to be mapped to CSL container-author) (closes #872)
- For A/V item types, "Recording Type" mapped to "Type" is now "Format" mapped to "Medium" (closes #1060)
- For "Radio Broadcast" and "TV Broadcast", replaced "Series Title" with "Program Title" mapped to "Publication Title" (CSL field container-title rather than collection-title) (closes #860)
- For "Patent", added "Country" field, removed (nonfunctional) base-map from "Place" to "Country", added "Issuing Authority", replaced "Date" with "Filing Date" (not currently mapped to CSL), and moved "Date" data to "Filing Date". Kept "Issue Date" base-mapped to "Date".  (closes #1375)
- For "Film", mapped "Distributor" to "Publisher" (closes #861) and added "Genre" mapped to "Type"
- For "Podcast", mapped "Audio File Type" to "Medium" rather than "Type"
- For "Bill", added "Cosponsor" creator type (closes #655)
- For "Case", added "Author" as primary creator type instead of "Counsel" (#655)
- For "Computer Program", added "Date" (closes #1502)
- For "Thesis" and "Newspaper Article", added "Place" (closes #1274)
- For "Thesis", replaced 'pages' with 'numPages' (closes #1618)


This can't yet sync, so upping sync API version and delaying dev XPI build.
2010-01-25 23:16:15 +00:00
Dan Stillman
fccbff1f7f Delete invalid triggers 2010-01-16 01:37:40 +00:00
Dan Stillman
8870d5e514 Support for NSF Reviewer item type (for NSF use only -- not installed by default)
Also:

- Beginnings of custom item type/field support, though not intended for external use yet
- Zotero.Date.strToDate() now parses 'yesterday'/'today'/'tomorrow' and localized equivalents, allowing those strings to be used in fields such as 'Accessed'
- Cleaner display of dates without times in 'Accessed' field
- Item type menus in metadata pane, New drop-down, and advanced search window now sort by localized string

New methods:

- Zotero.CreatorTypes.itemTypeHasCreators(itemTypeID)
- Saved searches on item type should now use 'itemType' condition rather than 'itemTypeID'
2010-01-15 21:55:25 +00:00
Dan Stillman
94e279e034 ECL 1.0 -> GPLv3 2009-12-28 09:47:49 +00:00
Dan Stillman
9c5c02ef50 - In saved searches, use librayID_key hashes rather than ids for collections and saved searches (fixes inconsistent references across machines going forward, though it can't fix references that are already incorrect)
- Make "Saved Search" a separate search condition from 'Collection' in drop-down menu
- Better handle invalid search conditions
- (Dev) Saved search conditions are now 'collection' and 'savedSearch' rather than 'collectionID' and 'savedSearchID', though the latter can be used as shortcuts when adding

This could use some testing.
2009-12-05 10:26:47 +00:00
Dan Stillman
0fe5389858 Remove any remaining blank tags and enforce on DB level 2009-12-02 08:11:37 +00:00
Dan Stillman
3446aaf645 Fix constraint error "UPDATE itemAttachments SET syncState=?" during sync 2009-11-14 18:31:48 +00:00
Dan Stillman
67831bcb79 - Address "Delete reconciliation unimplemented for collections" message
- If collection items were added/removed on both sides, items from both sides were not always added
- Fix a couple other related glitches which may or may not have shown up before the above issues were fixed
2009-10-12 08:14:11 +00:00
Dan Stillman
884e5474fe Zotero File Storage megacommit
- Group file sync via Zotero File Storage
- Split file syncing into separate modules for ZFS and WebDAV
- Dragging items between libraries copies child notes, snapshots/files, and links based on checkboxes for each (enabled by default) in the Zotero preferences
- Sync errors now trigger an exclamation/error icon separate from the sync icon, with a popup window displaying the error and an option to report it
- Various errors that could cause perpetual sync icon spinning now stop the sync properly
- Zotero.Utilities.md5(str) is now md5(strOrFile, base64)
- doPost(), doHead(), and retrieveSource() now takes a headers parameter instead of requestContentType
- doHead() can now accept an nsIURI (with login credentials), is a background request, and isn't cached
- When library access or file writing access is denied during sync, display a warning and then reset local group to server version
- Perform additional steps (e.g., removing local groups) when switching sync users to prevent errors
- Compare hash as well as mod time when checking for modified local files
- Don't trigger notifications when removing groups from the client
- Clear relation links to items in removed groups
- Zotero.Item.attachmentHash property to get file MD5
- importFromFile() now takes libraryID as a third parameter
- Zotero.Attachments.getNumFiles() returns the number of files in the attachment directory
- Zotero.Attachments.copyAttachmentToLibrary() copies an attachment item, including files, to another library
- Removed Zotero.File.getFileHash() in favor of updated Zotero.Utilities.md5()
- Zotero.File.copyDirectory(dir, newDir) copies all files from dir into newDir
- Preferences shuffling: OpenURL to Advanced, import/export character set options to Export, "Include URLs of paper articles in references" to Styles
- Other stuff I don't remember

Suffice it to say, this could use testing.
2009-09-13 07:23:29 +00:00
Dan Stillman
d3b3cf1176 Fix entire autocomplete speed problem with a single missing index... 2009-09-03 05:19:04 +00:00
Dan Stillman
5c1ffd1e2f Reset storageModTime to 0 if < 0 and prevent setting < 0, though it shouldn't happen to begin with 2009-08-08 10:06:34 +00:00
Dan Stillman
0def6c109f Update some triggers and fix inconsistent database entries that could cause sync errors 2009-07-17 07:07:27 +00:00
Dan Stillman
31bf663b03 Fix a serious but hopefully rare upgrade bug since Sync Preview 1 that could cause a handful of creators to be turned into either empty strings or other creators (the latter being much less likely)
For libraries that have already been upgraded, this renames orphaned item creators to "[Missing Name]"
2009-07-04 09:00:44 +00:00
Dan Stillman
ad965b1675 Fix possible "syncDeleteLog not empty and no timestamp in Zotero.Sync.delete()" error after upgrading 2009-06-10 07:28:30 +00:00
Dan Stillman
6de3c02301 Fix problems with imported files in 2.0b4 due to incorrect NULL handling 2009-05-27 03:52:18 +00:00
Dan Stillman
f93f7384a6 Fix incorrectly entered MIME types and the DB bug in 2.0b4 that caused it 2009-05-22 02:07:22 +00:00
Dan Stillman
3ca64f746a - Remove empty creators from the database -- they shouldn't exist and were causing sync errors for some people
- Better logging for errors in metadata pane
2009-05-18 10:15:19 +00:00
Dan Stillman
7ab0a62e38 Fix dragging of items with old creators with NULL values into group libraries, and store (currently unused) shortName and birthYear fields as '' and NULL, respectively 2009-05-17 07:54:42 +00:00
Dan Stillman
91459f95f7 2.0b3 megacommit
- Support for group libraries
- General support for multiple libraries of different types
- Streamlined sync support
  - Using solely libraryID and key rather than itemID, and removed all itemID-changing code
  - Combined two requests for increased performance and decreased server load
  - Added warning on user account change
  - Provide explicit error message on SSL failure
- Removed snapshot and link toolbar buttons and changed browser context menu options and drags to create parent items + snapshots
- Closes #786, Add numPages field
- Fixes #1063, Duplicate item with tags broken in Sync Preview
- Added better purging of deleted tags
- Added local user key before first sync
- Add clientDateModified to all objects for more flexibility in syncing
- Added new triples-based Relation object type, currently used to store links between items copied between local and group libraries
- Updated zotero.org translator for groups
- Additional trigger-based consistency checks
- Fixed broken URL drag in Firefox 3.5
- Disabled zeroconf menu option (no longer functional)

Developer-specific changes:

- Overhauled data layer
  - Data object constructors no longer take arguments (return to 1.0-like API)
  - Existing objects can be retrieved by setting id or library/key properties
  - id/library/key must be set for new objects before other fields
- New methods:
  - ZoteroPane.getSelectedLibraryID()
  - ZoteroPane.getSelectedGroup(asID)
  - ZoteroPane.addItemFromDocument(doc, itemType, saveSnapshot)
  - ZoteroPane.addItemFromURL(url, itemType)
  - ZoteroPane.canEdit()
  - Zotero.CollectionTreeView.selectLibrary(libraryID)
  - New Zotero.URI methods
- Changed methods
  - Many data object methods now take a libraryID
  - ZoteroPane.addAttachmentFromPage(link, itemID)
- Removed saveItem and saveAttachments parameters from Zotero.Translate constructor
- translate() now takes a libraryID, null for local library, or false to not save items (previously on constructor)
- saveAttachments is now a translate() parameter
- Zotero.flattenArguments() better handles passed objects
- Zotero.File.getFileHash() (not currently used)
2009-05-14 18:23:40 +00:00
Simon Kornblith
9ca461c59b Proxy system overhaul
- Only one preference for recognizing proxies for transparent redirection
- Blacklists sites and http://%h/%p
- Fixes to EZProxy

This will clear all existing proxies from Zotero
2009-03-23 19:55:57 +00:00
Dan Stillman
893bbc2c89 Add dateAdded to all objects 2009-02-06 06:37:13 +00:00
Dan Stillman
eb79a0f659 Addresses #513, Deleted Items folder
- Still experimental, but committing for testing
- Sync conflicts with deleted items aren't yet supported

Unrelated: deprecated ZoteroPane.deleteSelectedItem() in favor of more accurately named deleteSelectedItems()
2009-01-28 21:25:06 +00:00
Dan Stillman
c7b2c84869 - Add automatic merging of collection and tag metadata and associated items, with warning alerts (eventually to be converted to logged notifications)
- Switch to using only keys for deleted items
- Fix various tag-related problems
- Probably other things
2008-12-27 05:42:52 +00:00
Dan Stillman
4d7bca4f43 Fix for some numeric directories being left behind during upgrade process, except this time maybe for real 2008-10-31 00:29:04 +00:00
Dan Stillman
0f0c531247 Merged r3450-3580 from 1.0 branch 2008-10-25 07:37:47 +00:00
Dan Stillman
108fd304ab Fixed lots of sync bugs
- All string values are now trimmed going into the DB (with a migration step for existing values) -- this fixes erroneous conflicts due to leading/trailing whitespace in sync XML being ignored
- Case disambiguation fixed on server
- Added basic diff ability to collections and tags so that identical objects won't trigger conflicts
- Fixed various other bugs that could cause erroneous conflicts
- Moved string fields in serialize() objects into a 'fields' object for consistency with Zotero.Item

Upshot of most of the above is that identical pre-upgrade libraries should now merge cleanly

Also reorganized/simplified/modularized parts of the sync code
2008-10-24 11:10:05 +00:00
Dan Stillman
3fdb212dd6 Fix for some attachment directories not being properly migrated to keys
Also migrates remaining files for past upgrades on the trunk (assuming their ids haven't been changed by syncing--if the item that has a given id already has a directory or if there is no attachment item with that id, the directory will be moved to orphaned-files)
2008-10-22 07:45:27 +00:00
Dan Stillman
651bcf2380 Adds rich text support to notes
- Still a few issues
- Converts plaintext notes to HTML on upgrade
2008-10-13 19:51:53 +00:00
Dan Stillman
083bdd4753 - Switch to using separate property files for storage sync rather than WebDAV properties, which aren't supported on all servers
- Fix potential security issues with symlinks in ZIP files due to Firefox brokenness
- Zotero.Utilities.HTTP.doGet() can now take a URI instead (and doesn't display the password that way for authenticated requests)
- For now, delete orphaned files immediately when using "Purge Orphaned Storage Files" instead of waiting a day
- Properly remove deleted files from delete log
- Better debugging of various things
2008-09-17 11:27:36 +00:00
Dan Stillman
86678aba27 Install/upgrade support for flat-file translators and styles
Files are copied from translators.zip and styles.zip (or, for SVN installs, 'translators' and (for now) 'csl' directories) in the installation directory to 'translators' and 'styles' directories in the data directory. A build_zip file is provided for testing translators.zip (which will take precedence over a 'translators' directory) but isn't required.

The timestamp stored in repotime.txt is stored in the database and is sent to the server for updates since that time.

Updating a file in [install-dir]/translators or [install-dir]/styles automatically copies all files in that directory to the data directory.
2008-09-12 22:09:54 +00:00
Dan Stillman
a8bb8dae40 Adds WebDAV file sync
- Still experimental and incomplete, with no lock support and not much error handling

Also:

- New expiry date for sync functions
- Attachment character set was being dropped during syncing
- Possibly improves sizing issues with preferences window
- Fixes problems with attachment filenames with extended characters
- Fixes some problem with tags that I don't remember
- Makes XMLHTTPRequest calls are now background requests (no auth windows or other prompts)
- Z.U.HTTP.doOptions() now takes an nsIURI instead of a URL spec
- New methods:
  - Zotero.Utilities.rand(min, max)
  - Zotero.Utilities.probability(x)
  - Zotero.Utilities.Base64.encode(str) and decode(str)
  - Zotero.getTempDirectory()
  - Zotero.Date.dateToISO(date) - convert JS Date object to ISO 8601 UTC date/time
  - Zotero.Date.isoToDate(isoDate) - convert an ISO 8601 UTC date/time to a JS Date object
2008-08-31 23:36:01 +00:00
Dan Stillman
4945737355 Fix SQL error 2008-07-29 17:49:04 +00:00
Simon Kornblith
09e8249db8 closes #743, Support non-EZproxy proxies
closes #831, transparent EZProxy support
adds a proxy pane to the preferences
asks before saving proxies to the DB (to avoid the potential phishing risk #831 would otherwise pose)
2008-07-28 11:11:12 +00:00
Dan Stillman
4f45e9156f Update userdata version 2008-07-08 16:27:24 +00:00
Dan Stillman
9596cece44 Add UNIQUE index on itemDataValues values 2008-07-07 14:00:34 +00:00
Dan Stillman
19b08a604a Drop redundant index on fulltextWords 2008-06-25 00:22:25 +00:00
Dan Stillman
9bf8333ea8 Missed file for tag case insensitivity 2008-06-16 21:01:09 +00:00
Dan Stillman
9bcdf021dd - Fixes tag editing
- Adds tag syncing
- Fixes a few other things

No tag CR yet
Requires new 1.0 DB upgrade
2008-06-16 05:46:10 +00:00
Dan Stillman
3de1789f26 Initial Zotero 1.5 Megacommit
Apologies for the massive (and, due to data_access.js splitting, difficult-to-follow) commit. Please note that external code that accesses the data layer may need to be tweaked for compatibility. Here's a comprehensive-as-possible changelog:

- Added server sync functionality (incomplete)
- Overhaul of data layer
  - Split data_access.js into separate files (item.js, items.js, creator.js, etc.)
  - Made creators and collections first-class objects, similar to items
  - Constructors now take id as first parameter, e.g. new Zotero.Item(1234, 'book'), to allow explicit id setting and id changing
  - Made various data layer operations (including attachment fields) require a save() rather than making direct DB changes
  - Better handling of unsaved objects
    - Item.setCreator() now takes creator objects instead of creator ids, and Item.save() will auto-save unsaved creators
    - clone() now works on unsaved objects
  - Newly created object instances are now disabled after save() to force refetch of globally accessible instance using Zotero.(Items|Creators|etc.).get()
  - Added secondary lookup key to data objects
  - Deprecated getID() and getItemType() methods in favor of .id and .itemTypeID properties
  - toArray() deprecated in favor of serialize(), which has a somewhat modified format
  - Added support for multiple creators with identical data -- currently unimplemented in interface and most of data layer
  - Added Item.diff() for comparing item metadata
- Database changes
  - Added SQLite triggers to enforce foreign key constraints
  - Added Zotero.DB.transactionVacuum flag to run a VACUUM after a transaction
  - Added Zotero.DB.transactionDate, .transactionDateTime, and transactionTimestamp to retrieve consistent timestamps for entire transaction
  - Properly store 64-bit integers
  - Set PRAGMA locking_mode=EXCLUSIVE on database
  - Set SQLite page size to 4096 on new databases
  - Set SQLite page cache to 8MB
  - Do some database cleanup and integrity checking on migration from 1.0 branch
  - Removed IF NOT EXISTS from userdata.sql CREATE statements -- userdata.sql is now processed only on DB initialization
  - Removed itemNoteTitles table and moved titles into itemNotes
- Abstracted metadata edit box and note box into flexible XBL bindings with various modes, including read-only states
- Massive speed-up of item tree view
- Several fixes from 1.0 branch for Fx3 compatibility
- Added Notifier observer to log delete events for syncing
- Zotero.Utilities changes
  - New methods getSQLDataType() and md5()
  - Removed onError from Zotero.Utilities.HTTP.doGet()
  - Don't display more than 1024 characters in doPost() debug output
  - Don't display passwords in doPost() debug output
- Added Zotero.Notifier.untrigger() -- currently unused
- Added Zotero.reloadDataObjects() to reset all in-memory objects
- Added |chars| parameter to Zotero.randomString(len, chars)
- Added Zotero.Date.getUnixTimestamp() and Date.toUnixTimestamp(JSDate)
- Adjusted zotero-service.js to simplify file inclusion

Various things (such as tags) are temporarily broken.
2008-05-04 08:32:48 +00:00
Dan Stillman
35ff52f2e8 Merged 1.0 branch back to trunk 2007-10-23 07:11:59 +00:00
Dan Stillman
c59dcdc0a6 New item types, fields, creator types, and the glue to make them work
If anyone's out there, now would be the time to test this.

Missing icons for the new types -- I could try to get some of those now, or we could just launch. Maybe we'll just launch. But really, might want to test this. Just sayin'.
2006-10-05 22:27:29 +00:00
Dan Stillman
cd26267afe Closes #340, Change isInstitution to fieldMode everywhere
Including in the DB, which it turns out isn't really all that bad (thanks, among other things, to SQLite's ability to DROP tables within transactions without autocommitting (which MySQL can't do))
2006-10-05 00:59:26 +00:00
Dan Stillman
74dbdec49b Renamed user.js to userdata.js 2006-10-04 23:37:15 +00:00
Renamed from user.sql (Browse further)