Commit graph

148 commits

Author SHA1 Message Date
Simon Kornblith
2d8ed16d88 adds export of tags to MODS.
adds export of seeAlso info and project hierarchy to RDF. for now, this is embedded in the modsCollection root element.

uses nodeIDs for Dublin Core RDF.
2006-07-06 03:39:32 +00:00
Simon Kornblith
c0251085a9 Add export filters for RIS and Dublin Core RDF 2006-07-05 21:44:01 +00:00
Simon Kornblith
8b4a44be0f fixes a bug that made the Google Books translator not appear
adjusts the Google Books translator to work with the latest revision of the site

renames the MODS translator to just MODS, because "Metadata Object Description Schema (MODS)" was too long for the export dialog
2006-06-30 19:21:36 +00:00
Dan Stillman
6c88563ded Changed translators.type column to INT and added index
Updated scraper updated mechanism to handle new translator schema, roughly
2006-06-29 07:58:50 +00:00
Dan Stillman
35eb1292a5 Changed getRandomID() to use the full SQLite three-byte range if unable to find a two-byte id in 3 tries 2006-06-29 07:03:24 +00:00
Dan Stillman
b495bb6334 Use getRandomID() for new item ids rather than auto-increment 2006-06-29 06:28:50 +00:00
Dan Stillman
72ca609b52 Addresses #87, Add fromArray() and toArray() methods to Item objects
Changed _getDescendents to take _nested_ flag, be extensible later for smart folders and other types, and include the collection name in the dataset

Added Collection.toArray()

Sample array:

'0' ...
	'id' => "13"
	'type' => "item"
'1' ...
	'id' => "14"
	'type' => "item"
'2' ...
	'id' => "7373"
	'name' => "A Sub-project!"
	'type' => "collection"
	'children' ...
		'0' ...
			'id' => "15"
			'type' => "item"
		'1' ...
			'id' => "9233"
			'name' => "A Sub-sub-project!"
			'type' => "collection"
			'children' ...
2006-06-29 05:18:55 +00:00
Dan Stillman
9b23e1ecdc Addresses #87, Add fromArray() and toArray() methods to Item objects
toArray() improvements:

- seeAlso support (array of itemIDs)

- Added itemID to source notes

- Fixed bug in creator handling
2006-06-29 03:56:22 +00:00
Simon Kornblith
77282c3edc - fixes a bug that could result in scrapers using utilities.processDocuments malfunctioning
- fixes a bug that could result in the Scrape Progress chrome thingy sticking around forever
- makes chrome thingy disappear when URL changes or when tabs are switched
2006-06-29 03:22:10 +00:00
Dan Stillman
2d23ba97e5 See Also functionality for items and notes
Item.addSeeAlso(itemID)
Item.removeSeeAlso(itemID)
Item.getSeeAlso() -- array of linked items

Relationships are mutual

