Skip to content

Instantly share code, notes, and snippets.

@cfitz
Created November 18, 2010 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfitz/705593 to your computer and use it in GitHub Desktop.
Save cfitz/705593 to your computer and use it in GitHub Desktop.
hydra_tune_ds.rb
# HydraTuneDS
class HydraTuneDS < ActiveFedora::NokogiriDatastream
set_terminology do |t| t.root(:path=>"dc", :xmlns=>"http://purl.org/dc/elements/1.1/", :schema=>"http://purl.org/dc/elements/1.1/")
t.title(:index_as=>[:searchable, :displayable, :facetable, :sortable], :required=>:true, :type=>:string )
t.creator(:index_as=>[:searchable, :displayable, :facetable, :sortable], :required=>:true, :type=>:string)
end
def self.xml_template
builder = Nokogiri::XML::Builder.new do |xml|
xml.dc(:xmlns=>"http://purl.org/dc/elements/1.1/") {
xml.title
xml.creator
}
end
return builder.doc
end #self.xml_template
end #class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment