Class: Dor::RoleMetadataDS
- Inherits:
-
ActiveFedora::OmDatastream
- Object
- ActiveFedora::OmDatastream
- Dor::RoleMetadataDS
- Includes:
- SolrDocHelper
- Defined in:
- lib/dor/datastreams/role_metadata_ds.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#prefix ⇒ Object
maintain AF < 8 indexing behavior.
- #to_solr(solr_doc = {}, *args) ⇒ Object
Methods included from SolrDocHelper
Class Method Details
.xml_template ⇒ Object
31 32 33 34 35 |
# File 'lib/dor/datastreams/role_metadata_ds.rb', line 31 def self.xml_template Nokogiri::XML::Builder.new do |xml| xml.roleMetadata {} end.doc end |
Instance Method Details
#prefix ⇒ Object
maintain AF < 8 indexing behavior
51 52 53 |
# File 'lib/dor/datastreams/role_metadata_ds.rb', line 51 def prefix '' end |
#to_solr(solr_doc = {}, *args) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/dor/datastreams/role_metadata_ds.rb', line 37 def to_solr(solr_doc = {}, *args) find_by_xpath('/roleMetadata/role/*').each do |actor| role_type = actor.parent['type'] val = [actor.at_xpath('identifier/@type'), actor.at_xpath('identifier/text()')].join ':' add_solr_value(solr_doc, "apo_role_#{actor.name}_#{role_type}", val, :string, [:symbol]) add_solr_value(solr_doc, "apo_role_#{role_type}", val, :string, [:symbol]) if ['dor-apo-manager', 'dor-apo-depositor'].include? role_type add_solr_value(solr_doc, 'apo_register_permissions', val, :string, [:symbol, :stored_searchable]) end end solr_doc end |