Closes #82, Notes: see also table
2006-06-29 01:37:53 +00:00
Dan Stillman
098b7b1b9e Allow single bound parameters not in arrays in DB.query() calls 2006-06-29 01:06:02 +00:00
Simon Kornblith
45b9234996 addresses #78, figure out import/export architecture
- changes scrapers table to translators table; all import/export/web translators now belong in this table
- adds Scholar.Translate to handle translation issues. eventually, Scholar.Ingester.Document will become part of this interface
- adds Scholar_File_Interface (in fileInterface.js) to handle UI for export and eventually import. (David, when you have time, please connect Scholar_File_Interface.exportFile to a button.)
- adds an export translator for MODS. all of our metadata, but not our hierarchy (projects, etc.) translates directly and unambiguously into valid MODS. eventually, we can use RDF or another format to handle hierarchy.
- adds utilities.getVersion() and utilities.inArray() for simplified scraper coding
- fixes minor interface issues with the nifty chrome scraping status window
2006-06-29 00:56:50 +00:00
Dan Stillman
e45520b871 Updated obsolete references to itemKeywords table to use itemTags (this was breaking item delete and search) 2006-06-28 19:12:35 +00:00
Dan Stillman
20bad3609d Moving Scholar.Notes in the code -- ignore 2006-06-28 18:30:20 +00:00
Dan Stillman
e22bdaab33 Disallow setting note source to another note (presumably that's what See Also is for) 2006-06-28 18:28:09 +00:00
Dan Stillman
cef196529c Return the tagID, new or otherwise, in Item.addTag() 2006-06-28 18:12:38 +00:00
Dan Stillman
52f7ed62d0 Closes #31, tag data infrastructure
New methods:

Item.addTag(tag)
Item.getTags() -- array of tagIDs
Item.removeTag(tagID)

Tags.getName(tagID)
Tags.getID(tag)
Tags.add(text) -- returns tagID of new tag
Tags.purge() -- purge obsolete tags

The last two are for use by Item.addTag() and Item.removeTag(), respectively, and probably don't need to be used elsewhere.
2006-06-28 18:06:36 +00:00
Dan Stillman
b75376c1c1 Fixes #96, When notify() is called for a new note, getNote() on the item returns false
Item.save() changed to not call notify() if a transaction is in progress, which is totally going to trip someone up at some point, and probably me, but it's better than a new parameter
2006-06-28 15:47:58 +00:00
Dan Stillman
cb8f961639 Removed Scholar.HTTP, now that its functionality has been incorporated back into Scholar.Utilities.HTTP 2006-06-27 23:24:02 +00:00
Dan Stillman
312f32f505 Fixes #96, When notify() is called for a new note, getNote() on the item returns false
getNote() now returns an empty string rather than false on a new item

David, I assume this is what you meant--if not, reopen
2006-06-27 22:55:43 +00:00
Dan Stillman
2dece39ad3 Fixes #95, Notes.add() fails when sourceitem is null 2006-06-27 22:14:28 +00:00
Dan Stillman
91b732c3e1 Addresses #87, Add fromArray() and toArray() methods to Item objects
Item.toArray() implemented -- builds up a multidimensional array of item data, converting all type ids to their textual equivalents -- currently has empty placeholder arrays for tags and seeAlso

Sample source output:

'itemID' => "2"
'itemType' => "book"
'title' => "Computer-Mediated Communication: Human-to-Human Communication Across the Internet"
'dateAdded' => "2006-03-12 05:25:50"
'dateModified' => "2006-03-12 05:25:50"
'publisher' => "Allyn & Bacon Publishers"
'year' => "2002"
'pages' => "347"
'ISBN' => "0-205-32145-3"
'creators' ...
	'0' ...
		'firstName' => "Susan B."
		'lastName' => "Barnes"
		'creatorType' => "author"
'notes' ...
	'0' ...
		'note' => "text"
		'tags' ...
		'seeAlso' ...
	'1' ...
		'note' => "text"
		'tags' ...
		'seeAlso' ...
'tags' ...
'seeAlso' ...


Sample note output:

'itemID' => "17"
'itemType' => "note"
'dateAdded' => "2006-06-27 04:21:16"
'dateModified' => "2006-06-27 04:21:16"
'note' => "text"
'sourceItemID' => "2"
'tags' ...
'seeAlso' ...

sourceItemID won't exist if it's an independent note.

We'll use the same format in reverse for fromArray, so Simon, let me know if you need more data (preserving type ids, etc) or want anything in a different form.
2006-06-27 20:45:41 +00:00
Dan Stillman
22296470c3 Item.getCreators() to return multidim array of creator data (same as doing a loop to numNotes() and using getCreator()) 2006-06-27 20:26:44 +00:00
Dan Stillman
5ab37dacd5 Notification improvements for notes
Missing query() call for unlinking notes in Item.erase()
2006-06-27 19:42:02 +00:00
Dan Stillman
672ca5956e Fix the item creation SQL call to properly calculate the note count for numNotes() 2006-06-27 19:29:05 +00:00
Dan Stillman
d6fa0455e1 Fixes #29, independent notes
- Added 'note' item type

- Updated API to support independent note creation

Notes are, more or less, just regular items, with an item type of 1. They're created through Scholar.Notes.add(text, sourceItemID), which returns the itemID of the new note. sourceItemID is optional--if left out, an independent note will be created. (There's currently nothing stopping you from doing getNewItemByType(1) yourself, but the note would be contentless and broken, so you shouldn't do that.) Note data could've been stuffed into itemData, but I kept it separate in itemNotes to keep metadata searching faster and to keep things cleaner.

Methods calls that can be called on all items:

isNote() (same as testing for itemTypeID 1)

Method calls that can be called on source items only:

numNotes()
getNotes() (array of note itemIDs for a source)

Method calls that can be called on note items only:

updateNote(text)
setNoteSource(sourceItemID) (for changing source--use empty or false to make independent, which is currently what happens when you delete a note--will get option with #91)
getNote() (note content)
getNoteSource() (sourceItemID of a note)

Calling the above methods on the wrong item types will throw an error.


*** This will break note creation/display until David updates interface code. ***
2006-06-27 15:14:07 +00:00
Dan Stillman
bc18f42f81 Fix issue with null values passed natively to DB query statements as bound statements 2006-06-27 14:14:40 +00:00
Dan Stillman
3b119d4c6e Fixes #89, once an item is added to the library, the item list is no longer updated on delete
(I think--Simon, reopen if not)
2006-06-27 05:42:35 +00:00
Simon Kornblith
257ed8f69b closes #68, figure out way to have scrapers work for gated resources behind proxies. most institutions use EZProxy for their proxy needs (or a more transparent proxy, which we support natively). this implementation is significantly better than the old one, which refused to work after you'd already logged in once, and is also simpler, because it's stateless. it has to observe every HTTP request, but there's no noticeable speed hit. it also still doesn't work when there's a link from one gated site to another gated site, but as far as i can tell, this only happens on the Gale Group site. 2006-06-27 04:08:21 +00:00
Dan Stillman
031d78eeee Be a bit more helpful when calling getString() on a string with no localization 2006-06-26 20:41:09 +00:00
Simon Kornblith
4242c62b1b - Fix redundancy in utilities.js (I accidentally copied and pasted a much larger block of code than i meant to)
- Move processDocuments, a function for loading a DOM representation of a document or set of documents, to Scholar.Utilities.HTTP
- Add Scholar.Ingester.ingestURL, a simplified function to scrape a URL (closes #33)
2006-06-26 20:02:30 +00:00
Simon Kornblith
4535b220db Closes #84, make type icon in toolbar match item about to be scraped. It's not perfect, since to get everything right, we'd need to scrape the page as soon as it appears, but it provides a pretty good indication. Multiple items get the folder icon. If there's a better icon out there, it's pretty straightforward to implement. 2006-06-26 18:05:23 +00:00
Simon Kornblith
cb647aa607 remove vestigial code pieces and make usage clearer for Scholar.Utilities.HTTP 2006-06-26 16:32:19 +00:00
Simon Kornblith
ed47e0c84c Forgot to commit updated utilities... 2006-06-26 16:19:44 +00:00
Simon Kornblith
04730860a6 Move Scholar.HTTP to Scholar.Utilities.HTTP; create Scholar.Utilities.Ingester.HTTPUtilities to handle proxied URLs for Ingester 2006-06-26 16:18:55 +00:00
Simon Kornblith
7148852955 make generic Scholar.Utilities class and HTTP-dependent Scholar.Utilities.Ingester and Scholar.Utilities.HTTP classes in preparation for import/export filters; split off into separate javascript file 2006-06-26 14:46:57 +00:00
Simon Kornblith
303c6ee68d closes #41, get library call number 2006-06-26 01:08:59 +00:00
Dan Stillman
05c8b0e467 Fixes #60, make sure it works well offline
- Added detection for network failure -- debug message is output and noNetwork property is added to the xmlhttp object

- Removed onStatus callback from HTTP.doGet and HTTP.doPost -- that was copied over from the Piggy Bank API, but the onDone callback has to handle errors anyway, so it can just check the status code if it actually cares to differentiate non-200 status codes from any other error

- Added error handling for empty responseXML to Schema._updateScrapersRemoteCallback

- Renamed SCHOLAR_CONFIG['REPOSITORY_CHECK_RETRY'] to SCHOLAR_CONFIG['REPOSITORY_RETRY_INTERVAL']
2006-06-25 20:14:11 +00:00
Dan Stillman
480f9d56f6 Fixes #14, Add a callNumber field to all item types, and fixes #75, Add an "extra" field to all item types
I also added accessionNumber to all types (except website), since that's what Endnote does, but we may or may not think that's necessary
2006-06-25 18:10:27 +00:00
Simon Kornblith
5e73dcdd2e - Search results scraping for WorldCat.
- Make scraperJavaScript run on reload again, because it makes debugging easier
- There's not actually a memory leak in the proxyMonitor code.
2006-06-25 16:13:47 +00:00
Dan Stillman
dc8c695855 Fixes #11, Observe user pref to turn off automatic scraper updates 2006-06-25 07:34:03 +00:00
Dan Stillman
691993a6c3 Added Scholar.Prefs, a front-end to the preferences service with simple get(pref) and set(pref, value) methods that will retrieve and set based on the type of the default value, which I believe should generally should fine -- for more fine-grained control, use Scholar.Prefs.prefBranch to access the branch directly
Scholar.Prefs also registers itself as a preferences observer and can be used to trigger actions when certain prefs are changed by editing the switch statement in the observe() method

Updated preferences.js to use Scholar.Prefs
2006-06-25 07:31:01 +00:00
Dan Stillman
b679bc6327 Fixes #62, Cache notes count for items 2006-06-25 05:43:00 +00:00
Dan Stillman
a207bf3817 Fixed error in History.add() call in Item.save() that was breaking new item inserts 2006-06-25 05:26:53 +00:00
Simon Kornblith
9e78d62b13 Better handling of itemTypes, and improved date handling in PubMed scraper. 2006-06-25 05:03:01 +00:00
Dan Stillman
b2247e1dd2 Fixes #66, Need a function to get typeID given typeName
- Added methods getID(idOrName) and getName(idOrName) to Scholar.CreatorTypes and Scholar.ItemTypes to take either typeID or typeName

- Removed getTypeName() in each and changed references accordingly

- Streamlined both classes to be as similar as possible
2006-06-25 04:35:11 +00:00
Simon Kornblith
22eebc6cdf Addresses #68, figure out way to have scrapers work for gated resources behind proxies. We can now access pages through an EZProxy. We need to know what alternatives to EZProxy exist in order to support them. Also, fixes some spacing issues in browser.js. 2006-06-25 04:30:43 +00:00
Dan Stillman
b8ad832e74 Begin to work undo functionality into data layer -- currently just for Item.save()
History.undo()/redo() now reload the item, though changes won't show in open metadata pane due to #71

refs #67
2006-06-25 04:11:19 +00:00
Simon Kornblith
f897564f0e Temporary fix to get ingested item types right until #66 is implemented 2006-06-24 21:44:36 +00:00
Simon Kornblith
260ce80086 - Search results scraping for TLC. This is the last of the library scrapers.
- Minor fixes to ingester utilities.
2006-06-24 15:38:53 +00:00