dor-services 4.6.0 → 4.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dor/models/describable.rb +14 -10
- data/lib/dor/version.rb +1 -1
- metadata +1 -1
@@ -77,13 +77,13 @@ module Dor
|
|
77
77
|
end
|
78
78
|
rights.xpath("//use/machine[#{ci_compare('type', 'creativecommons')}]").each do |lic|
|
79
79
|
next if(lic.text =~ /none/i)
|
80
|
-
new_text = "CC #{lic.text}
|
80
|
+
new_text = "CC #{lic.text}: " << rights.at_xpath("//use/human[#{ci_compare('type', 'creativecommons')}]").text.strip
|
81
81
|
new_lic = doc.create_element("accessCondition", new_text, :type => 'license')
|
82
82
|
doc.root.element_children.last.add_next_sibling new_lic
|
83
83
|
end
|
84
84
|
rights.xpath("//use/machine[#{ci_compare('type', 'opendata')}]").each do |lic|
|
85
85
|
next if(lic.text =~ /none/i)
|
86
|
-
new_text = "ODC #{lic.text}
|
86
|
+
new_text = "ODC #{lic.text}: " << rights.at_xpath("//use/human[#{ci_compare('type', 'opendata')}]").text.strip
|
87
87
|
new_lic = doc.create_element("accessCondition", new_text, :type => 'license')
|
88
88
|
doc.root.element_children.last.add_next_sibling new_lic
|
89
89
|
end
|
@@ -114,11 +114,17 @@ module Dor
|
|
114
114
|
title_info_node=Nokogiri::XML::Node.new('titleInfo',doc)
|
115
115
|
title_node=Nokogiri::XML::Node.new('title',doc)
|
116
116
|
title_node.content=collection_title
|
117
|
+
|
118
|
+
id_node=Nokogiri::XML::Node.new('identifier',doc)
|
119
|
+
id_node['type'] = 'uri'
|
120
|
+
id_node.content = "http://#{Dor::Config.stacks.document_cache_host}/#{druid.split(':').last}"
|
121
|
+
|
117
122
|
type_node=Nokogiri::XML::Node.new('typeOfResource',doc)
|
118
123
|
type_node['collection'] = 'yes'
|
119
124
|
doc.root.add_child(related_item_node)
|
120
125
|
related_item_node.add_child(title_info_node)
|
121
126
|
title_info_node.add_child(title_node)
|
127
|
+
related_item_node.add_child(id_node)
|
122
128
|
related_item_node.add_child(type_node)
|
123
129
|
end
|
124
130
|
end
|
@@ -202,15 +208,13 @@ module Dor
|
|
202
208
|
|
203
209
|
def self.get_collection_title(obj)
|
204
210
|
xml=obj.descMetadata.ng_xml
|
205
|
-
preferred_citation=xml.search('//mods:mods/mods:note[@type=\'preferredCitation\']','mods' => 'http://www.loc.gov/mods/v3')
|
206
211
|
title=''
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
subtitle
|
212
|
-
|
213
|
-
title+=' ('+subtitle.first.content+')'
|
212
|
+
title_node = xml.at_xpath('//mods:mods/mods:titleInfo/mods:title','mods' => 'http://www.loc.gov/mods/v3')
|
213
|
+
if(title_node)
|
214
|
+
title = title_node.content
|
215
|
+
subtitle=xml.at_xpath('//mods:mods/mods:titleInfo/mods:subTitle','mods' => 'http://www.loc.gov/mods/v3')
|
216
|
+
if(subtitle)
|
217
|
+
title += ' (' + subtitle.content + ')'
|
214
218
|
end
|
215
219
|
end
|
216
220
|
title
|
data/lib/dor/version.rb
CHANGED