Commit graph

588 commits

Author SHA1 Message Date
Simon Kornblith
73b5634f62 addresses #215, allow user to select citation style and change citation styles on the fly
addresses #214, add footnote support to word integration

- the third icon on the Zotero Word toolbar is now reserved for "Document Options," which, for now, means on the selection of styles
- the Document Options window will, for now, appear the first time you create a citation. the default style probably belongs in the Scholar preferences window.
- you can now generate citations in both footnote and in-text citation formats. you can't yet switch between them on the fly, but that should be coming soon...
- Ibid is not yet implemented. again, coming soon.
2006-08-29 23:15:13 +00:00
Simon Kornblith
d8171f775c closes #223, citing the same item multiple times should produce only one bibliography entry 2006-08-29 17:29:35 +00:00
Dan Stillman
bdebc8dffa Saved search improvements:
- select() new collections and saved searches on creation

- Show all collections in search dialog Collection condition drop-down, not just top-level ones -- eventually there should probably be some sort of level indication to show hierarchy

- Don't allow a search to define itself as a savedSearchID condition. Right.

- Fixed a couple bugs in Collection condition creation that would've made such searches often not work

- Added saved search 'add' support to collectionTreeView notify(), and send the right trigger from Scholar.Search
2006-08-29 11:16:31 +00:00
Dan Stillman
cd432a1e2a Add 'recursive' flag to Scholar.getCollections() to retrieve all collections in a flat ordered array 2006-08-29 11:06:54 +00:00
Dan Stillman
97c3f13112 Closes #222, Quick search should use current view as the context 2006-08-29 07:18:41 +00:00
Simon Kornblith
0c24beee3f closes #213, add in-text citation support to citation engine
fixes date and et al. handling bugs in citation engine
permits citation of multiple items in Word integration
2006-08-29 04:24:11 +00:00
Dan Stillman
97b2abf2f9 Fix error when trying to delete all items in Library (thanks Dan C.) 2006-08-29 01:00:43 +00:00
Dan Stillman
46368e98dd Closes #176, Customize search operators for itemData fields
Implemented isBefore and isAfter operators and added to date conditions -- currently have to type dates in SQL format, but we'll have a chooser or something by Beta 2 (this should probably be a known issue)

Added isLessThan and isGreaterThan to 'pages', 'section', 'accessionNumber', 'seriesNumber', and 'issue' fields, though somebody should probably check me on that list

Removed JS strict warning on empty search results
2006-08-28 20:49:24 +00:00
Dan Stillman
cdd24fe3b7 Addresses #126, Editing oddities
- Added support for tabbing between fields, which unfortunately we don't get for free from tabindex because of what we're doing with labels and textboxes. (The textbox being tabbed away from is deleted before the blur() completes, so it doesn't know where it's supposed to go next.) Basically replicated the built-in functionality for all the text fields -- can add on special tricks for creator adding/removing later.

