Closes #1181, Patch for File Download for MODS XML Import

Won't be pushed to existing clients until 1.0.8
This commit is contained in:
Dan Stillman 2008-10-20 10:16:33 +00:00
parent 7c0bc7035b
commit 4d6aef5816

View file

@ -8,7 +8,7 @@
"maxVersion":"", "maxVersion":"",
"priority":50, "priority":50,
"inRepository":true, "inRepository":true,
"lastUpdated":"2008-08-20 01:05:28" "lastUpdated":"2008-10-20 10:10:37"
} }
Zotero.addOption("exportNotes", true); Zotero.addOption("exportNotes", true);
@ -593,8 +593,25 @@ function doImport() {
newItem.callNumber = mods.m::classification.text().toString(); newItem.callNumber = mods.m::classification.text().toString();
// archiveLocation // archiveLocation
newItem.archiveLocation = mods.m::location.m::physicalLocation.text().toString(); newItem.archiveLocation = mods.m::location.m::physicalLocation.text().toString();
// url // attachments and url
newItem.url = mods.m::location.m::url.text().toString(); for each(var url in mods.m::location.m::url) {
var value = url.text().toString();
if (url.@access == "raw object") {
var filetitle;
if (url.@displayLabel){
filetitle = url.@displayLabel;
} else {
filetitle = "Attachment";
}
if (value.substr(-4,4)==".pdf") {
newItem.attachments.push({url:value, mimeType:"application/pdf", title:filetitle, downloadable:true});
} else {
newItem.attachments.push({url:value, title:filetitle, downloadable:true});
}
} else {
newItem.url = value;
}
}
// abstract // abstract
newItem.abstractNote = mods.m::abstract.text().toString(); newItem.abstractNote = mods.m::abstract.text().toString();