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)
This commit is contained in:
Dan Stillman 2006-10-02 00:00:50 +00:00
parent 100bf182da
commit b684e97366
18 changed files with 162 additions and 94 deletions

View File

@ -19,8 +19,10 @@
if(citeLabel.firstChild)
citeLabel.removeChild(citeLabel.firstChild);
if(this.item)
if(this.item && !this.getAttribute('notitle')=='1')
{
citeLabel.appendChild(document.createTextNode(this.item.getField('title')));
}
]]>
</setter>
</property>

View File

@ -58,6 +58,7 @@
<menupopup>
<menuitem class="menuitem-iconic" id="tb-item-attachments-link" label="&toolbar.attachment.linked;" oncommand="ScholarItemPane.addAttachmentFromDialog(true);"/>
<menuitem class="menuitem-iconic" id="tb-item-attachments-file" label="&toolbar.attachment.add;" oncommand="ScholarItemPane.addAttachmentFromDialog();"/>
<menuitem class="menuitem-iconic" id="tb-item-attachments-web-link" label="&toolbar.attachment.weblink;" oncommand="ScholarItemPane.addAttachmentFromPage(true);"/>
<menuitem class="menuitem-iconic" id="tb-item-attachments-snapshot" label="&toolbar.attachment.snapshot;" oncommand="ScholarItemPane.addAttachmentFromPage();"/>
</menupopup>
</button>

View File