- Increased spacing between rows slightly and adjusted margins to get rid of shifting when switching between label and textbox -- this also fixes the annoying clicking-off-a-textbox-to-the-lower-portion-of-a-label-below-it-doesn't-select-the-label problem.
2006-08-28 08:43:18 +00:00
Simon Kornblith
c2c82e3c54 add basic Word integration. to see it in action, copy Zotero.dot to Microsoft Office 2004/Office/Startup/Word. if the gods are with you, you should see a new toolbar the next time you open Word.
not yet implemented:
- formatted in-text citations, rather than placeholders
- footnotes
- selection of citation style (for now, only APA is available)
- support for non-ASCII characters
- exclusion of notes from select items window
- Windows support (although it shouldn't be difficult)
- probably much more...
2006-08-28 05:38:37 +00:00
Dan Stillman
a976d4cd0e Fixes #212, Fails to load on Linux
Wrong permissions set on new Scholar directory
2006-08-27 21:17:49 +00:00
Dan Stillman
6fce0ef2a6 Add numChildren as known primary field to isPrimaryField() so item data isn't loaded for all items unnecessarily 2006-08-27 08:05:56 +00:00
Simon Kornblith
d3fc9866b9 - add ABC-CLIO (America: History and Life) translator
- fix a potential issue with COinS support
2006-08-26 21:36:49 +00:00
Dan Stillman
4fefaf1edf Added method to generate SQL in Item Type Manager for easier export 2006-08-26 12:05:16 +00:00
Dan Stillman
bec5e78417 Changed itemTypeFields schema to support default show/hide setting for fields in particular item types
Updated item type manager to support changing default show/hide
2006-08-26 10:35:47 +00:00
Dan Stillman
1ac0c8e9a3 Debug message fix in DB.rollbackTransaction() 2006-08-26 08:54:31 +00:00
Dan Stillman
3d6aa4b6ab Updated the item type manager to support adding and removing item types and fields
Actually getting the modified tables out of the DB still requires ".dump tablename" in the client
2006-08-26 08:08:15 +00:00
Dan Stillman
1410433e73 Scholar.DB.getNextID(table, column) -- get the lowest unused integer >0 in a DB column 2006-08-26 08:02:17 +00:00
Dan Stillman
4b48ff0414 Stop JS strict warnings from Hash.get() misses 2006-08-26 05:33:44 +00:00
Simon Kornblith
f07cb5a5bc adds an InfoTrac OneFile translator
fixes a bug in ingester progress window handling
2006-08-26 03:50:15 +00:00
Simon Kornblith
62ffea9542 closes #209, Scholar does not refresh the item pane when a new collection is clicked
it's possible that this fix will introduce some bugs, but it appears to work fine
2006-08-25 19:15:03 +00:00
Dan Stillman
624faaf110 Closes #202, attachments categorized as notes
"Notes" column changed to "#" and combined with the attachment count. "#" isn't exactly immediately self-explanatory, but "Notes/attachments" would be way too long, and once you realize what it's for (i.e. the first time you create a child item), you really don't want the column taking up any more room than that... If people have a better suggestion, do share.
2006-08-25 08:37:16 +00:00
Dan Stillman
59c00ba6c2 Localized strings for the search dialog box, but not used yet (I'm not sure if XUL in bindings can use DTD strings or need to use properties...) 2006-08-25 08:12:28 +00:00
Dan Stillman
9df93a8e27 Fixes #206, notes/attachment count incorrect after deletion
The notes/attachment count wasn't going down on an attachment deletion because it's not actually a notes/attachment count at all--it's a notes count, and new attachments were incorrectly incrementing it.

This technically either fixes or invalidates #202 ("attachments categorized as notes"), depending on how you look at it, but I'll change that to reflect the desired goal of having a combined notes/attachments count.

Refs #202
2006-08-25 08:01:55 +00:00
Dan Stillman
ebb9122e0a Forgot to remove removed field from attachment item type 2006-08-25 07:38:16 +00:00
Dan Stillman
9a897e15e8 Closes #205, eliminate "source" field, and add "url" field on all item types 2006-08-24 20:33:29 +00:00
Dan Stillman
1bed666f21 Closes #198, smart collection icon is a couple of pixels too high 2006-08-24 19:44:35 +00:00
Dan Stillman
7d6bd8d0af "project"=>"collection" (already "collection" in most places internally) 2006-08-24 19:43:48 +00:00
Simon Kornblith
0e63958f96 - make proquest work better behind proxies
- improved frame support
2006-08-24 18:00:48 +00:00
Simon Kornblith
c5ec34d6ae closes #197 (my fault, not david's) 2006-08-23 03:55:41 +00:00
Dan Stillman
03d8097527 Disable creator add button on previous row when adding a new row (since bad things can happen if we don't) and undo on reverse 2006-08-22 19:52:15 +00:00
Dan Stillman
57f4e43507 OK, I think this should fix both #179 ("adding a new creator then clicking an existing creator makes the creator field disappear") and #190 ("tag issues") -- I caused #190 with my fix to the former, and David rebroke #179 with his revert to fix the latter.
The problem was twofold: 1) onselect="ScholarItemPane.loadPane(this.selectedIndex)" is (for some reason) triggered when clicking off of the "+" creator add button onto the rest of the deck pane (and not just when switching tabs) and 2) the selectedIndex passed into loadPane() from the deck during the non-tab triggers is (for some reason) an empty string rather than the index of the selected tab, which is why the creator problem only used to happen the first time you clicked away from a "+" (before the empty string was stored as a key in the _loaded array). (In short, onselect for decks is pretty broken.)

Now only calling loadPane if (this.selectedIndex!=='') -- can't just test for typeof=='number' because this.selectedIndex on the deck is always a string


refs #179 and #190
2006-08-22 07:01:21 +00:00
Dan Stillman
c4e9e76795 Search (data layer):
- Added 'fulltext' condition as shortcut to add an operator/value against all string-based conditions -- can be used for quicksearch within a view if collectionID/savedSearchID is added as a required condition along with it

Note that the 'fulltext' condition isn't stored internally and addCondition() doesn't return a searchConditionID for it, so it's not really meant to be used for saved searches.

Example:

var search = new Scholar.Search();
search.addCondition('collectionID', 'is', 6856, true);
search.addCondition('fulltext', 'contains', 'wellman');
Scholar.debug(search.search());


- Fixed isNot/doesNotContain for items table fields and collectionID
2006-08-22 04:23:01 +00:00
Dan Stillman
61c18639fe Operator selection bug in search interface (need to keep track of selected operator now that onConditionSelected() is called after loading in a condition) 2006-08-22 04:15:36 +00:00
David Norton
d38e94dd27 Fixes #190, tag issues.
- This was a problem with more than just tags. I reverted a change from r483 that shouldn't affect anything else.
2006-08-22 03:15:42 +00:00
David Norton
ee943c0d2c Closes #169, add OpenURL interface hooks
- Added menu, uses OCLC database. (someone should test from GMU or another institution)
2006-08-21 21:10:40 +00:00
Dan Stillman
3ac311e85a Search improvements:
Conditions can now offer drop-down menus rather than freeform text fields -- implemented for collections/saved searches and item types

Special handling to combine collections and saved searches into a single "Collection" menu (can we get away with calling them "Smart Collections"?) -- internally, values are stored as C1234 or S5678 in the interface and converted to/from regular collectionID and savedSearchID conditions for search.js

Use localized strings for conditions (tries searchConditions.* first, then itemFields.*)

Alphabetize condition list

Operator menu now fixed length for all conditions
2006-08-21 05:08:11 +00:00
Dan Stillman
b79937d134 Show proper operators for new and loaded conditions (before clicking on the menu) in search window 2006-08-20 08:22:07 +00:00
Dan Stillman
d193afe740 Items without rows in the applicable table didn't show up for searches with isNot or doesNotContain conditions 2006-08-20 07:34:37 +00:00
Simon Kornblith
04d05548b2 closes #103, figure out how to store captured pages in native export format
fixes ampersands in citation COinS
fixes tags and seeAlso in import/export (should now work for all items)
2006-08-20 04:35:04 +00:00
Dan Stillman
217636ad14 - Proper handling of saved search renaming and erasing (via Notifier)
- Support for multiple id collection/search remove/modify notifications

- New method Scholar.Searches.get(id) to get 'id' and 'name' for a particular savedSearchID
2006-08-20 03:27:25 +00:00
Dan Stillman
d6214b3f86 Fix some JS strict warnings in data methods 2006-08-20 02:03:57 +00:00
Dan Stillman
bfbea6474e Fixes #196, Error: Scholar.File.getMIMETypeFromFile is not a function (line 1957) when adding new files
My bad
2006-08-20 01:40:39 +00:00
Dan Stillman
6a994a25a2 Closes #193, need a function to add snapshots from folders
Scholar.Attachments.importSnapshotFromFile(file, url, title, mimeType, charset, sourceItemID)

file is primary file within directory -- file.parent is copied into the storage directory
url is the original URL associated with the snapshot
2006-08-19 23:28:49 +00:00
Simon Kornblith
94bd2415da adds short roles to CSL (Ed. instead of Editor)
adds COinS to exported HTML
uses real lists in HTML output
fixes other small citation style issues
2006-08-19 23:14:27 +00:00
Dan Stillman
89acdf101c Fix #191, calling Scholar.Attachments.importFromURL on a PDF without PDF plug-in installed results in a prompt to save the file to the disk
Attachments.importFromURL() now first does a HEAD request to get the MIME type and passes that through Scholar.MIME.hasInternalHandler() (now abstracted from Scholar.File, along with the other MIME functions) -- if it can handle the MIME type, it uses a hidden browser; otherwise, it use a remote web page persist to save the file directly
2006-08-19 20:51:01 +00:00
Dan Stillman
3ce672756c Fix Utilities.HTTP.doHead() brokenness 2006-08-19 20:45:27 +00:00
Simon Kornblith
26668a6e73 closes #194, EBSCO translator
closes #160, cache regular expressions
closes #188, rewrite MARC handling functions

MARC-based translators should now produce item types besides "book." right now, artwork, film, and manuscript are available. MARC also has codes for various types of audio (speech, music, etc.) and maps.
the EBSCO translator does not yet produce attachments. i sent them an email because their RIS export is invalid (the URLs come after the "end of record" field) and i'm waiting to see if they'll fix it before i try to fix it myself.
the EBSCO translator is unfortunately a bit slow, because it has to make 5 requests in order to get RIS export. the alternative (scraping individual item pages) would be even slower.
regular expression caching can be turned off by disabling extensions.scholar.cacheTranslatorData in about:config. if you leave it on, you'll have to restart Firefox after updating translators.
2006-08-19 18:58:09 +00:00
Dan Stillman
85929cd27d Fixes #195, ISBNs should not become INTs
The ISBNs were actually stored fine in the database--it was just that the DB methods were using getInt32() to retrieve them. Using getInt64() instead.
2006-08-18 19:24:46 +00:00
Dan Stillman
73cc7b8707 Fixes #192, double-clicking webpage snapshots sometimes brings up a save dialog
On Simon's suggestion, appending .html to all text/html files--I can't reproduce the problem, and I'm not sure what's causing the ExternalHelperAppService to get confused, but this should at least avoid the issue...
2006-08-18 07:06:01 +00:00
Simon Kornblith
20486d5053 addresses #103, figure out how to store captured pages in native export format
import/export of file data should work for all file types _except_ snapshots (in this situation, export is working, but import is not yet complete; see #193)
also, fixes a potential security issue that could have allowed malicious web translators to post local data to remote sites (although, given we maintain the central repository and there's no easy way to install a translator, the risk would have been minimal to begin with).
2006-08-18 05:58:14 +00:00
Simon Kornblith
10ba568ee8 closes #39, auto-ingest of associated files (as recognizable)
closes #3, Overflow metadata dumps into "extra" field

add "extra" data where such data is useful and conveniently accessible (not available for XML-based export or MARC formats yet)
add links to permanent URLs
download associated files from full text sources (if extensions.scholar.downloadAssociatedFiles preference is enabled)
fix WorldCat translator
improve InnoPAC translator (it now works on Georgetown search results pages, albeit slowly, because it must first realize the catalog is misconfigured)
tag items from SIRSI and WorldCat
return to putting the full lengths of books into "pages," because some citation styles require it
fix COinS (broken a few revisions ago)
2006-08-17 07:56:01 +00:00
Simon Kornblith
410e090ecd closes #104, speed up multiple item adds 2006-08-15 23:03:11 +00:00
Dan Stillman
f9ffbd12dd Notifier.isEnabled() 2006-08-15 21:31:08 +00:00
Dan Stillman
fccc822063 Like the last commit, just functional 2006-08-15 21:24:21 +00:00
Dan Stillman
d456255b94 Allow multiple ids in notifier add/item events on interface side
(I didn't actually test this...)
2006-08-15 21:11:52 +00:00
Dan Stillman
844fcc0ee9 Run _loadChildItems() in Collection.loadFromRow() so that _childItems.length is calculated properly 2006-08-15 20:38:20 +00:00
Dan Stillman
7f13072ef4 Added Scholar.Notifier.enable() and disable() to turn on and off trigger() notifications (enabled at startup)
Changed 'smartcollection' notifier type to 'search' and reduced hash length to 2
2006-08-15 19:59:17 +00:00
Simon Kornblith
51108446e3 closes #187, make berkeley's library work
closes #186, stop translators from hanging

when a document loads inside a frameset, we now check whether we can scrape each individual frame.
all functions involving tabs have been vastly simplified, because in the process of figuring this out, i discovered Firefox 2's new tab events.
if a translator throws an exception inside loadDocument(), doGet(), doPost(), or processDocuments(), a translate error message will appear, and the translator will not hang
2006-08-15 19:46:42 +00:00
Dan Stillman
009a4ad520 Fix search brokenness from r453 2006-08-15 04:59:09 +00:00
Dan Stillman
3a18dcb70f Unsaved creators are no longer saved (e.g. on creator type change) if they don't have a firstName or a lastName
(Also fixes bug from r379 where changing creator type on a blank unsaved creator would actually insert "(first)" and "(last)")

Localized '(first)' and '(last)'


Refs #179, adding a new creator then clicking an existing creator makes the creator field disappear
2006-08-15 03:19:11 +00:00
Simon Kornblith
b35ba91c15 closes #185, Citations shouldn't add a period to reference titles that already end with punctuation marks 2006-08-15 01:26:14 +00:00
Simon Kornblith
37a6684546 write "?" if a character cannot be converted to UTF-8 (although i'm not sure how this would ever happen) 2006-08-15 01:09:06 +00:00
Simon Kornblith
52fe187328 closes #184, support non-ASCII characters in HTML and RTF. since we use the unicode features of RTF 1.5, this requires Word 97 or later on a PC (or presumably Word 98 or later on a Mac) to read.
fixes one last strict mode bug
2006-08-15 01:05:20 +00:00
Simon Kornblith
c18f75d667 show fewer warnings in strict mode 2006-08-14 22:28:22 +00:00
Simon Kornblith
ba1a383aa1 don't throw an error trying to make a bibliography with an item with no date (thanks Dan) 2006-08-14 22:05:58 +00:00
Simon Kornblith
dac5bbb3f3 closes #183, export bibliography to RTF 2006-08-14 21:54:45 +00:00
Simon Kornblith
feff0aa531 closes #53, export to footnote or bibliography
closes #180, make all contextual menu export/create bibliography options work right

also:
- add Chicago Note style output
- unregister RDF data sources from cache after import
2006-08-14 20:34:13 +00:00
Dan Stillman
46fa6484a5 Fix last unhelpful debug message in db.js 2006-08-14 18:44:28 +00:00
Dan Stillman
c92faace52 Fixes #179, adding a new creator then clicking an existing creator makes the creator field disappear
Fixed a number of creator-editing-related issues (mostly interface-side, with a little help from the data layer):

- New row no longer disappears when clicking "+" and then clicking the existing or new creator (removed onselect="ScholarItemPane.loadPane(this.selectedIndex)" on the <deck> (from r371, with changelog "Individual tabs don't load their content unless selected"), which doesn't seem to be necessary as far as I can tell)

- New row no longer disappears when changing creator before editing names (setting the creator type now triggers an Item.save() with an otherwise blank creator (now allowed by the data layer), which isn't entirely ideal but is probably OK for now)

- Clicking the minus button on an unsaved row (i.e. one just created with the plus button) no longer throws an error (new method Item.hasCreatorAt(pos), and ScholarItemPane.removeCreator() just deletes the label directly, since it doesn't get a notify() event to reload the pane)

- The plus button is disabled on unsaved rows, since allowing the user to create multiple unsaved rows and then edit one in the middle is problematic (and the other alternatives have their own problems); the minus button is also disabled on the default row that shows when there are no creators

- Creator type is no longer reset when editing a name field

- Name field is no longer erased when clicking directly on creator type popup and changing creator type without blurring textbox

- Comma is appended to last name when switching from <textbox> to <label> without saving changes (before it was just appended to labels when the pane was loaded)
2006-08-14 10:02:00 +00:00
Simon Kornblith
3195a1c382 closes #112, ingested items should be automatically added to selected project
references #178, changes to various date fields

- updates CSL to work with the latest schema. we can now (almost) generate completely valid APA style. the only issue is that there's no syntax for specifying short forms for page and creator type labels.
- updates scrapers to use date field rather than year field.
- removes now-unnecessary translation engine code pertaining to year field.
2006-08-14 05:12:28 +00:00
Dan Stillman
1ea0e14ad3 Fixes #182, Date Added/Modified is in UTC
Added isUTC parameter to Scholar.Date.sqlToDate() and now run the two columns through that

Side effect: now using toLocaleString() to format the date strings
2006-08-14 03:19:01 +00:00
Dan Stillman
496daebd8e Oops 2006-08-13 22:30:25 +00:00
Dan Stillman
cfc13ee9ac Closes #178, various changes to date fields
Closes #111, minor modifications to field list schema

Changes per above tickets and comments at http://chnm.grouphub.com/projects/310105/msg/cat/2333974/2995041/comments

- date, year and lastModified merged into date
- added date field to journalArticle
- added series, seriesTitle and seriesText to journalArticle
- added seriesNumber (along with series) to book and bookSection
2006-08-13 20:31:11 +00:00
Simon Kornblith
1ada4ddc00 add localized strings for CSL
closes #110, implement CSL for citation styling
2006-08-12 23:28:39 +00:00
Simon Kornblith
05edc2a08b rewrote citation support to support new version of CSL schema. bibliographic output is much improved. 2006-08-12 23:23:56 +00:00
Dan Stillman
bf96eca337 Use alternate method of differentiating between no network connection and invalid repository response in _updateScrapersRemoteCallback(), since xmlhttp.noNetwork property is no longer available
(xmlhttp.status seems to turn into a very large integer when there's a network error--I can't imagine this a fairly reliable test, but, then, neither was the previous one, and at least at the moment we're not actually using the test for anything other than an appropriate debug message)
2006-08-12 04:44:58 +00:00
Simon Kornblith
ddb4fc872c remove the doStatus argument from Scholar.Utilities.HTTP 2006-08-12 04:27:49 +00:00
Dan Stillman
7e1a678f9b Addresses #136, Detect mime type and character set of local files when importing
Use new MIME type detection tricks when linking and importing files -- now for charset detection...
2006-08-12 03:54:13 +00:00
Dan Stillman
794238c23f - Added file.js to chnmIScholarService.js
- Fixed bug in File.hasInternalHandler() (no access to navigator from XPCOM)

- Changed "View Attachment" action to check File.hasInternalHandler() and use window.loadURI() for internally handled files and nsIFile.launch() for external -- this prevents the user from getting a helper app dialog when they try to view external files. I basically had to duplicate most of Mozilla's content detection logic and "guess" whether or not it will be able to handle the file internally, which seems a little silly, but, while I feel there are probably better ways to do various parts of this, what's here seems to do the trick. Let me know if you notice it guessing incorrectly (i.e. you get a helper app dialog rather than having a file just open or it launches a file that should've just been loaded into the window). Also look for text files that should be launched rather than opened, especially XML-based data files, as this is a chance for Scholar to be smarter than Firefox itself--for example, OmniGraffle files, which are actually just XML files, normally open up in Firefox as an XML tree, but Scholar will launch them instead. (I imagine the same will need to be done for OmniOutliner, among other things...)
2006-08-12 03:45:57 +00:00
Dan Stillman
d0d1ed8c1d Scholar.File -- some methods to help with MIME type detection of local files (might be abstracted into MIME class later)
Methods:

getExtension(ext)
isExternalTextExtension(ext)
getSample(nsIFile)
sniffForMIMEType(nsIFile)
sniffForBinary(nsIFile)
getMIMETypeFromFile(nsIFile)
hasInternalHandler(nsIFile)
2006-08-12 01:41:48 +00:00
Dan Stillman
f07ff9ac2a Renamed "Files" to "Attachments" -- since Files could be links as well as actually files (or both, for web page snapshots), things were getting just about as confusing as when Items were called Objects.
If you have attachments to the old terminology, feel free to file a complaint.

Changed interface code too, since David is gone (or at the very least has more important things to do with his remaining time)
2006-08-12 00:18:20 +00:00
Simon Kornblith
36a402713c rename Scholar.Utilities.Ingester.HTTPUtilities to Scholar.Utilities.Ingester.HTTP for consistency 2006-08-11 16:34:22 +00:00
David Norton
e56abbc5f4 Closes #138, Ability to view files
Some minor fixes to editing creators.
2006-08-11 15:48:26 +00:00
Dan Stillman
1447b3be92 Item.getLocalFileURL() -- Return a file:/// URL path to files and snapshots 2006-08-11 15:34:06 +00:00
Simon Kornblith
064ecd17db removes unnecessary pieces of piggy bank API from utilities and updates translators to abide by current translator guidelines 2006-08-11 15:28:18 +00:00
Dan Stillman
1e8aa81c02 Fixes #108, Delay repository check by a few seconds if DB transaction is already in progress 2006-08-11 05:51:55 +00:00
Dan Stillman
9c7f33e21a Extended itemCreators primary key to include orderIndex and removed artificial restriction on adding the same creator/creatorType more than once for the same source -- who knows, maybe they just have the same name...
Properly ignore firstName for institutional creators in Item.setCreator() and Item.creatorExists() (which is now unused)
2006-08-11 05:15:56 +00:00
Dan Stillman
957b220cd3 Closes #56, add "institution" field in creators table to deal with institutional authors
- 'isInstitution' parameter added to Item.setCreator(), Creators.getID(), Creators.add()

- 'isInstitution' property added to return from Creators.get() and Item.getCreator()


var obj = Scholar.Items.getNewItemByType(1);
obj.setField('title', 'Digital History for Dummies');
obj.setCreator(0, '', 'Center for History and New Media', 1, true); // true == institutional creator
var id = obj.save();


Note: 'firstName' field is ignored when 'isInstitution' is true
2006-08-11 04:36:44 +00:00
Dan Stillman
9e75fc2589 Localized string for website accessDate 2006-08-10 22:46:44 +00:00
Dan Stillman
97628b0d2c More helpful debug error output in DB parameter handling and Notifier.trigger() 2006-08-10 22:46:00 +00:00
Dan Stillman
892478be2e Fixed bug that was breaking Scholar.Files.getFile() 2006-08-10 22:44:45 +00:00
David Norton
d815154efa Removing a saved search removes the item in the left pane.
Search dialog:
 - should work now.
 - Any/All control
 - All 8 operators
Add search button uses an icon
2006-08-10 22:39:21 +00:00
Dan Stillman
7d48fdbeda Closes #175, Add ability to specify certain conditions as required in an ANY search
Conditions in ANY queries can be made required by passing 'true' as an extra parameter to addCondition() and updateCondition() -- this can be used for limiting ANY queries to particular collections (in place of the removed 'context' condition), but if there was an elegant way to expose it to the user for all ANY queries, it's something users might find very useful.
2006-08-10 21:05:28 +00:00
Dan Stillman
3a410c5acd Addresses #171, Add more conditions to advanced search architecture
- Implemented 'collectionID' and 'savedSearchID' conditions (a.k.a. search within a search) and removed special 'context' condition. Per my conversation with Dan, the 'recursive' flag is now a global flag that applies to all specified collectionIDs, which is less than ideal but probably better than the alternatives (e.g. having condition-specific recursive checkboxes). It does mean, however, that a "Search subfolders" checkbox is irrelevant if there are no collectionID conditions and should probably be greyed out until applicable.

Another side effect is that it's no longer possible to do an ANY search and return results only within a specific folder (though it can now be done by putting the ANY conditions in a subsearch). Since ANY searches are always annoying in this regard, what I might do is add a way to mark particular conditions as required even in ANY mode, which would allow for quite a lot of flexibility...

Note also that while 'collectionID' and 'savedSearchID' are standard conditions, they should probably be combined into a single condition on the interface side (like playlists and smart playlists under just 'Playlist' in iTunes).

- Now skips invalid/obsolete saved conditions in load()
2006-08-10 09:44:08 +00:00
Dan Stillman
4fe960d190 Search updates:
- Remaining searchConditionIDs are no longer affected by removeCondition() (i.e. they now act like autoincrements), which should make interface code simpler

- Changed default join mode to ALL

- Fixed loading of saved searches with no search conditions
2006-08-10 04:32:36 +00:00
Dan Stillman
0061a8d0df Fix problem with addCondition() overwriting existing search conditions (thanks David) 2006-08-10 02:52:29 +00:00
Simon Kornblith
3a1ffb6174 make LOC/WebVoyage scraper and other scrapers using Scholar.loadTranslator work again 2006-08-09 18:59:38 +00:00
Dan Stillman
f3a66085f5 Closes #173, Try to detect content type of linked pages without loading entire file
Closes #174, Don't load images and attached files when detecting content type in linkFromURL()

If mime type not provided, Scholar.Files.linkFromURL() now uses XMLHTTPRequest HEAD request to get the content type without loading file (thanks Simon for the idea)

If title not provided, try to figure it out from URL, though not particularly intelligently (last slash)

Note that order of title and mimeType parameters is now swapped

This code should be a bit smarter about unexpected conditions
2006-08-09 18:37:34 +00:00
Simon Kornblith
cde7170868 references #169, add OpenURL interface hooks
Scholar.OpenURL.discoverResolvers() now returns an array of {name, url, version} objects
2006-08-09 16:58:54 +00:00
Dan Stillman
36af25b3e9 Cache file link mode 2006-08-09 16:25:28 +00:00
David Norton
6877d33e61 Closes #172, add preference for EndNote MIME type stealing feature
Addresses #169, add OpenURL interface hooks
Addresses #170, Put "Link" option before "Import" in drop-down menu

Fixes some advanced search flaws (there are still bugs)
2006-08-09 15:44:11 +00:00
David Norton
8d5f1e62b6 Closes #47, advanced search
Closes #152, Saved Searches (interface layer)

For now, advanced search IS a saved search.

There are still bugs. The 'search' icon is ugly. I wanted to get it out there, however.
2006-08-09 11:43:33 +00:00
Dan Stillman
d7990b0e03 Updated Scholar.Files.linkFromURL() to take title and mime type as parameters, to prevent loading huge external PDFs just to get the content type when the ingester already knows it (though that will hopefully be alleviated by #173 and #174 later) 2006-08-09 06:32:16 +00:00
Dan Stillman
318cf3194f Addresses #171, Add more conditions to advanced search architecture
Added conditions 'tagID', 'tag' (text), 'creator' (concats first and last before comparing), and 'note'
2006-08-08 23:08:52 +00:00
Simon Kornblith
6efd6d2cc4 closes #99, add options for export 2006-08-08 23:00:33 +00:00
Simon Kornblith
af080fe384 allow EndNote MIME handler to be unregistered without restarting Firefox 2006-08-08 21:40:33 +00:00
Simon Kornblith
3edb6e0286 closes #86, steal EndNote download links
Scholar should now attempt to process citation information from EndNote download links (MIME types application/x-endnote-refer and application/x-research-info-systems). in situations where Scholar cannot process the information, a standard helper app dialog will appear. this behavior is controlled by the preference extensions.scholar.parseEndNoteMIMETypes.
2006-08-08 21:17:07 +00:00
Dan Stillman
9f57379415 Make searchConditionIDs a little easier to work with--now accessible by with the .id property of search conditions in addition to index 2006-08-08 15:40:42 +00:00
Dan Stillman
f8739ee6c5 Closes #135, Associate MIME types with abstract file types and implement Scholar.FileTypes.getIDFromMIMEType()
MIME type prefixes are handled using wildcards (e.g. audio/foobar will return the audio file type since it matches 'audio/%')
2006-08-08 08:23:23 +00:00
Dan Stillman
1de9007608 Take two 2006-08-08 07:05:39 +00:00
Dan Stillman
b5cb0e3a92 Fixed repeat single-file loading with Files.importFromURL() and Files.linkFromURL() (have to use the "pageload" event rather than "load" -- thanks Simon) 2006-08-08 07:05:05 +00:00
Dan Stillman
425d806307 Closes #158, Add linkFromURL() and importFromURL() functions to Scholar.Files 2006-08-08 06:08:21 +00:00
Dan Stillman
d7ed7c256c Fix the startup trouble the search code was causing (moved DB call into init() function rather than constructor) -- sorry about that 2006-08-08 05:26:51 +00:00
Simon Kornblith
504ebf8996 closes #162, do sniffing for import formats
import should now work regardless of file extensions. this should make #86 (steal EndNote download links) fairly easy to implement.
2006-08-08 02:46:52 +00:00
Dan Stillman
d67d96c321 Closes #7, Add advanced search functionality to data layer
Implemented advanced/saved search architecture -- to use, you create a new search with var search = new Scholar.Search(), add conditions to it with addCondition(condition, operator, value), and run it with search(). The standard conditions with their respective operators can be retrieved with Scholar.SearchConditions.getStandardConditions(). Others are for special search flags and can be specified as follows (condition, operator, value):

'context', null, collectionIDToSearchWithin
'recursive', 'true'|'false' (as strings!--defaults to false if not specified, though, so should probably just be removed if not wanted), null
'joinMode', 'any'|'all', null

For standard conditions, currently only 'title' and the itemData fields are supported -- more coming soon.

Localized strings created for the standard search operators


API:

search.setName(name) -- must be called before save() on new searches
search.load(savedSearchID)
search.save() -- saves search to DB and returns a savedSearchID
search.addCondition(condition, operator, value)
search.updateCondition(searchConditionID, condition, operator, value)
search.removeCondition(searchConditionID)
search.getSearchCondition(searchConditionID) -- returns a specific search condition used in the search
search.getSearchConditions() -- returns search conditions used in the search
search.search() -- runs search and returns an array of item ids for results
search.getSQL() -- will be used by Dan for search-within-search

Scholar.Searches.getAll() -- returns an array of saved searches with 'id' and 'name', in alphabetical order
Scholar.Searches.erase(savedSearchID) -- deletes a given saved search from the DB

Scholar.SearchConditions.get(condition) -- get condition data (operators, etc.)
Scholar.SearchConditions.getStandardConditions() -- retrieve conditions for use in drop-down menu (as opposed to special search flags)
Scholar.SearchConditions.hasOperator() -- used by Dan for error-checking
2006-08-08 02:04:02 +00:00
Simon Kornblith
216f0c7581 closes #83, figure out how to implement OpenURL
closes #76, implement extensible search/retrieval architecture for obtaining metadata

OpenURL COinS lookup is now implemented using a real search architecture system. at the moment, it works with Open WorldCat for books, CrossRef for journal articles (provided the COinS object contains a DOI or an ISSN), and PubMed when a PMID is available.
2006-08-08 01:06:33 +00:00
David Norton
9e5c15423a Fixes #164, On item delete, if "Erase Files" is not checked, it still shows files and notes being deleted.
If you are simple removing an item from a project, it won't ask you if you want to delete files and notes.

ItemTreeView:
 - notify() now works with multiple ids for action=modify.
 - saveSelection() returns an array of selected IDs instead of saving it to a class variable
 - rememberSelection(selection) takes an array of IDs.
2006-08-07 15:25:29 +00:00
Simon Kornblith
6626eba844 addresses #83, figure out how to implement OpenURL
OpenURL lookup now works for books. this means that all that's necessary to add scrapable book metadata to a page is an ISBN, as shown below:

<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info:ofi/fmt:kev:mtx:book&amp;rft.isbn=1579550088"></span>

also, we can now scrape Open WorldCat and Wikipedia Book Sources pages with no specialized code involved.

i'm still looking for a better way of looking up journal article metadata. it's currently implemented with CrossRef, but CrossRef simply will not work without a DOI, and is also incomplete (only holds the last name of the first author).
2006-08-07 05:15:30 +00:00
Simon Kornblith
56769079b0 addresses #83, figure out how to implement OpenURL
Scholar.OpenURL.resolve(item) returns the URL that retrieves an item from the user's OpenURL resolver. this means we can implement a "find in my library" feature.
Scholar.OpenURL.discoverResolvers() returns a list of available resolvers for the user's current location (by IP address).
2006-08-06 21:59:50 +00:00
Dan Stillman
d4acec8a77 Addresses #111, minor modifications to field list schema, and http://chnm.grouphub.com/P2995041
Still some outstanding questions on Basecamp, though
2006-08-06 16:10:28 +00:00
Simon Kornblith
fc589a37cf closes #131, make import/export symmetrical
all 4 import/export formats currently supported (MODS, Hybrid RDF, Unqualified Dublin Core, and RIS) now work as both import and export translators
2006-08-06 09:34:51 +00:00
Simon Kornblith
9144b56772 addresses #131, make import/export symmetrical
closes #163, make translator API allow creator types besides author

import and export in the multi-ontology RDF format should now work properly. collections, notes, and see also are all preserved. more extensive testing will be necessary later.
2006-08-05 20:58:45 +00:00
Dan Stillman
1ce4de835b Fixes #167, Item note cache is not set on new note creation 2006-08-05 07:42:32 +00:00
Dan Stillman
8dd972dea1 Make Collection.getDescendents() a[n officially] public method and add second param to limit results to 'collection' or 'item' 2006-08-05 06:39:15 +00:00
Dan Stillman
701762a11f Fixes #166, Scholar.ItemTypes.getID("journalArticle") throws "Invalid item type journalarticle"
Fixed ignoreCase logic (and also set all but CharacterSets to false, since there's no reason for them to be true)

Also made CachedTypes.getID() and getName() return false and '', respectively, on unknown types rather than letting them hit the error (there's still the 'invalid * type' debug message)
2006-08-04 19:39:53 +00:00
David Norton
0b552c5fdb Closes #153, When deleting an item, don't give option to erase attached notes and files when there are none
Also, the default option (when applicable) is to delete attached notes and files.
2006-08-04 14:36:04 +00:00
David Norton
85815dad49 Closes #159, "Snapshot to Current Page" and "Link to Current Page" should save page as item
-   We might want to do this for regular files as well? I think we need a discussion on how Citation will be presented to the user, and if that will save the web page, and all that jazz.
2006-08-04 14:23:44 +00:00
Dan Stillman
9d58fac7e0 Abstracted the Scholar.*Types logic to a base function that can be extended and added singletons for the various types -- rock the JS prototype model 2006-08-04 04:34:16 +00:00
Simon Kornblith
b4c8dbe700 closes #157, add database infrastructure for different CSL styles
CSL is stored in a new "csl" table. only metadata relevant to updates and selection (ID, date updated, and title) is stored in columns.
2006-08-03 04:54:16 +00:00
Simon Kornblith
30af2c89df - closes #130, add progress bar for import/export
- eliminates "unresponsive script" message on import/export

i tried to make a progress bar that actually provides useful information, but for some reason, XUL interface updates are done asynchronously, and thus don't actually happen as long as the import/export operation continues. the code is there, but disabled, if there's some solution to this issue, but i searched and couldn't find one.
2006-08-02 21:06:58 +00:00
David Norton
6ad7acf4d8 Addressed #155, Localize strings 2006-08-02 17:57:16 +00:00
David Norton
e30a1b717a Addresses #63, Add GPL license info to source code.
License file added.
	Header added to David's interface files -- add header to your own files.
2006-08-02 16:49:19 +00:00
David Norton
04ce48ae64 Closes #156, Double-clicking a note in the item list should open it in a popup window 2006-08-02 16:08:19 +00:00
David Norton
b79420e75b Closes #154, Clicking an item in Related should display that item.
Cancel Search ('x') button now uses a custom image.
Fixes problem with items list freezing on item add
2006-08-02 15:13:31 +00:00
Simon Kornblith
f6c12d3d81 closes #112, ingested items should be automatically added to selected project 2006-08-02 14:17:16 +00:00
Dan Stillman
5c6d9de4b8 Addresses #77, maintain database backups
Temporarily added in a check of the backup file on startup, since I'm not entirely convinced that the backup mechanism on shutdown couldn't create a corrupt file under certain conditions

If you run with debug output on and notice the "Backup file was corrupt" message, let me know.
2006-08-01 23:32:18 +00:00
Dan Stillman
d3bc693dab Closes #77, maintain database backups
The Scholar database is backed up on browser close. On startup, if the main database is damaged, the extension saves a copy of the damaged file and tries to restore from the last automatic backup. If it fails, it creates a new database file.

New methods:

Scholar.getScholarDatabase(string [ext])
Scholar.backupDatabase()
Scholar.moveToUnique(file, newFile) -- find a unique filename using the leafName of newFile as the suggested name (using the built-in Mozilla functionality) and move the file there
Scholar.Date.getFileDateString(file)
Scholar.Date.getFileTimeString(file)
2006-08-01 23:10:31 +00:00
Dan Stillman
9a0457b43e Register shutdown handler to call Scholar.shutdown() on exit 2006-08-01 18:01:56 +00:00
David Norton
635d2e48b9 Closes #151, Show "X" in search box to cancel search.
- I had to make the textbox taller, but it seems to be working right.
Fixed problem with note editor in right pane not updating correctly.
2006-08-01 18:01:48 +00:00
David Norton
3414004cb0 Closes #45, reorder item fields 2006-07-31 22:35:14 +00:00
David Norton
cd4dd3bd92 Closes #148, Files should display a different icon for each type (file & snapshot, linked & unlinked)
Clicking a file or note in the rightmost pane displays it in the middle pane.
2006-07-31 20:35:22 +00:00
David Norton
0632cbf5e4 Closes #91, Add dialog to delete child notes when a source is deleted
Closes #146, ScholarPane.selectItem(id)
Closes #147, "Edit in a Separate Window" on a note should select the note's parent item.
Addresses #143, Scholar toolbar button to save current page as an independent file in the selected project.
 - Standalone Files are now added to the current Project.
Files added to an item are now actually attached to the item.
2006-07-31 19:14:06 +00:00
David Norton
426b839e5f Changed Add button to a single button, with a dropdown menu. 2006-07-31 17:05:41 +00:00
David Norton
4757d21b20 Fixes #143, Scholar toolbar button to save current page as an independent file in the selected project. 2006-07-31 16:58:14 +00:00
Dan Stillman
40ef9f669d Closes #90, Add flag to delete child notes when a source is deleted
Item.erase(true) deletes child items as well instead of just unlinking
2006-07-31 06:05:19 +00:00
Dan Stillman
526d368aaf Closes #117, permit dashes and commas in "pages" field
Closes #118, add "translator" creator type
Closes #122, add DOI and abbreviated journal title fields
Addresses #45, reorder item fields -- source/rights moved down to bottom; date fields not yet moved
2006-07-31 04:31:44 +00:00
Dan Stillman
9da1c210a0 Change repository check time back to once a day 2006-07-31 03:38:02 +00:00
Dan Stillman
1adeb840bf Closes #98, Cache note content to avoid repeated DB calls 2006-07-30 21:49:34 +00:00
Dan Stillman
6ab7fd1e18 Closes #119, When Item.isNote(), Item.getField('title') should return first line of note
Returns the first 80 characters of the note content as the title

Also changed setField() to use the loadIn parameter for primary fields so it can be used instead of this._data without affected _changedItems
2006-07-30 21:01:23 +00:00