Commit graph

443 commits

Author SHA1 Message Date
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