@ -41,6 +41,7 @@ var ScholarPane = new function()
this.addAttachmentFromDialog = addAttachmentFromDialog;
this.addAttachmentFromPage = addAttachmentFromPage;
this.viewSelectedAttachment = viewSelectedAttachment;
this.showSelectedAttachmentInFilesystem = showSelectedAttachmentInFilesystem;
/*
* Called when the window is open
@ -267,17 +268,47 @@ var ScholarPane = new function()
label.appendChild(document.createTextNode(val));
}
// Metadata for URL's
if (item.ref.getAttachmentLinkMode() == Scholar.Attachments.LINK_MODE_LINKED_URL
|| item.ref.getAttachmentLinkMode() == Scholar.Attachments.LINK_MODE_IMPORTED_URL)
{
var str = Scholar.getString('pane.item.attachments.view.link');
// "View Page"/"View Snapshot" label
if (item.ref.getAttachmentLinkMode() == Scholar.Attachments.LINK_MODE_IMPORTED_URL)
{
var str = Scholar.getString('pane.item.attachments.view.snapshot');
}
else
{
var str = Scholar.getString('pane.item.attachments.view.link');
}
document.getElementById('scholar-attachment-show').setAttribute('hidden', true);
// URL
document.getElementById('scholar-attachment-url').setAttribute('value', item.getField('url'));
document.getElementById('scholar-attachment-url').setAttribute('hidden', false);
// Access date
document.getElementById('scholar-attachment-accessed').setAttribute('value',
Scholar.getString('itemFields.accessDate') + ': '
+ Scholar.Date.sqlToDate(item.getField('accessDate')).toLocaleString());
document.getElementById('scholar-attachment-accessed').setAttribute('hidden', false);
}
// Metadata for files
else
{
var str = Scholar.getString('pane.item.attachments.view.file');
document.getElementById('scholar-attachment-show').setAttribute('hidden', false);
document.getElementById('scholar-attachment-url').setAttribute('hidden', true);
document.getElementById('scholar-attachment-accessed').setAttribute('hidden', true);
}
document.getElementById('scholar-attachment-view').setAttribute('label', str);
document.getElementById('scholar-attachment-links').item = item.ref;
var noteEditor = document.getElementById('scholar-attachment-note-editor');
noteEditor.item = null;
noteEditor.note = item.ref;
document.getElementById('item-pane').selectedIndex = 3;
}
else
@ -454,7 +485,7 @@ var ScholarPane = new function()
{
if(collectionsView.selection.count > 0 && collectionsView.selection.currentIndex != -1)
{
collection = collectionsView._getItemAtRow(collectionsView.selection.currentIndex);
var collection = collectionsView._getItemAtRow(collectionsView.selection.currentIndex);
if(collection && collection.isCollection())
return collection.ref;
}
@ -464,7 +495,7 @@ var ScholarPane = new function()
{
if(collectionsView.selection.count > 0 && collectionsView.selection.currentIndex != -1)
{
collection = collectionsView._getItemAtRow(collectionsView.selection.currentIndex);
var collection = collectionsView._getItemAtRow(collectionsView.selection.currentIndex);
if(collection && collection.isSearch())
{
return collection.ref;
@ -659,7 +690,7 @@ var ScholarPane = new function()
accessDate: "CURRENT_TIMESTAMP"
}
newItem(Scholar.ItemTypes.getID('website'), data);
newItem(Scholar.ItemTypes.getID('webpage'), data);
}
@ -682,6 +713,7 @@ var ScholarPane = new function()
}
}
function viewSelectedAttachment()
{
if(itemsView && itemsView.selection.count == 1)
@ -701,7 +733,22 @@ var ScholarPane = new function()
}
else
{
window.loadURI(attachment.getURL());
window.loadURI(attachment.getField('url'));
}
}
}
function showSelectedAttachmentInFilesystem()
{
if(itemsView && itemsView.selection.count == 1)
{
var attachment = getSelectedItems()[0];
if (attachment.getAttachmentLinkMode() != Scholar.Attachments.LINK_MODE_LINKED_URL)
{
var file = attachment.getFile();
file.reveal();
}
}
}

View File

@ -104,6 +104,8 @@
</menupopup>
</toolbarbutton>
<toolbarbutton id="tb-item-from-page" tooltiptext="&toolbar.newItemFromPage.label;" oncommand="ScholarPane.addItemFromPage()"/>
<toolbarseparator/>
<toolbarbutton id="tb-link-page" tooltiptext="&toolbar.attachment.weblink;" oncommand="ScholarPane.addAttachmentFromPage(true)"/>
<toolbarbutton id="tb-snapshot-page" tooltiptext="&toolbar.attachment.snapshot;" oncommand="ScholarPane.addAttachmentFromPage()"/>
<toolbarbutton id="tb-note-add" tooltiptext="&toolbar.note.standalone;" oncommand="ScholarPane.newNote();"/>
<spacer flex="1"/>
@ -187,14 +189,23 @@
<label id="scholar-view-selected-label"/>
</box>
<deck id="scholar-view-item" flex="1"/>
<!-- Note info pane -->
<vbox id="scholar-view-note" flex="1">
<noteeditor id="scholar-note-editor" flex="1"/>
<button id="scholar-view-note-button" label="&notes.separate;" oncommand="ScholarPane.openNoteWindow(this.getAttribute('noteID')); if(this.hasAttribute('sourceID')) ScholarPane.selectItem(this.getAttribute('sourceID'));"/>
</vbox>
<!-- Attachment info pane -->
<vbox id="scholar-view-attachment" flex="1">
<label id="scholar-attachment-label"/>
<button id="scholar-attachment-view" oncommand="ScholarPane.viewSelectedAttachment();"/>
<linksbox id="scholar-attachment-links" flex="1"/>
<hbox>
<button id="scholar-attachment-view" flex="1" oncommand="ScholarPane.viewSelectedAttachment();"/>
<button id="scholar-attachment-show" label="&item.attachment.file.show;" flex="1" oncommand="ScholarPane.showSelectedAttachmentInFilesystem()"/>
</hbox>
<vbox>
<label id="scholar-attachment-url" class="text-link" crop="end" onclick="window.loadURI(this.value)"/>
<label id="scholar-attachment-accessed"/>
</vbox>
<noteeditor id="scholar-attachment-note-editor" notitle="1" flex="1"/>
</vbox>
</deck>
</groupbox>

View File

@ -1466,7 +1466,7 @@ Scholar.CSL.prototype._getFieldValue = function(name, element, item, format,
interview:"interview",
film:"motion picture",
artwork:"graphic",
website:"webpage"
webpage:"webpage"
};
// TODO: check with Elena/APA/MLA on this
Scholar.CSL._fallbackTypeMappings = {
@ -1481,7 +1481,7 @@ Scholar.CSL._fallbackTypeMappings = {
interview:"book",
film:"book",
artwork:"book",
website:"article"
webpage:"article"
};
Scholar.CSL.prototype._getTypeFromItem = function(item) {

View File

@ -587,7 +587,7 @@ Scholar.Item.prototype.save = function(){
this.getField(fieldID));
}
updateStatement.bindInt32Parameter(2, fieldID);
updateStatement.execute();
updateStatement.executeStep();
}
}
@ -617,7 +617,7 @@ Scholar.Item.prototype.save = function(){
this.getField(fieldID));
}
insertStatement.execute();
insertStatement.executeStep();
}
}
}
@ -736,7 +736,7 @@ Scholar.Item.prototype.save = function(){
else {
statement.bindUTF8StringParameter(2, this.getField(fieldID));
}
statement.execute();
statement.executeStep();
}
Scholar.History.add('itemData', 'itemID-fieldID',
@ -868,7 +868,7 @@ Scholar.Item.prototype.isNote = function(){
* Note: This can only be called on note items.
**/
Scholar.Item.prototype.updateNote = function(text){
if (!this.isNote()){
if (!this.isNote() && !this.isAttachment()){
throw ("updateNote() can only be called on items of type 'note'");
}
@ -878,7 +878,12 @@ Scholar.Item.prototype.updateNote = function(text){
Scholar.DB.beginTransaction();
var sql = "UPDATE itemNotes SET note=? WHERE itemID=?";
if (this.isNote()){
var sql = "UPDATE itemNotes SET note=? WHERE itemID=?";
}
else {
var sql = "REPLACE INTO itemNotes (note, itemID) VALUES (?,?)";
}
var bindParams = [{string:text}, this.getID()];
var updated = Scholar.DB.query(sql, bindParams);
if (updated){
@ -897,7 +902,9 @@ Scholar.Item.prototype.updateNote = function(text){
Scholar.Item.prototype.updateNoteCache = function(text){
// Update cached values
this._noteData = text ? text : '';
this.setField('title', this._noteToTitle(), true);
if (this.isNote()){
this.setField('title', this._noteToTitle(), true);
}
}
@ -1015,8 +1022,8 @@ Scholar.Item.prototype.numNotes = function(){
* Get the text of an item note
**/
Scholar.Item.prototype.getNote = function(){
if (!this.isNote()){
throw ("getNote() can only be called on items of type 'note'");
if (!this.isNote() && !this.isAttachment()){
throw ("getNote() can only be called on notes and attachments");
}
if (this._noteData !== null){
@ -1120,7 +1127,7 @@ Scholar.Item.prototype.numAttachments = function(){
* _row_ is optional itemAttachments row if available to skip query
*
* Note: Always returns false for items with LINK_MODE_LINKED_URL,
* since they have no files -- use getURL() instead
* since they have no files -- use getField('url') instead
**/
Scholar.Item.prototype.getFile = function(row){
if (!this.isAttachment()){
@ -1158,33 +1165,6 @@ Scholar.Item.prototype.getFile = function(row){
}
/*
* Return the URL string associated with a linked or imported URL
*/
Scholar.Item.prototype.getURL = function(){
if (!this.isAttachment()){
throw ("getURL() can only be called on items of type 'attachment'");
}
var sql = "SELECT linkMode, path, originalPath FROM itemAttachments "
+ "WHERE itemID=" + this.getID();
var row = Scholar.DB.rowQuery(sql);
if (!row){
throw ('Attachment data not found for item ' + this.getID() + ' in getURL()');
}
switch (row['linkMode']){
case Scholar.Attachments.LINK_MODE_LINKED_URL:
return row['path'];
case Scholar.Attachments.LINK_MODE_IMPORTED_URL:
return row['originalPath'];
default:
throw ('getURL() cannot be called on attachments without associated URLs');
}
}
/*
* Return a file:/// URL path to files and snapshots
*/
@ -1479,7 +1459,7 @@ Scholar.Item.prototype.erase = function(deleteChildren){
// Regular item
// Delete child notes and files
// If flag given, delete child notes and files
else if (deleteChildren){
var sql = "SELECT itemID FROM itemNotes WHERE sourceItemID=?1 UNION "
+ "SELECT itemID FROM itemAttachments WHERE sourceItemID=?1";
@ -1493,7 +1473,7 @@ Scholar.Item.prototype.erase = function(deleteChildren){
}
}
// Just unlink any child notes or files without deleting
// Otherwise just unlink any child notes or files without deleting
else {
// Notes
var sql = "SELECT itemID FROM itemNotes WHERE sourceItemID=" + this.getID();
@ -2127,6 +2107,8 @@ Scholar.Attachments = new function(){
// Create a new attachment
var attachmentItem = Scholar.Items.getNewItemByType(Scholar.ItemTypes.getID('attachment'));
attachmentItem.setField('title', title);
attachmentItem.setField('url', url);
// TODO: access date
attachmentItem.save();
var itemID = attachmentItem.getID();
@ -2203,6 +2185,8 @@ Scholar.Attachments = new function(){
// Create a new attachment
var attachmentItem = Scholar.Items.getNewItemByType(Scholar.ItemTypes.getID('attachment'));
attachmentItem.setField('title', title);
attachmentItem.setField('url', url);
attachmentItem.setField('accessDate', "CURRENT_TIMESTAMP");
attachmentItem.save();
var itemID = attachmentItem.getID();
@ -2291,6 +2275,8 @@ Scholar.Attachments = new function(){
// Create a new attachment
var attachmentItem = Scholar.Items.getNewItemByType(Scholar.ItemTypes.getID('attachment'));
attachmentItem.setField('title', title);
attachmentItem.setField('url', url);
attachmentItem.setField('accessDate', "CURRENT_TIMESTAMP");
attachmentItem.save();
var itemID = attachmentItem.getID();
@ -2363,14 +2349,7 @@ Scholar.Attachments = new function(){
* Returns the itemID of the new attachment
**/
function _addToDB(file, url, title, linkMode, mimeType, charsetID, sourceItemID, itemID){
if (url){
var path = url;
}
if (file){
if (linkMode==self.LINK_MODE_IMPORTED_URL){
var originalPath = path;
}
// Path relative to Scholar directory for external files and relative
// to storage directory for imported files
var refDir = (linkMode==this.LINK_MODE_LINKED_FILE)
@ -2403,19 +2382,23 @@ Scholar.Attachments = new function(){
else {
var attachmentItem = Scholar.Items.getNewItemByType(Scholar.ItemTypes.getID('attachment'));
attachmentItem.setField('title', title);
if (linkMode==self.LINK_MODE_IMPORTED_URL
|| linkMode==self.LINK_MODE_LINKED_URL){
attachmentItem.setField('url', url);
attachmentItem.setField('accessDate', "CURRENT_TIMESTAMP");
}
attachmentItem.save();
}
var sql = "INSERT INTO itemAttachments (itemID, sourceItemID, linkMode, "
+ "mimeType, charsetID, path, originalPath) VALUES (?,?,?,?,?,?,?)";
+ "mimeType, charsetID, path) VALUES (?,?,?,?,?,?)";
var bindParams = [
attachmentItem.getID(),
(sourceItemID ? {int:sourceItemID} : null),
{int:linkMode},
{string:mimeType},
(charsetID ? {int:charsetID} : null),
{string:path},
(originalPath ? {string:originalPath} : null)
(path ? {string:path} : null)
];
Scholar.DB.query(sql, bindParams);
Scholar.DB.commitTransaction();

View File

@ -63,7 +63,7 @@ Scholar.Fulltext = new function(){
* Index multiple words at once
*/
function indexWords(itemID, words){
if (!words || !words.length){
if (!words || !words.length || !itemID){
return false;
}
@ -98,12 +98,12 @@ Scholar.Fulltext = new function(){
}
else {
statement1.bindUTF8StringParameter(0, word);
statement1.execute()
statement1.executeStep()
var wordID = Scholar.DB.getLastInsertID();
}
statement2.bindInt32Parameter(0, wordID);
statement2.execute();
statement2.executeStep();
}
statement1.reset();

View File

@ -482,6 +482,15 @@ Scholar.Schema = new function(){
if (i==1){
Scholar.DB.query("DELETE FROM version WHERE schema='schema'");
}
if (i==5){
Scholar.DB.query("REPLACE INTO itemData SELECT itemID, 1, originalPath FROM itemAttachments WHERE linkMode=1");
Scholar.DB.query("REPLACE INTO itemData SELECT itemID, 1, path FROM itemAttachments WHERE linkMode=3");
Scholar.DB.query("REPLACE INTO itemData SELECT itemID, 27, dateAdded FROM items NATURAL JOIN itemAttachments WHERE linkMode IN (1,3)");
Scholar.DB.query("UPDATE itemAttachments SET originalPath=NULL WHERE linkMode=1");
Scholar.DB.query("UPDATE itemAttachments SET path=NULL WHERE linkMode=3");
try { Scholar.DB.query("DELETE FROM fulltextItems WHERE itemID IS NULL"); } catch(e){}
}
}
_updateSchema('user');

View File

@ -903,7 +903,7 @@ Scholar.Translate.prototype._translationComplete = function(returnValue, error)
Scholar.debug("translation using "+this.translator[0].label+" failed: \n"+errorString);
if(this.type == "web") {
// report translation error for websites
// report translation error for webpages
this._reportTranslationFailure(errorString);
}
} else {
@ -1081,8 +1081,8 @@ Scholar.Translate.prototype._itemDone = function(item) {
}
try { // make sure notifier gets turned back on when done
// Get typeID, defaulting to "website"
var type = (item.itemType ? item.itemType : "website");
// Get typeID, defaulting to "webpage"
var type = (item.itemType ? item.itemType : "webpage");
if(type == "note") { // handle notes differently
var myID = Scholar.Notes.add(item.note);
@ -1717,11 +1717,11 @@ Scholar.Translate.prototype._exportGetAttachment = function(attachment) {
var attachmentID = attachment.getID();
var linkMode = attachment.getAttachmentLinkMode();
// get url if one exists
// get URL and accessDate if they exist
if(linkMode == Scholar.Attachments.LINK_MODE_LINKED_URL ||
linkMode == Scholar.Attachments.LINK_MODE_IMPORTED_URL) {
var url = attachment.getURL()
attachmentArray.url = url;
attachmentArray.url = attachment.getField('url');
attachmentArray.accessDate = attachment.getField('accessDate');
} else if(!this._displayOptions["exportFileData"]) {
// only export urls, not files, if exportFileData is off
return false;

View File

@ -43,10 +43,12 @@
<!ENTITY toolbar.openURL.tooltip "Find through your local library">
<!ENTITY item.add "Add">
<!ENTITY item.attachment.file.show "Show File">
<!ENTITY toolbar.note.standalone "New Standalone Note">
<!ENTITY toolbar.attachment.linked "Link to File...">
<!ENTITY toolbar.attachment.add "Store Copy of File...">
<!ENTITY toolbar.attachment.weblink "Save Link to Current Page">
<!ENTITY toolbar.attachment.snapshot "Take Snapshot of Current Page">
<!ENTITY selectitems.title "Select Items">

View File

@ -30,6 +30,7 @@ pane.item.notes.delete.confirm = Are you sure you want to delete this note?
pane.item.notes.count.singular = %1 note
pane.item.notes.count.plural = %1 notes
pane.item.attachments.view.link = View Page
pane.item.attachments.view.snapshot = View Snapshot
pane.item.attachments.view.file = View File
pane.item.attachments.delete.confirm = Are you sure you want to delete this attachment?
pane.item.attachments.count.singular = %1 attachment
@ -81,7 +82,7 @@ itemTypes.manuscript = Manuscript
itemTypes.interview = Interview
itemTypes.film = Film
itemTypes.artwork = Artwork
itemTypes.website = Web Page
itemTypes.webpage = Web Page
itemTypes.attachment = Attachment
creatorTypes.author = Author

View File

@ -52,6 +52,10 @@
height: 24px;
}
#scholar-pane toolbarseparator {
height:24px;
}
#scholar-pane toolbar .toggler
{
margin: 4px;
@ -108,6 +112,11 @@
list-style-image: url('chrome://scholar/skin/toolbar-item-from-page.png');
}
#tb-link-page
{
list-style-image: url('chrome://scholar/skin/toolbar-link-add.png');
}
#tb-snapshot-page
{
list-style-image: url('chrome://scholar/skin/toolbar-snapshot-add.png');

View File

@ -112,11 +112,12 @@ zoterosearchtextbox .toolbarbutton-menu-dropmarker
margin-bottom:-1px;
}
/* DEBUG: this doesn't seem to work, unfortunately */
/* DEBUG: this doesn't seem to work, unfortunately
#editpane-dynamic-fields label[singleField=false]:after
{
content:",";
}
*/
.clicky, .unclicky
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

View File

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 635 B

View File

@ -1,7 +1,7 @@
-- 91
-- 92
-- Set the following timestamp to the most recent scraper update date
REPLACE INTO "version" VALUES ('repository', STRFTIME('%s', '2006-08-31 22:44:00'));
REPLACE INTO "version" VALUES ('repository', STRFTIME('%s', '2006-10-01 17:00:00'));
REPLACE INTO "translators" VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '2006-08-11 11:18:00', 1, 100, 4, 'Amazon.com', 'Simon Kornblith', '^http://www\.amazon\.com/',
'function detectWeb(doc, url) {
@ -2713,14 +2713,14 @@ function doSearch(item) {
lookupPMIDs([getPMID(item.contextObject)]);
}');
REPLACE INTO "translators" VALUES ('951c027d-74ac-47d4-a107-9c3069ab7b48', '2006-06-26 16:41:00', 1, 100, 4, 'Embedded RDF', 'Simon Kornblith', NULL,
REPLACE INTO "translators" VALUES ('951c027d-74ac-47d4-a107-9c3069ab7b48', '2006-10-01 17:00:00', 1, 100, 4, 'Embedded RDF', 'Simon Kornblith', NULL,
'function detectWeb(doc, url) {
var metaTags = doc.getElementsByTagName("meta");
for(var i=0; i<metaTags.length; i++) {
var tag = metaTags[i].getAttribute("name");
if(tag && tag.substr(0, 3).toLowerCase() == "dc.") {
return "website";
return "webpage";
}
}
@ -3537,14 +3537,14 @@ function doWeb(doc, url) {
}
}');
REPLACE INTO "translators" VALUES ('1e6d1529-246f-4429-84e2-1f1b180b250d', '2006-09-06 17:54:00', 1, 100, 4, 'Chronicle of Higher Education', 'Simon Kornblith', '^http://chronicle\.com/',
REPLACE INTO "translators" VALUES ('1e6d1529-246f-4429-84e2-1f1b180b250d', '2006-10-01 17:00:00', 1, 100, 4, 'Chronicle of Higher Education', 'Simon Kornblith', '^http://chronicle\.com/',
'function detectWeb(doc, url) {
var articleRegexp = /^http:\/\/chronicle\.com\/(?:daily|weekly)\/[^/]+\//
if(articleRegexp.test(url)) {
if(doc.location.href.indexOf("weekly") != -1) {
return "magazineArticle";
} else {
return "website";
return "webpage";
}
} else {
var aTags = doc.getElementsByTagName("a");
@ -3581,7 +3581,7 @@ function scrape(doc) {
}
}
} else {
var newItem = new Scholar.Item("website");
var newItem = new Scholar.Item("webpage");
}
newItem.publicationTitle = "The Chronicle of Higher Education";
newItem.ISSN = "0009-5982";
@ -4222,7 +4222,7 @@ function doSearch(item) {
Scholar.wait();
}');
REPLACE INTO "translators" VALUES ('0e2235e7-babf-413c-9acf-f27cce5f059c', '2006-07-05 23:40:00', 1, 50, 3, 'MODS', 'Simon Kornblith', 'xml',
REPLACE INTO "translators" VALUES ('0e2235e7-babf-413c-9acf-f27cce5f059c', '2006-10-01 17:00:00', 1, 50, 3, 'MODS', 'Simon Kornblith', 'xml',
'Scholar.addOption("exportNotes", true);
function detectImport() {
@ -4280,7 +4280,7 @@ function doExport() {
} else if(item.itemType == "artwork") {
modsType = "still image";
marcGenre = "art original";
} else if(item.itemType == "website") {
} else if(item.itemType == "webpage") {
modsType = "multimedia";
marcGenre = "web site";
} else if(item.itemType == "note" || item.itemType == "attachment") {
@ -4586,7 +4586,7 @@ function doImport() {
} else if(marcGenre == "art original") {
newItem.itemType = "artwork";
} else if(marcGenre == "web site") {
newItem.itemType = "website";
newItem.itemType = "webpage";
}
}
@ -4723,7 +4723,7 @@ function doImport() {
}
}');
REPLACE INTO "translators" VALUES ('14763d24-8ba0-45df-8f52-b8d1108e7ac9', '2006-08-30 11:37:00', 1, 25, 2, 'Zotero RDF', 'Simon Kornblith', 'rdf',
REPLACE INTO "translators" VALUES ('14763d24-8ba0-45df-8f52-b8d1108e7ac9', '2006-10-01 17:00:00', 1, 25, 2, 'Zotero RDF', 'Simon Kornblith', 'rdf',
'Scholar.configure("getCollections", true);
Scholar.configure("dataMode", "rdf");
Scholar.addOption("exportNotes", true);
@ -4886,7 +4886,7 @@ function doExport() {
type = "MotionPicture";
} else if(item.itemType == "artwork") {
type = "Illustration";
} else if(item.itemType == "website") {
} else if(item.itemType == "webpage") {
type = "Document";
} else if(item.itemType == "note") {
type = "Memo";
@ -5247,7 +5247,7 @@ REPLACE INTO "translators" VALUES ('6e372642-ed9d-4934-b5d1-c11ac758ebb7', '2006
}
}');
REPLACE INTO "translators" VALUES ('5e3ad958-ac79-463d-812b-a86a9235c28f', '2006-07-15 17:09:00', 1, 100, 1, 'RDF', 'Simon Kornblith', 'rdf',
REPLACE INTO "translators" VALUES ('5e3ad958-ac79-463d-812b-a86a9235c28f', '2006-10-01 17:00:00', 1, 100, 1, 'RDF', 'Simon Kornblith', 'rdf',
'Scholar.configure("dataMode", "rdf");
function detectImport() {
@ -5513,7 +5513,7 @@ function doImport() {
} else if(type == n.bib+"Illustration") {
newItem.itemType = "illustration";
} else if(type == n.bib+"Document") {
newItem.itemType = "website";
newItem.itemType = "webpage";
} else if(type == n.bib+"Memo") {
// check to see if this note is independent
if(isPart(node)) {
@ -5732,7 +5732,7 @@ function doImport() {
}
}');
REPLACE INTO "translators" VALUES ('32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7', '2006-08-08 17:12:00', 1, 100, 3, 'RIS', 'Simon Kornblith', 'ris',
REPLACE INTO "translators" VALUES ('32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7', '2006-10-01 17:00:00', 1, 100, 3, 'RIS', 'Simon Kornblith', 'ris',
'Scholar.configure("dataMode", "line");
Scholar.addOption("exportNotes", true);
@ -5768,7 +5768,7 @@ var inputFieldMap = {
CY:"place"
};
// TODO: figure out if these are the best types for letter, interview, website
// TODO: figure out if these are the best types for letter, interview, webpage
var typeMap = {
book:"BOOK",
bookSection:"CHAP",
@ -5781,7 +5781,7 @@ var typeMap = {
interview:"PCOMM",
film:"MPCT",
artwork:"ART",
website:"ELEC"
webpage:"ELEC"
};
// supplements outputTypeMap for importing
@ -6108,7 +6108,7 @@ function doExport() {
}
}');
REPLACE INTO "translators" VALUES ('881f60f2-0802-411a-9228-ce5f47b64c7d', '2006-08-09 17:13:00', 1, 100, 3, 'Refer/BibIX', 'Simon Kornblith', 'txt',
REPLACE INTO "translators" VALUES ('881f60f2-0802-411a-9228-ce5f47b64c7d', '2006-10-01 17:00:00', 1, 100, 3, 'Refer/BibIX', 'Simon Kornblith', 'txt',
'Scholar.configure("dataMode", "line");
function detectImport() {
@ -6167,7 +6167,7 @@ var typeMap = {
interview:"Personal Communication",
film:"Audiovisual Material",
artwork:"Artwork",
website:"Electronic Source"
webpage:"Electronic Source"
};
// supplements outputTypeMap for importing
@ -6342,7 +6342,7 @@ function doExport() {
}
}');
REPLACE INTO "translators" VALUES ('9cb70025-a888-4a29-a210-93ec52da40d4', '2006-09-06 21:28:00', 1, 100, 3, 'BibTeX', 'Simon Kornblith', 'bib',
REPLACE INTO "translators" VALUES ('9cb70025-a888-4a29-a210-93ec52da40d4', '2006-10-01 17:00:00', 1, 100, 3, 'BibTeX', 'Simon Kornblith', 'bib',
'Scholar.configure("dataMode", "block");
function detectImport() {
@ -6401,7 +6401,7 @@ var typeMap = {
interview:"misc",
film:"misc",
artwork:"misc",
website:"misc"
webpage:"misc"
};
// supplements outputTypeMap for importing

View File

@ -1,4 +1,4 @@
-- 3
-- 4
-- This file creates system tables that can be safely wiped and reinitialized
-- at any time, as long as existing ids are preserved.
@ -143,7 +143,7 @@
INSERT INTO itemTypes VALUES (10,'interview',NULL,1);
INSERT INTO itemTypes VALUES (11,'film',NULL,1);
INSERT INTO itemTypes VALUES (12,'artwork',NULL,1);
INSERT INTO itemTypes VALUES (13,'website',NULL,2);
INSERT INTO itemTypes VALUES (13,'webpage',NULL,0);
INSERT INTO itemTypes VALUES (14,'attachment',NULL,0);
INSERT INTO fields VALUES (1,'url',NULL);
@ -305,6 +305,8 @@
INSERT INTO itemTypeFields VALUES (13, 27, NULL, 4);
INSERT INTO itemTypeFields VALUES (13, 2, NULL, 5);
INSERT INTO itemTypeFields VALUES (13, 22, NULL, 6);
INSERT INTO itemTypeFields VALUES (14, 27, NULL, 1);
INSERT INTO itemTypeFields VALUES (14, 1, NULL, 2);
INSERT INTO "fileTypes" VALUES(1, 'webpage');
INSERT INTO "fileTypes" VALUES(2, 'image');

View File

@ -1,4 +1,4 @@
-- 4
-- 5
-- This file creates tables containing user-specific data -- any changes
-- to existing tables made here must be mirrored in transition steps in