dor-services 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 770ca0435e119517c61cfe64021bfff08daae50bf6a1fca4731029c6b8532204
|
4
|
+
data.tar.gz: 3a6e05fd0fb500a3a59643345faf127bcb8c2b1c69dbd2ba9f8434d08261e954
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80dedffd987f1bd397edb8815e33a85d8caf970c7bb587e3b2957c6b3d9d6c9b46c9cbd150286b7551e44712cfb7b4758970a444377c13c41ed38309f70080ba
|
7
|
+
data.tar.gz: 05b2a3d6cf76e71c7251f2eeb6124c9823e85cf607d246649d928eb69f99916ba5f2e74cd52cea998c645dd699132fec15fe9db486b19a3715c4216051ce88f5
|
@@ -43,11 +43,11 @@ module Dor
|
|
43
43
|
# Generates Dublin Core from the MODS in the descMetadata datastream using the LoC mods2dc stylesheet
|
44
44
|
# Should not be used for the Fedora DC datastream
|
45
45
|
# @raise [CrosswalkError] Raises an Exception if the generated DC is empty or has no children
|
46
|
-
# @return [Nokogiri::
|
46
|
+
# @return [Nokogiri::XML::Document] the DublinCore XML document object
|
47
47
|
def generate_dublin_core(include_collection_as_related_item: true)
|
48
|
-
DublinCoreService.new(self, include_collection_as_related_item: include_collection_as_related_item).
|
48
|
+
DublinCoreService.new(self, include_collection_as_related_item: include_collection_as_related_item).ng_xml
|
49
49
|
end
|
50
|
-
deprecation_deprecate generate_dublin_core: 'Use DublinCoreService#
|
50
|
+
deprecation_deprecate generate_dublin_core: 'Use DublinCoreService#ng_xml instead'
|
51
51
|
|
52
52
|
# @return [String] Public descriptive medatada XML
|
53
53
|
def generate_public_desc_md(**options)
|
@@ -14,8 +14,8 @@ module Dor
|
|
14
14
|
# Generates Dublin Core from the MODS in the descMetadata datastream using the LoC mods2dc stylesheet
|
15
15
|
# Should not be used for the Fedora DC datastream
|
16
16
|
# @raise [CrosswalkError] Raises an Exception if the generated DC is empty or has no children
|
17
|
-
# @return [Nokogiri::
|
18
|
-
def
|
17
|
+
# @return [Nokogiri::XML::Document] the DublinCore XML document object
|
18
|
+
def ng_xml
|
19
19
|
dc_doc = MODS_TO_DC_XSLT.transform(desc_md)
|
20
20
|
dc_doc.xpath('/oai_dc:dc/*[count(text()) = 0]', oai_dc: XMLNS_OAI_DC).remove # Remove empty nodes
|
21
21
|
raise CrosswalkError, "Dor::Item#generate_dublin_core produced incorrect xml (no root):\n#{dc_doc.to_xml}" if dc_doc.root.nil?
|
@@ -24,6 +24,11 @@ module Dor
|
|
24
24
|
dc_doc
|
25
25
|
end
|
26
26
|
|
27
|
+
# @return [String] the DublinCore XML document object
|
28
|
+
def to_xml
|
29
|
+
ng_xml.to_xml
|
30
|
+
end
|
31
|
+
|
27
32
|
private
|
28
33
|
|
29
34
|
def desc_md
|
@@ -19,7 +19,7 @@ module Dor
|
|
19
19
|
pub.add_child(public_rights_metadata.root)
|
20
20
|
|
21
21
|
pub.add_child(public_relationships.root) unless public_relationships.nil? # TODO: Should never be nil in practice; working around an ActiveFedora quirk for testing
|
22
|
-
pub.add_child(object.
|
22
|
+
pub.add_child(DublinCoreService.new(object).ng_xml.root)
|
23
23
|
pub.add_child(PublicDescMetadataService.new(object).ng_xml.root)
|
24
24
|
pub.add_child(release_xml.root) unless release_xml.xpath('//release').children.size == 0 # If there are no release_tags, this prevents an empty <releaseData/> from being added
|
25
25
|
# 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,
|
@@ -25,8 +25,7 @@ module Dor
|
|
25
25
|
attr_reader :item
|
26
26
|
|
27
27
|
def transfer_metadata
|
28
|
-
|
29
|
-
transfer_to_document_store(dc_xml, 'dc')
|
28
|
+
transfer_to_document_store(DublinCoreService.new(item).ng_xml.to_xml(&:no_declaration), 'dc')
|
30
29
|
%w(identityMetadata contentMetadata rightsMetadata).each do |stream|
|
31
30
|
transfer_to_document_store(item.datastreams[stream].content.to_s, stream) if item.datastreams[stream]
|
32
31
|
end
|
data/lib/dor/version.rb
CHANGED