diff --git a/lib/ead/traject/ead2_component_config.rb b/lib/ead/traject/ead2_component_config.rb index 90c4a5bf..c2d5939e 100644 --- a/lib/ead/traject/ead2_component_config.rb +++ b/lib/ead/traject/ead2_component_config.rb @@ -107,19 +107,21 @@ to_field 'digital_objects_ssm' do |record, accumulator, context| record.xpath('./daogrp/daoloc|./did/daogrp/daoloc').each do |daoloc| + href = (daoloc.attributes['href'] || daoloc.attributes['xlink:href'])&.value + next unless href && href =~ /^http/ label = daoloc.parent.attributes['title']&.text || daoloc.parent.attributes['xlink:title']&.text || daoloc.xpath('./parent::daogrp/daodesc/p')&.text - href = (daoloc.attributes['href'] || daoloc.attributes['xlink:href'])&.value role = (daoloc.attributes['role'] || daoloc.attributes['xlink:role'])&.value type = (daoloc.attributes['type'] || daoloc.attributes['xlink:type'])&.value accumulator << Acfa::DigitalObject.new(label: label, href: href, role: role, type: type).to_json end record.xpath('./dao|./did/dao').each do |dao| + href = (dao.attributes['href'] || dao.attributes['xlink:href'])&.value + next unless href && href =~ /^http/ label = dao.attributes['title']&.value || dao.attributes['xlink:title']&.value || dao.xpath('daodesc/p')&.text - href = (dao.attributes['href'] || dao.attributes['xlink:href'])&.value role = (dao.attributes['role'] || dao.attributes['xlink:role'])&.value type = (dao.attributes['type'] || dao.attributes['xlink:type'])&.value accumulator << Acfa::DigitalObject.new(label: label, href: href, role: role, type: type).to_json diff --git a/spec/fixtures/ead/test_digital_objects/from_did.xml b/spec/fixtures/ead/test_digital_objects/from_did.xml index c556105e..dad5edbd 100644 --- a/spec/fixtures/ead/test_digital_objects/from_did.xml +++ b/spec/fixtures/ead/test_digital_objects/from_did.xml @@ -1,31 +1,104 @@ -Test for Access Restriction InheritanceTEST.2024.07.22 TEST.2024.07.22Rare Book and Manuscript Library
Butler Library, 6th FloorColumbia University, Mail Code 1127535 W. 114th St.New York, NY 10027Business Number: (212) 867-5309Fax Number: (212) 867-5309rbml@libraries.cul.columbia.eduURL:
This finding aid was produced using ArchivesSpace on 2024-11-01 10:34:41 -0400.Description is written in: English, Latin script.
- - - Rare Book and Manuscript Library - - Test for Access Restriction Inheritance - TEST.2024.07.22 - English . - - 1 Linear Feet - - undated - - - Conditions Governing Access -

This is the first collection-level conditions governing access note.

- - Conditions Governing Access -

This is the second collection-level conditions governing access note.

- - Conditions Governing Use -

This is the first collection-level use restriction note.

- - Conditions Governing Use -

This is the second collection-level use restriction note.

- Series 1Conditions Governing Access

This is the first series-level access restriction.

Conditions Governing Access

This is the second series-level access restriction.

FileConditions Governing Access

This is a file-level conditions governing access note.

13

The First DAO Fallback

-

The Second DAO Fallback

-

The Third DAO Fallback

-
+ + + + + + Test for Access Restriction InheritanceTEST.2024.07.22 TEST.2024.07.22 + + + Rare Book and Manuscript Library +
+ Butler Library, 6th Floor + Columbia University, Mail Code 1127 + 535 W. 114th St. + New York, NY 10027 + Business Number: (212) 867-5309 + Fax Number: (212) 867-5309 + rbml@libraries.cul.columbia.edu + URL: +
+
+
+ + This finding aid was produced using ArchivesSpace on 2024-11-01 10:34:41 -0400. + Description is written in: English, Latin script. + +
+ + + + Rare Book and Manuscript Library + + Test for Access Restriction Inheritance + TEST.2024.07.22 + English . + + 1 Linear Feet + + undated + + + Conditions Governing Access +

This is the first collection-level conditions governing access note.

+
+ + Conditions Governing Access +

This is the second collection-level conditions governing access note.

+
+ + Conditions Governing Use +

This is the first collection-level use restriction note.

+
+ + Conditions Governing Use +

This is the second collection-level use restriction note.

+
+ + + + Series 1 + + + Conditions Governing Access +

This is the first series-level access restriction.

+
+ + Conditions Governing Access +

This is the second series-level access restriction.

+
+ + + File + + + Conditions Governing Access +

This is a file-level conditions governing access note.

+
+ 1 + 3 + + +

The First DAO Fallback

+
+
+ + +

The Second DAO Fallback

+
+
+ + +

The Third DAO Fallback

+
+
+ + +

DAO without URL

+
+
+
+
+
+