Commit graph

26 commits

Author SHA1 Message Date
Dan Stillman
56c7afc47e Duplicate detection:
- Adds a per-library "Duplicate Items" virtual search to the source list -- shows up by default for "My Library" but can be added to and removed from all libraries
- Current matching algorithm is very basic: finds exact title matches (after normalizing case/diacritics/punctuation/spacing) and DOI/ISBN matches (untested)
- In duplicates view, sets are selected automatically; in other views, duplicate items can be selected manually and the merge interface can be brought up with "Merge Items" in the context menu
- Can select a master item and individual fields to merge from other versions
- Word processor integration code will automatically find mapped replacements and update documents with new item keys

Possible future improvements:

- Improved detection algorithms
- UI tweaks
- Currently if any items differ, all available versions will be shown as master item options, even if only one item is different; probably the earliest equivalent item should be shown for each distinct version
- Caching of results for performance
- Confidence scale
- Creator version selection (currently the creators from the chosen master item are kept)
- Merging of matching child items
- Better sorting of duplicates if not clustered together by the selected sort column
- Relation path compression when merging items that are already mapped to previously removed duplicates

Other changes in this commit:

- Don't show Trash in word processor integration windows
- Consider items in trash to be missing in word processor documents
- Selection of special views (Trash, Unfiled, Duplicates) is now restored properly in new windows
- Disabled field transform context menu when item isn't editable
- Left/right arrow now expands/collapses all selected items instead of just the last-selected row
- Relation deletions are now synced
- The same items row is now reselected after item deletion
- (dev) Zotero.Item.getNotes(), Zotero.Item.getAttachments(), and Zotero.Item.getTags() now return empty arrays rather than FALSE if no matches -- tests on those return values in third-party code will need to be changed
- (dev) New function Zotero.Utilities.removeDiacritics(str, lowercaseOnly) -- could be used to generate ASCII BibTeX keys
- (dev) New 'tempTable' search condition can take a table to join against -- useful for implementing virtual source lists
- (dev) Significant UI code cleanup
- (dev) Moved all item pane content into itemPane.xul
- Probably various other things


Needless to say, this needs testing.
2011-07-22 21:24:38 +00:00
Dan Stillman
51f8c11ea0 Switch client code license to Affero GPL version 3 2011-05-18 18:34:22 +00:00
Dan Stillman
2f802fe74d Don't start Standalone on databases from <2.1b3 2011-01-13 20:52:15 +00:00
Dan Stillman
5f099967b2 - Move translatorCache to userdata so that translators aren't reinstalled after a system.sql update
- Delete existing translatorCache via schema update to fix translator filename bug in 2.1b1 build
2010-10-03 17:44:10 +00:00
Simon Kornblith
bddb583e43 - cache translators in DB to reduce startup times on Windows
- fix some error handling in translate.js
2010-06-28 09:07:44 +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
cce572965c Fix incorrect base-mapping (addresses #861) 2010-01-25 23:27:48 +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
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
270eb3d67c Map 'network' field in tvBroadcast to 'publisher' 2009-06-25 00:18:47 +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
Dan Stillman
5920f22c52 Addresses #1408, Incorect format for legal case citations in CMS note without biblography style
Added 'docketNumber' to 'case' item type and mapped it to base field 'number'
2009-03-15 18:18: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
77133f465c - Saved search syncing, with automatic latest-wins conflict resolution
- Last sync time displayed in sync button tooltip
- Various and sundry bug fixes

DB must be re-upgraded from 1.0
2008-06-02 09:15:43 +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
7236aaf58e Whitespace-only change -- ignore 2008-02-07 09:45:35 +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
eccc2159c1 Oops--CSL table needs to be defined in scrapers.sql too.
(The problem with the current system is that any local translators or styles will be wiped out on upgrades (though not auto-updates), but the solution for that is probably to just offer an SQL file that the user can put custom SQL statements in to be run on upgrades (sorta the same idea as user.js in Firefox). Will deal with that at a later date, though.)
2006-10-02 21:25:47 +00:00
Dan Stillman
40c9e620e7 - Note icon in toolbar no longer opens a new window by default, though it does if you hold down the shift key when clicking (let's hear it for undocumented features)
- Removed Note from New Item (+) menu
- Replaced "#" column with "+", at Dan C.'s suggestion
2006-10-02 06:44:16 +00:00
Dan Stillman
508b35f6d1 1) By "Scrapers don't save metadata properly" in my last commit, I meant only URL and accessDate, though on second thought they probably will work.
1b) However, I also did, in fact, break scraping completely, so my previous statement was actually correct. Fix for that coming right up.

2) Fixed problem with translators table getting wiped out completely whenever system.sql was updated (from r671, I believe). Right. Moved the DROP and CREATE statements for translators into translators.sql.
2006-10-02 01:07:56 +00:00
Dan Stillman
b684e97366 Closes #252, Metadata not displaying for page snapshots
Closes #304, change references to "website" to "web page"

