1 /* ---------------------------------------------------------------------------
2 * Copyright (C) 2009-2015 Equinox Software, Inc.
3 * Mike Rylander <miker@esilibrary.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * ---------------------------------------------------------------------------
18 // This module requires a /real/ jQuery be used with your
19 // angularjs, so as to avoid using hand-rolled AJAX.
23 Record : function(kwargs) {
24 if (!kwargs) kwargs = {};
26 this.generate008 = function () {
31 var y = now.getUTCFullYear().toString().substr(2,2);
32 var m = now.getUTCMonth() + 1;
33 if (m < 10) m = '0' + m;
34 var d = now.getUTCDate();
35 if (d < 10) d = '0' + d;
38 if (f = this.field('008',true)[0]) {
42 /* lang code from 041a */
43 var lang = orig008.substr(35, 3);
45 if (f = this.field('041',true)[0]) {
46 if (s = f.subfield('a',true)[0]) {
51 /* country code from 044a */
52 var country = orig008.substr(15, 3);
53 if (f = this.field('044',true)[0]) {
54 if (s = f.subfield('a',true)[0]) {
55 if(s[1]) country = s[1];
58 while (country.length < 3) country = country + ' ';
59 if (country.length > 3) country = country.substr(0,3);
62 var date1 = now.getUTCFullYear().toString();
63 if (f = this.field('260',true)[0]) {
64 if (s = f.subfield('c',true)[0]) {
67 tmpd = tmpd.replace(/[^0-9]/g, '');
68 if (tmpd.match(/^\d\d\d\d/)) {
69 date1 = tmpd.substr(0, 4);
75 var date2 = orig008.substr(11, 4);
76 var datetype = orig008.substr(6, 1);
77 var modded = orig008.substr(38, 1);
78 var catsrc = orig008.substr(39, 1);
80 return '' + y + m + d + datetype + date1 + date2 + country + ' ' + lang + modded + catsrc;
84 this.title = function () { return this.subfield('245','a')[1] }
86 this.field = function (spec, wantarray) {
87 var list = this.fields.filter(function (f) {
88 if (f.tag.match(spec)) return true;
92 if (!wantarray && list.length == 1) return list[0];
96 this.subfield = function (spec, code) {
97 var f = this.field(spec, true)[0];
98 if (f) return f.subfield(code)
102 this.appendFields = function () {
104 Array.prototype.slice.call(arguments).forEach( function (f) { f.position = me.fields.length; me.fields.push( f ) } );
107 this.deleteField = function (f) { return this.deleteFields(f) },
109 this.insertOrderedFields = function () {
111 for (var i = 0; i < arguments.length; i++) {
112 var f = arguments[i];
114 for (var j = 0; j < this.fields.length; j++) {
115 if (f.tag < this.fields[j].tag) {
116 this.insertFieldsBefore(this.fields[j], f);
121 if (!done) this.appendFields(f);
125 this.insertFieldsBefore = function (target) {
126 var args = Array.prototype.slice.call(arguments);
129 for (var j = 0; j < this.fields.length; j++) {
130 if (target === this.fields[j]) {
131 args.forEach( function (f) {
133 me.fields.splice(j++,0,f);
138 for (var j = 0; j < this.fields.length; j++) {
139 this.fields[j].position = j;
143 this.insertFieldsAfter = function (target) {
144 var args = Array.prototype.slice.call(arguments);
147 for (var j = 0; j < this.fields.length; j++) {
148 if (target === this.fields[j]) {
149 args.forEach( function (f) {
151 me.fields.splice(++j,0,f);
156 for (var j = 0; j < this.fields.length; j++) {
157 this.fields[j].position = j;
161 this.deleteFields = function () {
164 for ( var i in arguments ) {
165 var f = arguments[i];
166 for (var j = 0; j < me.fields.length; j++) {
167 if (f === me.fields[j]) {
168 me.fields[j].record = null;
169 me.fields.splice(j,1);
175 for (var j = 0; j < this.fields.length; j++) {
176 this.fields[j].position = j;
181 // this.clone = function () { return dojo.clone(this) } // maybe implement later...
183 this.fromXmlURL = function (url) {
185 return $.get( // This is a Promise
188 me.fromXmlDocument($('record', mxml)[0]);
189 if (me.onLoad) me.onLoad();
193 this.fromXmlString = function (mxml) {
194 this.fromXmlDocument( $( $.parseXML( mxml ) ).find('record')[0] );
197 this.fromXmlDocument = function (mxml) {
199 me.leader = $($('leader',mxml)[0]).text() || '00000cam a2200205Ka 4500';
201 $('controlfield', mxml).each(function (ind) {
206 tag : cf.attr('tag'),
212 $('datafield', mxml).each(function (ind) {
217 tag : df.attr('tag'),
218 ind1 : df.attr('ind1'),
219 ind2 : df.attr('ind2'),
220 subfields : $('subfield', df).map(
222 return [[ $(sf).attr('code'), $(sf).text(), i ]];
229 for (var j = 0; j < this.fields.length; j++) {
230 this.fields[j].position = j;
237 this.toXmlDocument = function () {
239 var doc = $.parseXML('<record xmlns="http://www.loc.gov/MARC21/slim"/>');
240 var rec_node = $('record', doc)[0];
242 var ldr = doc.createElementNS('http://www.loc.gov/MARC21/slim', 'leader');
243 ldr.textContent = this.leader;
244 rec_node.appendChild( ldr );
246 this.fields.forEach(function (f) {
247 var element = f.isControlfield() ? 'controlfield' : 'datafield';
248 var f_node = doc.createElementNS( 'http://www.loc.gov/MARC21/slim', element );
249 f_node.setAttribute('tag', f.tag);
251 if (f.isControlfield()) {
252 if (f.data) f_node.textContent = f.data;
254 f_node.setAttribute('ind1', f.indicator(1));
255 f_node.setAttribute('ind2', f.indicator(2));
256 f.subfields.forEach( function (sf) {
257 var sf_node = doc.createElementNS('http://www.loc.gov/MARC21/slim', 'subfield');
258 sf_node.setAttribute('code', sf[0]);
259 sf_node.textContent = sf[1];
260 f_node.appendChild(sf_node);
264 rec_node.appendChild(f_node);
270 this.toXmlString = function () {
271 return (new XMLSerializer()).serializeToString( this.toXmlDocument() );
274 this.fromBreaker = function (marctxt) {
277 function cf_line_data (l) { return l.substring(4) || '' };
278 function df_line_data (l) { return l.substring(6) || '' };
279 function line_tag (l) { return l.substring(0,3) };
280 function df_ind1 (l) { return l.substring(4,5).replace('\\',' ') };
281 function df_ind2 (l) { return l.substring(5,6).replace('\\',' ') };
282 function isControlField (l) {
284 return (x == 'LDR' || x < '010') ? true : false;
287 var lines = marctxt.replace(/^=/gm,'').split('\n');
288 lines.forEach(function (current_line, ind) {
290 if (current_line.match(/^#/)) {
291 // skip comment lines
292 } else if (isControlField(current_line)) {
293 if (line_tag(current_line) == 'LDR') {
294 me.leader = cf_line_data(current_line) || '00000cam a2200205Ka 4500';
299 tag : line_tag(current_line),
300 data : cf_line_data(current_line).replace('\\',' ','g'),
305 if (current_line.substring(4,5) == me.delimiter) // add delimiters if they were left out
306 current_line = current_line.substring(0,3) + ' \\\\' + current_line.substring(4);
308 var data = df_line_data(current_line);
309 if (!(data.substring(0,1) == me.delimiter)) data = me.delimiter + 'a' + data;
311 var sf_list = data.split(me.delimiter);
317 tag : line_tag(current_line),
318 ind1 : df_ind1(current_line),
319 ind2 : df_ind2(current_line),
320 subfields : sf_list.map( function (sf, i) {
321 var sf_data = sf.substring(1);
322 if (me.delimiter == '$') sf_data = sf_data.replace(/\{dollar\}/g, '$');
323 return [ sf.substring(0,1), sf_data, i ];
330 for (var j = 0; j < this.fields.length; j++) {
331 this.fields[j].position = j;
338 this.toBreaker = function () {
341 var mtxt = '=LDR ' + this.leader + '\n';
343 mtxt += this.fields.map( function (f) {
344 if (f.isControlfield()) {
345 if (f.data) return '=' + f.tag + ' ' + f.data.replace(' ','\\','g');
348 return '=' + f.tag + ' ' +
349 f.indicator(1).replace(' ','\\') +
350 f.indicator(2).replace(' ','\\') +
351 f.subfields.map( function (sf) {
353 if (me.delimiter == '$') sf_data = sf_data.replace(/\$/g, '{dollar}');
354 return me.delimiter + sf[0] + sf_data;
362 this.recordType = function () {
364 var _t = this.leader.substr(MARC21.Record._ff_pos.Type.ldr.BKS.start, MARC21.Record._ff_pos.Type.ldr.BKS.len);
365 var _b = this.leader.substr(MARC21.Record._ff_pos.BLvl.ldr.BKS.start, MARC21.Record._ff_pos.BLvl.ldr.BKS.len);
367 for (var t in MARC21.Record._recType) {
368 if (_t.match(MARC21.Record._recType[t].Type) && _b.match(MARC21.Record._recType[t].BLvl)) {
372 return 'BKS'; // default
375 this.videorecordingFormatName = function () {
376 var _7 = this.field('007').data;
378 if (_7 && _7.match(/^v/)) {
379 var _v_e = _7.substr(
380 MARC21.Record._physical_characteristics.v.subfields.e.start,
381 MARC21.Record._physical_characteristics.v.subfields.e.len
384 return MARC21.Record._physical_characteristics.v.subfields.e.values[ _v_e ];
390 this.videorecordingFormatCode = function () {
391 var _7 = this.field('007').data;
393 if (_7 && _7.match(/^v/)) {
395 MARC21.Record._physical_characteristics.v.subfields.e.start,
396 MARC21.Record._physical_characteristics.v.subfields.e.len
403 this.extractFixedField = function (field, dflt) {
404 if (!MARC21.Record._ff_pos[field]) return null;
406 var _l = this.leader;
407 var _8 = this.field('008').data;
408 var _6 = this.field('006').data;
410 var rtype = this.recordType();
414 if (MARC21.Record._ff_pos[field].ldr && _l) {
415 if (MARC21.Record._ff_pos[field].ldr[rtype]) {
417 MARC21.Record._ff_pos[field].ldr[rtype].start,
418 MARC21.Record._ff_pos[field].ldr[rtype].len
421 } else if (MARC21.Record._ff_pos[field]._8 && _8) {
422 if (MARC21.Record._ff_pos[field]._8[rtype]) {
424 MARC21.Record._ff_pos[field]._8[rtype].start,
425 MARC21.Record._ff_pos[field]._8[rtype].len
430 if (!val && MARC21.Record._ff_pos[field]._6 && _6) {
431 if (MARC21.Record._ff_pos[field]._6[rtype]) {
433 MARC21.Record._ff_pos[field]._6[rtype].start,
434 MARC21.Record._ff_pos[field]._6[rtype].len
443 if (MARC21.Record._ff_pos[field].ldr && MARC21.Record._ff_pos[field].ldr[rtype]) {
444 d = MARC21.Record._ff_pos[field].ldr[rtype].def;
448 if (MARC21.Record._ff_pos[field]._8 && MARC21.Record._ff_pos[field]._8[rtype]) {
449 d = MARC21.Record._ff_pos[field]._8[rtype].def;
453 if (!val && MARC21.Record._ff_pos[field]._6 && MARC21.Record._ff_pos[field]._6[rtype]) {
454 d = MARC21.Record._ff_pos[field]._6[rtype].def;
459 for (var j = 0; j < MARC21.Record._ff_pos[field][p][rtype].len; j++) {
470 this.setFixedField = function (field, value) {
471 if (!MARC21.Record._ff_pos[field]) return null;
473 var _l = this.leader;
474 var _8 = this.field('008').data;
475 var _6 = this.field('006').data;
477 var rtype = this.recordType();
480 if (MARC21.Record._ff_pos[field].ldr && _l) {
481 if (MARC21.Record._ff_pos[field].ldr[rtype]) { // It's in the leader
482 if (value.length > MARC21.Record._ff_pos[field].ldr[rtype].len)
483 value = value.substr(0, MARC21.Record._ff_pos[field].ldr[rtype].len);
484 while (value.length < MARC21.Record._ff_pos[field].ldr[rtype].len)
485 value += MARC21.Record._ff_pos[field].ldr[rtype].def;
487 _l.substring(0, MARC21.Record._ff_pos[field].ldr[rtype].start) +
490 MARC21.Record._ff_pos[field].ldr[rtype].start
491 + MARC21.Record._ff_pos[field].ldr[rtype].len
495 } else if (MARC21.Record._ff_pos[field]._8 && _8) {
496 if (MARC21.Record._ff_pos[field]._8[rtype]) { // Nope, it's in the 008
497 if (value.length > MARC21.Record._ff_pos[field]._8[rtype].len)
498 value = value.substr(0, MARC21.Record._ff_pos[field]._8[rtype].len);
499 while (value.length < MARC21.Record._ff_pos[field]._8[rtype].len)
500 value += MARC21.Record._ff_pos[field]._8[rtype].def;
501 this.field('008').update(
502 _8.substring(0, MARC21.Record._ff_pos[field]._8[rtype].start) +
505 MARC21.Record._ff_pos[field]._8[rtype].start
506 + MARC21.Record._ff_pos[field]._8[rtype].len
513 if (!done && MARC21.Record._ff_pos[field]._6 && _6) {
514 if (MARC21.Record._ff_pos[field]._6[rtype]) { // ok, maybe the 006?
515 if (value.length > MARC21.Record._ff_pos[field]._6[rtype].len)
516 value = value.substr(0, MARC21.Record._ff_pos[field]._6[rtype].len);
517 while (value.length < MARC21.Record._ff_pos[field]._6[rtype].len)
518 value += MARC21.Record._ff_pos[field]._6[rtype].def;
519 this.field('006').update(
520 _6.substring(0, MARC21.Record._ff_pos[field]._6[rtype].start) +
523 MARC21.Record._ff_pos[field]._6[rtype].start
524 + MARC21.Record._ff_pos[field]._6[rtype].len
535 this.delimiter = MARC21.Record.delimiter ? MARC21.Record.delimiter : '\u2021';
536 this.leader = '00000cam a2200205Ka 4500';
538 if (kwargs.delimiter) this.delimiter = kwargs.delimiter;
539 if (kwargs.onLoad) this.onLoad = kwargs.onLoad;
542 this.fromXmlURL(kwargs.url);
543 } else if (kwargs.marcxml) {
544 this.fromXmlString(kwargs.marcxml);
545 if (this.onLoad) this.onLoad();
546 } else if (kwargs.xml) {
547 this.fromXmlDocument(kwargs.xml);
548 if (this.onLoad) this.onLoad();
549 } else if (kwargs.marcbreaker) {
550 this.fromBreaker(kwargs.marcbreaker);
551 if (this.onLoad) this.onLoad();
554 if (kwargs.rtype == 'AUT') {
555 this.setFixedField('Type','z');
560 Field : function (kwargs) {
561 if (!kwargs) kwargs = {};
563 this.subfield = function (code, wantarray) {
564 var list = this.subfields.filter( function (s) {
565 if (s[0] == code) return true; return false;
567 if (!wantarray && list.length == 1) return list[0];
571 this.addSubfields = function () {
572 for (var i = 0; i < arguments.length; i++) {
573 var code = arguments[i];
574 var value = arguments[++i];
575 this.subfields.push( [ code, value ] );
579 this.deleteExactSubfields = function () {
583 for ( var i in arguments ) {
584 var f = arguments[i];
585 for (var j = 0; j < me.subfields.length; j++) {
586 if (f === me.subfields[j]) {
587 me.subfields.splice(j,1);
592 if (done && me.subfields[j])
593 me.subfields[j][2] -= 1;
600 this.deleteSubfields = function (c) {
601 return this.deleteSubfield( { code : c } );
604 this.deleteSubfield = function (args) {
606 if (!Array.isArray( args.code )) {
607 args.code = [ args.code ];
610 if (args.pos && !Array.isArray( args.pos )) {
611 args.pos = [ args.pos ];
614 for (var i = 0; i < args.code.length; i++) {
616 for (var j = 0; j < me.subfields.length; j++) {
617 if (me.subfields[j][0] == args.code[i]) {
619 if (!sub_pos[args.code[i]]) sub_pos[args.code[j]] = 0;
620 else sub_pos[args.code[i]]++;
623 for (var k = 0; k < args.pos.length; k++) {
624 if (sub_pos[args.code[i]] == args.pos[k]) me.subfields.splice(j,1);
626 } else if (args.match && me.subfields[j][1].match( args.match )) {
627 me.subfields.splice(j,1);
629 me.subfields.splice(j,1);
636 this.update = function ( args ) {
637 if (this.isControlfield()) {
640 if (args.ind1) this.ind1 = args.ind1;
641 if (args.ind2) this.ind2 = args.ind2;
642 if (args.tag) this.tag = args.tag;
644 for (var i in args) {
645 if (i == 'tag' || i == 'ind1' || i == 'ind2') continue;
647 this.subfields.forEach( function (f) {
648 if (!done && f[0] == i) {
657 this.isControlfield = function () {
658 return this.tag < '010' ? true : false;
661 this.indicator = function (num, value) {
662 if (value !== undefined) {
663 if (num == 1) this.ind1 = value;
664 else if (num == 2) this.ind2 = value;
665 else { this.error = true; return null; }
667 if (num == 1) return this.ind1;
668 else if (num == 2) return this.ind2;
669 else { this.error = true; return null; }
673 this.record = null; // MARC record pointer
674 this.tag = ''; // MARC tag
675 this.ind1 = ' '; // MARC indicator 1
676 this.ind2 = ' '; // MARC indicator 2
677 this.data = ''; // MARC data for a controlfield element
678 this.subfields = []; // list of MARC subfields for a datafield element
680 this.position = kwargs.position;
681 this.record = kwargs.record;
682 this.tag = kwargs.tag;
683 this.ind1 = kwargs.ind1 || ' ';
684 this.ind2 = kwargs.ind2 || ' ';
685 this.data = kwargs.data;
687 if (kwargs.subfields) this.subfields = kwargs.subfields;
688 else this.subfields = [];
692 Batch : function(kwargs) {
694 this.parse = function () {
695 if (this.source instanceof Object ) { // assume an xml collection document
696 this.source = $('record', this.source);
698 } else if (this.source.match(/^\s*</)) { // this is xml text
699 this.source = $.parseXML( mxml ).find('record');
701 } else { // must be a marcbreaker doc. split on blank lines
702 this.source = this.source.split(/^$/);
703 this.type = 'marcbreaker';
707 this.fetchURL = function (u) {
709 $.get( u, function (mrc) {
715 this.next = function () {
716 var chunk = this.source[this.current_record++];
720 args[this.type] = chunk;
721 if (this.delimiter) args.delimiter = this.delimiter;
722 return new MARC21.Record(args);
730 this.source = kwargs.source;
731 this.delimiter = kwargs.delimiter
732 this.current_record = 0;
734 if (this.source) this.ready = true;
735 if (!this.ready && kwargs.url) this.fetchURL( kwargs.url );
737 if (this.ready) this.parse();
741 AuthorityControlSet : function (kwargs) {
743 kwargs = kwargs || {};
745 if (!MARC21.AuthorityControlSet._remote_loaded) {
747 // TODO -- push the raw tree into the oils cache for later reuse
749 // fetch everything up front...
750 this._preFetchWithFielder({
751 "acs": "_control_set_list",
752 "at": "_thesaurus_list",
753 "acsaf": "_authority_field_list",
754 "acsbf": "_bib_field_list",
755 "aba": "_browse_axis_list",
756 "abaafm": "_browse_field_map_list"
759 MARC21.AuthorityControlSet._remote_loaded = true;
762 if (MARC21.AuthorityControlSet._remote_loaded && !MARC21.AuthorityControlSet._remote_parsed) {
764 MARC21.AuthorityControlSet._browse_axis_by_code = {};
765 MARC21.AuthorityControlSet._browse_axis_list.forEach(function (ba) {
767 MARC21.AuthorityControlSet._browse_field_map_list.filter(
768 function (m) { return m.axis() == ba.code() }
771 MARC21.AuthorityControlSet._browse_axis_by_code[ba.code()] = ba;
774 // loop over each acs
775 MARC21.AuthorityControlSet._control_set_list.forEach(function (cs) {
776 MARC21.AuthorityControlSet._controlsets[''+cs.id()] = {
779 description : cs.description(),
780 authority_tag_map : {},
786 // grab the authority fields
787 var acsaf_list = MARC21.AuthorityControlSet._authority_field_list.filter(
788 function (af) { return af.control_set() == cs.id() }
791 var at_list = MARC21.AuthorityControlSet._thesaurus_list.filter(
792 function (at) { return at.control_set() == cs.id() }
795 MARC21.AuthorityControlSet._controlsets[''+cs.id()].raw.authority_fields( acsaf_list );
796 MARC21.AuthorityControlSet._controlsets[''+cs.id()].raw.thesauri( at_list );
798 // and loop over each
799 acsaf_list.forEach(function (csaf) {
802 // link the main entry if we're subordinate
803 if (csaf.main_entry()) {
805 acsaf_list.filter(function (x) {
806 return x.id() == csaf.main_entry();
811 // link the sub entries if we're main
813 acsaf_list.filter(function (x) {
814 return x.main_entry() == csaf.id();
819 var acsbf_list = MARC21.AuthorityControlSet._bib_field_list.filter(
820 function (b) { return b.authority_field() == csaf.id() }
822 csaf.bib_fields( acsbf_list );
824 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields = [].concat(
825 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields,
829 acsbf_list.forEach(function (csbf) {
830 // link the authority field to the bib field
831 if (csbf.authority_field()) {
832 csbf.authority_field(
833 acsaf_list.filter(function (x) {
834 return x.id() == csbf.authority_field();
841 MARC21.AuthorityControlSet._browse_axis_list.forEach(
844 function (m) { return m.field() == csaf.id() }
846 function (fm) { fm.field( csaf ); csaf.axis_maps().push( fm ) } // and set the field
853 // build the authority_tag_map
854 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields.forEach(function (bf) {
856 if (!MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()])
857 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()] = {};
859 bf.authority_field().sf_list().split('').forEach(function (sf_code) {
861 if (!MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code])
862 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code] = {};
864 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code][bf.authority_field().tag()] = sf_code;
870 if (this.controlSetList().length > 0)
871 delete MARC21.AuthorityControlSet._controlsets['-1'];
873 MARC21.AuthorityControlSet._remote_parsed = true;
876 this._preFetchWithFielder = function(cmap) {
877 for (var hint in cmap) {
878 var cache_key = cmap[hint];
879 var method = "open-ils.fielder." + hint + ".atomic";
880 var pkey = fieldmapper.IDL.fmclasses[hint].pkey;
883 query[pkey] = {"!=": null};
885 MARC21.AuthorityControlSet[cache_key] = dojo.map(
886 fieldmapper.standardRequest(
887 ["open-ils.fielder", method],
888 [{"cache": 1, "query" : query}]
890 function(h) { return new fieldmapper[hint]().fromHash(h); }
895 this.controlSetId = function (x) {
896 if (x) this._controlset = ''+x;
897 return this._controlset;
900 this.controlSet = function (x) {
901 return MARC21.AuthorityControlSet._controlsets[''+this.controlSetId(x)];
904 this.controlSetByThesaurusCode = function (x) {
905 var thes = MARC21.AuthorityControlSet._thesaurus_list.filter(
906 function (at) { return at.code() == x }
909 return this.controlSet(thes.control_set());
912 this.browseAxisByCode = function(code) {
913 return MARC21.AuthorityControlSet._browse_axis_by_code[code];
916 this.bibFieldByTag = function (x) {
918 return me.controlSet().bib_fields.filter(
919 function (bf) { if (bf.tag() == x) return true }
923 this.bibFields = function (x) {
924 return this.controlSet(x).bib_fields;
927 this.bibFieldBrowseAxes = function (t) {
929 for (var bcode in MARC21.AuthorityControlSet._browse_axis_by_code) {
930 MARC21.AuthorityControlSet._browse_axis_by_code[bcode].maps().forEach(
932 if (m.field().bib_fields().filter(
933 function (b) { return b.tag() == t }
942 this.authorityFields = function (x) {
943 return this.controlSet(x).raw.authority_fields();
946 this.thesauri = function (x) {
947 return this.controlSet(x).raw.thesauri();
950 this.controlSetList = function () {
952 for (var i in MARC21.AuthorityControlSet._controlsets) {
958 this.findControlSetsForTag = function (tag) {
960 var old_acs = this.controlSetId();
961 var acs_list = me.controlSetList().filter(
962 function(acs_id) { return (me.controlSet(acs_id).control_map[tag]) }
964 this.controlSetId(old_acs);
968 this.findControlSetsForAuthorityTag = function (tag) {
970 var old_acs = this.controlSetId();
972 var acs_list = me.controlSetList().filter(
974 var a = me.controlSet(acs_id);
975 for (var btag in a.control_map) {
976 for (var sf in a.control_map[btag]) {
977 if (a.control_map[btag][sf][tag]) return true;
983 this.controlSetId(old_acs);
987 this.bibToAuthority = function (field) {
988 var b_field = this.bibFieldByTag(field.tag);
990 if (b_field) { // construct an marc authority record
991 var af = b_field.authority_field();
994 for (var i = 0; i < field.subfields.length; i++) {
995 if (af.sf_list().indexOf(field.subfields[i][0]) > -1) {
996 sflist.push(field.subfields[i]);
1000 var m = new MARC21.Record ({rtype:'AUT'});
1010 return m.toXmlString();
1016 this.bibToAuthorities = function (field) {
1020 var old_acs = this.controlSetId();
1021 me.controlSetList().forEach(
1023 var acs = me.controlSet(acs_id);
1024 var x = me.bibToAuthority(field);
1025 if (x) { var foo = {}; foo[acs_id] = x; auth_list.push(foo); }
1028 this.controlSetId(old_acs);
1033 // This should not be used in an angular world. Instead, the call
1034 // to open-ils.search.authority.simple_heading.from_xml.batch.atomic should
1035 // be performed by the code that wants to find matching authorities.
1036 this.findMatchingAuthorities = function (field) {
1037 return fieldmapper.standardRequest(
1038 [ 'open-ils.search', 'open-ils.search.authority.simple_heading.from_xml.batch.atomic' ],
1039 this.bibToAuthorities(field)
1043 if (kwargs.controlSet) {
1044 this.controlSetId( kwargs.controlSet );
1046 this.controlSetId( this.controlSetList().sort(function(a,b){return (a - b)}) );
1052 MARC21.Record._recType = {
1053 BKS : { Type : /[at]{1}/, BLvl : /[acdm]{1}/ },
1054 SER : { Type : /[a]{1}/, BLvl : /[bsi]{1}/ },
1055 VIS : { Type : /[gkro]{1}/, BLvl : /[abcdmsi]{1}/ },
1056 MIX : { Type : /[p]{1}/, BLvl : /[cdi]{1}/ },
1057 MAP : { Type : /[ef]{1}/, BLvl : /[abcdmsi]{1}/ },
1058 SCO : { Type : /[cd]{1}/, BLvl : /[abcdmsi]{1}/ },
1059 REC : { Type : /[ij]{1}/, BLvl : /[abcdmsi]{1}/ },
1060 COM : { Type : /[m]{1}/, BLvl : /[abcdmsi]{1}/ },
1061 AUT : { Type : /[z]{1}/, BLvl : /.{1}/ },
1062 MFHD : { Type : /[uvxy]{1}/, BLvl : /.{1}/ }
1065 MARC21.Record._ff_pos = {
1068 SCO : {start: 24, len : 6, def : ' ' },
1069 REC : {start: 24, len : 6, def : ' ' }
1072 SCO : {start: 7, len : 6, def : ' ' },
1073 REC : {start: 7, len : 6, def : ' ' }
1078 SER : {start : 33, len : 1, def : ' ' }
1081 SER : {start : 16, len : 1, def : ' ' }
1086 BKS : {start : 22, len : 1, def : ' ' },
1087 SER : {start : 22, len : 1, def : ' ' },
1088 VIS : {start : 22, len : 1, def : ' ' },
1089 SCO : {start : 22, len : 1, def : ' ' },
1090 REC : {start : 22, len : 1, def : ' ' },
1091 COM : {start : 22, len : 1, def : ' ' }
1094 BKS : {start : 5, len : 1, def : ' ' },
1095 SER : {start : 5, len : 1, def : ' ' },
1096 VIS : {start : 5, len : 1, def : ' ' },
1097 SCO : {start : 5, len : 1, def : ' ' },
1098 REC : {start : 5, len : 1, def : ' ' },
1099 COM : {start : 5, len : 1, def : ' ' }
1104 BKS : {start : 34, len : 1, def : ' ' }
1107 BKS : {start : 17, len : 1, def : ' ' }
1112 BKS : {start : 7, len : 1, def : 'm' },
1113 SER : {start : 7, len : 1, def : 's' },
1114 VIS : {start : 7, len : 1, def : 'm' },
1115 MIX : {start : 7, len : 1, def : 'c' },
1116 MAP : {start : 7, len : 1, def : 'm' },
1117 SCO : {start : 7, len : 1, def : 'm' },
1118 REC : {start : 7, len : 1, def : 'm' },
1119 COM : {start : 7, len : 1, def : 'm' }
1124 SCO : {start : 18, len : 2, def : 'uu'},
1125 REC : {start : 18, len : 2, def : 'uu'}
1128 SCO : {start : 1, len : 2, def : 'uu'},
1129 REC : {start : 1, len : 2, def : 'uu'}
1134 BKS : {start : 29, len : 1, def : '0' },
1135 SER : {start : 29, len : 1, def : '0' }
1138 BKS : {start : 11, len : 1, def : '0' },
1139 SER : {start : 11, len : 1, def : '0' }
1144 BKS : {start : 24, len : 4, def : ' ' },
1145 SER : {start : 25, len : 3, def : ' ' }
1148 BKS : {start : 7, len : 4, def : ' ' },
1149 SER : {start : 8, len : 3, def : ' ' }
1154 MAP : {start: 25, len : 1, def : 'a' }
1157 MAP : {start : 8, len : 1, def : 'a' }
1162 BKS : {start : 8, len : 1, def : ' ' },
1163 SER : {start : 8, len : 1, def : ' ' },
1164 VIS : {start : 8, len : 1, def : ' ' },
1165 MIX : {start : 8, len : 1, def : ' ' },
1166 MAP : {start : 8, len : 1, def : ' ' },
1167 SCO : {start : 8, len : 1, def : ' ' },
1168 REC : {start : 8, len : 1, def : ' ' },
1169 COM : {start : 8, len : 1, def : ' ' }
1174 BKS : {start : 15, len : 3, def : ' ' },
1175 SER : {start : 15, len : 3, def : ' ' },
1176 VIS : {start : 15, len : 3, def : ' ' },
1177 MIX : {start : 15, len : 3, def : ' ' },
1178 MAP : {start : 15, len : 3, def : ' ' },
1179 SCO : {start : 15, len : 3, def : ' ' },
1180 REC : {start : 15, len : 3, def : ' ' },
1181 COM : {start : 15, len : 3, def : ' ' }
1186 BKS : {start : 7, len : 4, def : ' ' },
1187 SER : {start : 7, len : 4, def : ' ' },
1188 VIS : {start : 7, len : 4, def : ' ' },
1189 MIX : {start : 7, len : 4, def : ' ' },
1190 MAP : {start : 7, len : 4, def : ' ' },
1191 SCO : {start : 7, len : 4, def : ' ' },
1192 REC : {start : 7, len : 4, def : ' ' },
1193 COM : {start : 7, len : 4, def : ' ' }
1198 BKS : {start : 11, len : 4, def : ' ' },
1199 SER : {start : 11, len : 4, def : '9' },
1200 VIS : {start : 11, len : 4, def : ' ' },
1201 MIX : {start : 11, len : 4, def : ' ' },
1202 MAP : {start : 11, len : 4, def : ' ' },
1203 SCO : {start : 11, len : 4, def : ' ' },
1204 REC : {start : 11, len : 4, def : ' ' },
1205 COM : {start : 11, len : 4, def : ' ' }
1210 BKS : {start : 18, len : 1, def : ' ' },
1211 SER : {start : 18, len : 1, def : ' ' },
1212 VIS : {start : 18, len : 1, def : ' ' },
1213 MIX : {start : 18, len : 1, def : ' ' },
1214 MAP : {start : 18, len : 1, def : ' ' },
1215 SCO : {start : 18, len : 1, def : ' ' },
1216 REC : {start : 18, len : 1, def : ' ' },
1217 COM : {start : 18, len : 1, def : ' ' }
1222 BKS : {start : 6, len : 1, def : ' ' },
1223 SER : {start : 6, len : 1, def : 'c' },
1224 VIS : {start : 6, len : 1, def : ' ' },
1225 MIX : {start : 6, len : 1, def : ' ' },
1226 MAP : {start : 6, len : 1, def : ' ' },
1227 SCO : {start : 6, len : 1, def : ' ' },
1228 REC : {start : 6, len : 1, def : ' ' },
1229 COM : {start : 6, len : 1, def : ' ' }
1234 BKS : {start : 17, len : 1, def : ' ' },
1235 SER : {start : 17, len : 1, def : ' ' },
1236 VIS : {start : 17, len : 1, def : ' ' },
1237 MIX : {start : 17, len : 1, def : ' ' },
1238 MAP : {start : 17, len : 1, def : ' ' },
1239 SCO : {start : 17, len : 1, def : ' ' },
1240 REC : {start : 17, len : 1, def : ' ' },
1241 COM : {start : 17, len : 1, def : ' ' },
1242 AUT : {start : 17, len : 1, def : 'n' },
1243 MFHD : {start : 17, len : 1, def : 'u' }
1248 SER : {start : 24, len : 1, def : ' '}
1251 SER : {start : 7, len : 1, def : ' '}
1256 BKS : {start : 30, len : 1, def : '0' }
1259 BKS : {start : 13, len : 1, def : '0' }
1264 COM : {start: 26, len : 1, def : 'u' }
1267 COM : {start: 9, len : 1, def : 'u' }
1272 SCO : {start : 20, len : 1, def : 'u'},
1273 REC : {start : 20, len : 1, def : 'n'}
1276 SCO : {start : 3, len : 1, def : 'u'},
1277 REC : {start : 3, len : 1, def : 'n'}
1282 BKS : {start : 23, len : 1, def : ' ' },
1283 SER : {start : 23, len : 1, def : ' ' },
1284 VIS : {start : 29, len : 1, def : ' ' },
1285 MIX : {start : 23, len : 1, def : ' ' },
1286 MAP : {start : 29, len : 1, def : ' ' },
1287 SCO : {start : 23, len : 1, def : ' ' },
1288 REC : {start : 23, len : 1, def : ' ' }
1291 BKS : {start : 6, len : 1, def : ' ' },
1292 SER : {start : 6, len : 1, def : ' ' },
1293 VIS : {start : 12, len : 1, def : ' ' },
1294 MIX : {start : 6, len : 1, def : ' ' },
1295 MAP : {start : 12, len : 1, def : ' ' },
1296 SCO : {start : 6, len : 1, def : ' ' },
1297 REC : {start : 6, len : 1, def : ' ' }
1302 SER : {start : 18, len : 1, def : ' '}
1305 SER : {start : 1, len : 1, def : ' '}
1310 BKS : {start : 28, len : 1, def : ' ' },
1311 SER : {start : 28, len : 1, def : ' ' },
1312 VIS : {start : 28, len : 1, def : ' ' },
1313 MAP : {start : 28, len : 1, def : ' ' },
1314 COM : {start : 28, len : 1, def : ' ' }
1317 BKS : {start : 11, len : 1, def : ' ' },
1318 SER : {start : 11, len : 1, def : ' ' },
1319 VIS : {start : 11, len : 1, def : ' ' },
1320 MAP : {start : 11, len : 1, def : ' ' },
1321 COM : {start : 11, len : 1, def : ' ' }
1326 BKS : {start : 18, len : 4, def : ' ' }
1329 BKS : {start : 1, len : 4, def : ' ' }
1334 BKS : {start : 31, len : 1, def : '0' },
1335 MAP : {start : 31, len : 1, def : '0' }
1338 BKS : {start : 14, len : 1, def : '0' },
1339 MAP : {start : 14, len : 1, def : '0' }
1344 MFHD : {start : 18, len : 1, def : 'i' }
1349 BKS : {start : 35, len : 3, def : ' ' },
1350 SER : {start : 35, len : 3, def : ' ' },
1351 VIS : {start : 35, len : 3, def : ' ' },
1352 MIX : {start : 35, len : 3, def : ' ' },
1353 MAP : {start : 35, len : 3, def : ' ' },
1354 SCO : {start : 35, len : 3, def : ' ' },
1355 REC : {start : 35, len : 3, def : ' ' },
1356 COM : {start : 35, len : 3, def : ' ' }
1361 BKS : {start : 33, len : 1, def : '0' }
1364 BKS : {start : 16, len : 1, def : '0' }
1369 SCO : {start : 30, len : 2, def : 'n'},
1370 REC : {start : 30, len : 2, def : ' '}
1373 SCO : {start : 13, len : 2, def : 'n'},
1374 REC : {start : 13, len : 2, def : ' '}
1379 BKS : {start : 38, len : 1, def : ' ' },
1380 SER : {start : 38, len : 1, def : ' ' },
1381 VIS : {start : 38, len : 1, def : ' ' },
1382 MIX : {start : 38, len : 1, def : ' ' },
1383 MAP : {start : 38, len : 1, def : ' ' },
1384 SCO : {start : 38, len : 1, def : ' ' },
1385 REC : {start : 38, len : 1, def : ' ' },
1386 COM : {start : 38, len : 1, def : ' ' }
1391 SER : {start : 22, len : 1, def : ' '}
1394 SER : {start: 5, len : 1, def: ' '}
1399 SCO : {start : 21, len : 1, def : ' '},
1400 REC : {start : 21, len : 1, def : 'n'}
1403 SCO : {start : 4, len : 1, def : ' '},
1404 REC : {start : 4, len : 1, def : 'n'}
1409 MAP : {start : 22, len : 2, def : ' ' }
1412 MAP: {start : 5, len : 2, def : ' ' }
1417 BKS : {start : 5, len : 1, def : 'n' },
1418 SER : {start : 5, len : 1, def : 'n' },
1419 VIS : {start : 5, len : 1, def : 'n' },
1420 MIX : {start : 5, len : 1, def : 'n' },
1421 MAP : {start : 5, len : 1, def : 'n' },
1422 SCO : {start : 5, len : 1, def : 'n' },
1423 REC : {start : 5, len : 1, def : 'n' },
1424 COM : {start : 5, len : 1, def : 'n' },
1425 MFHD: {start : 5, len : 1, def : 'n' },
1426 AUT : {start : 5, len : 1, def : 'n' }
1431 SER : {start : 19, len : 1, def : ' '}
1434 SER : {start : 2, len : 1, def : ' '}
1439 MAP : {start: 18, len : 4, def : ' '}
1442 MAP : {start: 1, len : 4, def : ' '}
1447 SER : {start : 34, len : 1, def : '0' }
1450 SER : {start : 17, len : 1, def : '0' }
1455 MAP : {start: 33, len : 2, def : ' ' }
1458 MAP : {start: 16, len : 2, def : ' '}
1463 BKS : {start : 39, len : 1, def : 'd' },
1464 SER : {start : 39, len : 1, def : 'd' },
1465 VIS : {start : 39, len : 1, def : 'd' },
1466 SCO : {start : 39, len : 1, def : 'd' },
1467 REC : {start : 39, len : 1, def : 'd' },
1468 COM : {start : 39, len : 1, def : 'd' },
1469 MFHD : {start : 39, len : 1, def : 'd' },
1470 "AUT" : {"start" : 39, "len" : 1, "def" : 'd' }
1475 SER : {start : 21, len : 1, def : ' '}
1478 SER : {start : 4, len : 1, def : ' '}
1483 VIS : {start : 34, len : 1, def : ' '}
1486 VIS : {start : 17, len : 1, def : ' '}
1491 VIS : {start : 18, len : 3, def : ' '}
1494 VIS : {start : 1, len : 3, def : ' '}
1499 VIS : {start : 33, len : 1, def : ' ' }
1502 VIS : {start : 16, len : 1, def : ' ' }
1507 SCO : {start : 33, len : 1, def : ' ' },
1508 REC : {start : 33, len : 1, def : 'n' }
1511 SCO : {start : 16, len : 1, def : ' ' },
1512 REC : {start : 16, len : 1, def : 'n' }
1517 BKS : {start : 6, len : 1, def : 'a' },
1518 SER : {start : 6, len : 1, def : 'a' },
1519 VIS : {start : 6, len : 1, def : 'g' },
1520 MIX : {start : 6, len : 1, def : 'p' },
1521 MAP : {start : 6, len : 1, def : 'e' },
1522 SCO : {start : 6, len : 1, def : 'c' },
1523 REC : {start : 6, len : 1, def : 'i' },
1524 COM : {start : 6, len : 1, def : 'm' },
1525 AUT : {start : 6, len : 1, def : 'z' },
1526 MFHD : {start : 6, len : 1, def : 'y' }
1531 "AUT" : {"start" : 6, "len" : 1, "def" : ' ' }
1536 "AUT" : {"start" : 7, "len" : 1, "def" : ' ' }
1541 "AUT" : {"start" : 8, "len" : 1, "def" : ' ' }
1546 "AUT" : {"start" : 9, "len" : 1, "def" : ' ' }
1551 "AUT" : {"start" : 10, "len" : 1, "def" : ' ' }
1556 "AUT" : {"start" : 11, "len" : 1, "def" : ' ' }
1561 "AUT" : {"start" : 12, "len" : 1, "def" : ' ' }
1566 "AUT" : {"start" : 13, "len" : 1, "def" : ' ' }
1571 "AUT" : {"start" : 14, "len" : 1, "def" : ' ' }
1576 "AUT" : {"start" : 15, "len" : 1, "def" : ' ' }
1581 "AUT" : {"start" : 16, "len" : 1, "def" : ' ' }
1586 "AUT" : {"start" : 17, "len" : 1, "def" : ' ' }
1591 "AUT" : {"start" : 28, "len" : 1, "def" : ' ' }
1596 "AUT" : {"start" : 29, "len" : 1, "def" : ' ' }
1601 "AUT" : {"start" : 31, "len" : 1, "def" : ' ' }
1606 "AUT" : {"start" : 32, "len" : 1, "def" : ' ' }
1611 "AUT" : {"start" : 33, "len" : 1, "def" : ' ' }
1616 "AUT" : {"start" : 38, "len" : 1, "def" : ' ' }
1621 "AUT" : {"start" : 39, "len" : 1, "def" : ' ' }
1626 MARC21.Record._physical_characteristics = {
1628 label : "Electronic Resource",
1633 values: { a : "Tape Cartridge",
1634 b : "Chip cartridge",
1635 c : "Computer optical disk cartridge",
1636 f : "Tape cassette",
1638 j : "Magnetic disk",
1639 m : "Magneto-optical disk",
1649 values: { a : "One color",
1650 b : "Black-and-white",
1654 n : "Not applicable",
1661 label : "Dimensions",
1662 values: { a : "3 1/2 in.",
1664 g : "4 3/4 in. or 12 cm.",
1665 i : "1 1/8 x 2 3/8 in.",
1666 j : "3 7/8 x 2 1/2 in.",
1667 n : "Not applicable",
1677 values: { ' ' : "No sound (Silent)",
1684 label : "Image bit depth",
1685 values: { mmm : "Multiple",
1686 nnn : "Not applicable",
1692 label : "File formats",
1693 values: { a : "One file format",
1694 m : "Multiple file formats",
1700 label : "Quality assurance target(s)",
1701 values: { a : "Absent",
1702 n : "Not applicable",
1709 label : "Antecedent/Source",
1710 values: { a : "File reproduced from original",
1711 b : "File reproduced from microform",
1712 c : "File reproduced from electronic resource",
1713 d : "File reproduced from an intermediate (not microform)",
1715 n : "Not applicable",
1721 label : "Level of compression",
1722 values: { a : "Uncompressed",
1731 label : "Reformatting quality",
1732 values: { a : "Access",
1733 n : "Not applicable",
1747 values: { a : "Celestial globe",
1748 b : "Planetary or lunar globe",
1749 c : "Terrestrial globe",
1750 e : "Earth moon globe",
1758 values: { a : "One color",
1764 label : "Physical medium",
1765 values: { a : "Paper",
1779 label : "Type of reproduction",
1780 values: { f : "Facsimile",
1781 n : "Not applicable",
1794 values: { d : "Atlas",
1799 r : "Remote-sensing image",
1809 values: { a : "One color",
1815 label : "Physical medium",
1816 values: { a : "Paper",
1824 q : "Flexible base photographic medium, positive",
1825 r : "Flexible base photographic medium, negative",
1826 s : "Non-flexible base photographic medium, positive",
1827 t : "Non-flexible base photographic medium, negative",
1829 y : "Other photographic medium",
1835 label : "Type of reproduction",
1836 values: { f : "Facsimile",
1837 n : "Not applicable",
1844 label : "Production/reproduction details",
1845 values: { a : "Photocopy, blueline print",
1847 c : "Pre-production",
1855 label : "Positive/negative",
1856 values: { a : "Positive",
1859 n : "Not applicable"
1865 label : "Microform",
1870 values: { a : "Aperture card",
1871 b : "Microfilm cartridge",
1872 c : "Microfilm cassette",
1873 d : "Microfilm reel",
1875 f : "Microfiche cassette",
1883 label : "Positive/negative",
1884 values: { a : "Positive",
1892 label : "Dimensions",
1893 values: { a : "8 mm.",
1898 l : "3 x 5 in. (8 x 13 cm.)",
1899 m : "4 x 6 in. (11 x 15 cm.)",
1900 o : "6 x 9 in. (16 x 23 cm.)",
1901 p : "3 1/4 x 7 3/8 in. (9 x 19 cm.)",
1908 label : "Reduction ratio range/Reduction ratio",
1909 values: { a : "Low (1-16x)",
1910 b : "Normal (16-30x)",
1911 c : "High (31-60x)",
1912 d : "Very high (61-90x)",
1915 v : "Reduction ratio varies"
1921 values: { b : "Black-and-white",
1930 label : "Emulsion on film",
1931 values: { a : "Silver halide",
1935 n : "Not applicable",
1942 label : "Quality assurance target(s)",
1943 values: { a : "1st gen. master",
1944 b : "Printing master",
1946 m : "Mixed generation",
1952 label : "Base of film",
1953 values: { a : "Safety base, undetermined",
1954 c : "Safety base, acetate undetermined",
1955 d : "Safety base, diacetate",
1958 n : "Not applicable",
1959 p : "Safety base, polyester",
1960 r : "Safety base, mixed",
1961 t : "Safety base, triacetate",
1969 label : "Motion Picture",
1974 values: { a : "Film cartridge",
1975 f : "Film cassette",
1984 values: { b : "Black-and-white",
1994 label : "Motion picture presentation format",
1995 values: { a : "Standard sound aperture, reduced frame",
1996 b : "Nonanamorphic (wide-screen)",
1998 d : "Anamorphic (wide-screen)",
1999 e : "Other-wide screen format",
2000 f : "Standard. silent aperture, full frame",
2007 label : "Sound on medium or separate",
2008 values: { a : "Sound on medium",
2009 b : "Sound separate from medium",
2015 label : "Medium for sound",
2016 values: { a : "Optical sound track on motion picture film",
2017 b : "Magnetic sound track on motion picture film",
2018 c : "Magnetic audio tape in cartridge",
2020 e : "Magnetic audio tape on reel",
2021 f : "Magnetic audio tape in cassette",
2022 g : "Optical and magnetic sound track on film",
2031 label : "Dimensions",
2032 values: { a : "Standard 8 mm.",
2033 b : "Super 8 mm./single 8 mm.",
2045 label : "Configuration of playback channels",
2046 values: { k : "Mixed",
2048 n : "Not applicable",
2049 q : "Multichannel, surround or quadraphonic",
2057 label : "Production elements",
2058 values: { a : "Work print",
2062 e : "Mixing tracks",
2063 f : "Title bands/inter-title rolls",
2064 g : "Production rolls",
2065 n : "Not applicable",
2072 label : "Non-projected Graphic",
2077 values: { c : "Collage",
2080 f : "Photo-mechanical print",
2081 g : "Photonegative",
2085 l : "Technical drawing",
2087 o : "Flash/activity card",
2095 values: { a : "One color",
2096 b : "Black-and-white",
2106 label : "Primary support material",
2107 values: { a : "Canvas",
2108 b : "Bristol board",
2109 c : "Cardboard/illustration board",
2115 m : "Mixed collection",
2128 label : "Secondary support material",
2129 values: { a : "Canvas",
2130 b : "Bristol board",
2131 c : "Cardboard/illustration board",
2137 m : "Mixed collection",
2151 label : "Projected Graphic",
2156 values: { c : "Film cartridge",
2158 f : "Film filmstrip type",
2159 o : "Filmstrip roll",
2168 values: { b : "Black-and-white",
2172 n : "Not applicable",
2179 label : "Base of emulsion",
2180 values: { d : "Glass",
2183 k : "Film base, other than safety film",
2184 m : "Mixed collection",
2192 label : "Sound on medium or separate",
2193 values: { a : "Sound on medium",
2194 b : "Sound separate from medium",
2200 label : "Medium for sound",
2201 values: { a : "Optical sound track on motion picture film",
2202 b : "Magnetic sound track on motion picture film",
2203 c : "Magnetic audio tape in cartridge",
2205 e : "Magnetic audio tape on reel",
2206 f : "Magnetic audio tape in cassette",
2207 g : "Optical and magnetic sound track on film",
2216 label : "Dimensions",
2217 values: { a : "Standard 8 mm.",
2218 b : "Super 8 mm./single 8 mm.",
2224 j : "2 x 2 in. (5 x 5 cm.)",
2225 k : "2 1/4 x 2 1/4 in. (6 x 6 cm.)",
2226 s : "4 x 5 in. (10 x 13 cm.)",
2227 t : "5 x 7 in. (13 x 18 cm.)",
2228 v : "8 x 10 in. (21 x 26 cm.)",
2229 w : "9 x 9 in. (23 x 23 cm.)",
2230 x : "10 x 10 in. (26 x 26 cm.)",
2231 y : "7 x 7 in. (18 x 18 cm.)",
2238 label : "Secondary support material",
2239 values: { c : "Cardboard",
2243 j : "Metal and glass",
2244 k : "Synthetics and glass",
2245 m : "Mixed collection",
2253 label : "Remote-sensing Image",
2258 values: { u : "Unspecified" }
2262 label : "Altitude of sensor",
2263 values: { a : "Surface",
2266 n : "Not applicable",
2273 label : "Attitude of sensor",
2274 values: { a : "Low oblique",
2277 n : "Not applicable",
2283 label : "Cloud cover",
2284 values: { 0 : "0-09%",
2294 n : "Not applicable",
2300 label : "Platform construction type",
2301 values: { a : "Balloon",
2302 b : "Aircraft-low altitude",
2303 c : "Aircraft-medium altitude",
2304 d : "Aircraft-high altitude",
2305 e : "Manned spacecraft",
2306 f : "Unmanned spacecraft",
2307 g : "Land-based remote-sensing device",
2308 h : "Water surface-based remote-sensing device",
2309 i : "Submersible remote-sensing device",
2310 n : "Not applicable",
2317 label : "Platform use category",
2318 values: { a : "Meteorological",
2319 b : "Surface observing",
2320 c : "Space observing",
2322 n : "Not applicable",
2329 label : "Sensor type",
2330 values: { a : "Active",
2338 label : "Data type",
2339 values: { nn : "Not applicable",
2342 aa : "Visible light",
2343 da : "Near infrared",
2344 db : "Middle infrared",
2345 dc : "Far infrared",
2346 dd : "Thermal infrared",
2347 de : "Shortwave infrared (SWIR)",
2348 df : "Reflective infrared",
2349 dv : "Combinations",
2350 dz : "Other infrared data",
2351 ga : "Sidelooking airborne radar (SLAR)",
2352 gb : "Synthetic aperture radar (SAR-single frequency)",
2353 gc : "SAR-multi-frequency (multichannel)",
2354 gd : "SAR-like polarization",
2355 ge : "SAR-cross polarization",
2356 gf : "Infometric SAR",
2357 gg : "Polarmetric SAR",
2358 gu : "Passive microwave mapping",
2359 gz : "Other microwave data",
2360 ja : "Far ultraviolet",
2361 jb : "Middle ultraviolet",
2362 jc : "Near ultraviolet",
2363 jv : "Ultraviolet combinations",
2364 jz : "Other ultraviolet data",
2365 ma : "Multi-spectral, multidata",
2366 mb : "Multi-temporal",
2367 mm : "Combination of various data types",
2368 pa : "Sonar-water depth",
2369 pb : "Sonar-bottom topography images, sidescan",
2370 pc : "Sonar-bottom topography, near-surface",
2371 pd : "Sonar-bottom topography, near-bottom",
2372 pe : "Seismic surveys",
2373 pz : "Other acoustical data",
2374 ra : "Gravity anomales (general)",
2378 sa : "Magnetic field",
2379 ta : "Radiometric surveys"
2385 label : "Sound Recording",
2390 values: { d : "Sound disc",
2392 g : "Sound cartridge",
2393 i : "Sound-track film",
2395 s : "Sound cassette",
2396 t : "Sound-tape reel",
2398 w : "Wire recording",
2405 values: { a : "16 rpm",
2425 label : "Configuration of playback channels",
2426 values: { m : "Monaural",
2435 label : "Groove width or pitch",
2436 values: { m : "Microgroove/fine",
2437 n : "Not applicable",
2438 s : "Coarse/standard",
2445 label : "Dimensions",
2446 values: { a : "3 in.",
2452 g : "4 3/4 in. (12 cm.)",
2453 j : "3 7/8 x 2 1/2 in.",
2454 o : "5 1/4 x 3 7/8 in.",
2455 s : "2 3/4 x 4 in.",
2456 n : "Not applicable",
2463 label : "Tape width",
2464 values: { l : "1/8 in.",
2466 n : "Not applicable",
2475 label : "Tape configuration ",
2476 values: { a : "Full (1) track",
2477 b : "Half (2) track",
2478 c : "Quarter (4) track",
2482 n : "Not applicable",
2489 label : "Special playback",
2490 values: { a : "NAB standard",
2491 b : "CCIR standard",
2492 c : "Dolby-B encoded, standard Dolby",
2494 e : "Digital recording",
2495 f : "Dolby-A encoded",
2496 g : "Dolby-C encoded",
2498 n : "Not applicable",
2505 label : "Capture and storage",
2506 values: { a : "Acoustical capture, direct storage",
2507 b : "Direct storage, not acoustical",
2508 d : "Digital storage",
2509 e : "Analog electrical storage",
2517 label : "Tactile Material",
2522 values: { a : "Moon",
2525 d : "Tactile, with no writing system",
2532 label : "Class of braille writing",
2533 values: { a : "Literary braille",
2534 b : "Format code braille",
2535 c : "Mathematics and scientific braille",
2536 d : "Computer braille",
2537 e : "Music braille",
2538 m : "Multiple braille types",
2539 n : "Not applicable",
2546 label : "Level of contraction",
2547 values: { a : "Uncontracted",
2550 n : "Not applicable",
2557 label : "Braille music format",
2558 values: { a : "Bar over bar",
2560 c : "Line over line",
2563 f : "Section by section",
2566 i : "Spanner short form scoring",
2567 j : "Short form scoring",
2569 l : "Vertical score",
2570 n : "Not applicable",
2577 label : "Special physical characteristics",
2578 values: { a : "Print/braille",
2579 b : "Jumbo or enlarged braille",
2580 n : "Not applicable",
2588 label : "Videorecording",
2593 values: { c : "Videocartridge",
2595 f : "Videocassette",
2604 values: { b : "Black-and-white",
2607 n : "Not applicable",
2614 label : "Videorecording format",
2615 values: { a : "Beta",
2637 label : "Sound on medium or separate",
2638 values: { a : "Sound on medium",
2639 b : "Sound separate from medium",
2645 label : "Medium for sound",
2646 values: { a : "Optical sound track on motion picture film",
2647 b : "Magnetic sound track on motion picture film",
2648 c : "Magnetic audio tape in cartridge",
2650 e : "Magnetic audio tape on reel",
2651 f : "Magnetic audio tape in cassette",
2652 g : "Optical and magnetic sound track on motion picture film",
2661 label : "Dimensions",
2662 values: { a : "8 mm.",
2674 label : "Configuration of playback channel",
2675 values: { k : "Mixed",
2677 n : "Not applicable",
2678 q : "Multichannel, surround or quadraphonic",
2688 MARC21.AuthorityControlSet._remote_loaded = false;
2689 MARC21.AuthorityControlSet._remote_parsed = false;
2691 MARC21.AuthorityControlSet._controlsets = {
2692 // static sorta-LoC setup ... to be overwritten with server data
2695 name : 'Static LoC legacy mapping',
2696 description : 'Legacy mapping provided as a default',
2699 'a' : { 100 : 'a' },
2700 'd' : { 100 : 'd' },
2701 'e' : { 100 : 'e' },
2705 'a' : { 110 : 'a' },
2709 'a' : { 111 : 'a' },
2713 'a' : { 130 : 'a' },
2717 'a' : { 130 : 'a' },
2721 'a' : { 100 : 'a' },
2725 'a' : { 110 : 'a' },
2729 'a' : { 111 : 'a' },
2733 'a' : { 130 : 'a' },
2734 'n' : { 130 : 'n' },
2738 'a' : { 100 : 'a' },
2739 'd' : { 100 : 'd' },
2740 'q' : { 100 : 'q' },
2744 'a' : { 110 : 'a' },
2748 'a' : { 111 : 'a' },
2749 'c' : { 111 : 'c' },
2753 'a' : { 130 : 'a' },
2757 'a' : { 100 : 'a' },
2761 'a' : { 110 : 'a' },
2765 'a' : { 111 : 'a' },
2769 'a' : { 130 : 'a' },
2773 'a' : { 100 : 'a' },
2774 'd' : { 100 : 'd' },
2775 'q' : { 100 : 'q' },
2776 't' : { 100 : 't' },
2803 'a' : { 110 : 'a' },
2804 'd' : { 110 : 'd' },
2805 't' : { 110 : 't' },
2832 'a' : { 111 : 'a' },
2833 'd' : { 111 : 'd' },
2834 't' : { 111 : 't' },
2861 'a' : { 130 : 'a' },
2865 'a' : { 148 : 'a' },
2866 'v' : { 148 : 'v' },
2867 'x' : { 148 : 'x' },
2868 'y' : { 148 : 'y' },
2872 'a' : { 150 : 'a' },
2873 'b' : { 150 : 'b' },
2900 'a' : { 151 : 'a' },
2927 'a' : { 155 : 'a' },