Class: Marpa::DcDatastream
- Inherits:
-
ActiveFedora::NokogiriDatastream
- Object
- Fedora::BaseObject
- Fedora::Datastream
- ActiveFedora::Datastream
- ActiveFedora::NokogiriDatastream
- Marpa::DcDatastream
- Defined in:
- lib/active_fedora/samples/marpa-dc_datastream.rb
Overview
This is an example of a NokogiriDatastream that defines a terminology for Dublin Core xml
Some things to observe about this Class:
-
Defines a couple of custom terms, tibetan_title and english_title, that map to dc:title with varying @language attributes
-
Indicates which terms should be indexed as facets using :index_as=>
-
Defines an xml template that is an empty dublin core xml document with three namespaces set
-
Sets the namespace using :xmlns argument on the root term
-
Does not override or extend to_solr, so the default solrization approach will be used (Solrizer::XML::TerminologyBasedSolrizer)
Instance Attribute Summary
Attributes inherited from ActiveFedora::NokogiriDatastream
Attributes included from ActiveFedora::MetadataDatastreamHelper
Attributes inherited from ActiveFedora::Datastream
#dirty, #fields, #last_modified
Attributes inherited from Fedora::BaseObject
#attributes, #blob, #errors, #new_object, #uri
Class Method Summary collapse
Methods inherited from ActiveFedora::NokogiriDatastream
#content=, #from_solr, from_xml, #generate_solr_symbol, #get_values, #get_values_from_solr, #has_solr_name?, #initialize, #is_hierarchical_term_pointer?, #om_term_values, #om_update_values, #term_values, #to_xml, #update_indexed_attributes, #update_values
Methods included from ActiveFedora::MetadataDatastreamHelper
#from_solr, included, #initialize, #save, #set_blob_for_save, #to_solr, #to_xml
Methods inherited from ActiveFedora::Datastream
#after_save, #before_save, #check_concurrency, #content, #content=, delete, #delete, #dirty?, #dsid=, from_xml, #initialize, #last_modified_in_repository, #pid, #pid=, #save, #size, #to_param
Methods inherited from Fedora::Datastream
#control_group, #control_group=, #dsid, #initialize, #label, #label=, #mime_type, #mime_type=, #pid, #uri, #url
Methods inherited from Fedora::BaseObject
#[], #initialize, #new_object?
Constructor Details
This class inherits a constructor from ActiveFedora::NokogiriDatastream
Class Method Details
.xml_template ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/active_fedora/samples/marpa-dc_datastream.rb', line 86 def self.xml_template builder = Nokogiri::XML::Builder.new do |xml| xml.dc("xmlns"=>'http://purl.org/dc/terms/', "xmlns:dcterms"=>'http://purl.org/dc/terms/', "xmlns:xsi"=>'http://www.w3.org/2001/XMLSchema-instance') { } end return builder.doc end |