More changes as per discussions with Dan:

- Linked URLs have been given a second chance at life, though they still shouldn't be used for (most, if any) scrapers (which should use snapshots or the URL field instead)
- Renamed the "website" item type to "webpage"
- Removed "web page" from the New Item menu
- Added Save Link To Current Page toolbar button
- Added toolbar separator between New Item buttons and link/attachment/note to differentiate
- Added limited metadata (URL and accessDate) for attachments
- URL for attachments now stored in itemData (itemAttachments.originalPath is no longer used, but I'm probably not gonna worry about it and just wait for SQLite to support dropping columns with ALTER TABLE) -- getURL() removed in favor of getField('url')
- Snapshots now say "View Snapshot"
- Added Show File button to file attachments to show in filesystem
- Added timed note field to attachments for single notes and adjusted Item.updateNote(), etc. to work with attachments
- Fixed bug with manually bound params in fulltext indexer and Item.save() (execute() vs. executeStep()) -- any recently added items probably aren't in the fulltext index because of this


Known bugs/issues:

- Attachment metadata and notes probably aren't properly imported/exported now (and accessDate definitely isn't)
- Scrapers don't save metadata properly
- Attachment title should be editable
- File attachments could probably use some more metadata (#275, more or less, though they won't be getting tabs)
2006-10-02 00:00:50 +00:00
Dan Stillman
27f89fac5e Cross-posting to BC for discussion: http://chnm.grouphub.com/projects/310105/msg/cat/2114872/3538662/comments
Changes as per my discussions with Dan:

- Separated snapshot functionality into two individual buttons, Create New Item From Current Page and Take Snapshot of Current page
- Updated schema to support primary, secondary and hidden item types (and future user customizations)
- Reorganized New Item menu, moving secondary items into sub-menu
- Removed ability to create link attachments, since it never really made much sense -- will simply use the webpage item type instead. Underlying functionality still exists for the time being, as people have existing links in their libraries--I think we're gonna have to just warn beta testers and delete them in a transition step, as converting nested links really wouldn't be worth the effort.
- Moved file link/add functions into new item menu and removed attachment drop-down
- Large, prominent View and Locate buttons in edit pane for going to an associated URL and looking up in OpenURL, respectively -- buttons gray out as appropriate
- New Item from Page stores the URL and access date (Item.save() checks for the string "CURRENT_TIMESTAMP" for accessDate and doesn't bind it as a string)
- "Website" to "Web Page" (do we prefer "Webpage"? they both look a bit funky in uppercase)

More coming.


Bugs/Known Issues:

- Since snapshots from the toolbar are now top-level in the current collection, there needs to be a way to drag them into items
- The camera icon for adding snapshots, despite being a famfamfam icon, really doesn't read too well (or perhaps just clashes with the rest of our icons). Anybody have a better one? (It also may be able to just be lightened up a bit.)
- Trying the large View/Locate buttons after discussions with Dan, but this approach may not work -- 1) a large View button for the URL makes a lot less sense when you have a parent item with a child snapshot, since people will end up clicking it all the time when they really want to view the snapshot, and 2) the Locate button is awfully big for something that only applies to certain types of items, may not get used very often when it does, and probably won't work when it is
- The access date is stored in UTC and displayed with toLocaleString() like Date Added and Date Modified, but, unlike those two, it's also user-editable. This is clearly a problem. Probably need to parse to Date on blur() with strToDate() and insert as UTC, discarding anything left over. 
- Item type itself is still "website" -- should probably change that while we still can


Closes #253, OpenURL arrow should provide visual feedback on mouseover and/or look more button-like
Addresses #304, change references to "website" to "web page"
Addresses #207, openurl arrow functionality
2006-09-27 08:12:09 +00:00
Dan Stillman
fe319f033b Schema and Item Type Manager updates to handle item type templates
Note that there's no code for user types and fields yet -- just the schema (actually there's a tiny bit of code in the item type manager, since we'll probably use some of the same methods for managing user types, but not much)

Templates for primary item types are currently only used by the item type manager to make creating new types easier and to prevent the removal of fields from an item type that are associated with its template item type -- the fields are all still recorded in itemTypeFields, since they might have different orders or default visibility settings from their templates
2006-09-13 22:04:54 +00:00
Dan Stillman
14e3b05ca4 Separated schema into two files, system.sql and user.sql -- the former contains tables that can be wiped and reinitialized at any time *as long as ids are kept the same* (like scrapers.sql), whereas the latter contains user data that has to be migrated from one version to the other with transition steps
This should make development much easier, as we can, for example, add 80 item types without having to write transition steps

Pretty sure this won't delete anyone's data. Might want to test that theory, though.
2006-09-10 20:08:59 +00:00
Renamed from schema.sql (Browse further)