Class: Ddr::Models::FitsXmlFile

Inherits:
ActiveFedora::OmDatastream
  • Object
show all
Defined in:
lib/ddr/models/files/fits_xml_file.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



70
71
72
73
74
75
76
77
# File 'lib/ddr/models/files/fits_xml_file.rb', line 70

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



79
80
81
82
83
# File 'lib/ddr/models/files/fits_xml_file.rb', line 79

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