-
Notifications
You must be signed in to change notification settings - Fork 785
/
Copy pathK10plus ISBN.js
386 lines (371 loc) · 13.5 KB
/
K10plus ISBN.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
{
"translatorID": "de0eef58-cb39-4410-ada0-6b39f43383f9",
"label": "K10plus ISBN",
"creator": "Philipp Zumstein",
"target": "",
"minVersion": "4.0",
"maxVersion": "",
"priority": 99,
"inRepository": true,
"translatorType": 8,
"lastUpdated": "2024-10-09 14:20:54"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2015 Philipp Zumstein
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
function detectSearch(item) {
return !!item.ISBN;
}
function doSearch(item) {
//K10plus is the merged catalog of GBV and SWB
//search the ISBN or text over the SRU of K10plus, and take the result it as MARCXML
//documentation: https://wiki.k10plus.de/display/K10PLUS/SRU
let url;
if (item.ISBN) {
var queryISBN = ZU.cleanISBN(item.ISBN);
url = "https://sru.k10plus.de/opac-de-627?version=1.1&operation=searchRetrieve&query=pica.isb=" + queryISBN + "&maximumRecords=1";
}
else if (item.query) {
url = "https://sru.k10plus.de/opac-de-627?version=1.1&operation=searchRetrieve&query=" + encodeURIComponent(item.query) + "&maximumRecords=50";
}
//Z.debug(url);
ZU.doGet(url, function (text) {
//Z.debug(text);
var translator = Zotero.loadTranslator("import");
translator.setTranslator("edd87d07-9194-42f8-b2ad-997c4c7deefd");
translator.setString(text);
translator.setHandler("itemDone", function (obj, item) {
// Table of Contents = Inhaltsverzeichnis
/* e.g.
<datafield tag="856" ind1="4" ind2="2">
<subfield code="u">http://d-nb.info/1054452857/04</subfield>
<subfield code="m">DE-101</subfield>
<subfield code="3">Inhaltsverzeichnis</subfield>
</datafield>
*/
var parser = new DOMParser();
var xml = parser.parseFromString(text, "application/xml");
var ns = {
"marc": "http://www.loc.gov/MARC21/slim"
};
var tocURL = ZU.xpath(xml, '//marc:datafield[@tag="856"][ marc:subfield[text()="Inhaltsverzeichnis"] ]/marc:subfield[@code="u"]', ns);
if (tocURL.length) {
//Z.debug(tocURL[0].textContent);
let url = tocURL[0].textContent;
// Force all PDF URLs to HTTPS -- any domains specified in MARC records likely
// support HTTPS (e.g., www.gbv.de and d-nb.info)
if (url.startsWith("http://")) {
Z.debug(`Forcing HTTPS for ${url}`);
url = url.replace(/^http:\/\//, "https://");
}
item.attachments = [{
url,
title: "Table of Contents PDF",
mimeType: "application/pdf"
}];
}
//delete [u.a.] from place
if (item.place) {
item.place = item.place.replace(/\[?u\.[\s\u00A0]?a\.\]?\s*$/, '');
}
//DDC is not the callNumber in Germany
item.callNumber = "";
//place the queried ISBN as the first ISBN in the list (dublicates will be removed later)
item.ISBN = queryISBN + " " + item.ISBN;
//delete German tags
item.tags = [];
item.complete();
});
translator.translate();
});
}
// Testing locally in
// chrome://zotero/content/tools/testTranslators/testTranslators.html
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "search",
"input": {
"ISBN": "9783830931492"
},
"items": [
{
"itemType": "book",
"title": "Evaluation in Deutschland und Österreich: Stand und Entwicklungsperspektiven in den Arbeitsfeldern der DeGEval - Gesellschaft für Evaluation",
"creators": [
{
"lastName": "Böttcher",
"firstName": "Wolfgang",
"creatorType": "editor"
},
{
"lastName": "DeGEval - Gesellschaft für Evaluation",
"creatorType": "editor",
"fieldMode": true
}
],
"date": "2014",
"ISBN": "9783830931492",
"extra": "OCLC: 885612607",
"language": "ger",
"libraryCatalog": "K10plus ISBN",
"numPages": "219",
"place": "Münster",
"publisher": "Waxmann",
"shortTitle": "Evaluation in Deutschland und Österreich",
"attachments": [
{
"title": "Table of Contents PDF",
"mimeType": "application/pdf"
}
],
"tags": [],
"notes": [
{
"note": "Literaturangaben"
}
],
"seeAlso": []
}
]
},
{
"type": "search",
"input": {
"ISBN": "3-86688-240-8"
},
"items": [
{
"itemType": "book",
"title": "Bilinguale Lexik: nicht materieller lexikalischer Transfer als Folge der aktuellen russisch-deutschen Zweisprachigkeit",
"creators": [
{
"firstName": "Katrin Bente",
"lastName": "Karl",
"creatorType": "author"
}
],
"date": "2012",
"ISBN": "9783866882409 9783866882416",
"extra": "OCLC: 795769702",
"language": "ger",
"libraryCatalog": "K10plus ISBN",
"numPages": "387",
"place": "München",
"publisher": "Sagner",
"series": "Slavolinguistica",
"seriesNumber": "15",
"shortTitle": "Bilinguale Lexik",
"attachments": [
{
"title": "Table of Contents PDF",
"mimeType": "application/pdf"
}
],
"tags": [],
"notes": [
{
"note": "Literaturverz. S. [373] - 387 Die CD-ROM enth. einen Anh. mit Dokumenten zur Sprachproduktion und Sprachbewertung"
},
{
"note": "Teilw. zugl.: Hamburg, Univ., FB SLM, Diss., 2011 u.d.T.: Karl, Katrin Bente: Nicht materieller lexikalischer Transfer als Folge der aktuellen russisch-deutschen Zweisprachigkeit"
}
],
"seeAlso": []
}
]
},
{
"type": "search",
"input": {
"ISBN": "978-1-4073-0412-0"
},
"items": [
{
"itemType": "book",
"title": "The harbour of Sebastos (Caesarea Maritima) in its Roman Mediterranean context",
"creators": [
{
"firstName": "Avnēr",
"lastName": "Rabbān",
"creatorType": "author"
},
{
"firstName": "Michal",
"lastName": "Artzy",
"creatorType": "author"
}
],
"date": "2009",
"ISBN": "9781407304120",
"extra": "OCLC: 320755805",
"language": "eng",
"libraryCatalog": "K10plus ISBN",
"numPages": "222",
"place": "Oxford",
"publisher": "Archaeopress",
"series": "BAR International series",
"seriesNumber": "1930",
"attachments": [
{
"title": "Table of Contents PDF",
"mimeType": "application/pdf"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "search",
"input": {
"ISBN": "978-1-4912-5316-8"
},
"items": [
{
"itemType": "book",
"title": "Classroom activities for the busy teacher: EV3: A 10 week plan for teaching robotics using the LEGO Education EV3 Core Set (45544)",
"creators": [
{
"firstName": "Damien",
"lastName": "Kee",
"creatorType": "editor"
}
],
"date": "2013",
"ISBN": "9781491253168",
"abstractNote": "Introduction -- RileyRover basics -- Keeping track -- What is a robot? -- Flowcharting -- How far? -- How fast? -- That bot has personality! -- How many sides? -- Help, I'm stuck! -- Let's go prospecting! -- Stay away from the edge -- Prospecting and staying safe -- Going up and going down -- Cargo delivery -- Prepare the landing zone -- Meet your adoring public! -- As seen on TV! -- Mini-golf -- Dancing robots -- Robot wave -- Robot butler -- Student worksheets -- Building instructions. - \"A guide for teachers implementing a robotics unit in the classroom ... aimed at middle years schooling (ages 9-15) ... [and] based around a single robot, the RileyRover\"--page 1",
"extra": "OCLC: 860902984",
"language": "eng",
"libraryCatalog": "K10plus ISBN",
"numPages": "93",
"place": "Lexington, KY",
"publisher": "CreateSpace",
"shortTitle": "Classroom activities for the busy teacher",
"attachments": [],
"tags": [],
"notes": [
{
"note": "Place of publication information from back of book. Publisher information provided by Amazon"
}
],
"seeAlso": []
}
]
},
{
"type": "search",
"input": {
"ISBN": "9780754671275"
},
"items": [
{
"itemType": "book",
"title": "Remaining sensitive to the possibility of failure: second Resilience Engineering Symposium that was held November 8 - 10, 2007 in Juan-les-Pins",
"creators": [
{
"firstName": "Erik",
"lastName": "Hollnagel",
"creatorType": "editor"
},
{
"firstName": "Christopher P.",
"lastName": "Nemeth",
"creatorType": "editor"
},
{
"firstName": "Sidney",
"lastName": "Dekker",
"creatorType": "editor"
}
],
"date": "2008",
"ISBN": "9780754671275",
"language": "eng",
"libraryCatalog": "K10plus ISBN",
"numPages": "332",
"place": "Aldershot, Hampshire",
"publisher": "Ashgate",
"series": "Resilience engineering perspectives",
"seriesNumber": "1",
"shortTitle": "Remaining sensitive to the possibility of failure",
"attachments": [
{
"title": "Table of Contents PDF",
"mimeType": "application/pdf"
}
],
"tags": [],
"notes": [
{
"note": "Many of the papers are based on presentations made at the Second Resilience Engineering Symposium that was held November 8 - 10 2007 in Juan-les-Pins, France. - Complete proceedings from this symposium are availabe for download at http://www.resilience-engineering.org Includes bibliographical references and index"
}
],
"seeAlso": []
}
]
},
{
"type": "search",
"input": {
"ISBN": "9780231545853"
},
"items": [
{
"itemType": "book",
"title": "Design Thinking for the Greater Good: Innovation in the Social Sector",
"creators": [
{
"firstName": "Jeanne",
"lastName": "Liedtka",
"creatorType": "author"
},
{
"firstName": "Daisy",
"lastName": "Azer",
"creatorType": "author"
},
{
"firstName": "Randy",
"lastName": "Salzman",
"creatorType": "author"
}
],
"date": "2018",
"ISBN": "9780231545853",
"abstractNote": "Facing especially wicked problems, social sector organizations are searching for powerful new methods to understand and address them. Design Thinking for the Greater Good goes in depth on both the how of using new tools and the why. As a way to reframe problems, ideate solutions, and iterate toward better answers, design thinking is already well established in the commercial world. Through ten stories of struggles and successes in fields such as health care, education, agriculture, transportation, social services, and security, the authors show how collaborative creativity can shake up even the most entrenched bureaucracies—and provide a practical roadmap for readers to implement these tools.The design thinkers Jeanne Liedtka, Randy Salzman, and Daisy Azer explore how major agencies like the Department of Health and Human Services and the Transportation and Security Administration in the United States, as well as organizations in Canada, Australia, and the United Kingdom, have instituted principles of design thinking. In each case, these groups have used the tools of design thinking to reduce risk, manage change, use resources more effectively, bridge the communication gap between parties, and manage the competing demands of diverse stakeholders. Along the way, they have improved the quality of their products and enhanced the experiences of those they serve. These strategies are accessible to analytical and creative types alike, and their benefits extend throughout an organization. This book will help today's leaders and thinkers implement these practices in their own pursuit of creative solutions that are both innovative and achievable",
"language": "eng",
"libraryCatalog": "K10plus ISBN",
"numPages": "1",
"place": "New York Chichester",
"publisher": "Columbia University Press",
"series": "Columbia Business School Publishing",
"shortTitle": "Design Thinking for the Greater Good",
"attachments": [],
"tags": [],
"notes": [
{
"note": "Frontmatter -- -- CONTENTS -- -- Acknowledgments -- -- Part I. Why Design Thinking? -- -- 1. Catalyzing a Conversation for Change -- -- 2. How Do We Get There from Here? A Tale of Two Managers -- -- Part II. The Stories -- -- 3. Igniting Creative Confidence at US Health and Human Services -- -- 4. Including New Voices at the Kingwood Trust -- -- 5. Scaling Design Thinking at Monash Medical Centre -- -- 6. Turning Debate into Dialogue at the US Food and Drug Administration -- -- 7. Fostering Community Conversations in Iveragh, Ireland -- -- 8. Connecting—and Disconnecting—the Pieces at United Cerebral Palsy -- -- 9. The Power of Local at the Community Transportation Association of America -- -- 10. Bridging Technology and the Human Experience at the Transportation Security Administration -- -- 11. Making Innovation Safe at MasAgro -- -- 12. Integrating Design and Strategy at Children’s Health System of Texas -- -- Part III. Moving into Action: Bringing Design Thinking to Your Organization -- -- 13. The Four-Question Methodology in Action: Laying the Foundation -- -- 14. The Four-Question Methodology in Action: Ideas to Experiments -- -- 15. Building Organizational Capabilities -- -- Notes -- -- Index"
}
],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/