Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
Add the public mods descriptive metadata to the publicObject document
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Sep 30, 2016
1 parent 8fe792f commit 59373be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/dor/models/publishable.rb
Expand Up @@ -41,6 +41,7 @@ def public_xml
rels = public_relationships.root
pub.add_child(rels.clone) unless rels.nil? # TODO: Should never be nil in practice; working around an ActiveFedora quirk for testing
pub.add_child(generate_dublin_core.root.clone)
pub.add_child(Nokogiri::XML(generate_public_desc_md).root.clone) if metadata_format == 'mods'
pub.add_child(Nokogiri(generate_release_xml).root.clone) unless release_xml.children.size == 0 # If there are no release_tags, this prevents an empty <releaseData/> from being added
# Note we cannot base this on if an individual object has release tags or not, because the collection may cause one to be generated for an item,
# so we need to calculate it and then look at the final result.s
Expand Down
4 changes: 4 additions & 0 deletions spec/dor/publishable_spec.rb
Expand Up @@ -125,6 +125,10 @@ class ItemizableItem < ActiveFedora::Base
it 'rightsMetadata' do
expect(@p_xml.at_xpath('/publicObject/rightsMetadata')).to be
end
it 'generated mods' do
expect(@p_xml.at_xpath('/publicObject/mods:mods', 'mods' => 'http://www.loc.gov/mods/v3')).to be
end

it 'generated dublin core' do
expect(@p_xml.at_xpath('/publicObject/oai_dc:dc', 'oai_dc' => 'http://www.openarchives.org/OAI/2.0/oai_dc/')).to be
end
Expand Down

0 comments on commit 59373be

Please sign in to comment.