Sha256: 3976fdec80138f8d4501c2737e88874b5b0b9a04a7011fa76bad2f0f90cc5d74
Contents?: true
Size: 937 Bytes
Versions: 38
Compression:
Stored size: 937 Bytes
Contents
module Dor module Geoable extend ActiveSupport::Concern class CrosswalkError < Exception; end included do has_metadata :name => 'geoMetadata', :type => Dor::GeoMetadataDS, :label => 'Geographic Information Metadata in ISO 19139', :control_group => 'M' end # @return [String, nil] XML def fetch_geoMetadata_datastream candidates = datastreams['identityMetadata'].otherId.collect { |oid| oid.to_s } metadata_id = Dor::MetadataService.resolvable(candidates).first return nil if metadata_id.nil? Dor::MetadataService.fetch(metadata_id.to_s) end def build_geoMetadata_datastream(ds) content = fetch_geoMetadata_datastream 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 end end
Version data entries
38 entries across 38 versions & 1 rubygems