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 indicators 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 local_delimiter = me.delimiter;
312 if (data.indexOf('\u2021') > -1)
313 local_delimiter = '\u2021';
315 var sf_list = data.split(local_delimiter);
321 tag : line_tag(current_line),
322 ind1 : df_ind1(current_line),
323 ind2 : df_ind2(current_line),
324 subfields : sf_list.map( function (sf, i) {
325 var sf_data = sf.substring(1);
326 if (local_delimiter == '$') sf_data = sf_data.replace(/\{dollar\}/g, '$');
327 return [ sf.substring(0,1), sf_data, i ];
334 for (var j = 0; j < this.fields.length; j++) {
335 this.fields[j].position = j;
342 this.pruneEmptyFieldsAndSubfields = function() {
344 var fields_to_remove = [];
345 for (var i = 0; i < this.fields.length; i++) {
346 var f = this.fields[i];
347 if (f.isControlfield()) {
349 fields_to_remove.push(f);
352 f.pruneEmptySubfields();
353 if (f.isEmptyDatafield()) {
354 fields_to_remove.push(f);
358 fields_to_remove.forEach(function(f) {
363 this.toBreaker = function () {
366 var mtxt = '=LDR ' + this.leader + '\n';
368 mtxt += this.fields.map( function (f) {
369 if (f.isControlfield()) {
370 if (f.data) return '=' + f.tag + ' ' + f.data.replace(/ /g, '\\');
373 return '=' + f.tag + ' ' +
374 f.indicator(1).replace(' ','\\') +
375 f.indicator(2).replace(' ','\\') +
376 f.subfields.map( function (sf) {
378 if (me.delimiter == '$') sf_data = sf_data.replace(/\$/g, '{dollar}');
379 return me.delimiter + sf[0] + sf_data;
387 this.recordType = function () {
389 var _t = this.leader.substr(MARC21.Record._ff_pos.Type.ldr.BKS.start, MARC21.Record._ff_pos.Type.ldr.BKS.len);
390 var _b = this.leader.substr(MARC21.Record._ff_pos.BLvl.ldr.BKS.start, MARC21.Record._ff_pos.BLvl.ldr.BKS.len);
392 for (var t in MARC21.Record._recType) {
393 if (_t.match(MARC21.Record._recType[t].Type) && _b.match(MARC21.Record._recType[t].BLvl)) {
397 return 'BKS'; // default
400 this.videorecordingFormatName = function () {
401 var _7 = this.field('007').data;
403 if (_7 && _7.match(/^v/)) {
404 var _v_e = _7.substr(
405 MARC21.Record._physical_characteristics.v.subfields.e.start,
406 MARC21.Record._physical_characteristics.v.subfields.e.len
409 return MARC21.Record._physical_characteristics.v.subfields.e.values[ _v_e ];
415 this.videorecordingFormatCode = function () {
416 var _7 = this.field('007').data;
418 if (_7 && _7.match(/^v/)) {
420 MARC21.Record._physical_characteristics.v.subfields.e.start,
421 MARC21.Record._physical_characteristics.v.subfields.e.len
428 this.extractFixedField = function (field, dflt) {
429 if (!MARC21.Record._ff_pos[field]) return null;
431 var _l = this.leader;
432 var _8 = this.field('008').data;
433 var _6 = this.field('006').data;
435 var rtype = this.recordType();
439 if (MARC21.Record._ff_pos[field].ldr && _l) {
440 if (MARC21.Record._ff_pos[field].ldr[rtype]) {
442 MARC21.Record._ff_pos[field].ldr[rtype].start,
443 MARC21.Record._ff_pos[field].ldr[rtype].len
446 } else if (MARC21.Record._ff_pos[field]._8 && _8) {
447 if (MARC21.Record._ff_pos[field]._8[rtype]) {
449 MARC21.Record._ff_pos[field]._8[rtype].start,
450 MARC21.Record._ff_pos[field]._8[rtype].len
455 if (!val && MARC21.Record._ff_pos[field]._6 && _6) {
456 if (MARC21.Record._ff_pos[field]._6[rtype]) {
458 MARC21.Record._ff_pos[field]._6[rtype].start,
459 MARC21.Record._ff_pos[field]._6[rtype].len
468 if (MARC21.Record._ff_pos[field].ldr && MARC21.Record._ff_pos[field].ldr[rtype]) {
469 d = MARC21.Record._ff_pos[field].ldr[rtype].def;
473 if (MARC21.Record._ff_pos[field]._8 && MARC21.Record._ff_pos[field]._8[rtype]) {
474 d = MARC21.Record._ff_pos[field]._8[rtype].def;
478 if (!val && MARC21.Record._ff_pos[field]._6 && MARC21.Record._ff_pos[field]._6[rtype]) {
479 d = MARC21.Record._ff_pos[field]._6[rtype].def;
484 for (var j = 0; j < MARC21.Record._ff_pos[field][p][rtype].len; j++) {
495 this.setFixedField = function (field, value) {
496 if (!MARC21.Record._ff_pos[field]) return null;
498 var _l = this.leader;
499 var _8 = this.field('008').data;
500 var _6 = this.field('006').data;
502 var rtype = this.recordType();
505 if (MARC21.Record._ff_pos[field].ldr && _l) {
506 if (MARC21.Record._ff_pos[field].ldr[rtype]) { // It's in the leader
507 if (value.length > MARC21.Record._ff_pos[field].ldr[rtype].len)
508 value = value.substr(0, MARC21.Record._ff_pos[field].ldr[rtype].len);
509 while (value.length < MARC21.Record._ff_pos[field].ldr[rtype].len)
510 value += MARC21.Record._ff_pos[field].ldr[rtype].def;
512 _l.substring(0, MARC21.Record._ff_pos[field].ldr[rtype].start) +
515 MARC21.Record._ff_pos[field].ldr[rtype].start
516 + MARC21.Record._ff_pos[field].ldr[rtype].len
520 } else if (MARC21.Record._ff_pos[field]._8 && _8) {
521 if (MARC21.Record._ff_pos[field]._8[rtype]) { // Nope, it's in the 008
522 if (value.length > MARC21.Record._ff_pos[field]._8[rtype].len)
523 value = value.substr(0, MARC21.Record._ff_pos[field]._8[rtype].len);
524 while (value.length < MARC21.Record._ff_pos[field]._8[rtype].len)
525 value += MARC21.Record._ff_pos[field]._8[rtype].def;
527 // first ensure that 008 is padded to appropriate length
528 var f008_length = (rtype in MARC21.Record._ff_lengths['008']) ?
529 MARC21.Record._ff_lengths['008'][rtype] :
530 MARC21.Record._ff_lengths['008']['default'];
531 if (_8.length < f008_length) {
532 for (var i = _8.length; i < f008_length; i++) {
536 this.field('008').update(
537 _8.substring(0, MARC21.Record._ff_pos[field]._8[rtype].start) +
540 MARC21.Record._ff_pos[field]._8[rtype].start
541 + MARC21.Record._ff_pos[field]._8[rtype].len
548 if (!done && MARC21.Record._ff_pos[field]._6 && _6) {
549 if (MARC21.Record._ff_pos[field]._6[rtype]) { // ok, maybe the 006?
550 if (value.length > MARC21.Record._ff_pos[field]._6[rtype].len)
551 value = value.substr(0, MARC21.Record._ff_pos[field]._6[rtype].len);
552 while (value.length < MARC21.Record._ff_pos[field]._6[rtype].len)
553 value += MARC21.Record._ff_pos[field]._6[rtype].def;
554 this.field('006').update(
555 _6.substring(0, MARC21.Record._ff_pos[field]._6[rtype].start) +
558 MARC21.Record._ff_pos[field]._6[rtype].start
559 + MARC21.Record._ff_pos[field]._6[rtype].len
570 this.delimiter = MARC21.Record.delimiter ? MARC21.Record.delimiter : '\u2021';
571 this.leader = '00000cam a2200205Ka 4500';
573 if (kwargs.delimiter) this.delimiter = kwargs.delimiter;
574 if (kwargs.onLoad) this.onLoad = kwargs.onLoad;
577 this.fromXmlURL(kwargs.url);
578 } else if (kwargs.marcxml) {
579 this.fromXmlString(kwargs.marcxml);
580 if (this.onLoad) this.onLoad();
581 } else if (kwargs.xml) {
582 this.fromXmlDocument(kwargs.xml);
583 if (this.onLoad) this.onLoad();
584 } else if (kwargs.marcbreaker) {
585 this.fromBreaker(kwargs.marcbreaker);
586 if (this.onLoad) this.onLoad();
589 if (kwargs.rtype == 'AUT') {
590 this.setFixedField('Type','z');
595 Field : function (kwargs) {
596 if (!kwargs) kwargs = {};
598 this.subfield = function (code, wantarray) {
599 var list = this.subfields.filter( function (s) {
600 if (s[0] == code) return true; return false;
602 if (!wantarray && list.length == 1) return list[0];
606 this.addSubfields = function () {
607 for (var i = 0; i < arguments.length; i++) {
608 var code = arguments[i];
609 var value = arguments[++i];
610 this.subfields.push( [ code, value ] );
614 this.deleteExactSubfields = function () {
618 for ( var i in arguments ) {
619 var f = arguments[i];
620 for (var j = 0; j < me.subfields.length; j++) {
621 if (f === me.subfields[j]) {
622 me.subfields.splice(j,1);
627 if (done && me.subfields[j])
628 me.subfields[j][2] -= 1;
635 this.deleteSubfields = function (c) {
636 return this.deleteSubfield( { code : c } );
639 this.deleteSubfield = function (args) {
641 if (!Array.isArray( args.code )) {
642 args.code = [ args.code ];
645 if (args.pos && !Array.isArray( args.pos )) {
646 args.pos = [ args.pos ];
649 for (var i = 0; i < args.code.length; i++) {
651 for (var j = 0; j < me.subfields.length; j++) {
652 if (me.subfields[j][0] == args.code[i]) {
654 if (!sub_pos[args.code[i]]) sub_pos[args.code[j]] = 0;
655 else sub_pos[args.code[i]]++;
658 for (var k = 0; k < args.pos.length; k++) {
659 if (sub_pos[args.code[i]] == args.pos[k]) me.subfields.splice(j,1);
661 } else if (args.match && me.subfields[j][1].match( args.match )) {
662 me.subfields.splice(j,1);
664 me.subfields.splice(j,1);
671 this.update = function ( args ) {
672 if (this.isControlfield()) {
675 if (args.ind1) this.ind1 = args.ind1;
676 if (args.ind2) this.ind2 = args.ind2;
677 if (args.tag) this.tag = args.tag;
679 for (var i in args) {
680 if (i == 'tag' || i == 'ind1' || i == 'ind2') continue;
682 this.subfields.forEach( function (f) {
683 if (!done && f[0] == i) {
692 this.isControlfield = function () {
693 return this.tag < '010' ? true : false;
696 this.pruneEmptySubfields = function () {
697 if (this.isControlfield()) return;
699 var subfields_to_remove = [];
700 this.subfields.forEach( function(f) {
702 subfields_to_remove.push(f);
705 subfields_to_remove.forEach(function(f) {
706 me.deleteExactSubfields(f);
709 this.isEmptyDatafield = function () {
710 if (this.isControlfield()) return false;
712 this.subfields.forEach( function(f) {
713 if (isEmpty && f[1] != '') {
720 this.indicator = function (num, value) {
721 if (value !== undefined) {
722 if (num == 1) this.ind1 = value;
723 else if (num == 2) this.ind2 = value;
724 else { this.error = true; return null; }
726 if (num == 1) return this.ind1;
727 else if (num == 2) return this.ind2;
728 else { this.error = true; return null; }
732 this.record = null; // MARC record pointer
733 this.tag = ''; // MARC tag
734 this.ind1 = ' '; // MARC indicator 1
735 this.ind2 = ' '; // MARC indicator 2
736 this.data = ''; // MARC data for a controlfield element
737 this.subfields = []; // list of MARC subfields for a datafield element
739 this.position = kwargs.position;
740 this.record = kwargs.record;
741 this.tag = kwargs.tag;
742 this.ind1 = kwargs.ind1 || ' ';
743 this.ind2 = kwargs.ind2 || ' ';
744 this.data = kwargs.data;
746 if (kwargs.subfields) this.subfields = kwargs.subfields;
747 else this.subfields = [];
751 Batch : function(kwargs) {
753 this.parse = function () {
754 if (this.source instanceof Object ) { // assume an xml collection document
755 this.source = $('record', this.source);
757 } else if (this.source.match(/^\s*</)) { // this is xml text
758 this.source = $.parseXML( mxml ).find('record');
760 } else { // must be a marcbreaker doc. split on blank lines
761 this.source = this.source.split(/^$/);
762 this.type = 'marcbreaker';
766 this.fetchURL = function (u) {
768 $.get( u, function (mrc) {
774 this.next = function () {
775 var chunk = this.source[this.current_record++];
779 args[this.type] = chunk;
780 if (this.delimiter) args.delimiter = this.delimiter;
781 return new MARC21.Record(args);
789 this.source = kwargs.source;
790 this.delimiter = kwargs.delimiter
791 this.current_record = 0;
793 if (this.source) this.ready = true;
794 if (!this.ready && kwargs.url) this.fetchURL( kwargs.url );
796 if (this.ready) this.parse();
800 AuthorityControlSet : function (kwargs) {
802 kwargs = kwargs || {};
804 if (!MARC21.AuthorityControlSet._remote_loaded) {
806 // TODO -- push the raw tree into the oils cache for later reuse
808 // fetch everything up front...
809 this._preFetchWithFielder({
810 "acs": "_control_set_list",
811 "at": "_thesaurus_list",
812 "acsaf": "_authority_field_list",
813 "acsbf": "_bib_field_list",
814 "aba": "_browse_axis_list",
815 "abaafm": "_browse_field_map_list"
818 MARC21.AuthorityControlSet._remote_loaded = true;
821 if (MARC21.AuthorityControlSet._remote_loaded && !MARC21.AuthorityControlSet._remote_parsed) {
823 MARC21.AuthorityControlSet._browse_axis_by_code = {};
824 MARC21.AuthorityControlSet._browse_axis_list.forEach(function (ba) {
826 MARC21.AuthorityControlSet._browse_field_map_list.filter(
827 function (m) { return m.axis() == ba.code() }
830 MARC21.AuthorityControlSet._browse_axis_by_code[ba.code()] = ba;
833 // loop over each acs
834 MARC21.AuthorityControlSet._control_set_list.forEach(function (cs) {
835 MARC21.AuthorityControlSet._controlsets[''+cs.id()] = {
838 description : cs.description(),
839 authority_tag_map : {},
845 // grab the authority fields
846 var acsaf_list = MARC21.AuthorityControlSet._authority_field_list.filter(
847 function (af) { return af.control_set() == cs.id() }
850 var at_list = MARC21.AuthorityControlSet._thesaurus_list.filter(
851 function (at) { return at.control_set() == cs.id() }
854 MARC21.AuthorityControlSet._controlsets[''+cs.id()].raw.authority_fields( acsaf_list );
855 MARC21.AuthorityControlSet._controlsets[''+cs.id()].raw.thesauri( at_list );
857 // and loop over each
858 acsaf_list.forEach(function (csaf) {
861 // link the main entry if we're subordinate
862 if (csaf.main_entry()) {
864 acsaf_list.filter(function (x) {
865 return x.id() == csaf.main_entry();
870 // link the sub entries if we're main
872 acsaf_list.filter(function (x) {
873 return x.main_entry() == csaf.id();
878 var acsbf_list = MARC21.AuthorityControlSet._bib_field_list.filter(
879 function (b) { return b.authority_field() == csaf.id() }
881 csaf.bib_fields( acsbf_list );
883 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields = [].concat(
884 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields,
888 acsbf_list.forEach(function (csbf) {
889 // link the authority field to the bib field
890 if (csbf.authority_field()) {
891 csbf.authority_field(
892 acsaf_list.filter(function (x) {
893 return x.id() == csbf.authority_field();
900 MARC21.AuthorityControlSet._browse_axis_list.forEach(
903 function (m) { return m.field() == csaf.id() }
905 function (fm) { fm.field( csaf ); csaf.axis_maps().push( fm ) } // and set the field
912 // build the authority_tag_map
913 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields.forEach(function (bf) {
915 if (!MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()])
916 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()] = {};
918 bf.authority_field().sf_list().split('').forEach(function (sf_code) {
920 if (!MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code])
921 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code] = {};
923 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code][bf.authority_field().tag()] = sf_code;
929 if (this.controlSetList().length > 0)
930 delete MARC21.AuthorityControlSet._controlsets['-1'];
932 MARC21.AuthorityControlSet._remote_parsed = true;
935 this._preFetchWithFielder = function(cmap) {
936 for (var hint in cmap) {
937 var cache_key = cmap[hint];
938 var method = "open-ils.fielder." + hint + ".atomic";
939 var pkey = fieldmapper.IDL.fmclasses[hint].pkey;
942 query[pkey] = {"!=": null};
944 MARC21.AuthorityControlSet[cache_key] = dojo.map(
945 fieldmapper.standardRequest(
946 ["open-ils.fielder", method],
947 [{"cache": 1, "query" : query}]
949 function(h) { return new fieldmapper[hint]().fromHash(h); }
954 this.controlSetId = function (x) {
955 if (x) this._controlset = ''+x;
956 return this._controlset;
959 this.controlSet = function (x) {
960 return MARC21.AuthorityControlSet._controlsets[''+this.controlSetId(x)];
963 this.controlSetByThesaurusCode = function (x) {
964 var thes = MARC21.AuthorityControlSet._thesaurus_list.filter(
965 function (at) { return at.code() == x }
968 return this.controlSet(thes.control_set());
971 this.browseAxisByCode = function(code) {
972 return MARC21.AuthorityControlSet._browse_axis_by_code[code];
975 this.bibFieldByTag = function (x) {
977 return me.controlSet().bib_fields.filter(
978 function (bf) { if (bf.tag() == x) return true }
982 this.bibFields = function (x) {
983 return this.controlSet(x).bib_fields;
986 this.bibFieldBrowseAxes = function (t) {
988 for (var bcode in MARC21.AuthorityControlSet._browse_axis_by_code) {
989 MARC21.AuthorityControlSet._browse_axis_by_code[bcode].maps().forEach(
991 if (m.field().bib_fields().filter(
992 function (b) { return b.tag() == t }
1001 this.authorityFields = function (x) {
1002 return this.controlSet(x).raw.authority_fields();
1005 this.thesauri = function (x) {
1006 return this.controlSet(x).raw.thesauri();
1009 this.controlSetList = function () {
1011 for (var i in MARC21.AuthorityControlSet._controlsets) {
1017 this.findControlSetsForTag = function (tag) {
1019 var old_acs = this.controlSetId();
1020 var acs_list = me.controlSetList().filter(
1021 function(acs_id) { return (me.controlSet(acs_id).control_map[tag]) }
1023 this.controlSetId(old_acs);
1027 this.findControlSetsForAuthorityTag = function (tag) {
1029 var old_acs = this.controlSetId();
1031 var acs_list = me.controlSetList().filter(
1033 var a = me.controlSet(acs_id);
1034 for (var btag in a.control_map) {
1035 for (var sf in a.control_map[btag]) {
1036 if (a.control_map[btag][sf][tag]) return true;
1042 this.controlSetId(old_acs);
1046 this.bibToAuthority = function (field) {
1047 var b_field = this.bibFieldByTag(field.tag);
1049 if (b_field) { // construct an marc authority record
1050 var af = b_field.authority_field();
1053 for (var i = 0; i < field.subfields.length; i++) {
1054 if (af.sf_list().indexOf(field.subfields[i][0]) > -1) {
1055 sflist.push(field.subfields[i]);
1059 var m = new MARC21.Record ({rtype:'AUT'});
1069 return m.toXmlString();
1075 this.bibToAuthorities = function (field) {
1079 var old_acs = this.controlSetId();
1080 me.controlSetList().forEach(
1082 var acs = me.controlSet(acs_id);
1083 var x = me.bibToAuthority(field);
1084 if (x) { var foo = {}; foo[acs_id] = x; auth_list.push(foo); }
1087 this.controlSetId(old_acs);
1092 // This should not be used in an angular world. Instead, the call
1093 // to open-ils.search.authority.simple_heading.from_xml.batch.atomic should
1094 // be performed by the code that wants to find matching authorities.
1095 this.findMatchingAuthorities = function (field) {
1096 return fieldmapper.standardRequest(
1097 [ 'open-ils.search', 'open-ils.search.authority.simple_heading.from_xml.batch.atomic' ],
1098 this.bibToAuthorities(field)
1102 if (kwargs.controlSet) {
1103 this.controlSetId( kwargs.controlSet );
1105 this.controlSetId( this.controlSetList().sort(function(a,b){return (a - b)}) );
1111 MARC21.Record._recType = {
1112 BKS : { Type : /[at]{1}/, BLvl : /[acdm]{1}/ },
1113 SER : { Type : /[a]{1}/, BLvl : /[bsi]{1}/ },
1114 VIS : { Type : /[gkro]{1}/, BLvl : /[abcdmsi]{1}/ },
1115 MIX : { Type : /[p]{1}/, BLvl : /[cdi]{1}/ },
1116 MAP : { Type : /[ef]{1}/, BLvl : /[abcdmsi]{1}/ },
1117 SCO : { Type : /[cd]{1}/, BLvl : /[abcdmsi]{1}/ },
1118 REC : { Type : /[ij]{1}/, BLvl : /[abcdmsi]{1}/ },
1119 COM : { Type : /[m]{1}/, BLvl : /[abcdmsi]{1}/ },
1120 AUT : { Type : /[z]{1}/, BLvl : /.{1}/ },
1121 MFHD : { Type : /[uvxy]{1}/, BLvl : /.{1}/ }
1124 MARC21.Record._ff_lengths = {
1131 MARC21.Record._ff_pos = {
1134 SCO : {start: 24, len : 6, def : ' ' },
1135 REC : {start: 24, len : 6, def : ' ' }
1138 SCO : {start: 7, len : 6, def : ' ' },
1139 REC : {start: 7, len : 6, def : ' ' }
1144 SER : {start : 33, len : 1, def : ' ' }
1147 SER : {start : 16, len : 1, def : ' ' }
1152 BKS : {start : 22, len : 1, def : ' ' },
1153 SER : {start : 22, len : 1, def : ' ' },
1154 VIS : {start : 22, len : 1, def : ' ' },
1155 SCO : {start : 22, len : 1, def : ' ' },
1156 REC : {start : 22, len : 1, def : ' ' },
1157 COM : {start : 22, len : 1, def : ' ' }
1160 BKS : {start : 5, len : 1, def : ' ' },
1161 SER : {start : 5, len : 1, def : ' ' },
1162 VIS : {start : 5, len : 1, def : ' ' },
1163 SCO : {start : 5, len : 1, def : ' ' },
1164 REC : {start : 5, len : 1, def : ' ' },
1165 COM : {start : 5, len : 1, def : ' ' }
1170 BKS : {start : 34, len : 1, def : ' ' }
1173 BKS : {start : 17, len : 1, def : ' ' }
1178 BKS : {start : 7, len : 1, def : 'm' },
1179 SER : {start : 7, len : 1, def : 's' },
1180 VIS : {start : 7, len : 1, def : 'm' },
1181 MIX : {start : 7, len : 1, def : 'c' },
1182 MAP : {start : 7, len : 1, def : 'm' },
1183 SCO : {start : 7, len : 1, def : 'm' },
1184 REC : {start : 7, len : 1, def : 'm' },
1185 COM : {start : 7, len : 1, def : 'm' }
1190 SCO : {start : 18, len : 2, def : 'uu'},
1191 REC : {start : 18, len : 2, def : 'uu'}
1194 SCO : {start : 1, len : 2, def : 'uu'},
1195 REC : {start : 1, len : 2, def : 'uu'}
1200 BKS : {start : 29, len : 1, def : '0' },
1201 SER : {start : 29, len : 1, def : '0' }
1204 BKS : {start : 11, len : 1, def : '0' },
1205 SER : {start : 11, len : 1, def : '0' }
1210 BKS : {start : 24, len : 4, def : ' ' },
1211 SER : {start : 25, len : 3, def : ' ' }
1214 BKS : {start : 7, len : 4, def : ' ' },
1215 SER : {start : 8, len : 3, def : ' ' }
1220 MAP : {start: 25, len : 1, def : 'a' }
1223 MAP : {start : 8, len : 1, def : 'a' }
1228 BKS : {start : 8, len : 1, def : ' ' },
1229 SER : {start : 8, len : 1, def : ' ' },
1230 VIS : {start : 8, len : 1, def : ' ' },
1231 MIX : {start : 8, len : 1, def : ' ' },
1232 MAP : {start : 8, len : 1, def : ' ' },
1233 SCO : {start : 8, len : 1, def : ' ' },
1234 REC : {start : 8, len : 1, def : ' ' },
1235 COM : {start : 8, len : 1, def : ' ' }
1240 BKS : {start : 15, len : 3, def : ' ' },
1241 SER : {start : 15, len : 3, def : ' ' },
1242 VIS : {start : 15, len : 3, def : ' ' },
1243 MIX : {start : 15, len : 3, def : ' ' },
1244 MAP : {start : 15, len : 3, def : ' ' },
1245 SCO : {start : 15, len : 3, def : ' ' },
1246 REC : {start : 15, len : 3, def : ' ' },
1247 COM : {start : 15, len : 3, def : ' ' }
1252 BKS : {start : 7, len : 4, def : ' ' },
1253 SER : {start : 7, len : 4, def : ' ' },
1254 VIS : {start : 7, len : 4, def : ' ' },
1255 MIX : {start : 7, len : 4, def : ' ' },
1256 MAP : {start : 7, len : 4, def : ' ' },
1257 SCO : {start : 7, len : 4, def : ' ' },
1258 REC : {start : 7, len : 4, def : ' ' },
1259 COM : {start : 7, len : 4, def : ' ' }
1264 BKS : {start : 11, len : 4, def : ' ' },
1265 SER : {start : 11, len : 4, def : '9' },
1266 VIS : {start : 11, len : 4, def : ' ' },
1267 MIX : {start : 11, len : 4, def : ' ' },
1268 MAP : {start : 11, len : 4, def : ' ' },
1269 SCO : {start : 11, len : 4, def : ' ' },
1270 REC : {start : 11, len : 4, def : ' ' },
1271 COM : {start : 11, len : 4, def : ' ' }
1276 BKS : {start : 18, len : 1, def : ' ' },
1277 SER : {start : 18, len : 1, def : ' ' },
1278 VIS : {start : 18, len : 1, def : ' ' },
1279 MIX : {start : 18, len : 1, def : ' ' },
1280 MAP : {start : 18, len : 1, def : ' ' },
1281 SCO : {start : 18, len : 1, def : ' ' },
1282 REC : {start : 18, len : 1, def : ' ' },
1283 COM : {start : 18, len : 1, def : ' ' }
1288 BKS : {start : 6, len : 1, def : ' ' },
1289 SER : {start : 6, len : 1, def : 'c' },
1290 VIS : {start : 6, len : 1, def : ' ' },
1291 MIX : {start : 6, len : 1, def : ' ' },
1292 MAP : {start : 6, len : 1, def : ' ' },
1293 SCO : {start : 6, len : 1, def : ' ' },
1294 REC : {start : 6, len : 1, def : ' ' },
1295 COM : {start : 6, len : 1, def : ' ' }
1300 BKS : {start : 17, len : 1, def : ' ' },
1301 SER : {start : 17, len : 1, def : ' ' },
1302 VIS : {start : 17, len : 1, def : ' ' },
1303 MIX : {start : 17, len : 1, def : ' ' },
1304 MAP : {start : 17, len : 1, def : ' ' },
1305 SCO : {start : 17, len : 1, def : ' ' },
1306 REC : {start : 17, len : 1, def : ' ' },
1307 COM : {start : 17, len : 1, def : ' ' },
1308 AUT : {start : 17, len : 1, def : 'n' },
1309 MFHD : {start : 17, len : 1, def : 'u' }
1314 SER : {start : 24, len : 1, def : ' '}
1317 SER : {start : 7, len : 1, def : ' '}
1322 BKS : {start : 30, len : 1, def : '0' }
1325 BKS : {start : 13, len : 1, def : '0' }
1330 COM : {start: 26, len : 1, def : 'u' }
1333 COM : {start: 9, len : 1, def : 'u' }
1338 SCO : {start : 20, len : 1, def : 'u'},
1339 REC : {start : 20, len : 1, def : 'n'}
1342 SCO : {start : 3, len : 1, def : 'u'},
1343 REC : {start : 3, len : 1, def : 'n'}
1348 BKS : {start : 23, len : 1, def : ' ' },
1349 SER : {start : 23, len : 1, def : ' ' },
1350 VIS : {start : 29, len : 1, def : ' ' },
1351 MIX : {start : 23, len : 1, def : ' ' },
1352 MAP : {start : 29, len : 1, def : ' ' },
1353 SCO : {start : 23, len : 1, def : ' ' },
1354 REC : {start : 23, len : 1, def : ' ' }
1357 BKS : {start : 6, len : 1, def : ' ' },
1358 SER : {start : 6, len : 1, def : ' ' },
1359 VIS : {start : 12, len : 1, def : ' ' },
1360 MIX : {start : 6, len : 1, def : ' ' },
1361 MAP : {start : 12, len : 1, def : ' ' },
1362 SCO : {start : 6, len : 1, def : ' ' },
1363 REC : {start : 6, len : 1, def : ' ' }
1368 SER : {start : 18, len : 1, def : ' '}
1371 SER : {start : 1, len : 1, def : ' '}
1376 BKS : {start : 28, len : 1, def : ' ' },
1377 SER : {start : 28, len : 1, def : ' ' },
1378 VIS : {start : 28, len : 1, def : ' ' },
1379 MAP : {start : 28, len : 1, def : ' ' },
1380 COM : {start : 28, len : 1, def : ' ' }
1383 BKS : {start : 11, len : 1, def : ' ' },
1384 SER : {start : 11, len : 1, def : ' ' },
1385 VIS : {start : 11, len : 1, def : ' ' },
1386 MAP : {start : 11, len : 1, def : ' ' },
1387 COM : {start : 11, len : 1, def : ' ' }
1392 BKS : {start : 18, len : 4, def : ' ' }
1395 BKS : {start : 1, len : 4, def : ' ' }
1400 BKS : {start : 31, len : 1, def : '0' },
1401 MAP : {start : 31, len : 1, def : '0' }
1404 BKS : {start : 14, len : 1, def : '0' },
1405 MAP : {start : 14, len : 1, def : '0' }
1410 MFHD : {start : 18, len : 1, def : 'i' }
1415 BKS : {start : 35, len : 3, def : ' ' },
1416 SER : {start : 35, len : 3, def : ' ' },
1417 VIS : {start : 35, len : 3, def : ' ' },
1418 MIX : {start : 35, len : 3, def : ' ' },
1419 MAP : {start : 35, len : 3, def : ' ' },
1420 SCO : {start : 35, len : 3, def : ' ' },
1421 REC : {start : 35, len : 3, def : ' ' },
1422 COM : {start : 35, len : 3, def : ' ' }
1427 BKS : {start : 33, len : 1, def : '0' }
1430 BKS : {start : 16, len : 1, def : '0' }
1435 SCO : {start : 30, len : 2, def : 'n'},
1436 REC : {start : 30, len : 2, def : ' '}
1439 SCO : {start : 13, len : 2, def : 'n'},
1440 REC : {start : 13, len : 2, def : ' '}
1445 BKS : {start : 38, len : 1, def : ' ' },
1446 SER : {start : 38, len : 1, def : ' ' },
1447 VIS : {start : 38, len : 1, def : ' ' },
1448 MIX : {start : 38, len : 1, def : ' ' },
1449 MAP : {start : 38, len : 1, def : ' ' },
1450 SCO : {start : 38, len : 1, def : ' ' },
1451 REC : {start : 38, len : 1, def : ' ' },
1452 COM : {start : 38, len : 1, def : ' ' }
1457 SER : {start : 22, len : 1, def : ' '}
1460 SER : {start: 5, len : 1, def: ' '}
1465 SCO : {start : 21, len : 1, def : ' '},
1466 REC : {start : 21, len : 1, def : 'n'}
1469 SCO : {start : 4, len : 1, def : ' '},
1470 REC : {start : 4, len : 1, def : 'n'}
1475 MAP : {start : 22, len : 2, def : ' ' }
1478 MAP: {start : 5, len : 2, def : ' ' }
1483 BKS : {start : 5, len : 1, def : 'n' },
1484 SER : {start : 5, len : 1, def : 'n' },
1485 VIS : {start : 5, len : 1, def : 'n' },
1486 MIX : {start : 5, len : 1, def : 'n' },
1487 MAP : {start : 5, len : 1, def : 'n' },
1488 SCO : {start : 5, len : 1, def : 'n' },
1489 REC : {start : 5, len : 1, def : 'n' },
1490 COM : {start : 5, len : 1, def : 'n' },
1491 MFHD: {start : 5, len : 1, def : 'n' },
1492 AUT : {start : 5, len : 1, def : 'n' }
1497 SER : {start : 19, len : 1, def : ' '}
1500 SER : {start : 2, len : 1, def : ' '}
1505 MAP : {start: 18, len : 4, def : ' '}
1508 MAP : {start: 1, len : 4, def : ' '}
1513 SER : {start : 34, len : 1, def : '0' }
1516 SER : {start : 17, len : 1, def : '0' }
1521 MAP : {start: 33, len : 2, def : ' ' }
1524 MAP : {start: 16, len : 2, def : ' '}
1529 BKS : {start : 39, len : 1, def : 'd' },
1530 SER : {start : 39, len : 1, def : 'd' },
1531 VIS : {start : 39, len : 1, def : 'd' },
1532 SCO : {start : 39, len : 1, def : 'd' },
1533 REC : {start : 39, len : 1, def : 'd' },
1534 COM : {start : 39, len : 1, def : 'd' },
1535 MFHD : {start : 39, len : 1, def : 'd' },
1536 "AUT" : {"start" : 39, "len" : 1, "def" : 'd' }
1541 SER : {start : 21, len : 1, def : ' '}
1544 SER : {start : 4, len : 1, def : ' '}
1549 VIS : {start : 34, len : 1, def : ' '}
1552 VIS : {start : 17, len : 1, def : ' '}
1557 VIS : {start : 18, len : 3, def : ' '}
1560 VIS : {start : 1, len : 3, def : ' '}
1565 VIS : {start : 33, len : 1, def : ' ' }
1568 VIS : {start : 16, len : 1, def : ' ' }
1573 SCO : {start : 33, len : 1, def : ' ' },
1574 REC : {start : 33, len : 1, def : 'n' }
1577 SCO : {start : 16, len : 1, def : ' ' },
1578 REC : {start : 16, len : 1, def : 'n' }
1583 BKS : {start : 6, len : 1, def : 'a' },
1584 SER : {start : 6, len : 1, def : 'a' },
1585 VIS : {start : 6, len : 1, def : 'g' },
1586 MIX : {start : 6, len : 1, def : 'p' },
1587 MAP : {start : 6, len : 1, def : 'e' },
1588 SCO : {start : 6, len : 1, def : 'c' },
1589 REC : {start : 6, len : 1, def : 'i' },
1590 COM : {start : 6, len : 1, def : 'm' },
1591 AUT : {start : 6, len : 1, def : 'z' },
1592 MFHD : {start : 6, len : 1, def : 'y' }
1597 "AUT" : {"start" : 6, "len" : 1, "def" : ' ' }
1602 "AUT" : {"start" : 7, "len" : 1, "def" : ' ' }
1607 "AUT" : {"start" : 8, "len" : 1, "def" : ' ' }
1612 "AUT" : {"start" : 9, "len" : 1, "def" : ' ' }
1617 "AUT" : {"start" : 10, "len" : 1, "def" : ' ' }
1622 "AUT" : {"start" : 11, "len" : 1, "def" : ' ' }
1627 "AUT" : {"start" : 12, "len" : 1, "def" : ' ' }
1632 "AUT" : {"start" : 13, "len" : 1, "def" : ' ' }
1637 "AUT" : {"start" : 14, "len" : 1, "def" : ' ' }
1642 "AUT" : {"start" : 15, "len" : 1, "def" : ' ' }
1647 "AUT" : {"start" : 16, "len" : 1, "def" : ' ' }
1652 "AUT" : {"start" : 17, "len" : 1, "def" : ' ' }
1657 "AUT" : {"start" : 28, "len" : 1, "def" : ' ' }
1662 "AUT" : {"start" : 29, "len" : 1, "def" : ' ' }
1667 "AUT" : {"start" : 31, "len" : 1, "def" : ' ' }
1672 "AUT" : {"start" : 32, "len" : 1, "def" : ' ' }
1677 "AUT" : {"start" : 33, "len" : 1, "def" : ' ' }
1682 "AUT" : {"start" : 38, "len" : 1, "def" : ' ' }
1687 "AUT" : {"start" : 39, "len" : 1, "def" : ' ' }
1692 MARC21.Record._physical_characteristics = {
1694 label : "Electronic Resource",
1699 values: { a : "Tape Cartridge",
1700 b : "Chip cartridge",
1701 c : "Computer optical disk cartridge",
1702 f : "Tape cassette",
1704 j : "Magnetic disk",
1705 m : "Magneto-optical disk",
1715 values: { a : "One color",
1716 b : "Black-and-white",
1720 n : "Not applicable",
1727 label : "Dimensions",
1728 values: { a : "3 1/2 in.",
1730 g : "4 3/4 in. or 12 cm.",
1731 i : "1 1/8 x 2 3/8 in.",
1732 j : "3 7/8 x 2 1/2 in.",
1733 n : "Not applicable",
1743 values: { ' ' : "No sound (Silent)",
1750 label : "Image bit depth",
1751 values: { mmm : "Multiple",
1752 nnn : "Not applicable",
1758 label : "File formats",
1759 values: { a : "One file format",
1760 m : "Multiple file formats",
1766 label : "Quality assurance target(s)",
1767 values: { a : "Absent",
1768 n : "Not applicable",
1775 label : "Antecedent/Source",
1776 values: { a : "File reproduced from original",
1777 b : "File reproduced from microform",
1778 c : "File reproduced from electronic resource",
1779 d : "File reproduced from an intermediate (not microform)",
1781 n : "Not applicable",
1787 label : "Level of compression",
1788 values: { a : "Uncompressed",
1797 label : "Reformatting quality",
1798 values: { a : "Access",
1799 n : "Not applicable",
1813 values: { a : "Celestial globe",
1814 b : "Planetary or lunar globe",
1815 c : "Terrestrial globe",
1816 e : "Earth moon globe",
1824 values: { a : "One color",
1830 label : "Physical medium",
1831 values: { a : "Paper",
1845 label : "Type of reproduction",
1846 values: { f : "Facsimile",
1847 n : "Not applicable",
1860 values: { d : "Atlas",
1865 r : "Remote-sensing image",
1875 values: { a : "One color",
1881 label : "Physical medium",
1882 values: { a : "Paper",
1890 q : "Flexible base photographic medium, positive",
1891 r : "Flexible base photographic medium, negative",
1892 s : "Non-flexible base photographic medium, positive",
1893 t : "Non-flexible base photographic medium, negative",
1895 y : "Other photographic medium",
1901 label : "Type of reproduction",
1902 values: { f : "Facsimile",
1903 n : "Not applicable",
1910 label : "Production/reproduction details",
1911 values: { a : "Photocopy, blueline print",
1913 c : "Pre-production",
1921 label : "Positive/negative",
1922 values: { a : "Positive",
1925 n : "Not applicable"
1931 label : "Microform",
1936 values: { a : "Aperture card",
1937 b : "Microfilm cartridge",
1938 c : "Microfilm cassette",
1939 d : "Microfilm reel",
1941 f : "Microfiche cassette",
1949 label : "Positive/negative",
1950 values: { a : "Positive",
1958 label : "Dimensions",
1959 values: { a : "8 mm.",
1964 l : "3 x 5 in. (8 x 13 cm.)",
1965 m : "4 x 6 in. (11 x 15 cm.)",
1966 o : "6 x 9 in. (16 x 23 cm.)",
1967 p : "3 1/4 x 7 3/8 in. (9 x 19 cm.)",
1974 label : "Reduction ratio range/Reduction ratio",
1975 values: { a : "Low (1-16x)",
1976 b : "Normal (16-30x)",
1977 c : "High (31-60x)",
1978 d : "Very high (61-90x)",
1981 v : "Reduction ratio varies"
1987 values: { b : "Black-and-white",
1996 label : "Emulsion on film",
1997 values: { a : "Silver halide",
2001 n : "Not applicable",
2008 label : "Quality assurance target(s)",
2009 values: { a : "1st gen. master",
2010 b : "Printing master",
2012 m : "Mixed generation",
2018 label : "Base of film",
2019 values: { a : "Safety base, undetermined",
2020 c : "Safety base, acetate undetermined",
2021 d : "Safety base, diacetate",
2024 n : "Not applicable",
2025 p : "Safety base, polyester",
2026 r : "Safety base, mixed",
2027 t : "Safety base, triacetate",
2035 label : "Motion Picture",
2040 values: { a : "Film cartridge",
2041 f : "Film cassette",
2050 values: { b : "Black-and-white",
2060 label : "Motion picture presentation format",
2061 values: { a : "Standard sound aperture, reduced frame",
2062 b : "Nonanamorphic (wide-screen)",
2064 d : "Anamorphic (wide-screen)",
2065 e : "Other-wide screen format",
2066 f : "Standard. silent aperture, full frame",
2073 label : "Sound on medium or separate",
2074 values: { a : "Sound on medium",
2075 b : "Sound separate from medium",
2081 label : "Medium for sound",
2082 values: { a : "Optical sound track on motion picture film",
2083 b : "Magnetic sound track on motion picture film",
2084 c : "Magnetic audio tape in cartridge",
2086 e : "Magnetic audio tape on reel",
2087 f : "Magnetic audio tape in cassette",
2088 g : "Optical and magnetic sound track on film",
2097 label : "Dimensions",
2098 values: { a : "Standard 8 mm.",
2099 b : "Super 8 mm./single 8 mm.",
2111 label : "Configuration of playback channels",
2112 values: { k : "Mixed",
2114 n : "Not applicable",
2115 q : "Multichannel, surround or quadraphonic",
2123 label : "Production elements",
2124 values: { a : "Work print",
2128 e : "Mixing tracks",
2129 f : "Title bands/inter-title rolls",
2130 g : "Production rolls",
2131 n : "Not applicable",
2138 label : "Non-projected Graphic",
2143 values: { c : "Collage",
2146 f : "Photo-mechanical print",
2147 g : "Photonegative",
2151 l : "Technical drawing",
2153 o : "Flash/activity card",
2161 values: { a : "One color",
2162 b : "Black-and-white",
2172 label : "Primary support material",
2173 values: { a : "Canvas",
2174 b : "Bristol board",
2175 c : "Cardboard/illustration board",
2181 m : "Mixed collection",
2194 label : "Secondary support material",
2195 values: { a : "Canvas",
2196 b : "Bristol board",
2197 c : "Cardboard/illustration board",
2203 m : "Mixed collection",
2217 label : "Projected Graphic",
2222 values: { c : "Film cartridge",
2224 f : "Film filmstrip type",
2225 o : "Filmstrip roll",
2234 values: { b : "Black-and-white",
2238 n : "Not applicable",
2245 label : "Base of emulsion",
2246 values: { d : "Glass",
2249 k : "Film base, other than safety film",
2250 m : "Mixed collection",
2258 label : "Sound on medium or separate",
2259 values: { a : "Sound on medium",
2260 b : "Sound separate from medium",
2266 label : "Medium for sound",
2267 values: { a : "Optical sound track on motion picture film",
2268 b : "Magnetic sound track on motion picture film",
2269 c : "Magnetic audio tape in cartridge",
2271 e : "Magnetic audio tape on reel",
2272 f : "Magnetic audio tape in cassette",
2273 g : "Optical and magnetic sound track on film",
2282 label : "Dimensions",
2283 values: { a : "Standard 8 mm.",
2284 b : "Super 8 mm./single 8 mm.",
2290 j : "2 x 2 in. (5 x 5 cm.)",
2291 k : "2 1/4 x 2 1/4 in. (6 x 6 cm.)",
2292 s : "4 x 5 in. (10 x 13 cm.)",
2293 t : "5 x 7 in. (13 x 18 cm.)",
2294 v : "8 x 10 in. (21 x 26 cm.)",
2295 w : "9 x 9 in. (23 x 23 cm.)",
2296 x : "10 x 10 in. (26 x 26 cm.)",
2297 y : "7 x 7 in. (18 x 18 cm.)",
2304 label : "Secondary support material",
2305 values: { c : "Cardboard",
2309 j : "Metal and glass",
2310 k : "Synthetics and glass",
2311 m : "Mixed collection",
2319 label : "Remote-sensing Image",
2324 values: { u : "Unspecified" }
2328 label : "Altitude of sensor",
2329 values: { a : "Surface",
2332 n : "Not applicable",
2339 label : "Attitude of sensor",
2340 values: { a : "Low oblique",
2343 n : "Not applicable",
2349 label : "Cloud cover",
2350 values: { 0 : "0-09%",
2360 n : "Not applicable",
2366 label : "Platform construction type",
2367 values: { a : "Balloon",
2368 b : "Aircraft-low altitude",
2369 c : "Aircraft-medium altitude",
2370 d : "Aircraft-high altitude",
2371 e : "Manned spacecraft",
2372 f : "Unmanned spacecraft",
2373 g : "Land-based remote-sensing device",
2374 h : "Water surface-based remote-sensing device",
2375 i : "Submersible remote-sensing device",
2376 n : "Not applicable",
2383 label : "Platform use category",
2384 values: { a : "Meteorological",
2385 b : "Surface observing",
2386 c : "Space observing",
2388 n : "Not applicable",
2395 label : "Sensor type",
2396 values: { a : "Active",
2404 label : "Data type",
2405 values: { nn : "Not applicable",
2408 aa : "Visible light",
2409 da : "Near infrared",
2410 db : "Middle infrared",
2411 dc : "Far infrared",
2412 dd : "Thermal infrared",
2413 de : "Shortwave infrared (SWIR)",
2414 df : "Reflective infrared",
2415 dv : "Combinations",
2416 dz : "Other infrared data",
2417 ga : "Sidelooking airborne radar (SLAR)",
2418 gb : "Synthetic aperture radar (SAR-single frequency)",
2419 gc : "SAR-multi-frequency (multichannel)",
2420 gd : "SAR-like polarization",
2421 ge : "SAR-cross polarization",
2422 gf : "Infometric SAR",
2423 gg : "Polarmetric SAR",
2424 gu : "Passive microwave mapping",
2425 gz : "Other microwave data",
2426 ja : "Far ultraviolet",
2427 jb : "Middle ultraviolet",
2428 jc : "Near ultraviolet",
2429 jv : "Ultraviolet combinations",
2430 jz : "Other ultraviolet data",
2431 ma : "Multi-spectral, multidata",
2432 mb : "Multi-temporal",
2433 mm : "Combination of various data types",
2434 pa : "Sonar-water depth",
2435 pb : "Sonar-bottom topography images, sidescan",
2436 pc : "Sonar-bottom topography, near-surface",
2437 pd : "Sonar-bottom topography, near-bottom",
2438 pe : "Seismic surveys",
2439 pz : "Other acoustical data",
2440 ra : "Gravity anomales (general)",
2444 sa : "Magnetic field",
2445 ta : "Radiometric surveys"
2451 label : "Sound Recording",
2456 values: { d : "Sound disc",
2458 g : "Sound cartridge",
2459 i : "Sound-track film",
2461 s : "Sound cassette",
2462 t : "Sound-tape reel",
2464 w : "Wire recording",
2471 values: { a : "16 rpm",
2491 label : "Configuration of playback channels",
2492 values: { m : "Monaural",
2501 label : "Groove width or pitch",
2502 values: { m : "Microgroove/fine",
2503 n : "Not applicable",
2504 s : "Coarse/standard",
2511 label : "Dimensions",
2512 values: { a : "3 in.",
2518 g : "4 3/4 in. (12 cm.)",
2519 j : "3 7/8 x 2 1/2 in.",
2520 o : "5 1/4 x 3 7/8 in.",
2521 s : "2 3/4 x 4 in.",
2522 n : "Not applicable",
2529 label : "Tape width",
2530 values: { l : "1/8 in.",
2532 n : "Not applicable",
2541 label : "Tape configuration ",
2542 values: { a : "Full (1) track",
2543 b : "Half (2) track",
2544 c : "Quarter (4) track",
2548 n : "Not applicable",
2555 label : "Special playback",
2556 values: { a : "NAB standard",
2557 b : "CCIR standard",
2558 c : "Dolby-B encoded, standard Dolby",
2560 e : "Digital recording",
2561 f : "Dolby-A encoded",
2562 g : "Dolby-C encoded",
2564 n : "Not applicable",
2571 label : "Capture and storage",
2572 values: { a : "Acoustical capture, direct storage",
2573 b : "Direct storage, not acoustical",
2574 d : "Digital storage",
2575 e : "Analog electrical storage",
2583 label : "Tactile Material",
2588 values: { a : "Moon",
2591 d : "Tactile, with no writing system",
2598 label : "Class of braille writing",
2599 values: { a : "Literary braille",
2600 b : "Format code braille",
2601 c : "Mathematics and scientific braille",
2602 d : "Computer braille",
2603 e : "Music braille",
2604 m : "Multiple braille types",
2605 n : "Not applicable",
2612 label : "Level of contraction",
2613 values: { a : "Uncontracted",
2616 n : "Not applicable",
2623 label : "Braille music format",
2624 values: { a : "Bar over bar",
2626 c : "Line over line",
2629 f : "Section by section",
2632 i : "Spanner short form scoring",
2633 j : "Short form scoring",
2635 l : "Vertical score",
2636 n : "Not applicable",
2643 label : "Special physical characteristics",
2644 values: { a : "Print/braille",
2645 b : "Jumbo or enlarged braille",
2646 n : "Not applicable",
2654 label : "Videorecording",
2659 values: { c : "Videocartridge",
2661 f : "Videocassette",
2670 values: { b : "Black-and-white",
2673 n : "Not applicable",
2680 label : "Videorecording format",
2681 values: { a : "Beta",
2703 label : "Sound on medium or separate",
2704 values: { a : "Sound on medium",
2705 b : "Sound separate from medium",
2711 label : "Medium for sound",
2712 values: { a : "Optical sound track on motion picture film",
2713 b : "Magnetic sound track on motion picture film",
2714 c : "Magnetic audio tape in cartridge",
2716 e : "Magnetic audio tape on reel",
2717 f : "Magnetic audio tape in cassette",
2718 g : "Optical and magnetic sound track on motion picture film",
2727 label : "Dimensions",
2728 values: { a : "8 mm.",
2740 label : "Configuration of playback channel",
2741 values: { k : "Mixed",
2743 n : "Not applicable",
2744 q : "Multichannel, surround or quadraphonic",
2754 MARC21.AuthorityControlSet._remote_loaded = false;
2755 MARC21.AuthorityControlSet._remote_parsed = false;
2757 MARC21.AuthorityControlSet._controlsets = {
2758 // static sorta-LoC setup ... to be overwritten with server data
2761 name : 'Static LoC legacy mapping',
2762 description : 'Legacy mapping provided as a default',
2765 'a' : { 100 : 'a' },
2766 'd' : { 100 : 'd' },
2767 'e' : { 100 : 'e' },
2771 'a' : { 110 : 'a' },
2775 'a' : { 111 : 'a' },
2779 'a' : { 130 : 'a' },
2783 'a' : { 130 : 'a' },
2787 'a' : { 100 : 'a' },
2791 'a' : { 110 : 'a' },
2795 'a' : { 111 : 'a' },
2799 'a' : { 130 : 'a' },
2800 'n' : { 130 : 'n' },
2804 'a' : { 100 : 'a' },
2805 'd' : { 100 : 'd' },
2806 'q' : { 100 : 'q' },
2810 'a' : { 110 : 'a' },
2814 'a' : { 111 : 'a' },
2815 'c' : { 111 : 'c' },
2819 'a' : { 130 : 'a' },
2823 'a' : { 100 : 'a' },
2827 'a' : { 110 : 'a' },
2831 'a' : { 111 : 'a' },
2835 'a' : { 130 : 'a' },
2839 'a' : { 100 : 'a' },
2840 'd' : { 100 : 'd' },
2841 'q' : { 100 : 'q' },
2842 't' : { 100 : 't' },
2869 'a' : { 110 : 'a' },
2870 'd' : { 110 : 'd' },
2871 't' : { 110 : 't' },
2898 'a' : { 111 : 'a' },
2899 'd' : { 111 : 'd' },
2900 't' : { 111 : 't' },
2927 'a' : { 130 : 'a' },
2931 'a' : { 148 : 'a' },
2932 'v' : { 148 : 'v' },
2933 'x' : { 148 : 'x' },
2934 'y' : { 148 : 'y' },
2938 'a' : { 150 : 'a' },
2939 'b' : { 150 : 'b' },
2966 'a' : { 151 : 'a' },
2993 'a' : { 155 : 'a' },