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

Version Path
dor-services-5.18.0 lib/dor/models/concerns/geoable.rb
dor-services-5.17.3 lib/dor/models/concerns/geoable.rb
dor-services-5.17.2 lib/dor/models/concerns/geoable.rb
dor-services-5.17.1 lib/dor/models/geoable.rb
dor-services-5.16.0 lib/dor/models/geoable.rb
dor-services-5.15.1 lib/dor/models/geoable.rb
dor-services-5.15.0 lib/dor/models/geoable.rb
dor-services-5.14.2 lib/dor/models/geoable.rb
dor-services-5.14.1 lib/dor/models/geoable.rb
dor-services-5.14.0 lib/dor/models/geoable.rb
dor-services-5.13.0 lib/dor/models/geoable.rb
dor-services-5.12.0 lib/dor/models/geoable.rb
dor-services-5.11.1 lib/dor/models/geoable.rb
dor-services-5.11.0 lib/dor/models/geoable.rb
dor-services-5.10.4 lib/dor/models/geoable.rb
dor-services-5.10.3 lib/dor/models/geoable.rb
dor-services-5.10.2 lib/dor/models/geoable.rb
dor-services-5.10.1 lib/dor/models/geoable.rb
dor-services-5.10.0 lib/dor/models/geoable.rb
dor-services-5.9.1 lib/dor/models/geoable.rb