diff --git a/app/services/publish/public_cocina_service.rb b/app/services/publish/public_cocina_service.rb
index febc392b5..2ae5fffdf 100644
--- a/app/services/publish/public_cocina_service.rb
+++ b/app/services/publish/public_cocina_service.rb
@@ -11,14 +11,16 @@ def initialize(cocina)
@cocina = cocina
end
+ # update the label to match what is in the description.title (used by sul-embed and searchworks_traject_indexer (via PublicXmlService))
# remove any file that is not published
# remove any file_set that doesn't have at least one published file
# remove partOfProject (similar to how we remove tags from identityMetadata)
def build
+ label = Cocina::Models::Builders::TitleBuilder.build(cocina.description.title)
if cocina.dro?
- cocina.new(structural: build_structural, administrative: build_administrative)
+ cocina.new(label:, structural: build_structural, administrative: build_administrative)
elsif cocina.collection?
- cocina.new(administrative: build_administrative)
+ cocina.new(label:, administrative: build_administrative)
else
raise "unexpected call to PublicCocinaService.build for #{cocina.externalIdentifier}"
end
diff --git a/app/services/publish/public_xml_service.rb b/app/services/publish/public_xml_service.rb
index 825f29aaf..afc8fe53a 100644
--- a/app/services/publish/public_xml_service.rb
+++ b/app/services/publish/public_xml_service.rb
@@ -75,7 +75,7 @@ def release_date
# catkeys are used by PURL
# objectType is used by purl-fetcher
- # objectLabel is used by https://github.com/sul-dlss/searchworks_traject_indexer/blob/b5ed9906a5a0130eca5e68fbb0e8633bdbe6ffd6/lib/sdr_stuff.rb#L54
+ # objectLabel is used by https://github.com/sul-dlss/searchworks_traject_indexer/blob/72195e34e364fb2c191c40b23fe51679746f6419/lib/public_xml_record.rb#L34
# Barcode and sourceId are used by the CdlController in Stacks https://github.com/sul-dlss/stacks/blame/master/app/controllers/cdl_controller.rb#L121
def public_identity_metadata
nodes = catalog_record_ids(SYMPHONY).map { |catkey| " #{catkey}" }
@@ -87,7 +87,7 @@ def public_identity_metadata
<<~XML
#{public_cocina.collection? ? 'collection' : 'item'}
- #{Cocina::Models::Builders::TitleBuilder.build(public_cocina.description.title)}
+ #{public_cocina.label}
#{nodes.join("\n")}
XML
diff --git a/spec/services/publish/metadata_transfer_service_spec.rb b/spec/services/publish/metadata_transfer_service_spec.rb
index 7d23f7134..37d9ec5b5 100644
--- a/spec/services/publish/metadata_transfer_service_spec.rb
+++ b/spec/services/publish/metadata_transfer_service_spec.rb
@@ -112,7 +112,7 @@
before do
expect_any_instance_of(described_class).to receive(:transfer_to_document_store).with(/{"cocinaVersion"/, 'cocina.json')
expect_any_instance_of(described_class).to receive(:transfer_to_document_store).with(/