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;
526 this.field('008').update(
527 _8.substring(0, MARC21.Record._ff_pos[field]._8[rtype].start) +
530 MARC21.Record._ff_pos[field]._8[rtype].start
531 + MARC21.Record._ff_pos[field]._8[rtype].len
538 if (!done && MARC21.Record._ff_pos[field]._6 && _6) {
539 if (MARC21.Record._ff_pos[field]._6[rtype]) { // ok, maybe the 006?
540 if (value.length > MARC21.Record._ff_pos[field]._6[rtype].len)
541 value = value.substr(0, MARC21.Record._ff_pos[field]._6[rtype].len);
542 while (value.length < MARC21.Record._ff_pos[field]._6[rtype].len)
543 value += MARC21.Record._ff_pos[field]._6[rtype].def;
544 this.field('006').update(
545 _6.substring(0, MARC21.Record._ff_pos[field]._6[rtype].start) +
548 MARC21.Record._ff_pos[field]._6[rtype].start
549 + MARC21.Record._ff_pos[field]._6[rtype].len
560 this.delimiter = MARC21.Record.delimiter ? MARC21.Record.delimiter : '\u2021';
561 this.leader = '00000cam a2200205Ka 4500';
563 if (kwargs.delimiter) this.delimiter = kwargs.delimiter;
564 if (kwargs.onLoad) this.onLoad = kwargs.onLoad;
567 this.fromXmlURL(kwargs.url);
568 } else if (kwargs.marcxml) {
569 this.fromXmlString(kwargs.marcxml);
570 if (this.onLoad) this.onLoad();
571 } else if (kwargs.xml) {
572 this.fromXmlDocument(kwargs.xml);
573 if (this.onLoad) this.onLoad();
574 } else if (kwargs.marcbreaker) {
575 this.fromBreaker(kwargs.marcbreaker);
576 if (this.onLoad) this.onLoad();
579 if (kwargs.rtype == 'AUT') {
580 this.setFixedField('Type','z');
585 Field : function (kwargs) {
586 if (!kwargs) kwargs = {};
588 this.subfield = function (code, wantarray) {
589 var list = this.subfields.filter( function (s) {
590 if (s[0] == code) return true; return false;
592 if (!wantarray && list.length == 1) return list[0];
596 this.addSubfields = function () {
597 for (var i = 0; i < arguments.length; i++) {
598 var code = arguments[i];
599 var value = arguments[++i];
600 this.subfields.push( [ code, value ] );
604 this.deleteExactSubfields = function () {
608 for ( var i in arguments ) {
609 var f = arguments[i];
610 for (var j = 0; j < me.subfields.length; j++) {
611 if (f === me.subfields[j]) {
612 me.subfields.splice(j,1);
617 if (done && me.subfields[j])
618 me.subfields[j][2] -= 1;
625 this.deleteSubfields = function (c) {
626 return this.deleteSubfield( { code : c } );
629 this.deleteSubfield = function (args) {
631 if (!Array.isArray( args.code )) {
632 args.code = [ args.code ];
635 if (args.pos && !Array.isArray( args.pos )) {
636 args.pos = [ args.pos ];
639 for (var i = 0; i < args.code.length; i++) {
641 for (var j = 0; j < me.subfields.length; j++) {
642 if (me.subfields[j][0] == args.code[i]) {
644 if (!sub_pos[args.code[i]]) sub_pos[args.code[j]] = 0;
645 else sub_pos[args.code[i]]++;
648 for (var k = 0; k < args.pos.length; k++) {
649 if (sub_pos[args.code[i]] == args.pos[k]) me.subfields.splice(j,1);
651 } else if (args.match && me.subfields[j][1].match( args.match )) {
652 me.subfields.splice(j,1);
654 me.subfields.splice(j,1);
661 this.update = function ( args ) {
662 if (this.isControlfield()) {
665 if (args.ind1) this.ind1 = args.ind1;
666 if (args.ind2) this.ind2 = args.ind2;
667 if (args.tag) this.tag = args.tag;
669 for (var i in args) {
670 if (i == 'tag' || i == 'ind1' || i == 'ind2') continue;
672 this.subfields.forEach( function (f) {
673 if (!done && f[0] == i) {
682 this.isControlfield = function () {
683 return this.tag < '010' ? true : false;
686 this.pruneEmptySubfields = function () {
687 if (this.isControlfield()) return;
689 var subfields_to_remove = [];
690 this.subfields.forEach( function(f) {
692 subfields_to_remove.push(f);
695 subfields_to_remove.forEach(function(f) {
696 me.deleteExactSubfields(f);
699 this.isEmptyDatafield = function () {
700 if (this.isControlfield()) return false;
702 this.subfields.forEach( function(f) {
703 if (isEmpty && f[1] != '') {
710 this.indicator = function (num, value) {
711 if (value !== undefined) {
712 if (num == 1) this.ind1 = value;
713 else if (num == 2) this.ind2 = value;
714 else { this.error = true; return null; }
716 if (num == 1) return this.ind1;
717 else if (num == 2) return this.ind2;
718 else { this.error = true; return null; }
722 this.record = null; // MARC record pointer
723 this.tag = ''; // MARC tag
724 this.ind1 = ' '; // MARC indicator 1
725 this.ind2 = ' '; // MARC indicator 2
726 this.data = ''; // MARC data for a controlfield element
727 this.subfields = []; // list of MARC subfields for a datafield element
729 this.position = kwargs.position;
730 this.record = kwargs.record;
731 this.tag = kwargs.tag;
732 this.ind1 = kwargs.ind1 || ' ';
733 this.ind2 = kwargs.ind2 || ' ';
734 this.data = kwargs.data;
736 if (kwargs.subfields) this.subfields = kwargs.subfields;
737 else this.subfields = [];
741 Batch : function(kwargs) {
743 this.parse = function () {
744 if (this.source instanceof Object ) { // assume an xml collection document
745 this.source = $('record', this.source);
747 } else if (this.source.match(/^\s*</)) { // this is xml text
748 this.source = $.parseXML( mxml ).find('record');
750 } else { // must be a marcbreaker doc. split on blank lines
751 this.source = this.source.split(/^$/);
752 this.type = 'marcbreaker';
756 this.fetchURL = function (u) {
758 $.get( u, function (mrc) {
764 this.next = function () {
765 var chunk = this.source[this.current_record++];
769 args[this.type] = chunk;
770 if (this.delimiter) args.delimiter = this.delimiter;
771 return new MARC21.Record(args);
779 this.source = kwargs.source;
780 this.delimiter = kwargs.delimiter
781 this.current_record = 0;
783 if (this.source) this.ready = true;
784 if (!this.ready && kwargs.url) this.fetchURL( kwargs.url );
786 if (this.ready) this.parse();
790 AuthorityControlSet : function (kwargs) {
792 kwargs = kwargs || {};
794 if (!MARC21.AuthorityControlSet._remote_loaded) {
796 // TODO -- push the raw tree into the oils cache for later reuse
798 // fetch everything up front...
799 this._preFetchWithFielder({
800 "acs": "_control_set_list",
801 "at": "_thesaurus_list",
802 "acsaf": "_authority_field_list",
803 "acsbf": "_bib_field_list",
804 "aba": "_browse_axis_list",
805 "abaafm": "_browse_field_map_list"
808 MARC21.AuthorityControlSet._remote_loaded = true;
811 if (MARC21.AuthorityControlSet._remote_loaded && !MARC21.AuthorityControlSet._remote_parsed) {
813 MARC21.AuthorityControlSet._browse_axis_by_code = {};
814 MARC21.AuthorityControlSet._browse_axis_list.forEach(function (ba) {
816 MARC21.AuthorityControlSet._browse_field_map_list.filter(
817 function (m) { return m.axis() == ba.code() }
820 MARC21.AuthorityControlSet._browse_axis_by_code[ba.code()] = ba;
823 // loop over each acs
824 MARC21.AuthorityControlSet._control_set_list.forEach(function (cs) {
825 MARC21.AuthorityControlSet._controlsets[''+cs.id()] = {
828 description : cs.description(),
829 authority_tag_map : {},
835 // grab the authority fields
836 var acsaf_list = MARC21.AuthorityControlSet._authority_field_list.filter(
837 function (af) { return af.control_set() == cs.id() }
840 var at_list = MARC21.AuthorityControlSet._thesaurus_list.filter(
841 function (at) { return at.control_set() == cs.id() }
844 MARC21.AuthorityControlSet._controlsets[''+cs.id()].raw.authority_fields( acsaf_list );
845 MARC21.AuthorityControlSet._controlsets[''+cs.id()].raw.thesauri( at_list );
847 // and loop over each
848 acsaf_list.forEach(function (csaf) {
851 // link the main entry if we're subordinate
852 if (csaf.main_entry()) {
854 acsaf_list.filter(function (x) {
855 return x.id() == csaf.main_entry();
860 // link the sub entries if we're main
862 acsaf_list.filter(function (x) {
863 return x.main_entry() == csaf.id();
868 var acsbf_list = MARC21.AuthorityControlSet._bib_field_list.filter(
869 function (b) { return b.authority_field() == csaf.id() }
871 csaf.bib_fields( acsbf_list );
873 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields = [].concat(
874 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields,
878 acsbf_list.forEach(function (csbf) {
879 // link the authority field to the bib field
880 if (csbf.authority_field()) {
881 csbf.authority_field(
882 acsaf_list.filter(function (x) {
883 return x.id() == csbf.authority_field();
890 MARC21.AuthorityControlSet._browse_axis_list.forEach(
893 function (m) { return m.field() == csaf.id() }
895 function (fm) { fm.field( csaf ); csaf.axis_maps().push( fm ) } // and set the field
902 // build the authority_tag_map
903 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields.forEach(function (bf) {
905 if (!MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()])
906 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()] = {};
908 bf.authority_field().sf_list().split('').forEach(function (sf_code) {
910 if (!MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code])
911 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code] = {};
913 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code][bf.authority_field().tag()] = sf_code;
919 if (this.controlSetList().length > 0)
920 delete MARC21.AuthorityControlSet._controlsets['-1'];
922 MARC21.AuthorityControlSet._remote_parsed = true;
925 this._preFetchWithFielder = function(cmap) {
926 for (var hint in cmap) {
927 var cache_key = cmap[hint];
928 var method = "open-ils.fielder." + hint + ".atomic";
929 var pkey = fieldmapper.IDL.fmclasses[hint].pkey;
932 query[pkey] = {"!=": null};
934 MARC21.AuthorityControlSet[cache_key] = dojo.map(
935 fieldmapper.standardRequest(
936 ["open-ils.fielder", method],
937 [{"cache": 1, "query" : query}]
939 function(h) { return new fieldmapper[hint]().fromHash(h); }
944 this.controlSetId = function (x) {
945 if (x) this._controlset = ''+x;
946 return this._controlset;
949 this.controlSet = function (x) {
950 return MARC21.AuthorityControlSet._controlsets[''+this.controlSetId(x)];
953 this.controlSetByThesaurusCode = function (x) {
954 var thes = MARC21.AuthorityControlSet._thesaurus_list.filter(
955 function (at) { return at.code() == x }
958 return this.controlSet(thes.control_set());
961 this.browseAxisByCode = function(code) {
962 return MARC21.AuthorityControlSet._browse_axis_by_code[code];
965 this.bibFieldByTag = function (x) {
967 return me.controlSet().bib_fields.filter(
968 function (bf) { if (bf.tag() == x) return true }
972 this.bibFields = function (x) {
973 return this.controlSet(x).bib_fields;
976 this.bibFieldBrowseAxes = function (t) {
978 for (var bcode in MARC21.AuthorityControlSet._browse_axis_by_code) {
979 MARC21.AuthorityControlSet._browse_axis_by_code[bcode].maps().forEach(
981 if (m.field().bib_fields().filter(
982 function (b) { return b.tag() == t }
991 this.authorityFields = function (x) {
992 return this.controlSet(x).raw.authority_fields();
995 this.thesauri = function (x) {
996 return this.controlSet(x).raw.thesauri();
999 this.controlSetList = function () {
1001 for (var i in MARC21.AuthorityControlSet._controlsets) {
1007 this.findControlSetsForTag = function (tag) {
1009 var old_acs = this.controlSetId();
1010 var acs_list = me.controlSetList().filter(
1011 function(acs_id) { return (me.controlSet(acs_id).control_map[tag]) }
1013 this.controlSetId(old_acs);
1017 this.findControlSetsForAuthorityTag = function (tag) {
1019 var old_acs = this.controlSetId();
1021 var acs_list = me.controlSetList().filter(
1023 var a = me.controlSet(acs_id);
1024 for (var btag in a.control_map) {
1025 for (var sf in a.control_map[btag]) {
1026 if (a.control_map[btag][sf][tag]) return true;
1032 this.controlSetId(old_acs);
1036 this.bibToAuthority = function (field) {
1037 var b_field = this.bibFieldByTag(field.tag);
1039 if (b_field) { // construct an marc authority record
1040 var af = b_field.authority_field();
1043 for (var i = 0; i < field.subfields.length; i++) {
1044 if (af.sf_list().indexOf(field.subfields[i][0]) > -1) {
1045 sflist.push(field.subfields[i]);
1049 var m = new MARC21.Record ({rtype:'AUT'});
1059 return m.toXmlString();
1065 this.bibToAuthorities = function (field) {
1069 var old_acs = this.controlSetId();
1070 me.controlSetList().forEach(
1072 var acs = me.controlSet(acs_id);
1073 var x = me.bibToAuthority(field);
1074 if (x) { var foo = {}; foo[acs_id] = x; auth_list.push(foo); }
1077 this.controlSetId(old_acs);
1082 // This should not be used in an angular world. Instead, the call
1083 // to open-ils.search.authority.simple_heading.from_xml.batch.atomic should
1084 // be performed by the code that wants to find matching authorities.
1085 this.findMatchingAuthorities = function (field) {
1086 return fieldmapper.standardRequest(
1087 [ 'open-ils.search', 'open-ils.search.authority.simple_heading.from_xml.batch.atomic' ],
1088 this.bibToAuthorities(field)
1092 if (kwargs.controlSet) {
1093 this.controlSetId( kwargs.controlSet );
1095 this.controlSetId( this.controlSetList().sort(function(a,b){return (a - b)}) );
1101 MARC21.Record._recType = {
1102 BKS : { Type : /[at]{1}/, BLvl : /[acdm]{1}/ },
1103 SER : { Type : /[a]{1}/, BLvl : /[bsi]{1}/ },
1104 VIS : { Type : /[gkro]{1}/, BLvl : /[abcdmsi]{1}/ },
1105 MIX : { Type : /[p]{1}/, BLvl : /[cdi]{1}/ },
1106 MAP : { Type : /[ef]{1}/, BLvl : /[abcdmsi]{1}/ },
1107 SCO : { Type : /[cd]{1}/, BLvl : /[abcdmsi]{1}/ },
1108 REC : { Type : /[ij]{1}/, BLvl : /[abcdmsi]{1}/ },
1109 COM : { Type : /[m]{1}/, BLvl : /[abcdmsi]{1}/ },
1110 AUT : { Type : /[z]{1}/, BLvl : /.{1}/ },
1111 MFHD : { Type : /[uvxy]{1}/, BLvl : /.{1}/ }
1114 MARC21.Record._ff_pos = {
1117 SCO : {start: 24, len : 6, def : ' ' },
1118 REC : {start: 24, len : 6, def : ' ' }
1121 SCO : {start: 7, len : 6, def : ' ' },
1122 REC : {start: 7, len : 6, def : ' ' }
1127 SER : {start : 33, len : 1, def : ' ' }
1130 SER : {start : 16, len : 1, def : ' ' }
1135 BKS : {start : 22, len : 1, def : ' ' },
1136 SER : {start : 22, len : 1, def : ' ' },
1137 VIS : {start : 22, len : 1, def : ' ' },
1138 SCO : {start : 22, len : 1, def : ' ' },
1139 REC : {start : 22, len : 1, def : ' ' },
1140 COM : {start : 22, len : 1, def : ' ' }
1143 BKS : {start : 5, len : 1, def : ' ' },
1144 SER : {start : 5, len : 1, def : ' ' },
1145 VIS : {start : 5, len : 1, def : ' ' },
1146 SCO : {start : 5, len : 1, def : ' ' },
1147 REC : {start : 5, len : 1, def : ' ' },
1148 COM : {start : 5, len : 1, def : ' ' }
1153 BKS : {start : 34, len : 1, def : ' ' }
1156 BKS : {start : 17, len : 1, def : ' ' }
1161 BKS : {start : 7, len : 1, def : 'm' },
1162 SER : {start : 7, len : 1, def : 's' },
1163 VIS : {start : 7, len : 1, def : 'm' },
1164 MIX : {start : 7, len : 1, def : 'c' },
1165 MAP : {start : 7, len : 1, def : 'm' },
1166 SCO : {start : 7, len : 1, def : 'm' },
1167 REC : {start : 7, len : 1, def : 'm' },
1168 COM : {start : 7, len : 1, def : 'm' }
1173 SCO : {start : 18, len : 2, def : 'uu'},
1174 REC : {start : 18, len : 2, def : 'uu'}
1177 SCO : {start : 1, len : 2, def : 'uu'},
1178 REC : {start : 1, len : 2, def : 'uu'}
1183 BKS : {start : 29, len : 1, def : '0' },
1184 SER : {start : 29, len : 1, def : '0' }
1187 BKS : {start : 11, len : 1, def : '0' },
1188 SER : {start : 11, len : 1, def : '0' }
1193 BKS : {start : 24, len : 4, def : ' ' },
1194 SER : {start : 25, len : 3, def : ' ' }
1197 BKS : {start : 7, len : 4, def : ' ' },
1198 SER : {start : 8, len : 3, def : ' ' }
1203 MAP : {start: 25, len : 1, def : 'a' }
1206 MAP : {start : 8, len : 1, def : 'a' }
1211 BKS : {start : 8, len : 1, def : ' ' },
1212 SER : {start : 8, len : 1, def : ' ' },
1213 VIS : {start : 8, len : 1, def : ' ' },
1214 MIX : {start : 8, len : 1, def : ' ' },
1215 MAP : {start : 8, len : 1, def : ' ' },
1216 SCO : {start : 8, len : 1, def : ' ' },
1217 REC : {start : 8, len : 1, def : ' ' },
1218 COM : {start : 8, len : 1, def : ' ' }
1223 BKS : {start : 15, len : 3, def : ' ' },
1224 SER : {start : 15, len : 3, def : ' ' },
1225 VIS : {start : 15, len : 3, def : ' ' },
1226 MIX : {start : 15, len : 3, def : ' ' },
1227 MAP : {start : 15, len : 3, def : ' ' },
1228 SCO : {start : 15, len : 3, def : ' ' },
1229 REC : {start : 15, len : 3, def : ' ' },
1230 COM : {start : 15, len : 3, def : ' ' }
1235 BKS : {start : 7, len : 4, def : ' ' },
1236 SER : {start : 7, len : 4, def : ' ' },
1237 VIS : {start : 7, len : 4, def : ' ' },
1238 MIX : {start : 7, len : 4, def : ' ' },
1239 MAP : {start : 7, len : 4, def : ' ' },
1240 SCO : {start : 7, len : 4, def : ' ' },
1241 REC : {start : 7, len : 4, def : ' ' },
1242 COM : {start : 7, len : 4, def : ' ' }
1247 BKS : {start : 11, len : 4, def : ' ' },
1248 SER : {start : 11, len : 4, def : '9' },
1249 VIS : {start : 11, len : 4, def : ' ' },
1250 MIX : {start : 11, len : 4, def : ' ' },
1251 MAP : {start : 11, len : 4, def : ' ' },
1252 SCO : {start : 11, len : 4, def : ' ' },
1253 REC : {start : 11, len : 4, def : ' ' },
1254 COM : {start : 11, len : 4, def : ' ' }
1259 BKS : {start : 18, len : 1, def : ' ' },
1260 SER : {start : 18, len : 1, def : ' ' },
1261 VIS : {start : 18, len : 1, def : ' ' },
1262 MIX : {start : 18, len : 1, def : ' ' },
1263 MAP : {start : 18, len : 1, def : ' ' },
1264 SCO : {start : 18, len : 1, def : ' ' },
1265 REC : {start : 18, len : 1, def : ' ' },
1266 COM : {start : 18, len : 1, def : ' ' }
1271 BKS : {start : 6, len : 1, def : ' ' },
1272 SER : {start : 6, len : 1, def : 'c' },
1273 VIS : {start : 6, len : 1, def : ' ' },
1274 MIX : {start : 6, len : 1, def : ' ' },
1275 MAP : {start : 6, len : 1, def : ' ' },
1276 SCO : {start : 6, len : 1, def : ' ' },
1277 REC : {start : 6, len : 1, def : ' ' },
1278 COM : {start : 6, len : 1, def : ' ' }
1283 BKS : {start : 17, len : 1, def : ' ' },
1284 SER : {start : 17, len : 1, def : ' ' },
1285 VIS : {start : 17, len : 1, def : ' ' },
1286 MIX : {start : 17, len : 1, def : ' ' },
1287 MAP : {start : 17, len : 1, def : ' ' },
1288 SCO : {start : 17, len : 1, def : ' ' },
1289 REC : {start : 17, len : 1, def : ' ' },
1290 COM : {start : 17, len : 1, def : ' ' },
1291 AUT : {start : 17, len : 1, def : 'n' },
1292 MFHD : {start : 17, len : 1, def : 'u' }
1297 SER : {start : 24, len : 1, def : ' '}
1300 SER : {start : 7, len : 1, def : ' '}
1305 BKS : {start : 30, len : 1, def : '0' }
1308 BKS : {start : 13, len : 1, def : '0' }
1313 COM : {start: 26, len : 1, def : 'u' }
1316 COM : {start: 9, len : 1, def : 'u' }
1321 SCO : {start : 20, len : 1, def : 'u'},
1322 REC : {start : 20, len : 1, def : 'n'}
1325 SCO : {start : 3, len : 1, def : 'u'},
1326 REC : {start : 3, len : 1, def : 'n'}
1331 BKS : {start : 23, len : 1, def : ' ' },
1332 SER : {start : 23, len : 1, def : ' ' },
1333 VIS : {start : 29, len : 1, def : ' ' },
1334 MIX : {start : 23, len : 1, def : ' ' },
1335 MAP : {start : 29, len : 1, def : ' ' },
1336 SCO : {start : 23, len : 1, def : ' ' },
1337 REC : {start : 23, len : 1, def : ' ' }
1340 BKS : {start : 6, len : 1, def : ' ' },
1341 SER : {start : 6, len : 1, def : ' ' },
1342 VIS : {start : 12, len : 1, def : ' ' },
1343 MIX : {start : 6, len : 1, def : ' ' },
1344 MAP : {start : 12, len : 1, def : ' ' },
1345 SCO : {start : 6, len : 1, def : ' ' },
1346 REC : {start : 6, len : 1, def : ' ' }
1351 SER : {start : 18, len : 1, def : ' '}
1354 SER : {start : 1, len : 1, def : ' '}
1359 BKS : {start : 28, len : 1, def : ' ' },
1360 SER : {start : 28, len : 1, def : ' ' },
1361 VIS : {start : 28, len : 1, def : ' ' },
1362 MAP : {start : 28, len : 1, def : ' ' },
1363 COM : {start : 28, len : 1, def : ' ' }
1366 BKS : {start : 11, len : 1, def : ' ' },
1367 SER : {start : 11, len : 1, def : ' ' },
1368 VIS : {start : 11, len : 1, def : ' ' },
1369 MAP : {start : 11, len : 1, def : ' ' },
1370 COM : {start : 11, len : 1, def : ' ' }
1375 BKS : {start : 18, len : 4, def : ' ' }
1378 BKS : {start : 1, len : 4, def : ' ' }
1383 BKS : {start : 31, len : 1, def : '0' },
1384 MAP : {start : 31, len : 1, def : '0' }
1387 BKS : {start : 14, len : 1, def : '0' },
1388 MAP : {start : 14, len : 1, def : '0' }
1393 MFHD : {start : 18, len : 1, def : 'i' }
1398 BKS : {start : 35, len : 3, def : ' ' },
1399 SER : {start : 35, len : 3, def : ' ' },
1400 VIS : {start : 35, len : 3, def : ' ' },
1401 MIX : {start : 35, len : 3, def : ' ' },
1402 MAP : {start : 35, len : 3, def : ' ' },
1403 SCO : {start : 35, len : 3, def : ' ' },
1404 REC : {start : 35, len : 3, def : ' ' },
1405 COM : {start : 35, len : 3, def : ' ' }
1410 BKS : {start : 33, len : 1, def : '0' }
1413 BKS : {start : 16, len : 1, def : '0' }
1418 SCO : {start : 30, len : 2, def : 'n'},
1419 REC : {start : 30, len : 2, def : ' '}
1422 SCO : {start : 13, len : 2, def : 'n'},
1423 REC : {start : 13, len : 2, def : ' '}
1428 BKS : {start : 38, len : 1, def : ' ' },
1429 SER : {start : 38, len : 1, def : ' ' },
1430 VIS : {start : 38, len : 1, def : ' ' },
1431 MIX : {start : 38, len : 1, def : ' ' },
1432 MAP : {start : 38, len : 1, def : ' ' },
1433 SCO : {start : 38, len : 1, def : ' ' },
1434 REC : {start : 38, len : 1, def : ' ' },
1435 COM : {start : 38, len : 1, def : ' ' }
1440 SER : {start : 22, len : 1, def : ' '}
1443 SER : {start: 5, len : 1, def: ' '}
1448 SCO : {start : 21, len : 1, def : ' '},
1449 REC : {start : 21, len : 1, def : 'n'}
1452 SCO : {start : 4, len : 1, def : ' '},
1453 REC : {start : 4, len : 1, def : 'n'}
1458 MAP : {start : 22, len : 2, def : ' ' }
1461 MAP: {start : 5, len : 2, def : ' ' }
1466 BKS : {start : 5, len : 1, def : 'n' },
1467 SER : {start : 5, len : 1, def : 'n' },
1468 VIS : {start : 5, len : 1, def : 'n' },
1469 MIX : {start : 5, len : 1, def : 'n' },
1470 MAP : {start : 5, len : 1, def : 'n' },
1471 SCO : {start : 5, len : 1, def : 'n' },
1472 REC : {start : 5, len : 1, def : 'n' },
1473 COM : {start : 5, len : 1, def : 'n' },
1474 MFHD: {start : 5, len : 1, def : 'n' },
1475 AUT : {start : 5, len : 1, def : 'n' }
1480 SER : {start : 19, len : 1, def : ' '}
1483 SER : {start : 2, len : 1, def : ' '}
1488 MAP : {start: 18, len : 4, def : ' '}
1491 MAP : {start: 1, len : 4, def : ' '}
1496 SER : {start : 34, len : 1, def : '0' }
1499 SER : {start : 17, len : 1, def : '0' }
1504 MAP : {start: 33, len : 2, def : ' ' }
1507 MAP : {start: 16, len : 2, def : ' '}
1512 BKS : {start : 39, len : 1, def : 'd' },
1513 SER : {start : 39, len : 1, def : 'd' },
1514 VIS : {start : 39, len : 1, def : 'd' },
1515 SCO : {start : 39, len : 1, def : 'd' },
1516 REC : {start : 39, len : 1, def : 'd' },
1517 COM : {start : 39, len : 1, def : 'd' },
1518 MFHD : {start : 39, len : 1, def : 'd' },
1519 "AUT" : {"start" : 39, "len" : 1, "def" : 'd' }
1524 SER : {start : 21, len : 1, def : ' '}
1527 SER : {start : 4, len : 1, def : ' '}
1532 VIS : {start : 34, len : 1, def : ' '}
1535 VIS : {start : 17, len : 1, def : ' '}
1540 VIS : {start : 18, len : 3, def : ' '}
1543 VIS : {start : 1, len : 3, def : ' '}
1548 VIS : {start : 33, len : 1, def : ' ' }
1551 VIS : {start : 16, len : 1, def : ' ' }
1556 SCO : {start : 33, len : 1, def : ' ' },
1557 REC : {start : 33, len : 1, def : 'n' }
1560 SCO : {start : 16, len : 1, def : ' ' },
1561 REC : {start : 16, len : 1, def : 'n' }
1566 BKS : {start : 6, len : 1, def : 'a' },
1567 SER : {start : 6, len : 1, def : 'a' },
1568 VIS : {start : 6, len : 1, def : 'g' },
1569 MIX : {start : 6, len : 1, def : 'p' },
1570 MAP : {start : 6, len : 1, def : 'e' },
1571 SCO : {start : 6, len : 1, def : 'c' },
1572 REC : {start : 6, len : 1, def : 'i' },
1573 COM : {start : 6, len : 1, def : 'm' },
1574 AUT : {start : 6, len : 1, def : 'z' },
1575 MFHD : {start : 6, len : 1, def : 'y' }
1580 "AUT" : {"start" : 6, "len" : 1, "def" : ' ' }
1585 "AUT" : {"start" : 7, "len" : 1, "def" : ' ' }
1590 "AUT" : {"start" : 8, "len" : 1, "def" : ' ' }
1595 "AUT" : {"start" : 9, "len" : 1, "def" : ' ' }
1600 "AUT" : {"start" : 10, "len" : 1, "def" : ' ' }
1605 "AUT" : {"start" : 11, "len" : 1, "def" : ' ' }
1610 "AUT" : {"start" : 12, "len" : 1, "def" : ' ' }
1615 "AUT" : {"start" : 13, "len" : 1, "def" : ' ' }
1620 "AUT" : {"start" : 14, "len" : 1, "def" : ' ' }
1625 "AUT" : {"start" : 15, "len" : 1, "def" : ' ' }
1630 "AUT" : {"start" : 16, "len" : 1, "def" : ' ' }
1635 "AUT" : {"start" : 17, "len" : 1, "def" : ' ' }
1640 "AUT" : {"start" : 28, "len" : 1, "def" : ' ' }
1645 "AUT" : {"start" : 29, "len" : 1, "def" : ' ' }
1650 "AUT" : {"start" : 31, "len" : 1, "def" : ' ' }
1655 "AUT" : {"start" : 32, "len" : 1, "def" : ' ' }
1660 "AUT" : {"start" : 33, "len" : 1, "def" : ' ' }
1665 "AUT" : {"start" : 38, "len" : 1, "def" : ' ' }
1670 "AUT" : {"start" : 39, "len" : 1, "def" : ' ' }
1675 MARC21.Record._physical_characteristics = {
1677 label : "Electronic Resource",
1682 values: { a : "Tape Cartridge",
1683 b : "Chip cartridge",
1684 c : "Computer optical disk cartridge",
1685 f : "Tape cassette",
1687 j : "Magnetic disk",
1688 m : "Magneto-optical disk",
1698 values: { a : "One color",
1699 b : "Black-and-white",
1703 n : "Not applicable",
1710 label : "Dimensions",
1711 values: { a : "3 1/2 in.",
1713 g : "4 3/4 in. or 12 cm.",
1714 i : "1 1/8 x 2 3/8 in.",
1715 j : "3 7/8 x 2 1/2 in.",
1716 n : "Not applicable",
1726 values: { ' ' : "No sound (Silent)",
1733 label : "Image bit depth",
1734 values: { mmm : "Multiple",
1735 nnn : "Not applicable",
1741 label : "File formats",
1742 values: { a : "One file format",
1743 m : "Multiple file formats",
1749 label : "Quality assurance target(s)",
1750 values: { a : "Absent",
1751 n : "Not applicable",
1758 label : "Antecedent/Source",
1759 values: { a : "File reproduced from original",
1760 b : "File reproduced from microform",
1761 c : "File reproduced from electronic resource",
1762 d : "File reproduced from an intermediate (not microform)",
1764 n : "Not applicable",
1770 label : "Level of compression",
1771 values: { a : "Uncompressed",
1780 label : "Reformatting quality",
1781 values: { a : "Access",
1782 n : "Not applicable",
1796 values: { a : "Celestial globe",
1797 b : "Planetary or lunar globe",
1798 c : "Terrestrial globe",
1799 e : "Earth moon globe",
1807 values: { a : "One color",
1813 label : "Physical medium",
1814 values: { a : "Paper",
1828 label : "Type of reproduction",
1829 values: { f : "Facsimile",
1830 n : "Not applicable",
1843 values: { d : "Atlas",
1848 r : "Remote-sensing image",
1858 values: { a : "One color",
1864 label : "Physical medium",
1865 values: { a : "Paper",
1873 q : "Flexible base photographic medium, positive",
1874 r : "Flexible base photographic medium, negative",
1875 s : "Non-flexible base photographic medium, positive",
1876 t : "Non-flexible base photographic medium, negative",
1878 y : "Other photographic medium",
1884 label : "Type of reproduction",
1885 values: { f : "Facsimile",
1886 n : "Not applicable",
1893 label : "Production/reproduction details",
1894 values: { a : "Photocopy, blueline print",
1896 c : "Pre-production",
1904 label : "Positive/negative",
1905 values: { a : "Positive",
1908 n : "Not applicable"
1914 label : "Microform",
1919 values: { a : "Aperture card",
1920 b : "Microfilm cartridge",
1921 c : "Microfilm cassette",
1922 d : "Microfilm reel",
1924 f : "Microfiche cassette",
1932 label : "Positive/negative",
1933 values: { a : "Positive",
1941 label : "Dimensions",
1942 values: { a : "8 mm.",
1947 l : "3 x 5 in. (8 x 13 cm.)",
1948 m : "4 x 6 in. (11 x 15 cm.)",
1949 o : "6 x 9 in. (16 x 23 cm.)",
1950 p : "3 1/4 x 7 3/8 in. (9 x 19 cm.)",
1957 label : "Reduction ratio range/Reduction ratio",
1958 values: { a : "Low (1-16x)",
1959 b : "Normal (16-30x)",
1960 c : "High (31-60x)",
1961 d : "Very high (61-90x)",
1964 v : "Reduction ratio varies"
1970 values: { b : "Black-and-white",
1979 label : "Emulsion on film",
1980 values: { a : "Silver halide",
1984 n : "Not applicable",
1991 label : "Quality assurance target(s)",
1992 values: { a : "1st gen. master",
1993 b : "Printing master",
1995 m : "Mixed generation",
2001 label : "Base of film",
2002 values: { a : "Safety base, undetermined",
2003 c : "Safety base, acetate undetermined",
2004 d : "Safety base, diacetate",
2007 n : "Not applicable",
2008 p : "Safety base, polyester",
2009 r : "Safety base, mixed",
2010 t : "Safety base, triacetate",
2018 label : "Motion Picture",
2023 values: { a : "Film cartridge",
2024 f : "Film cassette",
2033 values: { b : "Black-and-white",
2043 label : "Motion picture presentation format",
2044 values: { a : "Standard sound aperture, reduced frame",
2045 b : "Nonanamorphic (wide-screen)",
2047 d : "Anamorphic (wide-screen)",
2048 e : "Other-wide screen format",
2049 f : "Standard. silent aperture, full frame",
2056 label : "Sound on medium or separate",
2057 values: { a : "Sound on medium",
2058 b : "Sound separate from medium",
2064 label : "Medium for sound",
2065 values: { a : "Optical sound track on motion picture film",
2066 b : "Magnetic sound track on motion picture film",
2067 c : "Magnetic audio tape in cartridge",
2069 e : "Magnetic audio tape on reel",
2070 f : "Magnetic audio tape in cassette",
2071 g : "Optical and magnetic sound track on film",
2080 label : "Dimensions",
2081 values: { a : "Standard 8 mm.",
2082 b : "Super 8 mm./single 8 mm.",
2094 label : "Configuration of playback channels",
2095 values: { k : "Mixed",
2097 n : "Not applicable",
2098 q : "Multichannel, surround or quadraphonic",
2106 label : "Production elements",
2107 values: { a : "Work print",
2111 e : "Mixing tracks",
2112 f : "Title bands/inter-title rolls",
2113 g : "Production rolls",
2114 n : "Not applicable",
2121 label : "Non-projected Graphic",
2126 values: { c : "Collage",
2129 f : "Photo-mechanical print",
2130 g : "Photonegative",
2134 l : "Technical drawing",
2136 o : "Flash/activity card",
2144 values: { a : "One color",
2145 b : "Black-and-white",
2155 label : "Primary support material",
2156 values: { a : "Canvas",
2157 b : "Bristol board",
2158 c : "Cardboard/illustration board",
2164 m : "Mixed collection",
2177 label : "Secondary support material",
2178 values: { a : "Canvas",
2179 b : "Bristol board",
2180 c : "Cardboard/illustration board",
2186 m : "Mixed collection",
2200 label : "Projected Graphic",
2205 values: { c : "Film cartridge",
2207 f : "Film filmstrip type",
2208 o : "Filmstrip roll",
2217 values: { b : "Black-and-white",
2221 n : "Not applicable",
2228 label : "Base of emulsion",
2229 values: { d : "Glass",
2232 k : "Film base, other than safety film",
2233 m : "Mixed collection",
2241 label : "Sound on medium or separate",
2242 values: { a : "Sound on medium",
2243 b : "Sound separate from medium",
2249 label : "Medium for sound",
2250 values: { a : "Optical sound track on motion picture film",
2251 b : "Magnetic sound track on motion picture film",
2252 c : "Magnetic audio tape in cartridge",
2254 e : "Magnetic audio tape on reel",
2255 f : "Magnetic audio tape in cassette",
2256 g : "Optical and magnetic sound track on film",
2265 label : "Dimensions",
2266 values: { a : "Standard 8 mm.",
2267 b : "Super 8 mm./single 8 mm.",
2273 j : "2 x 2 in. (5 x 5 cm.)",
2274 k : "2 1/4 x 2 1/4 in. (6 x 6 cm.)",
2275 s : "4 x 5 in. (10 x 13 cm.)",
2276 t : "5 x 7 in. (13 x 18 cm.)",
2277 v : "8 x 10 in. (21 x 26 cm.)",
2278 w : "9 x 9 in. (23 x 23 cm.)",
2279 x : "10 x 10 in. (26 x 26 cm.)",
2280 y : "7 x 7 in. (18 x 18 cm.)",
2287 label : "Secondary support material",
2288 values: { c : "Cardboard",
2292 j : "Metal and glass",
2293 k : "Synthetics and glass",
2294 m : "Mixed collection",
2302 label : "Remote-sensing Image",
2307 values: { u : "Unspecified" }
2311 label : "Altitude of sensor",
2312 values: { a : "Surface",
2315 n : "Not applicable",
2322 label : "Attitude of sensor",
2323 values: { a : "Low oblique",
2326 n : "Not applicable",
2332 label : "Cloud cover",
2333 values: { 0 : "0-09%",
2343 n : "Not applicable",
2349 label : "Platform construction type",
2350 values: { a : "Balloon",
2351 b : "Aircraft-low altitude",
2352 c : "Aircraft-medium altitude",
2353 d : "Aircraft-high altitude",
2354 e : "Manned spacecraft",
2355 f : "Unmanned spacecraft",
2356 g : "Land-based remote-sensing device",
2357 h : "Water surface-based remote-sensing device",
2358 i : "Submersible remote-sensing device",
2359 n : "Not applicable",
2366 label : "Platform use category",
2367 values: { a : "Meteorological",
2368 b : "Surface observing",
2369 c : "Space observing",
2371 n : "Not applicable",
2378 label : "Sensor type",
2379 values: { a : "Active",
2387 label : "Data type",
2388 values: { nn : "Not applicable",
2391 aa : "Visible light",
2392 da : "Near infrared",
2393 db : "Middle infrared",
2394 dc : "Far infrared",
2395 dd : "Thermal infrared",
2396 de : "Shortwave infrared (SWIR)",
2397 df : "Reflective infrared",
2398 dv : "Combinations",
2399 dz : "Other infrared data",
2400 ga : "Sidelooking airborne radar (SLAR)",
2401 gb : "Synthetic aperture radar (SAR-single frequency)",
2402 gc : "SAR-multi-frequency (multichannel)",
2403 gd : "SAR-like polarization",
2404 ge : "SAR-cross polarization",
2405 gf : "Infometric SAR",
2406 gg : "Polarmetric SAR",
2407 gu : "Passive microwave mapping",
2408 gz : "Other microwave data",
2409 ja : "Far ultraviolet",
2410 jb : "Middle ultraviolet",
2411 jc : "Near ultraviolet",
2412 jv : "Ultraviolet combinations",
2413 jz : "Other ultraviolet data",
2414 ma : "Multi-spectral, multidata",
2415 mb : "Multi-temporal",
2416 mm : "Combination of various data types",
2417 pa : "Sonar-water depth",
2418 pb : "Sonar-bottom topography images, sidescan",
2419 pc : "Sonar-bottom topography, near-surface",
2420 pd : "Sonar-bottom topography, near-bottom",
2421 pe : "Seismic surveys",
2422 pz : "Other acoustical data",
2423 ra : "Gravity anomales (general)",
2427 sa : "Magnetic field",
2428 ta : "Radiometric surveys"
2434 label : "Sound Recording",
2439 values: { d : "Sound disc",
2441 g : "Sound cartridge",
2442 i : "Sound-track film",
2444 s : "Sound cassette",
2445 t : "Sound-tape reel",
2447 w : "Wire recording",
2454 values: { a : "16 rpm",
2474 label : "Configuration of playback channels",
2475 values: { m : "Monaural",
2484 label : "Groove width or pitch",
2485 values: { m : "Microgroove/fine",
2486 n : "Not applicable",
2487 s : "Coarse/standard",
2494 label : "Dimensions",
2495 values: { a : "3 in.",
2501 g : "4 3/4 in. (12 cm.)",
2502 j : "3 7/8 x 2 1/2 in.",
2503 o : "5 1/4 x 3 7/8 in.",
2504 s : "2 3/4 x 4 in.",
2505 n : "Not applicable",
2512 label : "Tape width",
2513 values: { l : "1/8 in.",
2515 n : "Not applicable",
2524 label : "Tape configuration ",
2525 values: { a : "Full (1) track",
2526 b : "Half (2) track",
2527 c : "Quarter (4) track",
2531 n : "Not applicable",
2538 label : "Special playback",
2539 values: { a : "NAB standard",
2540 b : "CCIR standard",
2541 c : "Dolby-B encoded, standard Dolby",
2543 e : "Digital recording",
2544 f : "Dolby-A encoded",
2545 g : "Dolby-C encoded",
2547 n : "Not applicable",
2554 label : "Capture and storage",
2555 values: { a : "Acoustical capture, direct storage",
2556 b : "Direct storage, not acoustical",
2557 d : "Digital storage",
2558 e : "Analog electrical storage",
2566 label : "Tactile Material",
2571 values: { a : "Moon",
2574 d : "Tactile, with no writing system",
2581 label : "Class of braille writing",
2582 values: { a : "Literary braille",
2583 b : "Format code braille",
2584 c : "Mathematics and scientific braille",
2585 d : "Computer braille",
2586 e : "Music braille",
2587 m : "Multiple braille types",
2588 n : "Not applicable",
2595 label : "Level of contraction",
2596 values: { a : "Uncontracted",
2599 n : "Not applicable",
2606 label : "Braille music format",
2607 values: { a : "Bar over bar",
2609 c : "Line over line",
2612 f : "Section by section",
2615 i : "Spanner short form scoring",
2616 j : "Short form scoring",
2618 l : "Vertical score",
2619 n : "Not applicable",
2626 label : "Special physical characteristics",
2627 values: { a : "Print/braille",
2628 b : "Jumbo or enlarged braille",
2629 n : "Not applicable",
2637 label : "Videorecording",
2642 values: { c : "Videocartridge",
2644 f : "Videocassette",
2653 values: { b : "Black-and-white",
2656 n : "Not applicable",
2663 label : "Videorecording format",
2664 values: { a : "Beta",
2686 label : "Sound on medium or separate",
2687 values: { a : "Sound on medium",
2688 b : "Sound separate from medium",
2694 label : "Medium for sound",
2695 values: { a : "Optical sound track on motion picture film",
2696 b : "Magnetic sound track on motion picture film",
2697 c : "Magnetic audio tape in cartridge",
2699 e : "Magnetic audio tape on reel",
2700 f : "Magnetic audio tape in cassette",
2701 g : "Optical and magnetic sound track on motion picture film",
2710 label : "Dimensions",
2711 values: { a : "8 mm.",
2723 label : "Configuration of playback channel",
2724 values: { k : "Mixed",
2726 n : "Not applicable",
2727 q : "Multichannel, surround or quadraphonic",
2737 MARC21.AuthorityControlSet._remote_loaded = false;
2738 MARC21.AuthorityControlSet._remote_parsed = false;
2740 MARC21.AuthorityControlSet._controlsets = {
2741 // static sorta-LoC setup ... to be overwritten with server data
2744 name : 'Static LoC legacy mapping',
2745 description : 'Legacy mapping provided as a default',
2748 'a' : { 100 : 'a' },
2749 'd' : { 100 : 'd' },
2750 'e' : { 100 : 'e' },
2754 'a' : { 110 : 'a' },
2758 'a' : { 111 : 'a' },
2762 'a' : { 130 : 'a' },
2766 'a' : { 130 : 'a' },
2770 'a' : { 100 : 'a' },
2774 'a' : { 110 : 'a' },
2778 'a' : { 111 : 'a' },
2782 'a' : { 130 : 'a' },
2783 'n' : { 130 : 'n' },
2787 'a' : { 100 : 'a' },
2788 'd' : { 100 : 'd' },
2789 'q' : { 100 : 'q' },
2793 'a' : { 110 : 'a' },
2797 'a' : { 111 : 'a' },
2798 'c' : { 111 : 'c' },
2802 'a' : { 130 : 'a' },
2806 'a' : { 100 : 'a' },
2810 'a' : { 110 : 'a' },
2814 'a' : { 111 : 'a' },
2818 'a' : { 130 : 'a' },
2822 'a' : { 100 : 'a' },
2823 'd' : { 100 : 'd' },
2824 'q' : { 100 : 'q' },
2825 't' : { 100 : 't' },
2852 'a' : { 110 : 'a' },
2853 'd' : { 110 : 'd' },
2854 't' : { 110 : 't' },
2881 'a' : { 111 : 'a' },
2882 'd' : { 111 : 'd' },
2883 't' : { 111 : 't' },
2910 'a' : { 130 : 'a' },
2914 'a' : { 148 : 'a' },
2915 'v' : { 148 : 'v' },
2916 'x' : { 148 : 'x' },
2917 'y' : { 148 : 'y' },
2921 'a' : { 150 : 'a' },
2922 'b' : { 150 : 'b' },
2949 'a' : { 151 : 'a' },
2976 'a' : { 155 : 'a' },