1 /* ---------------------------------------------------------------------------
2 * Copyright (C) 2009-2015 Equinox Software, Inc.
3 * Mike Rylander <miker@esilibrary.com>
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 * ---------------------------------------------------------------------------
18 // This module requires a /real/ jQuery be used with your
19 // angularjs, so as to avoid using hand-rolled AJAX.
23 Record : function(kwargs) {
24 if (!kwargs) kwargs = {};
26 this.generate008 = function () {
31 var y = now.getUTCFullYear().toString().substr(2,2);
32 var m = now.getUTCMonth() + 1;
33 if (m < 10) m = '0' + m;
34 var d = now.getUTCDate();
35 if (d < 10) d = '0' + d;
38 if (f = this.field('008',true)[0]) {
42 /* lang code from 041a */
43 var lang = orig008.substr(35, 3);
45 if (f = this.field('041',true)[0]) {
46 if (s = f.subfield('a',true)[0]) {
51 /* country code from 044a */
52 var country = orig008.substr(15, 3);
53 if (f = this.field('044',true)[0]) {
54 if (s = f.subfield('a',true)[0]) {
55 if(s[1]) country = s[1];
58 while (country.length < 3) country = country + ' ';
59 if (country.length > 3) country = country.substr(0,3);
62 var date1 = now.getUTCFullYear().toString();
63 if (f = this.field('260',true)[0]) {
64 if (s = f.subfield('c',true)[0]) {
67 tmpd = tmpd.replace(/[^0-9]/g, '');
68 if (tmpd.match(/^\d\d\d\d/)) {
69 date1 = tmpd.substr(0, 4);
75 var date2 = orig008.substr(11, 4);
76 var datetype = orig008.substr(6, 1);
77 var modded = orig008.substr(38, 1);
78 var catsrc = orig008.substr(39, 1);
80 return '' + y + m + d + datetype + date1 + date2 + country + ' ' + lang + modded + catsrc;
84 this.title = function () { return this.subfield('245','a')[1] }
86 this.field = function (spec, wantarray) {
87 var list = this.fields.filter(function (f) {
88 if (f.tag.match(spec)) return true;
92 if (!wantarray && list.length == 1) return list[0];
96 this.subfield = function (spec, code) {
97 var f = this.field(spec, true)[0];
98 if (f) return f.subfield(code)
102 this.appendFields = function () {
104 Array.prototype.slice.call(arguments).forEach( function (f) { f.position = me.fields.length; me.fields.push( f ) } );
107 this.deleteField = function (f) { return this.deleteFields(f) },
109 this.insertOrderedFields = function () {
111 for (var i = 0; i < arguments.length; i++) {
112 var f = arguments[i];
114 for (var j = 0; j < this.fields.length; j++) {
115 if (f.tag < this.fields[j].tag) {
116 this.insertFieldsBefore(this.fields[j], f);
121 if (!done) this.appendFields(f);
125 this.insertFieldsBefore = function (target) {
126 var args = Array.prototype.slice.call(arguments);
129 for (var j = 0; j < this.fields.length; j++) {
130 if (target === this.fields[j]) {
131 args.forEach( function (f) {
133 me.fields.splice(j++,0,f);
138 for (var j = 0; j < this.fields.length; j++) {
139 this.fields[j].position = j;
143 this.insertFieldsAfter = function (target) {
144 var args = Array.prototype.slice.call(arguments);
147 for (var j = 0; j < this.fields.length; j++) {
148 if (target === this.fields[j]) {
149 args.forEach( function (f) {
151 me.fields.splice(++j,0,f);
156 for (var j = 0; j < this.fields.length; j++) {
157 this.fields[j].position = j;
161 this.deleteFields = function () {
164 for ( var i in arguments ) {
165 var f = arguments[i];
166 for (var j = 0; j < me.fields.length; j++) {
167 if (f === me.fields[j]) {
168 me.fields[j].record = null;
169 me.fields.splice(j,1);
175 for (var j = 0; j < this.fields.length; j++) {
176 this.fields[j].position = j;
181 // this.clone = function () { return dojo.clone(this) } // maybe implement later...
183 this.fromXmlURL = function (url) {
185 return $.get( // This is a Promise
188 me.fromXmlDocument($('record', mxml)[0]);
189 if (me.onLoad) me.onLoad();
193 this.fromXmlString = function (mxml) {
194 this.fromXmlDocument( $( $.parseXML( mxml ) ).find('record')[0] );
197 this.fromXmlDocument = function (mxml) {
199 me.leader = $($('leader',mxml)[0]).text() || '00000cam a2200205Ka 4500';
201 $('controlfield', mxml).each(function (ind) {
206 tag : cf.attr('tag'),
212 $('datafield', mxml).each(function (ind) {
217 tag : df.attr('tag'),
218 ind1 : df.attr('ind1'),
219 ind2 : df.attr('ind2'),
220 subfields : $('subfield', df).map(
222 return [[ $(sf).attr('code'), $(sf).text(), i ]];
229 for (var j = 0; j < this.fields.length; j++) {
230 this.fields[j].position = j;
237 this.toXmlDocument = function () {
239 var doc = $.parseXML('<record xmlns="http://www.loc.gov/MARC21/slim"/>');
240 var rec_node = $('record', doc)[0];
242 var ldr = doc.createElementNS('http://www.loc.gov/MARC21/slim', 'leader');
243 ldr.textContent = this.leader;
244 rec_node.appendChild( ldr );
246 this.fields.forEach(function (f) {
247 var element = f.isControlfield() ? 'controlfield' : 'datafield';
248 var f_node = doc.createElementNS( 'http://www.loc.gov/MARC21/slim', element );
249 f_node.setAttribute('tag', f.tag);
251 if (f.isControlfield()) {
252 if (f.data) f_node.textContent = f.data;
254 f_node.setAttribute('ind1', f.indicator(1));
255 f_node.setAttribute('ind2', f.indicator(2));
256 f.subfields.forEach( function (sf) {
257 var sf_node = doc.createElementNS('http://www.loc.gov/MARC21/slim', 'subfield');
258 sf_node.setAttribute('code', sf[0]);
259 sf_node.textContent = sf[1];
260 f_node.appendChild(sf_node);
264 rec_node.appendChild(f_node);
270 this.toXmlString = function () {
271 return (new XMLSerializer()).serializeToString( this.toXmlDocument() );
274 this.fromBreaker = function (marctxt) {
277 function cf_line_data (l) { return l.substring(4) || '' };
278 function df_line_data (l) { return l.substring(6) || '' };
279 function line_tag (l) { return l.substring(0,3) };
280 function df_ind1 (l) { return l.substring(4,5).replace('\\',' ') };
281 function df_ind2 (l) { return l.substring(5,6).replace('\\',' ') };
282 function isControlField (l) {
284 return (x == 'LDR' || x < '010') ? true : false;
287 var lines = marctxt.replace(/^=/gm,'').split('\n');
288 lines.forEach(function (current_line, ind) {
290 if (current_line.match(/^#/)) {
291 // skip comment lines
292 } else if (isControlField(current_line)) {
293 if (line_tag(current_line) == 'LDR') {
294 me.leader = cf_line_data(current_line) || '00000cam a2200205Ka 4500';
299 tag : line_tag(current_line),
300 data : cf_line_data(current_line).replace('\\',' ','g'),
305 if (current_line.substring(4,5) == me.delimiter) // add delimiters if they were left out
306 current_line = current_line.substring(0,3) + ' \\\\' + current_line.substring(4);
308 var data = df_line_data(current_line);
309 if (!(data.substring(0,1) == me.delimiter)) data = me.delimiter + 'a' + data;
311 var sf_list = data.split(me.delimiter);
317 tag : line_tag(current_line),
318 ind1 : df_ind1(current_line),
319 ind2 : df_ind2(current_line),
320 subfields : sf_list.map( function (sf, i) {
321 var sf_data = sf.substring(1);
322 if (me.delimiter == '$') sf_data = sf_data.replace(/\{dollar\}/g, '$');
323 return [ sf.substring(0,1), sf_data, i ];
330 for (var j = 0; j < this.fields.length; j++) {
331 this.fields[j].position = j;
338 this.pruneEmptyFieldsAndSubfields = function() {
340 var fields_to_remove = [];
341 for (var i = 0; i < this.fields.length; i++) {
342 var f = this.fields[i];
343 if (f.isControlfield()) {
345 fields_to_remove.push(f);
348 f.pruneEmptySubfields();
349 if (f.isEmptyDatafield()) {
350 fields_to_remove.push(f);
354 fields_to_remove.forEach(function(f) {
359 this.toBreaker = function () {
362 var mtxt = '=LDR ' + this.leader + '\n';
364 mtxt += this.fields.map( function (f) {
365 if (f.isControlfield()) {
366 if (f.data) return '=' + f.tag + ' ' + f.data.replace(' ','\\','g');
369 return '=' + f.tag + ' ' +
370 f.indicator(1).replace(' ','\\') +
371 f.indicator(2).replace(' ','\\') +
372 f.subfields.map( function (sf) {
374 if (me.delimiter == '$') sf_data = sf_data.replace(/\$/g, '{dollar}');
375 return me.delimiter + sf[0] + sf_data;
383 this.recordType = function () {
385 var _t = this.leader.substr(MARC21.Record._ff_pos.Type.ldr.BKS.start, MARC21.Record._ff_pos.Type.ldr.BKS.len);
386 var _b = this.leader.substr(MARC21.Record._ff_pos.BLvl.ldr.BKS.start, MARC21.Record._ff_pos.BLvl.ldr.BKS.len);
388 for (var t in MARC21.Record._recType) {
389 if (_t.match(MARC21.Record._recType[t].Type) && _b.match(MARC21.Record._recType[t].BLvl)) {
393 return 'BKS'; // default
396 this.videorecordingFormatName = function () {
397 var _7 = this.field('007').data;
399 if (_7 && _7.match(/^v/)) {
400 var _v_e = _7.substr(
401 MARC21.Record._physical_characteristics.v.subfields.e.start,
402 MARC21.Record._physical_characteristics.v.subfields.e.len
405 return MARC21.Record._physical_characteristics.v.subfields.e.values[ _v_e ];
411 this.videorecordingFormatCode = function () {
412 var _7 = this.field('007').data;
414 if (_7 && _7.match(/^v/)) {
416 MARC21.Record._physical_characteristics.v.subfields.e.start,
417 MARC21.Record._physical_characteristics.v.subfields.e.len
424 this.extractFixedField = function (field, dflt) {
425 if (!MARC21.Record._ff_pos[field]) return null;
427 var _l = this.leader;
428 var _8 = this.field('008').data;
429 var _6 = this.field('006').data;
431 var rtype = this.recordType();
435 if (MARC21.Record._ff_pos[field].ldr && _l) {
436 if (MARC21.Record._ff_pos[field].ldr[rtype]) {
438 MARC21.Record._ff_pos[field].ldr[rtype].start,
439 MARC21.Record._ff_pos[field].ldr[rtype].len
442 } else if (MARC21.Record._ff_pos[field]._8 && _8) {
443 if (MARC21.Record._ff_pos[field]._8[rtype]) {
445 MARC21.Record._ff_pos[field]._8[rtype].start,
446 MARC21.Record._ff_pos[field]._8[rtype].len
451 if (!val && MARC21.Record._ff_pos[field]._6 && _6) {
452 if (MARC21.Record._ff_pos[field]._6[rtype]) {
454 MARC21.Record._ff_pos[field]._6[rtype].start,
455 MARC21.Record._ff_pos[field]._6[rtype].len
464 if (MARC21.Record._ff_pos[field].ldr && MARC21.Record._ff_pos[field].ldr[rtype]) {
465 d = MARC21.Record._ff_pos[field].ldr[rtype].def;
469 if (MARC21.Record._ff_pos[field]._8 && MARC21.Record._ff_pos[field]._8[rtype]) {
470 d = MARC21.Record._ff_pos[field]._8[rtype].def;
474 if (!val && MARC21.Record._ff_pos[field]._6 && MARC21.Record._ff_pos[field]._6[rtype]) {
475 d = MARC21.Record._ff_pos[field]._6[rtype].def;
480 for (var j = 0; j < MARC21.Record._ff_pos[field][p][rtype].len; j++) {
491 this.setFixedField = function (field, value) {
492 if (!MARC21.Record._ff_pos[field]) return null;
494 var _l = this.leader;
495 var _8 = this.field('008').data;
496 var _6 = this.field('006').data;
498 var rtype = this.recordType();
501 if (MARC21.Record._ff_pos[field].ldr && _l) {
502 if (MARC21.Record._ff_pos[field].ldr[rtype]) { // It's in the leader
503 if (value.length > MARC21.Record._ff_pos[field].ldr[rtype].len)
504 value = value.substr(0, MARC21.Record._ff_pos[field].ldr[rtype].len);
505 while (value.length < MARC21.Record._ff_pos[field].ldr[rtype].len)
506 value += MARC21.Record._ff_pos[field].ldr[rtype].def;
508 _l.substring(0, MARC21.Record._ff_pos[field].ldr[rtype].start) +
511 MARC21.Record._ff_pos[field].ldr[rtype].start
512 + MARC21.Record._ff_pos[field].ldr[rtype].len
516 } else if (MARC21.Record._ff_pos[field]._8 && _8) {
517 if (MARC21.Record._ff_pos[field]._8[rtype]) { // Nope, it's in the 008
518 if (value.length > MARC21.Record._ff_pos[field]._8[rtype].len)
519 value = value.substr(0, MARC21.Record._ff_pos[field]._8[rtype].len);
520 while (value.length < MARC21.Record._ff_pos[field]._8[rtype].len)
521 value += MARC21.Record._ff_pos[field]._8[rtype].def;
522 this.field('008').update(
523 _8.substring(0, MARC21.Record._ff_pos[field]._8[rtype].start) +
526 MARC21.Record._ff_pos[field]._8[rtype].start
527 + MARC21.Record._ff_pos[field]._8[rtype].len
534 if (!done && MARC21.Record._ff_pos[field]._6 && _6) {
535 if (MARC21.Record._ff_pos[field]._6[rtype]) { // ok, maybe the 006?
536 if (value.length > MARC21.Record._ff_pos[field]._6[rtype].len)
537 value = value.substr(0, MARC21.Record._ff_pos[field]._6[rtype].len);
538 while (value.length < MARC21.Record._ff_pos[field]._6[rtype].len)
539 value += MARC21.Record._ff_pos[field]._6[rtype].def;
540 this.field('006').update(
541 _6.substring(0, MARC21.Record._ff_pos[field]._6[rtype].start) +
544 MARC21.Record._ff_pos[field]._6[rtype].start
545 + MARC21.Record._ff_pos[field]._6[rtype].len
556 this.delimiter = MARC21.Record.delimiter ? MARC21.Record.delimiter : '\u2021';
557 this.leader = '00000cam a2200205Ka 4500';
559 if (kwargs.delimiter) this.delimiter = kwargs.delimiter;
560 if (kwargs.onLoad) this.onLoad = kwargs.onLoad;
563 this.fromXmlURL(kwargs.url);
564 } else if (kwargs.marcxml) {
565 this.fromXmlString(kwargs.marcxml);
566 if (this.onLoad) this.onLoad();
567 } else if (kwargs.xml) {
568 this.fromXmlDocument(kwargs.xml);
569 if (this.onLoad) this.onLoad();
570 } else if (kwargs.marcbreaker) {
571 this.fromBreaker(kwargs.marcbreaker);
572 if (this.onLoad) this.onLoad();
575 if (kwargs.rtype == 'AUT') {
576 this.setFixedField('Type','z');
581 Field : function (kwargs) {
582 if (!kwargs) kwargs = {};
584 this.subfield = function (code, wantarray) {
585 var list = this.subfields.filter( function (s) {
586 if (s[0] == code) return true; return false;
588 if (!wantarray && list.length == 1) return list[0];
592 this.addSubfields = function () {
593 for (var i = 0; i < arguments.length; i++) {
594 var code = arguments[i];
595 var value = arguments[++i];
596 this.subfields.push( [ code, value ] );
600 this.deleteExactSubfields = function () {
604 for ( var i in arguments ) {
605 var f = arguments[i];
606 for (var j = 0; j < me.subfields.length; j++) {
607 if (f === me.subfields[j]) {
608 me.subfields.splice(j,1);
613 if (done && me.subfields[j])
614 me.subfields[j][2] -= 1;
621 this.deleteSubfields = function (c) {
622 return this.deleteSubfield( { code : c } );
625 this.deleteSubfield = function (args) {
627 if (!Array.isArray( args.code )) {
628 args.code = [ args.code ];
631 if (args.pos && !Array.isArray( args.pos )) {
632 args.pos = [ args.pos ];
635 for (var i = 0; i < args.code.length; i++) {
637 for (var j = 0; j < me.subfields.length; j++) {
638 if (me.subfields[j][0] == args.code[i]) {
640 if (!sub_pos[args.code[i]]) sub_pos[args.code[j]] = 0;
641 else sub_pos[args.code[i]]++;
644 for (var k = 0; k < args.pos.length; k++) {
645 if (sub_pos[args.code[i]] == args.pos[k]) me.subfields.splice(j,1);
647 } else if (args.match && me.subfields[j][1].match( args.match )) {
648 me.subfields.splice(j,1);
650 me.subfields.splice(j,1);
657 this.update = function ( args ) {
658 if (this.isControlfield()) {
661 if (args.ind1) this.ind1 = args.ind1;
662 if (args.ind2) this.ind2 = args.ind2;
663 if (args.tag) this.tag = args.tag;
665 for (var i in args) {
666 if (i == 'tag' || i == 'ind1' || i == 'ind2') continue;
668 this.subfields.forEach( function (f) {
669 if (!done && f[0] == i) {
678 this.isControlfield = function () {
679 return this.tag < '010' ? true : false;
682 this.pruneEmptySubfields = function () {
683 if (this.isControlfield()) return;
685 var subfields_to_remove = [];
686 this.subfields.forEach( function(f) {
688 subfields_to_remove.push(f);
691 subfields_to_remove.forEach(function(f) {
692 me.deleteExactSubfields(f);
695 this.isEmptyDatafield = function () {
696 if (this.isControlfield()) return false;
698 this.subfields.forEach( function(f) {
699 if (isEmpty && f[1] != '') {
706 this.indicator = function (num, value) {
707 if (value !== undefined) {
708 if (num == 1) this.ind1 = value;
709 else if (num == 2) this.ind2 = value;
710 else { this.error = true; return null; }
712 if (num == 1) return this.ind1;
713 else if (num == 2) return this.ind2;
714 else { this.error = true; return null; }
718 this.record = null; // MARC record pointer
719 this.tag = ''; // MARC tag
720 this.ind1 = ' '; // MARC indicator 1
721 this.ind2 = ' '; // MARC indicator 2
722 this.data = ''; // MARC data for a controlfield element
723 this.subfields = []; // list of MARC subfields for a datafield element
725 this.position = kwargs.position;
726 this.record = kwargs.record;
727 this.tag = kwargs.tag;
728 this.ind1 = kwargs.ind1 || ' ';
729 this.ind2 = kwargs.ind2 || ' ';
730 this.data = kwargs.data;
732 if (kwargs.subfields) this.subfields = kwargs.subfields;
733 else this.subfields = [];
737 Batch : function(kwargs) {
739 this.parse = function () {
740 if (this.source instanceof Object ) { // assume an xml collection document
741 this.source = $('record', this.source);
743 } else if (this.source.match(/^\s*</)) { // this is xml text
744 this.source = $.parseXML( mxml ).find('record');
746 } else { // must be a marcbreaker doc. split on blank lines
747 this.source = this.source.split(/^$/);
748 this.type = 'marcbreaker';
752 this.fetchURL = function (u) {
754 $.get( u, function (mrc) {
760 this.next = function () {
761 var chunk = this.source[this.current_record++];
765 args[this.type] = chunk;
766 if (this.delimiter) args.delimiter = this.delimiter;
767 return new MARC21.Record(args);
775 this.source = kwargs.source;
776 this.delimiter = kwargs.delimiter
777 this.current_record = 0;
779 if (this.source) this.ready = true;
780 if (!this.ready && kwargs.url) this.fetchURL( kwargs.url );
782 if (this.ready) this.parse();
786 AuthorityControlSet : function (kwargs) {
788 kwargs = kwargs || {};
790 if (!MARC21.AuthorityControlSet._remote_loaded) {
792 // TODO -- push the raw tree into the oils cache for later reuse
794 // fetch everything up front...
795 this._preFetchWithFielder({
796 "acs": "_control_set_list",
797 "at": "_thesaurus_list",
798 "acsaf": "_authority_field_list",
799 "acsbf": "_bib_field_list",
800 "aba": "_browse_axis_list",
801 "abaafm": "_browse_field_map_list"
804 MARC21.AuthorityControlSet._remote_loaded = true;
807 if (MARC21.AuthorityControlSet._remote_loaded && !MARC21.AuthorityControlSet._remote_parsed) {
809 MARC21.AuthorityControlSet._browse_axis_by_code = {};
810 MARC21.AuthorityControlSet._browse_axis_list.forEach(function (ba) {
812 MARC21.AuthorityControlSet._browse_field_map_list.filter(
813 function (m) { return m.axis() == ba.code() }
816 MARC21.AuthorityControlSet._browse_axis_by_code[ba.code()] = ba;
819 // loop over each acs
820 MARC21.AuthorityControlSet._control_set_list.forEach(function (cs) {
821 MARC21.AuthorityControlSet._controlsets[''+cs.id()] = {
824 description : cs.description(),
825 authority_tag_map : {},
831 // grab the authority fields
832 var acsaf_list = MARC21.AuthorityControlSet._authority_field_list.filter(
833 function (af) { return af.control_set() == cs.id() }
836 var at_list = MARC21.AuthorityControlSet._thesaurus_list.filter(
837 function (at) { return at.control_set() == cs.id() }
840 MARC21.AuthorityControlSet._controlsets[''+cs.id()].raw.authority_fields( acsaf_list );
841 MARC21.AuthorityControlSet._controlsets[''+cs.id()].raw.thesauri( at_list );
843 // and loop over each
844 acsaf_list.forEach(function (csaf) {
847 // link the main entry if we're subordinate
848 if (csaf.main_entry()) {
850 acsaf_list.filter(function (x) {
851 return x.id() == csaf.main_entry();
856 // link the sub entries if we're main
858 acsaf_list.filter(function (x) {
859 return x.main_entry() == csaf.id();
864 var acsbf_list = MARC21.AuthorityControlSet._bib_field_list.filter(
865 function (b) { return b.authority_field() == csaf.id() }
867 csaf.bib_fields( acsbf_list );
869 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields = [].concat(
870 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields,
874 acsbf_list.forEach(function (csbf) {
875 // link the authority field to the bib field
876 if (csbf.authority_field()) {
877 csbf.authority_field(
878 acsaf_list.filter(function (x) {
879 return x.id() == csbf.authority_field();
886 MARC21.AuthorityControlSet._browse_axis_list.forEach(
889 function (m) { return m.field() == csaf.id() }
891 function (fm) { fm.field( csaf ); csaf.axis_maps().push( fm ) } // and set the field
898 // build the authority_tag_map
899 MARC21.AuthorityControlSet._controlsets[''+cs.id()].bib_fields.forEach(function (bf) {
901 if (!MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()])
902 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()] = {};
904 bf.authority_field().sf_list().split('').forEach(function (sf_code) {
906 if (!MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code])
907 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code] = {};
909 MARC21.AuthorityControlSet._controlsets[''+cs.id()].control_map[bf.tag()][sf_code][bf.authority_field().tag()] = sf_code;
915 if (this.controlSetList().length > 0)
916 delete MARC21.AuthorityControlSet._controlsets['-1'];
918 MARC21.AuthorityControlSet._remote_parsed = true;
921 this._preFetchWithFielder = function(cmap) {
922 for (var hint in cmap) {
923 var cache_key = cmap[hint];
924 var method = "open-ils.fielder." + hint + ".atomic";
925 var pkey = fieldmapper.IDL.fmclasses[hint].pkey;
928 query[pkey] = {"!=": null};
930 MARC21.AuthorityControlSet[cache_key] = dojo.map(
931 fieldmapper.standardRequest(
932 ["open-ils.fielder", method],
933 [{"cache": 1, "query" : query}]
935 function(h) { return new fieldmapper[hint]().fromHash(h); }
940 this.controlSetId = function (x) {
941 if (x) this._controlset = ''+x;
942 return this._controlset;
945 this.controlSet = function (x) {
946 return MARC21.AuthorityControlSet._controlsets[''+this.controlSetId(x)];
949 this.controlSetByThesaurusCode = function (x) {
950 var thes = MARC21.AuthorityControlSet._thesaurus_list.filter(
951 function (at) { return at.code() == x }
954 return this.controlSet(thes.control_set());
957 this.browseAxisByCode = function(code) {
958 return MARC21.AuthorityControlSet._browse_axis_by_code[code];
961 this.bibFieldByTag = function (x) {
963 return me.controlSet().bib_fields.filter(
964 function (bf) { if (bf.tag() == x) return true }
968 this.bibFields = function (x) {
969 return this.controlSet(x).bib_fields;
972 this.bibFieldBrowseAxes = function (t) {
974 for (var bcode in MARC21.AuthorityControlSet._browse_axis_by_code) {
975 MARC21.AuthorityControlSet._browse_axis_by_code[bcode].maps().forEach(
977 if (m.field().bib_fields().filter(
978 function (b) { return b.tag() == t }
987 this.authorityFields = function (x) {
988 return this.controlSet(x).raw.authority_fields();
991 this.thesauri = function (x) {
992 return this.controlSet(x).raw.thesauri();
995 this.controlSetList = function () {
997 for (var i in MARC21.AuthorityControlSet._controlsets) {
1003 this.findControlSetsForTag = function (tag) {
1005 var old_acs = this.controlSetId();
1006 var acs_list = me.controlSetList().filter(
1007 function(acs_id) { return (me.controlSet(acs_id).control_map[tag]) }
1009 this.controlSetId(old_acs);
1013 this.findControlSetsForAuthorityTag = function (tag) {
1015 var old_acs = this.controlSetId();
1017 var acs_list = me.controlSetList().filter(
1019 var a = me.controlSet(acs_id);
1020 for (var btag in a.control_map) {
1021 for (var sf in a.control_map[btag]) {
1022 if (a.control_map[btag][sf][tag]) return true;
1028 this.controlSetId(old_acs);
1032 this.bibToAuthority = function (field) {
1033 var b_field = this.bibFieldByTag(field.tag);
1035 if (b_field) { // construct an marc authority record
1036 var af = b_field.authority_field();
1039 for (var i = 0; i < field.subfields.length; i++) {
1040 if (af.sf_list().indexOf(field.subfields[i][0]) > -1) {
1041 sflist.push(field.subfields[i]);
1045 var m = new MARC21.Record ({rtype:'AUT'});
1055 return m.toXmlString();
1061 this.bibToAuthorities = function (field) {
1065 var old_acs = this.controlSetId();
1066 me.controlSetList().forEach(
1068 var acs = me.controlSet(acs_id);
1069 var x = me.bibToAuthority(field);
1070 if (x) { var foo = {}; foo[acs_id] = x; auth_list.push(foo); }
1073 this.controlSetId(old_acs);
1078 // This should not be used in an angular world. Instead, the call
1079 // to open-ils.search.authority.simple_heading.from_xml.batch.atomic should
1080 // be performed by the code that wants to find matching authorities.
1081 this.findMatchingAuthorities = function (field) {
1082 return fieldmapper.standardRequest(
1083 [ 'open-ils.search', 'open-ils.search.authority.simple_heading.from_xml.batch.atomic' ],
1084 this.bibToAuthorities(field)
1088 if (kwargs.controlSet) {
1089 this.controlSetId( kwargs.controlSet );
1091 this.controlSetId( this.controlSetList().sort(function(a,b){return (a - b)}) );
1097 MARC21.Record._recType = {
1098 BKS : { Type : /[at]{1}/, BLvl : /[acdm]{1}/ },
1099 SER : { Type : /[a]{1}/, BLvl : /[bsi]{1}/ },
1100 VIS : { Type : /[gkro]{1}/, BLvl : /[abcdmsi]{1}/ },
1101 MIX : { Type : /[p]{1}/, BLvl : /[cdi]{1}/ },
1102 MAP : { Type : /[ef]{1}/, BLvl : /[abcdmsi]{1}/ },
1103 SCO : { Type : /[cd]{1}/, BLvl : /[abcdmsi]{1}/ },
1104 REC : { Type : /[ij]{1}/, BLvl : /[abcdmsi]{1}/ },
1105 COM : { Type : /[m]{1}/, BLvl : /[abcdmsi]{1}/ },
1106 AUT : { Type : /[z]{1}/, BLvl : /.{1}/ },
1107 MFHD : { Type : /[uvxy]{1}/, BLvl : /.{1}/ }
1110 MARC21.Record._ff_pos = {
1113 SCO : {start: 24, len : 6, def : ' ' },
1114 REC : {start: 24, len : 6, def : ' ' }
1117 SCO : {start: 7, len : 6, def : ' ' },
1118 REC : {start: 7, len : 6, def : ' ' }
1123 SER : {start : 33, len : 1, def : ' ' }
1126 SER : {start : 16, len : 1, def : ' ' }
1131 BKS : {start : 22, len : 1, def : ' ' },
1132 SER : {start : 22, len : 1, def : ' ' },
1133 VIS : {start : 22, len : 1, def : ' ' },
1134 SCO : {start : 22, len : 1, def : ' ' },
1135 REC : {start : 22, len : 1, def : ' ' },
1136 COM : {start : 22, len : 1, def : ' ' }
1139 BKS : {start : 5, len : 1, def : ' ' },
1140 SER : {start : 5, len : 1, def : ' ' },
1141 VIS : {start : 5, len : 1, def : ' ' },
1142 SCO : {start : 5, len : 1, def : ' ' },
1143 REC : {start : 5, len : 1, def : ' ' },
1144 COM : {start : 5, len : 1, def : ' ' }
1149 BKS : {start : 34, len : 1, def : ' ' }
1152 BKS : {start : 17, len : 1, def : ' ' }
1157 BKS : {start : 7, len : 1, def : 'm' },
1158 SER : {start : 7, len : 1, def : 's' },
1159 VIS : {start : 7, len : 1, def : 'm' },
1160 MIX : {start : 7, len : 1, def : 'c' },
1161 MAP : {start : 7, len : 1, def : 'm' },
1162 SCO : {start : 7, len : 1, def : 'm' },
1163 REC : {start : 7, len : 1, def : 'm' },
1164 COM : {start : 7, len : 1, def : 'm' }
1169 SCO : {start : 18, len : 2, def : 'uu'},
1170 REC : {start : 18, len : 2, def : 'uu'}
1173 SCO : {start : 1, len : 2, def : 'uu'},
1174 REC : {start : 1, len : 2, def : 'uu'}
1179 BKS : {start : 29, len : 1, def : '0' },
1180 SER : {start : 29, len : 1, def : '0' }
1183 BKS : {start : 11, len : 1, def : '0' },
1184 SER : {start : 11, len : 1, def : '0' }
1189 BKS : {start : 24, len : 4, def : ' ' },
1190 SER : {start : 25, len : 3, def : ' ' }
1193 BKS : {start : 7, len : 4, def : ' ' },
1194 SER : {start : 8, len : 3, def : ' ' }
1199 MAP : {start: 25, len : 1, def : 'a' }
1202 MAP : {start : 8, len : 1, def : 'a' }
1207 BKS : {start : 8, len : 1, def : ' ' },
1208 SER : {start : 8, len : 1, def : ' ' },
1209 VIS : {start : 8, len : 1, def : ' ' },
1210 MIX : {start : 8, len : 1, def : ' ' },
1211 MAP : {start : 8, len : 1, def : ' ' },
1212 SCO : {start : 8, len : 1, def : ' ' },
1213 REC : {start : 8, len : 1, def : ' ' },
1214 COM : {start : 8, len : 1, def : ' ' }
1219 BKS : {start : 15, len : 3, def : ' ' },
1220 SER : {start : 15, len : 3, def : ' ' },
1221 VIS : {start : 15, len : 3, def : ' ' },
1222 MIX : {start : 15, len : 3, def : ' ' },
1223 MAP : {start : 15, len : 3, def : ' ' },
1224 SCO : {start : 15, len : 3, def : ' ' },
1225 REC : {start : 15, len : 3, def : ' ' },
1226 COM : {start : 15, len : 3, def : ' ' }
1231 BKS : {start : 7, len : 4, def : ' ' },
1232 SER : {start : 7, len : 4, def : ' ' },
1233 VIS : {start : 7, len : 4, def : ' ' },
1234 MIX : {start : 7, len : 4, def : ' ' },
1235 MAP : {start : 7, len : 4, def : ' ' },
1236 SCO : {start : 7, len : 4, def : ' ' },
1237 REC : {start : 7, len : 4, def : ' ' },
1238 COM : {start : 7, len : 4, def : ' ' }
1243 BKS : {start : 11, len : 4, def : ' ' },
1244 SER : {start : 11, len : 4, def : '9' },
1245 VIS : {start : 11, len : 4, def : ' ' },
1246 MIX : {start : 11, len : 4, def : ' ' },
1247 MAP : {start : 11, len : 4, def : ' ' },
1248 SCO : {start : 11, len : 4, def : ' ' },
1249 REC : {start : 11, len : 4, def : ' ' },
1250 COM : {start : 11, len : 4, def : ' ' }
1255 BKS : {start : 18, len : 1, def : ' ' },
1256 SER : {start : 18, len : 1, def : ' ' },
1257 VIS : {start : 18, len : 1, def : ' ' },
1258 MIX : {start : 18, len : 1, def : ' ' },
1259 MAP : {start : 18, len : 1, def : ' ' },
1260 SCO : {start : 18, len : 1, def : ' ' },
1261 REC : {start : 18, len : 1, def : ' ' },
1262 COM : {start : 18, len : 1, def : ' ' }
1267 BKS : {start : 6, len : 1, def : ' ' },
1268 SER : {start : 6, len : 1, def : 'c' },
1269 VIS : {start : 6, len : 1, def : ' ' },
1270 MIX : {start : 6, len : 1, def : ' ' },
1271 MAP : {start : 6, len : 1, def : ' ' },
1272 SCO : {start : 6, len : 1, def : ' ' },
1273 REC : {start : 6, len : 1, def : ' ' },
1274 COM : {start : 6, len : 1, def : ' ' }
1279 BKS : {start : 17, len : 1, def : ' ' },
1280 SER : {start : 17, len : 1, def : ' ' },
1281 VIS : {start : 17, len : 1, def : ' ' },
1282 MIX : {start : 17, len : 1, def : ' ' },
1283 MAP : {start : 17, len : 1, def : ' ' },
1284 SCO : {start : 17, len : 1, def : ' ' },
1285 REC : {start : 17, len : 1, def : ' ' },
1286 COM : {start : 17, len : 1, def : ' ' },
1287 AUT : {start : 17, len : 1, def : 'n' },
1288 MFHD : {start : 17, len : 1, def : 'u' }
1293 SER : {start : 24, len : 1, def : ' '}
1296 SER : {start : 7, len : 1, def : ' '}
1301 BKS : {start : 30, len : 1, def : '0' }
1304 BKS : {start : 13, len : 1, def : '0' }
1309 COM : {start: 26, len : 1, def : 'u' }
1312 COM : {start: 9, len : 1, def : 'u' }
1317 SCO : {start : 20, len : 1, def : 'u'},
1318 REC : {start : 20, len : 1, def : 'n'}
1321 SCO : {start : 3, len : 1, def : 'u'},
1322 REC : {start : 3, len : 1, def : 'n'}
1327 BKS : {start : 23, len : 1, def : ' ' },
1328 SER : {start : 23, len : 1, def : ' ' },
1329 VIS : {start : 29, len : 1, def : ' ' },
1330 MIX : {start : 23, len : 1, def : ' ' },
1331 MAP : {start : 29, len : 1, def : ' ' },
1332 SCO : {start : 23, len : 1, def : ' ' },
1333 REC : {start : 23, len : 1, def : ' ' }
1336 BKS : {start : 6, len : 1, def : ' ' },
1337 SER : {start : 6, len : 1, def : ' ' },
1338 VIS : {start : 12, len : 1, def : ' ' },
1339 MIX : {start : 6, len : 1, def : ' ' },
1340 MAP : {start : 12, len : 1, def : ' ' },
1341 SCO : {start : 6, len : 1, def : ' ' },
1342 REC : {start : 6, len : 1, def : ' ' }
1347 SER : {start : 18, len : 1, def : ' '}
1350 SER : {start : 1, len : 1, def : ' '}
1355 BKS : {start : 28, len : 1, def : ' ' },
1356 SER : {start : 28, len : 1, def : ' ' },
1357 VIS : {start : 28, len : 1, def : ' ' },
1358 MAP : {start : 28, len : 1, def : ' ' },
1359 COM : {start : 28, len : 1, def : ' ' }
1362 BKS : {start : 11, len : 1, def : ' ' },
1363 SER : {start : 11, len : 1, def : ' ' },
1364 VIS : {start : 11, len : 1, def : ' ' },
1365 MAP : {start : 11, len : 1, def : ' ' },
1366 COM : {start : 11, len : 1, def : ' ' }
1371 BKS : {start : 18, len : 4, def : ' ' }
1374 BKS : {start : 1, len : 4, def : ' ' }
1379 BKS : {start : 31, len : 1, def : '0' },
1380 MAP : {start : 31, len : 1, def : '0' }
1383 BKS : {start : 14, len : 1, def : '0' },
1384 MAP : {start : 14, len : 1, def : '0' }
1389 MFHD : {start : 18, len : 1, def : 'i' }
1394 BKS : {start : 35, len : 3, def : ' ' },
1395 SER : {start : 35, len : 3, def : ' ' },
1396 VIS : {start : 35, len : 3, def : ' ' },
1397 MIX : {start : 35, len : 3, def : ' ' },
1398 MAP : {start : 35, len : 3, def : ' ' },
1399 SCO : {start : 35, len : 3, def : ' ' },
1400 REC : {start : 35, len : 3, def : ' ' },
1401 COM : {start : 35, len : 3, def : ' ' }
1406 BKS : {start : 33, len : 1, def : '0' }
1409 BKS : {start : 16, len : 1, def : '0' }
1414 SCO : {start : 30, len : 2, def : 'n'},
1415 REC : {start : 30, len : 2, def : ' '}
1418 SCO : {start : 13, len : 2, def : 'n'},
1419 REC : {start : 13, len : 2, def : ' '}
1424 BKS : {start : 38, len : 1, def : ' ' },
1425 SER : {start : 38, len : 1, def : ' ' },
1426 VIS : {start : 38, len : 1, def : ' ' },
1427 MIX : {start : 38, len : 1, def : ' ' },
1428 MAP : {start : 38, len : 1, def : ' ' },
1429 SCO : {start : 38, len : 1, def : ' ' },
1430 REC : {start : 38, len : 1, def : ' ' },
1431 COM : {start : 38, len : 1, def : ' ' }
1436 SER : {start : 22, len : 1, def : ' '}
1439 SER : {start: 5, len : 1, def: ' '}
1444 SCO : {start : 21, len : 1, def : ' '},
1445 REC : {start : 21, len : 1, def : 'n'}
1448 SCO : {start : 4, len : 1, def : ' '},
1449 REC : {start : 4, len : 1, def : 'n'}
1454 MAP : {start : 22, len : 2, def : ' ' }
1457 MAP: {start : 5, len : 2, def : ' ' }
1462 BKS : {start : 5, len : 1, def : 'n' },
1463 SER : {start : 5, len : 1, def : 'n' },
1464 VIS : {start : 5, len : 1, def : 'n' },
1465 MIX : {start : 5, len : 1, def : 'n' },
1466 MAP : {start : 5, len : 1, def : 'n' },
1467 SCO : {start : 5, len : 1, def : 'n' },
1468 REC : {start : 5, len : 1, def : 'n' },
1469 COM : {start : 5, len : 1, def : 'n' },
1470 MFHD: {start : 5, len : 1, def : 'n' },
1471 AUT : {start : 5, len : 1, def : 'n' }
1476 SER : {start : 19, len : 1, def : ' '}
1479 SER : {start : 2, len : 1, def : ' '}
1484 MAP : {start: 18, len : 4, def : ' '}
1487 MAP : {start: 1, len : 4, def : ' '}
1492 SER : {start : 34, len : 1, def : '0' }
1495 SER : {start : 17, len : 1, def : '0' }
1500 MAP : {start: 33, len : 2, def : ' ' }
1503 MAP : {start: 16, len : 2, def : ' '}
1508 BKS : {start : 39, len : 1, def : 'd' },
1509 SER : {start : 39, len : 1, def : 'd' },
1510 VIS : {start : 39, len : 1, def : 'd' },
1511 SCO : {start : 39, len : 1, def : 'd' },
1512 REC : {start : 39, len : 1, def : 'd' },
1513 COM : {start : 39, len : 1, def : 'd' },
1514 MFHD : {start : 39, len : 1, def : 'd' },
1515 "AUT" : {"start" : 39, "len" : 1, "def" : 'd' }
1520 SER : {start : 21, len : 1, def : ' '}
1523 SER : {start : 4, len : 1, def : ' '}
1528 VIS : {start : 34, len : 1, def : ' '}
1531 VIS : {start : 17, len : 1, def : ' '}
1536 VIS : {start : 18, len : 3, def : ' '}
1539 VIS : {start : 1, len : 3, def : ' '}
1544 VIS : {start : 33, len : 1, def : ' ' }
1547 VIS : {start : 16, len : 1, def : ' ' }
1552 SCO : {start : 33, len : 1, def : ' ' },
1553 REC : {start : 33, len : 1, def : 'n' }
1556 SCO : {start : 16, len : 1, def : ' ' },
1557 REC : {start : 16, len : 1, def : 'n' }
1562 BKS : {start : 6, len : 1, def : 'a' },
1563 SER : {start : 6, len : 1, def : 'a' },
1564 VIS : {start : 6, len : 1, def : 'g' },
1565 MIX : {start : 6, len : 1, def : 'p' },
1566 MAP : {start : 6, len : 1, def : 'e' },
1567 SCO : {start : 6, len : 1, def : 'c' },
1568 REC : {start : 6, len : 1, def : 'i' },
1569 COM : {start : 6, len : 1, def : 'm' },
1570 AUT : {start : 6, len : 1, def : 'z' },
1571 MFHD : {start : 6, len : 1, def : 'y' }
1576 "AUT" : {"start" : 6, "len" : 1, "def" : ' ' }
1581 "AUT" : {"start" : 7, "len" : 1, "def" : ' ' }
1586 "AUT" : {"start" : 8, "len" : 1, "def" : ' ' }
1591 "AUT" : {"start" : 9, "len" : 1, "def" : ' ' }
1596 "AUT" : {"start" : 10, "len" : 1, "def" : ' ' }
1601 "AUT" : {"start" : 11, "len" : 1, "def" : ' ' }
1606 "AUT" : {"start" : 12, "len" : 1, "def" : ' ' }
1611 "AUT" : {"start" : 13, "len" : 1, "def" : ' ' }
1616 "AUT" : {"start" : 14, "len" : 1, "def" : ' ' }
1621 "AUT" : {"start" : 15, "len" : 1, "def" : ' ' }
1626 "AUT" : {"start" : 16, "len" : 1, "def" : ' ' }
1631 "AUT" : {"start" : 17, "len" : 1, "def" : ' ' }
1636 "AUT" : {"start" : 28, "len" : 1, "def" : ' ' }
1641 "AUT" : {"start" : 29, "len" : 1, "def" : ' ' }
1646 "AUT" : {"start" : 31, "len" : 1, "def" : ' ' }
1651 "AUT" : {"start" : 32, "len" : 1, "def" : ' ' }
1656 "AUT" : {"start" : 33, "len" : 1, "def" : ' ' }
1661 "AUT" : {"start" : 38, "len" : 1, "def" : ' ' }
1666 "AUT" : {"start" : 39, "len" : 1, "def" : ' ' }
1671 MARC21.Record._physical_characteristics = {
1673 label : "Electronic Resource",
1678 values: { a : "Tape Cartridge",
1679 b : "Chip cartridge",
1680 c : "Computer optical disk cartridge",
1681 f : "Tape cassette",
1683 j : "Magnetic disk",
1684 m : "Magneto-optical disk",
1694 values: { a : "One color",
1695 b : "Black-and-white",
1699 n : "Not applicable",
1706 label : "Dimensions",
1707 values: { a : "3 1/2 in.",
1709 g : "4 3/4 in. or 12 cm.",
1710 i : "1 1/8 x 2 3/8 in.",
1711 j : "3 7/8 x 2 1/2 in.",
1712 n : "Not applicable",
1722 values: { ' ' : "No sound (Silent)",
1729 label : "Image bit depth",
1730 values: { mmm : "Multiple",
1731 nnn : "Not applicable",
1737 label : "File formats",
1738 values: { a : "One file format",
1739 m : "Multiple file formats",
1745 label : "Quality assurance target(s)",
1746 values: { a : "Absent",
1747 n : "Not applicable",
1754 label : "Antecedent/Source",
1755 values: { a : "File reproduced from original",
1756 b : "File reproduced from microform",
1757 c : "File reproduced from electronic resource",
1758 d : "File reproduced from an intermediate (not microform)",
1760 n : "Not applicable",
1766 label : "Level of compression",
1767 values: { a : "Uncompressed",
1776 label : "Reformatting quality",
1777 values: { a : "Access",
1778 n : "Not applicable",
1792 values: { a : "Celestial globe",
1793 b : "Planetary or lunar globe",
1794 c : "Terrestrial globe",
1795 e : "Earth moon globe",
1803 values: { a : "One color",
1809 label : "Physical medium",
1810 values: { a : "Paper",
1824 label : "Type of reproduction",
1825 values: { f : "Facsimile",
1826 n : "Not applicable",
1839 values: { d : "Atlas",
1844 r : "Remote-sensing image",
1854 values: { a : "One color",
1860 label : "Physical medium",
1861 values: { a : "Paper",
1869 q : "Flexible base photographic medium, positive",
1870 r : "Flexible base photographic medium, negative",
1871 s : "Non-flexible base photographic medium, positive",
1872 t : "Non-flexible base photographic medium, negative",
1874 y : "Other photographic medium",
1880 label : "Type of reproduction",
1881 values: { f : "Facsimile",
1882 n : "Not applicable",
1889 label : "Production/reproduction details",
1890 values: { a : "Photocopy, blueline print",
1892 c : "Pre-production",
1900 label : "Positive/negative",
1901 values: { a : "Positive",
1904 n : "Not applicable"
1910 label : "Microform",
1915 values: { a : "Aperture card",
1916 b : "Microfilm cartridge",
1917 c : "Microfilm cassette",
1918 d : "Microfilm reel",
1920 f : "Microfiche cassette",
1928 label : "Positive/negative",
1929 values: { a : "Positive",
1937 label : "Dimensions",
1938 values: { a : "8 mm.",
1943 l : "3 x 5 in. (8 x 13 cm.)",
1944 m : "4 x 6 in. (11 x 15 cm.)",
1945 o : "6 x 9 in. (16 x 23 cm.)",
1946 p : "3 1/4 x 7 3/8 in. (9 x 19 cm.)",
1953 label : "Reduction ratio range/Reduction ratio",
1954 values: { a : "Low (1-16x)",
1955 b : "Normal (16-30x)",
1956 c : "High (31-60x)",
1957 d : "Very high (61-90x)",
1960 v : "Reduction ratio varies"
1966 values: { b : "Black-and-white",
1975 label : "Emulsion on film",
1976 values: { a : "Silver halide",
1980 n : "Not applicable",
1987 label : "Quality assurance target(s)",
1988 values: { a : "1st gen. master",
1989 b : "Printing master",
1991 m : "Mixed generation",
1997 label : "Base of film",
1998 values: { a : "Safety base, undetermined",
1999 c : "Safety base, acetate undetermined",
2000 d : "Safety base, diacetate",
2003 n : "Not applicable",
2004 p : "Safety base, polyester",
2005 r : "Safety base, mixed",
2006 t : "Safety base, triacetate",
2014 label : "Motion Picture",
2019 values: { a : "Film cartridge",
2020 f : "Film cassette",
2029 values: { b : "Black-and-white",
2039 label : "Motion picture presentation format",
2040 values: { a : "Standard sound aperture, reduced frame",
2041 b : "Nonanamorphic (wide-screen)",
2043 d : "Anamorphic (wide-screen)",
2044 e : "Other-wide screen format",
2045 f : "Standard. silent aperture, full frame",
2052 label : "Sound on medium or separate",
2053 values: { a : "Sound on medium",
2054 b : "Sound separate from medium",
2060 label : "Medium for sound",
2061 values: { a : "Optical sound track on motion picture film",
2062 b : "Magnetic sound track on motion picture film",
2063 c : "Magnetic audio tape in cartridge",
2065 e : "Magnetic audio tape on reel",
2066 f : "Magnetic audio tape in cassette",
2067 g : "Optical and magnetic sound track on film",
2076 label : "Dimensions",
2077 values: { a : "Standard 8 mm.",
2078 b : "Super 8 mm./single 8 mm.",
2090 label : "Configuration of playback channels",
2091 values: { k : "Mixed",
2093 n : "Not applicable",
2094 q : "Multichannel, surround or quadraphonic",
2102 label : "Production elements",
2103 values: { a : "Work print",
2107 e : "Mixing tracks",
2108 f : "Title bands/inter-title rolls",
2109 g : "Production rolls",
2110 n : "Not applicable",
2117 label : "Non-projected Graphic",
2122 values: { c : "Collage",
2125 f : "Photo-mechanical print",
2126 g : "Photonegative",
2130 l : "Technical drawing",
2132 o : "Flash/activity card",
2140 values: { a : "One color",
2141 b : "Black-and-white",
2151 label : "Primary support material",
2152 values: { a : "Canvas",
2153 b : "Bristol board",
2154 c : "Cardboard/illustration board",
2160 m : "Mixed collection",
2173 label : "Secondary support material",
2174 values: { a : "Canvas",
2175 b : "Bristol board",
2176 c : "Cardboard/illustration board",
2182 m : "Mixed collection",
2196 label : "Projected Graphic",
2201 values: { c : "Film cartridge",
2203 f : "Film filmstrip type",
2204 o : "Filmstrip roll",
2213 values: { b : "Black-and-white",
2217 n : "Not applicable",
2224 label : "Base of emulsion",
2225 values: { d : "Glass",
2228 k : "Film base, other than safety film",
2229 m : "Mixed collection",
2237 label : "Sound on medium or separate",
2238 values: { a : "Sound on medium",
2239 b : "Sound separate from medium",
2245 label : "Medium for sound",
2246 values: { a : "Optical sound track on motion picture film",
2247 b : "Magnetic sound track on motion picture film",
2248 c : "Magnetic audio tape in cartridge",
2250 e : "Magnetic audio tape on reel",
2251 f : "Magnetic audio tape in cassette",
2252 g : "Optical and magnetic sound track on film",
2261 label : "Dimensions",
2262 values: { a : "Standard 8 mm.",
2263 b : "Super 8 mm./single 8 mm.",
2269 j : "2 x 2 in. (5 x 5 cm.)",
2270 k : "2 1/4 x 2 1/4 in. (6 x 6 cm.)",
2271 s : "4 x 5 in. (10 x 13 cm.)",
2272 t : "5 x 7 in. (13 x 18 cm.)",
2273 v : "8 x 10 in. (21 x 26 cm.)",
2274 w : "9 x 9 in. (23 x 23 cm.)",
2275 x : "10 x 10 in. (26 x 26 cm.)",
2276 y : "7 x 7 in. (18 x 18 cm.)",
2283 label : "Secondary support material",
2284 values: { c : "Cardboard",
2288 j : "Metal and glass",
2289 k : "Synthetics and glass",
2290 m : "Mixed collection",
2298 label : "Remote-sensing Image",
2303 values: { u : "Unspecified" }
2307 label : "Altitude of sensor",
2308 values: { a : "Surface",
2311 n : "Not applicable",
2318 label : "Attitude of sensor",
2319 values: { a : "Low oblique",
2322 n : "Not applicable",
2328 label : "Cloud cover",
2329 values: { 0 : "0-09%",
2339 n : "Not applicable",
2345 label : "Platform construction type",
2346 values: { a : "Balloon",
2347 b : "Aircraft-low altitude",
2348 c : "Aircraft-medium altitude",
2349 d : "Aircraft-high altitude",
2350 e : "Manned spacecraft",
2351 f : "Unmanned spacecraft",
2352 g : "Land-based remote-sensing device",
2353 h : "Water surface-based remote-sensing device",
2354 i : "Submersible remote-sensing device",
2355 n : "Not applicable",
2362 label : "Platform use category",
2363 values: { a : "Meteorological",
2364 b : "Surface observing",
2365 c : "Space observing",
2367 n : "Not applicable",
2374 label : "Sensor type",
2375 values: { a : "Active",
2383 label : "Data type",
2384 values: { nn : "Not applicable",
2387 aa : "Visible light",
2388 da : "Near infrared",
2389 db : "Middle infrared",
2390 dc : "Far infrared",
2391 dd : "Thermal infrared",
2392 de : "Shortwave infrared (SWIR)",
2393 df : "Reflective infrared",
2394 dv : "Combinations",
2395 dz : "Other infrared data",
2396 ga : "Sidelooking airborne radar (SLAR)",
2397 gb : "Synthetic aperture radar (SAR-single frequency)",
2398 gc : "SAR-multi-frequency (multichannel)",
2399 gd : "SAR-like polarization",
2400 ge : "SAR-cross polarization",
2401 gf : "Infometric SAR",
2402 gg : "Polarmetric SAR",
2403 gu : "Passive microwave mapping",
2404 gz : "Other microwave data",
2405 ja : "Far ultraviolet",
2406 jb : "Middle ultraviolet",
2407 jc : "Near ultraviolet",
2408 jv : "Ultraviolet combinations",
2409 jz : "Other ultraviolet data",
2410 ma : "Multi-spectral, multidata",
2411 mb : "Multi-temporal",
2412 mm : "Combination of various data types",
2413 pa : "Sonar-water depth",
2414 pb : "Sonar-bottom topography images, sidescan",
2415 pc : "Sonar-bottom topography, near-surface",
2416 pd : "Sonar-bottom topography, near-bottom",
2417 pe : "Seismic surveys",
2418 pz : "Other acoustical data",
2419 ra : "Gravity anomales (general)",
2423 sa : "Magnetic field",
2424 ta : "Radiometric surveys"
2430 label : "Sound Recording",
2435 values: { d : "Sound disc",
2437 g : "Sound cartridge",
2438 i : "Sound-track film",
2440 s : "Sound cassette",
2441 t : "Sound-tape reel",
2443 w : "Wire recording",
2450 values: { a : "16 rpm",
2470 label : "Configuration of playback channels",
2471 values: { m : "Monaural",
2480 label : "Groove width or pitch",
2481 values: { m : "Microgroove/fine",
2482 n : "Not applicable",
2483 s : "Coarse/standard",
2490 label : "Dimensions",
2491 values: { a : "3 in.",
2497 g : "4 3/4 in. (12 cm.)",
2498 j : "3 7/8 x 2 1/2 in.",
2499 o : "5 1/4 x 3 7/8 in.",
2500 s : "2 3/4 x 4 in.",
2501 n : "Not applicable",
2508 label : "Tape width",
2509 values: { l : "1/8 in.",
2511 n : "Not applicable",
2520 label : "Tape configuration ",
2521 values: { a : "Full (1) track",
2522 b : "Half (2) track",
2523 c : "Quarter (4) track",
2527 n : "Not applicable",
2534 label : "Special playback",
2535 values: { a : "NAB standard",
2536 b : "CCIR standard",
2537 c : "Dolby-B encoded, standard Dolby",
2539 e : "Digital recording",
2540 f : "Dolby-A encoded",
2541 g : "Dolby-C encoded",
2543 n : "Not applicable",
2550 label : "Capture and storage",
2551 values: { a : "Acoustical capture, direct storage",
2552 b : "Direct storage, not acoustical",
2553 d : "Digital storage",
2554 e : "Analog electrical storage",
2562 label : "Tactile Material",
2567 values: { a : "Moon",
2570 d : "Tactile, with no writing system",
2577 label : "Class of braille writing",
2578 values: { a : "Literary braille",
2579 b : "Format code braille",
2580 c : "Mathematics and scientific braille",
2581 d : "Computer braille",
2582 e : "Music braille",
2583 m : "Multiple braille types",
2584 n : "Not applicable",
2591 label : "Level of contraction",
2592 values: { a : "Uncontracted",
2595 n : "Not applicable",
2602 label : "Braille music format",
2603 values: { a : "Bar over bar",
2605 c : "Line over line",
2608 f : "Section by section",
2611 i : "Spanner short form scoring",
2612 j : "Short form scoring",
2614 l : "Vertical score",
2615 n : "Not applicable",
2622 label : "Special physical characteristics",
2623 values: { a : "Print/braille",
2624 b : "Jumbo or enlarged braille",
2625 n : "Not applicable",
2633 label : "Videorecording",
2638 values: { c : "Videocartridge",
2640 f : "Videocassette",
2649 values: { b : "Black-and-white",
2652 n : "Not applicable",
2659 label : "Videorecording format",
2660 values: { a : "Beta",
2682 label : "Sound on medium or separate",
2683 values: { a : "Sound on medium",
2684 b : "Sound separate from medium",
2690 label : "Medium for sound",
2691 values: { a : "Optical sound track on motion picture film",
2692 b : "Magnetic sound track on motion picture film",
2693 c : "Magnetic audio tape in cartridge",
2695 e : "Magnetic audio tape on reel",
2696 f : "Magnetic audio tape in cassette",
2697 g : "Optical and magnetic sound track on motion picture film",
2706 label : "Dimensions",
2707 values: { a : "8 mm.",
2719 label : "Configuration of playback channel",
2720 values: { k : "Mixed",
2722 n : "Not applicable",
2723 q : "Multichannel, surround or quadraphonic",
2733 MARC21.AuthorityControlSet._remote_loaded = false;
2734 MARC21.AuthorityControlSet._remote_parsed = false;
2736 MARC21.AuthorityControlSet._controlsets = {
2737 // static sorta-LoC setup ... to be overwritten with server data
2740 name : 'Static LoC legacy mapping',
2741 description : 'Legacy mapping provided as a default',
2744 'a' : { 100 : 'a' },
2745 'd' : { 100 : 'd' },
2746 'e' : { 100 : 'e' },
2750 'a' : { 110 : 'a' },
2754 'a' : { 111 : 'a' },
2758 'a' : { 130 : 'a' },
2762 'a' : { 130 : 'a' },
2766 'a' : { 100 : 'a' },
2770 'a' : { 110 : 'a' },
2774 'a' : { 111 : 'a' },
2778 'a' : { 130 : 'a' },
2779 'n' : { 130 : 'n' },
2783 'a' : { 100 : 'a' },
2784 'd' : { 100 : 'd' },
2785 'q' : { 100 : 'q' },
2789 'a' : { 110 : 'a' },
2793 'a' : { 111 : 'a' },
2794 'c' : { 111 : 'c' },
2798 'a' : { 130 : 'a' },
2802 'a' : { 100 : 'a' },
2806 'a' : { 110 : 'a' },
2810 'a' : { 111 : 'a' },
2814 'a' : { 130 : 'a' },
2818 'a' : { 100 : 'a' },
2819 'd' : { 100 : 'd' },
2820 'q' : { 100 : 'q' },
2821 't' : { 100 : 't' },
2848 'a' : { 110 : 'a' },
2849 'd' : { 110 : 'd' },
2850 't' : { 110 : 't' },
2877 'a' : { 111 : 'a' },
2878 'd' : { 111 : 'd' },
2879 't' : { 111 : 't' },
2906 'a' : { 130 : 'a' },
2910 'a' : { 148 : 'a' },
2911 'v' : { 148 : 'v' },
2912 'x' : { 148 : 'x' },
2913 'y' : { 148 : 'y' },
2917 'a' : { 150 : 'a' },
2918 'b' : { 150 : 'b' },
2945 'a' : { 151 : 'a' },
2972 'a' : { 155 : 'a' },