Class: Ddr::Datastreams::FitsDatastream

Inherits:
ActiveFedora::OmDatastream
  • Object
show all
Defined in:
lib/ddr/datastreams/fits_datastream.rb

Constant Summary collapse

FITS_XMLNS =
"http://hul.harvard.edu/ois/xml/ns/fits/fits_output".freeze
FITS_SCHEMA =
"http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd".freeze
EXIFTOOL =
"Exiftool"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.xml_templateObject



68
69
70
71
72
73
74
75
# File 'lib/ddr/datastreams/fits_datastream.rb', line 68

def self.xml_template
  builder = Nokogiri::XML::Builder.new do |xml|
    xml.fits("xmlns"=>FITS_XMLNS,
             "xmlns:xsi"=>"http://www.w3.org/2001/XMLSchema-instance",
             "xsi:schemaLocation"=>"http://hul.harvard.edu/ois/xml/ns/fits/fits_output http://hul.harvard.edu/ois/xml/xsd/fits/fits_output.xsd")
  end
  builder.doc
end

Instance Method Details

#modifiedObject



81
82
83
84
85
# File 'lib/ddr/datastreams/fits_datastream.rb', line 81

def modified
  ng_xml
    .xpath("//fits:fileinfo/fits:lastmodified[@toolname != '#{EXIFTOOL}']", fits: FITS_XMLNS)
    .map(&:text)
end

#prefixObject



77
78
79
# File 'lib/ddr/datastreams/fits_datastream.rb', line 77

def prefix
  "fits__"
end