Commit Graph

22 Commits

Author SHA1 Message Date
Dan Stillman
206e18c351 Addresses #442, Add abbreviated item title and formatting logic
Add shortTitle field, just for real this time
2007-03-24 21:49:01 +00:00
Dan Stillman
d35ca68586 Addresses #442, Add abbreviated item title and formatting logic
Closes #578, rename "Publication" to "Book Title" on bookSection type

Also moved URL above call number on all fields.
2007-03-23 20:04:31 +00:00
Dan Stillman
4b52c8c44d Closes #451, conference paper needs "publicationTitle" field?
Added proceedingsTitle with base field publicationTitle for now, since the hierarchical item type structure will require both (the conference itself will be an event)

Copied any conferenceName value to proceedingsTitle
2007-03-23 00:43:27 +00:00
Dan Stillman
358924de47 Moved title field to itemData table, which made the following possible:
- All remaining fields in the items table exists in all items and are non-user-editable
   - Simplified some data access code (e.g. removed Item.isEditableField())
   - 'title' is now a base field used in case (Case Name), statute (nameOfAct) and e-mail (Subject)

Reengineered parts of the data layer for better performance

   - Various recent changes, including the 'title' change above and base field mapping in Item.getField(), had a negative effect on performance. This should help. In particular, itemData values are now loaded in in bulk by Items._load() (via Items.get()) rather than on-demand, the sort process in itemTreeView caches values while sorting, and ItemFields.getFieldIDFromTypeAndBase() is faster.


Addresses #346, mapping for new item types
2007-03-10 06:44:39 +00:00
Dan Stillman
22dacc2dbc Renaming 'abstract' field to 'abstractNote' so it's not a reserved word in JS and we don't have to add in special logic for it
(Doesn't have to be 'abstractNote', especially now that abstracts aren't actually notes--other suggestions welcome.)
2007-02-28 20:16:04 +00:00
Dan Stillman
97d1e0b844 Closes #346, mapping for new item types
Closes #227, Indent nested collections in search drop-down
Addresses #528, Make search condition drop-down menu less unwieldy

- Created new distinct fields for differently labeled fields
- Mapped lots of fields to base fields
- Made base field search conditions search type-specific fields as well
- Removed type-specific fields that are based on base fields not show up in search conditions drop-down
- Added a tooltip when hovering over a condition in the search conditions drop-down that shows the fields it searches (when there's more than one)
- Moved search dialog CSS to separate file
2007-02-17 09:39:51 +00:00
Dan Stillman
3e7ddd04d8 Removed abstract-as-note functionality in favor of a regular 'abstract' field
Abstract displays in metadata pane as a cropped one-line field by default; clicking the 'Abstract' label toggles between the cropped field and an expanded view

Some problems with import/export: https://www.zotero.org/trac/ticket/537

Refs #537
2007-02-15 20:33:14 +00:00
Dan Stillman
4caa096a46 Addresses #346, mapping for new item types
Closes #453, Check if any fields will actually be discarded on item type change before giving warning
Refs #530, Add base field conversion to translation level

Added mechanism for linking item type fields via base fields, e.g. publisher => label in audioRecording

New methods:

Item.getFieldsNotInType(itemTypeID, allowBaseConversion)
ItemFields.getLocalizedString(itemTypeID, field)
ItemFields.isBaseField(fieldID)
ItemFields.getFieldIDFromTypeAndBase(itemType, baseField)
ItemFields.getBaseIDFromTypeAndField(itemType, typeField)
ItemFields.getTypeFieldsFromBase(baseField)

Currently only the publisher fields are mapped -- I need more feedback on #346 before I implement the others (specifically on whether or not all these sorts of fields should be done as distinct fields or whether some should just be localized strings (in which case they'll autocomplete but not show up separately as search conditions))

Also added 'university' as distinct publisher field for thesis

Values of equivalent fields are now preserved when switching between item types (e.g. the 'studio' value becomes the 'label' value when switching between videoRecording and audioRecording), and the pop-up is much smarter--it will only prompt you if fields will in fact be lost, and it will list the fields that would be deleted.

Not finished:

- Searching for base fields doesn't yet search the type-specific fields, as Elena requested
- import/export/bib should be updated to use the ItemFields base conversion methods where appropriate -- data coming from the 'publisher' field from translators, for example, should be put into the appropriate type-specific field.
2007-02-03 17:08:03 +00:00
Dan Stillman
fb22bd04ba Closes #438, Add language field to every item type
Closes #450, encyclopedia article and dictionary entry types

Language might want some special properties (Dublin Core recommends "en" or "en-us"-style values as a best practice)

Also reordered some fields
2007-01-30 20:38:51 +00:00
Dan Stillman
a443348a63 Fixes #490, Presentation item type is missing the date field 2007-01-12 09:05:06 +00:00
Dan Stillman
0abda111a6 Addresses #394, Add generic item types
Add Document item type.  Just the type -- no magical properties for now.

Fields: title, publisher, date, and the globals (callNumber, archiveLocation, repository, rights, url, accessDate, extra). 
Creator types: author, contributor, editor, translator, reviewedAuthor (should these all be here?)
2007-01-02 12:19:00 +00:00
Dan Stillman
5ad86d2f50 Add conference paper item type 2006-12-09 17:29:00 +00:00
Dan Stillman
e73285ffc5 Improve date field handling
- Item.setField() stores dates in a multipart format beginning with an SQL date followed by the user's entry, so "November 3, 2006" becomes "2006-11-03 November 3, 2006" -- date field entries are parsed with Zotero.Date.strToDate() if not already in multipart format

- Item.getField() returns just the user part unless passed the new second parameter, _unformatted_, which returns the field directly from DB without processing (e.g. the full multipart string)

- Added SQLite triggers on the itemData table to enforce multipart format even if the table is modified outside the API

- Migration step to update existing dates

- Indicator next to date field to show what we've parsed and a tooltip over the date field to show the SQL date -- though I'm not sure how well the abbreviation part will localize (i.e. can you abbreviate 'month' in Chinese?)

One obvious problem is how to handle date ranges when sorting or searching, which may end up rendering this whole method fairly useless (though I guess the multipart format could begin with two SQL dates instead of just one, at the cost of some storage space...).


Other changes:

- Utilities.lpad() handling for undefined value parameter

- new Zotero.Date methods: strToMultipart(), isMultipart(), multipartToSQL(), multipartToStr(), isSQLDate(), sqlHasYear(), sqlHasMonth, sqlHasDay getLocaleDateOrder() (the last one unused for now)

- try/catch around manual itemData INSERT execute() statements in Item.save()
2006-11-03 09:23:24 +00:00
Dan Stillman
0f75f1243e Fixes #357, Presentation item type missing some fields 2006-10-21 10:46:52 +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