Module: BerkeleyLibrary::TIND::Mapping::AlmaBase
- Includes:
- Logging
- Included in:
- AlmaMultipleTIND, AlmaSingleTIND, FieldCatalogUtil, Util
- Defined in:
- lib/berkeley_library/tind/mapping/alma_base.rb
Class Attribute Summary collapse
-
.collection_parameter_hash ⇒ Object
Returns the value of attribute collection_parameter_hash.
-
.excluding_origin_tags ⇒ Object
Returns the value of attribute excluding_origin_tags.
-
.including_origin_tags ⇒ Object
Returns the value of attribute including_origin_tags.
-
.is_035_from_mms_id ⇒ Object
Returns the value of attribute is_035_from_mms_id.
-
.is_barcode ⇒ Object
Returns the value of attribute is_barcode.
Instance Method Summary collapse
-
#base_save(id, tind_record, file) ⇒ Object
This is mainly for testing purpose, each collection can have a function to save it's record.
-
#base_tind_record(id, datafields, alma_record = nil) ⇒ Object
id can be: 1) Alma mms id 2) Oskicat No 3) BarCode No When alma record is nil or un-qualified, raise error Input datafields - an array of record specific datafields: for example, fft datafields, datafield 035 etc.
Class Attribute Details
.collection_parameter_hash ⇒ Object
Returns the value of attribute collection_parameter_hash.
16 17 18 |
# File 'lib/berkeley_library/tind/mapping/alma_base.rb', line 16 def collection_parameter_hash @collection_parameter_hash end |
.excluding_origin_tags ⇒ Object
Returns the value of attribute excluding_origin_tags.
20 21 22 |
# File 'lib/berkeley_library/tind/mapping/alma_base.rb', line 20 def @excluding_origin_tags end |
.including_origin_tags ⇒ Object
Returns the value of attribute including_origin_tags.
19 20 21 |
# File 'lib/berkeley_library/tind/mapping/alma_base.rb', line 19 def @including_origin_tags end |
.is_035_from_mms_id ⇒ Object
Returns the value of attribute is_035_from_mms_id.
18 19 20 |
# File 'lib/berkeley_library/tind/mapping/alma_base.rb', line 18 def is_035_from_mms_id @is_035_from_mms_id end |
.is_barcode ⇒ Object
Returns the value of attribute is_barcode.
17 18 19 |
# File 'lib/berkeley_library/tind/mapping/alma_base.rb', line 17 def @is_barcode end |
Instance Method Details
#base_save(id, tind_record, file) ⇒ Object
This is mainly for testing purpose, each collection can have a function to save it's record
45 46 47 48 49 50 51 |
# File 'lib/berkeley_library/tind/mapping/alma_base.rb', line 45 def base_save(id, tind_record, file) raise ArgumentError, "#{id} has no TIND record or not a qualified TIND record." unless tind_record BerkeleyLibrary::TIND::MARC::XMLWriter.open(file) do |writer| writer.write(tind_record) end end |
#base_tind_record(id, datafields, alma_record = nil) ⇒ Object
id can be: 1) Alma mms id 2) Oskicat No 3) BarCode No When alma record is nil or un-qualified, raise error Input datafields - an array of record specific datafields: for example, fft datafields, datafield 035 etc.
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/berkeley_library/tind/mapping/alma_base.rb', line 31 def base_tind_record(id, datafields, alma_record = nil) marc_record = alma_record || alma_record_from(id) raise ArgumentError, "#{id} has no Alma record." unless marc_record unless Util.qualified_alma_record?(marc_record) raise ArgumentError, "#{id} belong to a host bibliographic record which should not be uploaded to TIND." end tind_record(id, marc_record, datafields) end |