Skip to content
Permalink
Browse files

Open Journal Systems: Get metadata for articles in galley view (need …

…for OJS 3) (zotero#1767)

Get metadata for PDF view of articles, which is not included in
OJS 3 (up to at least version 3.1.1-2).
  • Loading branch information...
jrwiebe authored and adam3smith committed Oct 12, 2018
1 parent 21e60d6 commit d844751773d14a86f297cf9cbd3ad51be1bf9f36
Showing with 52 additions and 2 deletions.
  1. +52 −2 Open Journal Systems.js
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2018-10-04 03:01:31"
"lastUpdated": "2018-10-12 17:46:47"
}

function detectWeb(doc, url) {
@@ -21,6 +21,17 @@ function detectWeb(doc, url) {
}

function doWeb(doc, url) {
// In OJS 3, up to at least version 3.1.1-2, the PDF view does not
// include metadata, so we must get it from the article landing page.
var urlParts = url.match(/(.+\/article\/view\/)([^/]+)\/[^/]+/);
if (urlParts) { //PDF view
ZU.processDocuments(urlParts[1] + urlParts[2], scrape);
} else { //Article view
scrape(doc, url);
}
}

function scrape(doc, url) {
//use Embeded Metadata
var trans = Zotero.loadTranslator('web');
trans.setTranslator('951c027d-74ac-47d4-a107-9c3069ab7b48');
@@ -85,7 +96,6 @@ function doWeb(doc, url) {
});

trans.translate();

}
/** BEGIN TEST CASES **/
var testCases = [
@@ -776,6 +786,46 @@ var testCases = [
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://journals.sfu.ca/jmde/index.php/jmde_1/article/view/100/115",
"items": [
{
"itemType": "journalArticle",
"title": "The Value of Evaluation Standards: A Comparative Assessment",
"creators": [
{
"firstName": "Robert",
"lastName": "Picciotto",
"creatorType": "author"
}
],
"date": "2007/12/18",
"ISSN": "1556-8180",
"issue": "3",
"language": "en",
"libraryCatalog": "journals.sfu.ca",
"pages": "30-59",
"publicationTitle": "Journal of MultiDisciplinary Evaluation",
"rights": "Copyright (c)",
"shortTitle": "The Value of Evaluation Standards",
"url": "http://journals.sfu.ca/jmde/index.php/jmde_1/article/view/100",
"volume": "2",
"attachments": [
{
"title": "Full Text PDF",
"mimeType": "application/pdf"
},
{
"title": "Snapshot"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/

0 comments on commit d844751

Please sign in to comment.
You can’t perform that action at this time.