Module: Dor::Geoable

Extended by:
ActiveSupport::Concern
Included in:
Item
Defined in:
lib/dor/models/concerns/geoable.rb

Instance Method Summary collapse

Instance Method Details

#build_geoMetadata_datastream(ds) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/dor/models/concerns/geoable.rb', line 20

def (ds)
  content = 
  return nil if content.nil?
  ds.dsLabel = label
  ds.ng_xml = Nokogiri::XML(content)
  ds.ng_xml.normalize_text!
  ds.content = ds.ng_xml.to_xml
end

#fetch_geoMetadata_datastreamString?

Returns XML.

Returns:

  • (String, nil)

    XML



13
14
15
16
17
18
# File 'lib/dor/models/concerns/geoable.rb', line 13

def 
  candidates = datastreams['identityMetadata'].otherId.collect { |oid| oid.to_s }
   = Dor::MetadataService.resolvable(candidates).first
  return nil if .nil?
  Dor::MetadataService.fetch(.to_s)
end